diff --git a/Common/DataModel/Multiplicity.h b/Common/DataModel/Multiplicity.h index 2547f888691..ce6aa4ba046 100644 --- a/Common/DataModel/Multiplicity.h +++ b/Common/DataModel/Multiplicity.h @@ -18,19 +18,20 @@ namespace o2::aod { namespace mult { -DECLARE_SOA_COLUMN(MultFV0A, multFV0A, float); //! -DECLARE_SOA_COLUMN(MultFV0C, multFV0C, float); //! -DECLARE_SOA_COLUMN(MultFT0A, multFT0A, float); //! -DECLARE_SOA_COLUMN(MultFT0C, multFT0C, float); //! -DECLARE_SOA_COLUMN(MultFDDA, multFDDA, float); //! -DECLARE_SOA_COLUMN(MultFDDC, multFDDC, float); //! -DECLARE_SOA_COLUMN(MultZNA, multZNA, float); //! -DECLARE_SOA_COLUMN(MultZNC, multZNC, float); //! -DECLARE_SOA_COLUMN(MultZEM1, multZEM1, float); //! -DECLARE_SOA_COLUMN(MultZEM2, multZEM2, float); //! -DECLARE_SOA_COLUMN(MultZPA, multZPA, float); //! -DECLARE_SOA_COLUMN(MultZPC, multZPC, float); //! -DECLARE_SOA_DYNAMIC_COLUMN(MultFV0M, multFV0M, //! +DECLARE_SOA_COLUMN(MultFV0A, multFV0A, float); //! +DECLARE_SOA_COLUMN(MultFV0AOuter, multFV0AOuter, float); //! +DECLARE_SOA_COLUMN(MultFV0C, multFV0C, float); //! +DECLARE_SOA_COLUMN(MultFT0A, multFT0A, float); //! +DECLARE_SOA_COLUMN(MultFT0C, multFT0C, float); //! +DECLARE_SOA_COLUMN(MultFDDA, multFDDA, float); //! +DECLARE_SOA_COLUMN(MultFDDC, multFDDC, float); //! +DECLARE_SOA_COLUMN(MultZNA, multZNA, float); //! +DECLARE_SOA_COLUMN(MultZNC, multZNC, float); //! +DECLARE_SOA_COLUMN(MultZEM1, multZEM1, float); //! +DECLARE_SOA_COLUMN(MultZEM2, multZEM2, float); //! +DECLARE_SOA_COLUMN(MultZPA, multZPA, float); //! +DECLARE_SOA_COLUMN(MultZPC, multZPC, float); //! +DECLARE_SOA_DYNAMIC_COLUMN(MultFV0M, multFV0M, //! [](float multFV0A, float multFV0C) -> float { return multFV0A + multFV0C; }); DECLARE_SOA_DYNAMIC_COLUMN(MultFT0M, multFT0M, //! [](float multFT0A, float multFT0C) -> float { return multFT0A + multFT0C; }); @@ -95,6 +96,8 @@ DECLARE_SOA_COLUMN(TimeToNeNext, timeToNeNext, float); //! DECLARE_SOA_TABLE(FV0Mults, "AOD", "FV0MULT", //! Multiplicity with the FV0 detector mult::MultFV0A, mult::MultFV0C, mult::MultFV0M); +DECLARE_SOA_TABLE(FV0AOuterMults, "AOD", "FVOAOUTERMULT", //! FV0 without innermost ring + mult::MultFV0AOuter); DECLARE_SOA_TABLE(FT0Mults, "AOD", "FT0MULT", //! Multiplicity with the FT0 detector mult::MultFT0A, mult::MultFT0C, mult::MultFT0M); diff --git a/Common/TableProducer/multiplicityTable.cxx b/Common/TableProducer/multiplicityTable.cxx index 908a44e92fb..579d85ce3e2 100644 --- a/Common/TableProducer/multiplicityTable.cxx +++ b/Common/TableProducer/multiplicityTable.cxx @@ -79,6 +79,7 @@ static const int defaultParameters[nTables][nParameters]{{-1}, {-1}, {-1}, {-1}, struct MultiplicityTable { SliceCache cache; Produces tableFV0; // 0 + Produces tableFV0AOuter; // 0-bis (produced with FV0) Produces tableFT0; // 1 Produces tableFDD; // 2 Produces tableZDC; // 3 @@ -307,6 +308,7 @@ struct MultiplicityTable { switch (i) { case kFV0Mults: // FV0 tableFV0.reserve(collisions.size()); + tableFV0AOuter.reserve(collisions.size()); break; case kFT0Mults: // FT0 tableFT0.reserve(collisions.size()); @@ -354,6 +356,7 @@ struct MultiplicityTable { // Initializing multiplicity values float multFV0A = 0.f; + float multFV0AOuter = 0.f; float multFV0C = 0.f; float multFT0A = 0.f; float multFT0C = 0.f; @@ -429,18 +432,25 @@ struct MultiplicityTable { case kFV0Mults: // FV0 { multFV0A = 0.f; + multFV0AOuter = 0.f; multFV0C = 0.f; // using FV0 row index from event selection task if (collision.has_foundFV0()) { const auto& fv0 = collision.foundFV0(); - for (auto amplitude : fv0.amplitude()) { + for (size_t ii = 0; ii < fv0.amplitude().size(); ii++) { + auto amplitude = fv0.amplitude()[ii]; + auto channel = fv0.channel()[ii]; multFV0A += amplitude; + if (channel > 7) { + multFV0AOuter += amplitude; + } } } else { multFV0A = -999.f; multFV0C = -999.f; } tableFV0(multFV0A, multFV0C); + tableFV0AOuter(multFV0AOuter); LOGF(debug, "multFV0A=%5.0f multFV0C=%5.0f", multFV0A, multFV0C); } break; case kFT0Mults: // FT0 diff --git a/Common/Tasks/centralityStudy.cxx b/Common/Tasks/centralityStudy.cxx index f9774f0963e..6a70a69a7bc 100644 --- a/Common/Tasks/centralityStudy.cxx +++ b/Common/Tasks/centralityStudy.cxx @@ -92,6 +92,7 @@ struct centralityStudy { ConfigurableAxis axisMultFDDC{"axisMultFDDC", {1000, 0, 100000}, "FDDC amplitude"}; ConfigurableAxis axisMultPVContributors{"axisMultPVContributors", {200, 0, 6000}, "Number of PV Contributors"}; ConfigurableAxis axisMultGlobalTracks{"axisMultGlobalTracks", {500, 0, 5000}, "Number of global tracks"}; + ConfigurableAxis axisMultMFTTracks{"axisMultMFTTracks", {500, 0, 5000}, "Number of MFT tracks"}; ConfigurableAxis axisTrackOccupancy{"axisTrackOccupancy", {50, 0, 5000}, "Track occupancy"}; ConfigurableAxis axisFT0COccupancy{"axisFT0COccupancy", {50, 0, 80000}, "FT0C occupancy"}; @@ -102,6 +103,7 @@ struct centralityStudy { ConfigurableAxis axisMultUltraFineFT0C{"axisMultUltraFineFT0C", {60000, 0, 60000}, "FT0C amplitude"}; ConfigurableAxis axisMultUltraFinePVContributors{"axisMultUltraFinePVContributors", {10000, 0, 10000}, "Number of PV Contributors"}; ConfigurableAxis axisMultUltraFineGlobalTracks{"axisMultUltraFineGlobalTracks", {5000, 0, 5000}, "Number of global tracks"}; + ConfigurableAxis axisMultUltraFineMFTTracks{"axisMultUltraFineMFTTracks", {5000, 0, 5000}, "Number of MFT tracks"}; ConfigurableAxis axisMultITSOnly{"axisMultITSOnly", {200, 0, 6000}, "Number of ITS only tracks"}; ConfigurableAxis axisMultITSTPC{"axisMultITSTPC", {200, 0, 6000}, "Number of ITSTPC matched tracks"}; @@ -139,12 +141,14 @@ struct centralityStudy { histos.add("hFT0M_Collisions", "hFT0M_Collisions", kTH1D, {axisMultUltraFineFT0M}); histos.add("hFV0A_Collisions", "hFV0A_Collisions", kTH1D, {axisMultUltraFineFV0A}); histos.add("hNGlobalTracks", "hNGlobalTracks", kTH1D, {axisMultUltraFineGlobalTracks}); + histos.add("hNMFTTracks", "hNMFTTracks", kTH1D, {axisMultUltraFineMFTTracks}); histos.add("hNPVContributors", "hNPVContributors", kTH1D, {axisMultUltraFinePVContributors}); histos.add("hFT0CvsPVz_Collisions_All", "hFT0CvsPVz_Collisions_All", kTProfile, {axisPVz}); histos.add("hFT0CvsPVz_Collisions", "hFT0CvsPVz_Collisions", kTProfile, {axisPVz}); histos.add("hFV0AvsPVz_Collisions", "hFV0AvsPVz_Collisions", kTProfile, {axisPVz}); histos.add("hNGlobalTracksvsPVz_Collisions", "hNGlobalTracksvsPVz_Collisions", kTProfile, {axisPVz}); + histos.add("hNMFTTracksvsPVz_Collisions", "hNMFTTracksvsPVz_Collisions", kTProfile, {axisPVz}); } if (doprocessBCs) { @@ -179,6 +183,7 @@ struct centralityStudy { histos.add("hNGlobalTracksVsFDDC", "hNGlobalTracksVsFDDC", kTH2F, {axisMultFDDC, axisMultGlobalTracks}); histos.add("hNGlobalTracksVsZNA", "hNGlobalTracksVsZNA", kTH2F, {axisZN, axisMultGlobalTracks}); histos.add("hNGlobalTracksVsZNC", "hNGlobalTracksVsZNC", kTH2F, {axisZN, axisMultGlobalTracks}); + histos.add("hNGlobalTracksVsNMFTTracks", "hNGlobalTracksVsNMFTTracks", kTH2F, {axisMultMFTTracks, axisMultGlobalTracks}); } if (doOccupancyStudyVsRawValues2d) { @@ -202,6 +207,7 @@ struct centralityStudy { histos.add("hNITSTPCTracksVsCentrality", "hNITSTPCTracksVsCentrality", kTH2F, {axisCentrality, axisMultPVContributors}); histos.add("hNITSOnlyTracksVsCentrality", "hNITSOnlyTracksVsCentrality", kTH2F, {axisCentrality, axisMultPVContributors}); histos.add("hNGlobalTracksVsCentrality", "hNGlobalTracksVsCentrality", kTH2F, {axisCentrality, axisMultPVContributors}); + histos.add("hNMFTVsCentrality", "hNMFTVsCentrality", kTH2F, {axisCentrality, axisMultMFTTracks}); histos.add("hPVChi2VsCentrality", "hPVChi2VsCentrality", kTH2F, {axisCentrality, axisPVChi2}); histos.add("hDeltaTimeVsCentrality", "hDeltaTimeVsCentrality", kTH2F, {axisCentrality, axisDeltaTime}); @@ -324,9 +330,11 @@ struct centralityStudy { histos.fill(HIST("hFT0M_Collisions"), (collision.multFT0A() + collision.multFT0C()) * scaleSignalFT0M); histos.fill(HIST("hFV0A_Collisions"), collision.multFV0A() * scaleSignalFV0A); histos.fill(HIST("hNGlobalTracks"), collision.multNTracksGlobal()); + histos.fill(HIST("hNMFTTracks"), collision.mftNtracks()); histos.fill(HIST("hFT0CvsPVz_Collisions_All"), collision.multPVz(), collision.multFT0C() * scaleSignalFT0C); histos.fill(HIST("hFV0AvsPVz_Collisions"), collision.multPVz(), collision.multFV0A() * scaleSignalFV0A); histos.fill(HIST("hNGlobalTracksvsPVz_Collisions"), collision.multPVz(), collision.multNTracksGlobal()); + histos.fill(HIST("hNMFTTracksvsPVz_Collisions"), collision.multPVz(), collision.mftNtracks()); if (collision.multFT0C() > minFT0CforVertexZ) { histos.fill(HIST("hFT0CvsPVz_Collisions"), collision.multPVz(), collision.multFT0C() * scaleSignalFT0C); } @@ -364,6 +372,7 @@ struct centralityStudy { histos.fill(HIST("hNGlobalTracksVsFDDC"), collision.multFDDC(), collision.multNTracksGlobal()); histos.fill(HIST("hNGlobalTracksVsZNA"), collision.multZNA(), collision.multNTracksGlobal()); histos.fill(HIST("hNGlobalTracksVsZNC"), collision.multZNC(), collision.multNTracksGlobal()); + histos.fill(HIST("hNMFTTracksVsZNC"), collision.mftNtracks(), collision.multNTracksGlobal()); } // if the table has centrality information @@ -374,6 +383,7 @@ struct centralityStudy { histos.fill(HIST("hNITSTPCTracksVsCentrality"), collision.centFT0C(), collision.multNTracksITSTPC()); histos.fill(HIST("hNITSOnlyTracksVsCentrality"), collision.centFT0C(), collision.multNTracksITSOnly()); histos.fill(HIST("hNGlobalTracksVsCentrality"), collision.centFT0C(), collision.multNTracksGlobal()); + histos.fill(HIST("hNMFTTracksVsCentrality"), collision.centFT0C(), collision.mftNtracks()); histos.fill(HIST("hPVChi2VsCentrality"), collision.centFT0C(), collision.multPVChi2()); if (doOccupancyStudyVsCentrality2d) { @@ -392,22 +402,22 @@ struct centralityStudy { } } - void processCollisions(soa::Join::iterator const& collision) + void processCollisions(soa::Join::iterator const& collision) { genericProcessCollision(collision); } - void processCollisionsWithCentrality(soa::Join::iterator const& collision) + void processCollisionsWithCentrality(soa::Join::iterator const& collision) { genericProcessCollision(collision); } - void processCollisionsWithCentralityWithNeighbours(soa::Join::iterator const& collision) + void processCollisionsWithCentralityWithNeighbours(soa::Join::iterator const& collision) { genericProcessCollision(collision); } - void processBCs(soa::Join::iterator const& multbc, soa::Join const&) + void processBCs(soa::Join::iterator const& multbc, soa::Join const&) { // process BCs, calculate FT0C distribution // conditionals suggested by FIT team (Jacek O. et al) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h index 3ea392eebe7..a6b80611649 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h @@ -159,7 +159,13 @@ class FemtoUniverseAngularContainer deltaEta = part1.eta() - part2.eta(); deltaPhi = part1.phi() - part2.phi(); - deltaPhi = RecoDecay::constrainAngle(deltaPhi, 0); + + while (deltaPhi < mPhiLow) { + deltaPhi += o2::constants::math::TwoPI; + } + while (deltaPhi > mPhiHigh) { + deltaPhi -= o2::constants::math::TwoPI; + } mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/DeltaEtaDeltaPhi"), deltaPhi, deltaEta, weight); if (use3dplots) { diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h index 38209e8bc8f..2b951e78353 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h @@ -88,7 +88,7 @@ class FemtoUniverseCascadeSelection } /// Initializes histograms for the task - template + template void init(HistogramRegistry* registry, bool isSelectCascOmega = false); template @@ -285,7 +285,7 @@ class FemtoUniverseCascadeSelection }; // namespace femto_universe -template +template void FemtoUniverseCascadeSelection::init(HistogramRegistry* registry, bool isSelectCascOmega) { @@ -308,22 +308,22 @@ void FemtoUniverseCascadeSelection::init(HistogramRegistry* registry, bool isSel /// \todo this should be an automatic check in the parent class, and the /// return type should be templated size_t nSelections = getNSelections(); - if (nSelections > 17 * sizeof(cutContainerType)) { + if (nSelections > 17 * sizeof(CutContainerType)) { LOG(fatal) << "FemtoUniverseCascadeCuts: Number of selections to large for your " "container - quitting!"; } posDaughTrack.init( + aod::femtouniverseparticle::CutContainerType>( mHistogramRegistry); negDaughTrack.init( + aod::femtouniverseparticle::CutContainerType>( mHistogramRegistry); bachTrackSel.init( + aod::femtouniverseparticle::CutContainerType>( mHistogramRegistry); // V0 (Lambda) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseCutculator.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseCutculator.h index 3417045e100..863ecee389d 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseCutculator.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseCutculator.h @@ -200,7 +200,7 @@ class FemtoUniverseCutculator /// \param selectionType Selection type under investigation, as defined in the /// selection class template - void checkForSelection(aod::femtouniverseparticle::cutContainerType& output, + void checkForSelection(aod::femtouniverseparticle::CutContainerType& output, size_t& counter, T1 objectSelection, T2 selectionType, bool SysChecks, float sign) { @@ -294,9 +294,9 @@ class FemtoUniverseCutculator /// container that will be put to the user task incorporating the user choice /// of selections template - aod::femtouniverseparticle::cutContainerType iterateSelection(T objectSelection, bool SysChecks, float sign) + aod::femtouniverseparticle::CutContainerType iterateSelection(T objectSelection, bool SysChecks, float sign) { - aod::femtouniverseparticle::cutContainerType output = 0; + aod::femtouniverseparticle::CutContainerType output = 0; size_t counter = 0; auto selectionVariables = objectSelection.getSelectionVariables(); for (auto selVarIt : selectionVariables) { @@ -309,7 +309,7 @@ class FemtoUniverseCutculator /// selection bit-wise container incorporating the user choice of selections void analyseCuts(std::string choice, bool SysChecks = false, float sign = 1) { - aod::femtouniverseparticle::cutContainerType output = -1; + aod::femtouniverseparticle::CutContainerType output = -1; if (choice == std::string("T")) { output = iterateSelection(mTrackSel, SysChecks, sign); } else if (choice == std::string("V")) { @@ -319,7 +319,7 @@ class FemtoUniverseCutculator std::cout << "Option " << choice << " not recognized - available options are (T/V)" << std::endl; return; } - std::bitset<8 * sizeof(aod::femtouniverseparticle::cutContainerType)> + std::bitset<8 * sizeof(aod::femtouniverseparticle::CutContainerType)> bitOutput = output; // LOGF(info, "+++++++++++++++++++++++++++++++++"); // LOGF(info, "CutCulator has spoken - your selection bit is"); diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniversePhiSelection.h b/PWGCF/FemtoUniverse/Core/FemtoUniversePhiSelection.h index 2794bd96e80..80bf1797414 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniversePhiSelection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniversePhiSelection.h @@ -72,7 +72,7 @@ class FemtoUniversePhiSelection /// Initializes histograms for the task template + typename CutContainerType> void init(HistogramRegistry* registry); template @@ -85,8 +85,8 @@ class FemtoUniversePhiSelection /// \todo for the moment the PID of the tracks is factored out into a separate /// field, hence 5 values in total \\ASK: what does it mean? - template - std::array getCutContainer(C const& col, V const& phi, + template + std::array getCutContainer(C const& col, V const& phi, T const& posTrack, T const& negTrack); @@ -273,7 +273,7 @@ class FemtoUniversePhiSelection template + typename CutContainerType> void FemtoUniversePhiSelection::init(HistogramRegistry* registry) { @@ -290,7 +290,7 @@ void FemtoUniversePhiSelection::init(HistogramRegistry* registry) /// \todo this should be an automatic check in the parent class, and the /// return type should be templated size_t nSelections = getNSelections(); - if (nSelections > 8 * sizeof(cutContainerType)) { + if (nSelections > 8 * sizeof(CutContainerType)) { LOG(fatal) << "FemtoUniversePhiCuts: Number of selections to large for your " "container - quitting!"; } @@ -309,11 +309,11 @@ void FemtoUniversePhiSelection::init(HistogramRegistry* registry) posDaughTrack.init( + aod::femtouniverseparticle::CutContainerType>( mHistogramRegistry); negDaughTrack.init( + aod::femtouniverseparticle::CutContainerType>( mHistogramRegistry); // mHistogramRegistry->add("LambdaQA/hInvMassLambdaNoCuts", "No cuts", kTH1F, @@ -519,13 +519,13 @@ void FemtoUniversePhiSelection::fillLambdaQA(C const& col, V const& phi, /// the CosPA of Phi needs as argument the posXYZ of collisions vertex so we need /// to pass the collsion as well -template -std::array +template +std::array FemtoUniversePhiSelection::getCutContainer(C const& col, V const& phi, T const& posTrack, T const& negTrack) { - auto outputPosTrack = posDaughTrack.getCutContainer(posTrack); - auto outputNegTrack = negDaughTrack.getCutContainer(negTrack); - cutContainerType output = 0; + auto outputPosTrack = posDaughTrack.getCutContainer(posTrack); + auto outputNegTrack = negDaughTrack.getCutContainer(negTrack); + CutContainerType output = 0; size_t counter = 0; auto lambdaMassNominal = o2::constants::physics::MassPhi; diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h index 79ee6e167ca..3724e84ce83 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h @@ -96,9 +96,9 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection + template void init(HistogramRegistry* registry); /// Passes the species to the task for which PID needs to be stored @@ -138,12 +138,12 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection - std::array getCutContainer(T const& track); + template + std::array getCutContainer(T const& track); /// Some basic QA histograms /// \tparam part Type of the particle for proper naming of the folders for QA @@ -289,7 +289,7 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection +template void FemtoUniverseTrackSelection::init(HistogramRegistry* registry) { if (registry) { @@ -298,7 +298,7 @@ void FemtoUniverseTrackSelection::init(HistogramRegistry* registry) /// check whether the number of selection exceeds the bitmap size unsigned int nSelections = getNSelections() - getNSelections(femto_universe_track_selection::kPIDnSigmaMax); - if (nSelections > 8 * sizeof(cutContainerType)) { + if (nSelections > 8 * sizeof(CutContainerType)) { LOG(fatal) << "FemtoUniverseTrackCuts: Number of selections too large for your container - quitting!"; } @@ -456,12 +456,12 @@ bool FemtoUniverseTrackSelection::isSelectedMinimal(T const& track) return true; } -template -std::array FemtoUniverseTrackSelection::getCutContainer(T const& track) +template +std::array FemtoUniverseTrackSelection::getCutContainer(T const& track) { - cutContainerType output = 0; + CutContainerType output = 0; size_t counter = 0; - cutContainerType outputPID = 0; + CutContainerType outputPID = 0; const auto sign = track.sign(); const auto pT = track.pt(); const auto eta = track.eta(); diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseV0Selection.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseV0Selection.h index 87c0a1cc406..d5999f658e0 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseV0Selection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseV0Selection.h @@ -71,7 +71,7 @@ class FemtoUniverseV0Selection /// Initializes histograms for the task template + typename CutContainerType> void init(HistogramRegistry* registry); template @@ -84,8 +84,8 @@ class FemtoUniverseV0Selection /// \todo for the moment the PID of the tracks is factored out into a separate /// field, hence 5 values in total \\ASK: what does it mean? - template - std::array getCutContainer(C const& col, V const& v0, + template + std::array getCutContainer(C const& col, V const& v0, T const& posTrack, T const& negTrack); @@ -273,7 +273,7 @@ class FemtoUniverseV0Selection template + typename CutContainerType> void FemtoUniverseV0Selection::init(HistogramRegistry* registry) { if (registry) { @@ -288,7 +288,7 @@ void FemtoUniverseV0Selection::init(HistogramRegistry* registry) /// \todo this should be an automatic check in the parent class, and the /// return type should be templated size_t nSelections = getNSelections(); - if (nSelections > 8 * sizeof(cutContainerType)) { + if (nSelections > 8 * sizeof(CutContainerType)) { LOG(fatal) << "FemtoUniverseV0Cuts: Number of selections to large for your " "container - quitting!"; } @@ -332,11 +332,11 @@ void FemtoUniverseV0Selection::init(HistogramRegistry* registry) posDaughTrack.init( + aod::femtouniverseparticle::CutContainerType>( mHistogramRegistry); negDaughTrack.init( + aod::femtouniverseparticle::CutContainerType>( mHistogramRegistry); mHistogramRegistry->add("LambdaQA/hInvMassLambdaNoCuts", "No cuts", kTH1F, @@ -542,13 +542,13 @@ void FemtoUniverseV0Selection::fillLambdaQA(C const& /*col*/, V const& v0, /// the CosPA of V0 needs as argument the posXYZ of collisions vertex so we need /// to pass the collsion as well -template -std::array +template +std::array FemtoUniverseV0Selection::getCutContainer(C const& /*col*/, V const& v0, T const& posTrack, T const& negTrack) { - auto outputPosTrack = posDaughTrack.getCutContainer(posTrack); - auto outputNegTrack = negDaughTrack.getCutContainer(negTrack); - cutContainerType output = 0; + auto outputPosTrack = posDaughTrack.getCutContainer(posTrack); + auto outputNegTrack = negDaughTrack.getCutContainer(negTrack); + CutContainerType output = 0; size_t counter = 0; auto lambdaMassNominal = o2::constants::physics::MassLambda; // FIXME: Get from the common header diff --git a/PWGCF/FemtoUniverse/Core/femtoUtils.h b/PWGCF/FemtoUniverse/Core/femtoUtils.h index 9fb075d6d53..080315a594f 100644 --- a/PWGCF/FemtoUniverse/Core/femtoUtils.h +++ b/PWGCF/FemtoUniverse/Core/femtoUtils.h @@ -53,7 +53,7 @@ int getPIDselection(float nSigma, std::vector vNsigma) /// \param vNsigma vector with available n-sigma selections for PID (to check if chosen nSigma value is avialable + size to get the bit number) /// \param KDetector enum corresponding to the PID technique /// \return Whether the PID selection specified in the vectors is fulfilled -bool isPIDSelected(aod::femtouniverseparticle::cutContainerType pidcut, +bool isPIDSelected(aod::femtouniverseparticle::CutContainerType pidcut, int vSpecies, int nSpecies, float nSigma, @@ -76,7 +76,7 @@ bool isPIDSelected(aod::femtouniverseparticle::cutContainerType pidcut, /// \param nSigmaTPC Number of TPC sigmas for selection /// \param nSigmaTPCTOF Number of TPC+TOF sigmas for selection (circular selection) /// \return Whether the PID selection is fulfilled -bool isFullPIDSelected(aod::femtouniverseparticle::cutContainerType const& pidCut, +bool isFullPIDSelected(aod::femtouniverseparticle::CutContainerType const& pidCut, float momentum, float pidThresh, int vSpecies, diff --git a/PWGCF/FemtoUniverse/DataModel/FemtoDerived.h b/PWGCF/FemtoUniverse/DataModel/FemtoDerived.h index fd2f4f2b5b0..66aa48bc750 100644 --- a/PWGCF/FemtoUniverse/DataModel/FemtoDerived.h +++ b/PWGCF/FemtoUniverse/DataModel/FemtoDerived.h @@ -31,26 +31,26 @@ namespace o2::aod /// FemtoUniverseCollision namespace femtouniversecollision { -DECLARE_SOA_COLUMN(MultV0M, multV0M, float); //! V0M multiplicity -DECLARE_SOA_COLUMN(MultNtr, multNtr, int); //! multiplicity of charged tracks as defined in the producer -DECLARE_SOA_COLUMN(Sphericity, sphericity, float); //! Sphericity of the event -DECLARE_SOA_COLUMN(MagField, magField, float); //! Magnetic field of the event -DECLARE_SOA_COLUMN(IRrate, irrate, float); //! Interaction rate -DECLARE_SOA_COLUMN(Occupancy, occupancy, int); //! TPC occupancy +DECLARE_SOA_COLUMN(MultV0M, multV0M, float); //! V0M multiplicity +DECLARE_SOA_COLUMN(MultNtr, multNtr, int); //! multiplicity of charged tracks as defined in the producer +DECLARE_SOA_COLUMN(Sphericity, sphericity, float); //! Sphericity of the event +DECLARE_SOA_COLUMN(MagField, magField, float); //! Magnetic field of the event +DECLARE_SOA_COLUMN(InteractionRate, interactionRate, float); //! Interaction rate +DECLARE_SOA_COLUMN(Occupancy, occupancy, int); //! TPC occupancy } // namespace femtouniversecollision -DECLARE_SOA_TABLE(FDCollisions, "AOD", "FDCOLLISION", +DECLARE_SOA_TABLE(FdCollisions, "AOD", "FDCOLLISION", o2::soa::Index<>, o2::aod::collision::PosZ, femtouniversecollision::MultV0M, femtouniversecollision::MultNtr, femtouniversecollision::Sphericity, femtouniversecollision::MagField); -using FDCollision = FDCollisions::iterator; +using FdCollision = FdCollisions::iterator; DECLARE_SOA_TABLE(FDExtCollisions, "AOD", "FDEXTCOLLISION", - femtouniversecollision::IRrate, + femtouniversecollision::InteractionRate, femtouniversecollision::Occupancy); using FDExtCollision = FDExtCollisions::iterator; @@ -75,7 +75,7 @@ enum ParticleType { static constexpr std::string_view ParticleTypeName[kNParticleTypes] = {"Tracks", "MCTruthTracks", "V0", "V0Child", "Cascade", "CascadeBachelor", "Phi", "PhiChild", "D0", "D0Child"}; //! Naming of the different particle types static constexpr std::string_view TempFitVarName[kNParticleTypes] = {"/hDCAxy", "/hPDGvspT", "/hCPA", "/hDCAxy", "/hCPA", "/hDCAxy", "/hInvMass", "/hDCAxy", "/hInvMass", "/hDCAxy"}; -using cutContainerType = uint32_t; //! Definition of the data type for the bit-wise container for the different selection criteria +using CutContainerType = uint32_t; //! Definition of the data type for the bit-wise container for the different selection criteria enum TrackType { kNoChild, //! Not a V0 child @@ -87,13 +87,13 @@ enum TrackType { static constexpr std::string_view TrackTypeName[kNTrackTypes] = {"Trk", "Pos", "Neg", "Bach"}; //! Naming of the different particle types -DECLARE_SOA_INDEX_COLUMN(FDCollision, fdCollision); +DECLARE_SOA_INDEX_COLUMN(FdCollision, fdCollision); DECLARE_SOA_COLUMN(Pt, pt, float); //! p_T (GeV/c) DECLARE_SOA_COLUMN(Eta, eta, float); //! Eta DECLARE_SOA_COLUMN(Phi, phi, float); //! Phi DECLARE_SOA_COLUMN(PartType, partType, uint8_t); //! Type of the particle, according to femtouniverseparticle::ParticleType -DECLARE_SOA_COLUMN(Cut, cut, cutContainerType); //! Bit-wise container for the different selection criteria -DECLARE_SOA_COLUMN(PIDCut, pidcut, cutContainerType); //! Bit-wise container for the different PID selection criteria \todo since bit-masking cannot be done yet with filters we use a second field for the PID +DECLARE_SOA_COLUMN(Cut, cut, CutContainerType); //! Bit-wise container for the different selection criteria +DECLARE_SOA_COLUMN(PidCut, pidCut, CutContainerType); //! Bit-wise container for the different PID selection criteria \todo since bit-masking cannot be done yet with filters we use a second field for the PID DECLARE_SOA_COLUMN(TempFitVar, tempFitVar, float); //! Observable for the template fitting (Track: DCA_xy, V0: CPA) DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(Children, children); //! Field for the track indices to remove auto-correlations DECLARE_SOA_COLUMN(MLambda, mLambda, float); //! The invariant mass of V0 candidate, assuming lambda @@ -121,11 +121,11 @@ DECLARE_SOA_DYNAMIC_COLUMN(P, p, //! Compute the overall momentum in GeV/c }); // debug variables DECLARE_SOA_COLUMN(Sign, sign, int8_t); //! Sign of the track charge -DECLARE_SOA_COLUMN(TPCNClsFound, tpcNClsFound, uint8_t); //! Number of TPC clusters -DECLARE_SOA_COLUMN(TPCNClsCrossedRows, tpcNClsCrossedRows, uint8_t); //! Number of TPC crossed rows -DECLARE_SOA_COLUMN(ITSNCls, itsNCls, uint8_t); //! Number of ITS clusters -DECLARE_SOA_COLUMN(ITSNClsInnerBarrel, itsNClsInnerBarrel, uint8_t); //! Number of ITS clusters in the inner barrel //! TPC signal -DECLARE_SOA_DYNAMIC_COLUMN(TPCCrossedRowsOverFindableCls, tpcCrossedRowsOverFindableCls, //! Compute the number of crossed rows over findable TPC clusters +DECLARE_SOA_COLUMN(TpcNClsFound, tpcNClsFound, uint8_t); //! Number of TPC clusters +DECLARE_SOA_COLUMN(TpcNClsCrossedRows, tpcNClsCrossedRows, uint8_t); //! Number of TPC crossed rows +DECLARE_SOA_COLUMN(ItsNCls, itsNCls, uint8_t); //! Number of ITS clusters +DECLARE_SOA_COLUMN(ItsNClsInnerBarrel, itsNClsInnerBarrel, uint8_t); //! Number of ITS clusters in the inner barrel //! TPC signal +DECLARE_SOA_DYNAMIC_COLUMN(TpcCrossedRowsOverFindableCls, tpcCrossedRowsOverFindableCls, //! Compute the number of crossed rows over findable TPC clusters [](uint8_t tpcNClsFindable, uint8_t tpcNClsCrossedRows) -> float { return (float)tpcNClsCrossedRows / (float)tpcNClsFindable; }); @@ -157,13 +157,13 @@ DECLARE_SOA_COLUMN(Dcav0topv, dcav0topv, float); //! DCA of V0 to DECLARE_SOA_TABLE(FDParticles, "AOD", "FDPARTICLE", o2::soa::Index<>, - femtouniverseparticle::FDCollisionId, + femtouniverseparticle::FdCollisionId, femtouniverseparticle::Pt, femtouniverseparticle::Eta, femtouniverseparticle::Phi, femtouniverseparticle::PartType, femtouniverseparticle::Cut, - femtouniverseparticle::PIDCut, + femtouniverseparticle::PidCut, femtouniverseparticle::TempFitVar, femtouniverseparticle::ChildrenIds, femtouniverseparticle::MLambda, @@ -177,13 +177,13 @@ using FDParticle = FDParticles::iterator; DECLARE_SOA_TABLE(FDExtParticles, "AOD", "FDEXTPARTICLE", femtouniverseparticle::Sign, - femtouniverseparticle::TPCNClsFound, + femtouniverseparticle::TpcNClsFound, track::TPCNClsFindable, - femtouniverseparticle::TPCNClsCrossedRows, + femtouniverseparticle::TpcNClsCrossedRows, track::TPCNClsShared, track::TPCInnerParam, - femtouniverseparticle::ITSNCls, - femtouniverseparticle::ITSNClsInnerBarrel, + femtouniverseparticle::ItsNCls, + femtouniverseparticle::ItsNClsInnerBarrel, track::DcaXY, track::DcaZ, track::TPCSignal, @@ -203,7 +203,7 @@ DECLARE_SOA_TABLE(FDExtParticles, "AOD", "FDEXTPARTICLE", femtouniverseparticle::DecayVtxY, femtouniverseparticle::DecayVtxZ, femtouniverseparticle::MKaon, - femtouniverseparticle::TPCCrossedRowsOverFindableCls, + femtouniverseparticle::TpcCrossedRowsOverFindableCls, pidtpc_tiny::TPCNSigmaEl, pidtpc_tiny::TPCNSigmaPi, pidtpc_tiny::TPCNSigmaKa, @@ -218,13 +218,13 @@ using FDFullParticle = FDExtParticles::iterator; DECLARE_SOA_TABLE(FDCascParticles, "AOD", "FDCASCPARTICLE", o2::soa::Index<>, - femtouniverseparticle::FDCollisionId, + femtouniverseparticle::FdCollisionId, femtouniverseparticle::Pt, femtouniverseparticle::Eta, femtouniverseparticle::Phi, femtouniverseparticle::PartType, femtouniverseparticle::Cut, - femtouniverseparticle::PIDCut, + femtouniverseparticle::PidCut, femtouniverseparticle::TempFitVar, femtouniverseparticle::ChildrenIds, femtouniverseparticle::MLambda, @@ -281,20 +281,20 @@ enum MCType { static constexpr std::string_view MCTypeName[kNMCTypes] = {"", "_MC"}; DECLARE_SOA_COLUMN(PartOriginMCTruth, partOriginMCTruth, uint8_t); //! Origin of the particle, according to femtouniverseparticle::ParticleOriginMCTruth -DECLARE_SOA_COLUMN(PDGMCTruth, pdgMCTruth, int); //! Particle PDG +DECLARE_SOA_COLUMN(PdgMCTruth, pdgMCTruth, int); //! Particle PDG // debug variables DECLARE_SOA_COLUMN(MotherPDG, motherPDG, int); //! Checks mother PDG, where mother is the primary particle for that decay chain } // namespace femtouniverse_mc_particle -DECLARE_SOA_TABLE(FDMCParticles, "AOD", "FDMCPARTICLE", +DECLARE_SOA_TABLE(FdMCParticles, "AOD", "FDMCPARTICLE", o2::soa::Index<>, femtouniverse_mc_particle::PartOriginMCTruth, - femtouniverse_mc_particle::PDGMCTruth, + femtouniverse_mc_particle::PdgMCTruth, femtouniverseparticle::Pt, femtouniverseparticle::Eta, femtouniverseparticle::Phi); -using FDMCParticle = FDMCParticles::iterator; +using FdMCParticle = FdMCParticles::iterator; DECLARE_SOA_TABLE(FDExtMCParticles, "AOD", "FDEXTMCPARTICLE", femtouniverse_mc_particle::MotherPDG); @@ -302,10 +302,10 @@ using FDExtMCParticle = FDExtMCParticles::iterator; namespace mcfdlabel { -DECLARE_SOA_INDEX_COLUMN(FDMCParticle, fdMCParticle); //! MC particle for femtouniverseparticle +DECLARE_SOA_INDEX_COLUMN(FdMCParticle, fdMCParticle); //! MC particle for femtouniverseparticle } // namespace mcfdlabel DECLARE_SOA_TABLE(FDMCLabels, "AOD", "FDMCLabel", //! Table joinable to FemtoUniverseParticle containing the MC labels - mcfdlabel::FDMCParticleId); + mcfdlabel::FdMCParticleId); /// Hash namespace hash diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerMCTruthTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerMCTruthTask.cxx index 9e68e923755..5eb3cab7395 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerMCTruthTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerMCTruthTask.cxx @@ -77,10 +77,10 @@ struct femtoUniverseProducerMCTruthTask { Service ccdb; /// Accessing the CCDB // Tables being produced - Produces outputCollision; + Produces outputCollision; Produces outputParts; // Produces outputPartsMCLabels; - // Produces outputPartsMC; + // Produces outputPartsMC; // Analysis configs Configurable ConfIsTrigger{"ConfIsTrigger", false, "Store all collisions"}; // Choose if filtering or skimming version is run @@ -121,7 +121,7 @@ struct femtoUniverseProducerMCTruthTask { colCuts.setCuts(ConfEvtZvtx, ConfEvtTriggerCheck, ConfEvtTriggerSel, ConfEvtOfflineCheck, ConfIsRun3, ConfCentFT0Min, ConfCentFT0Max); colCuts.init(&qaRegistry); - trackCuts.init(&qaRegistry); + trackCuts.init(&qaRegistry); mRunNumber = 0; mMagField = 0.0; @@ -189,7 +189,7 @@ struct femtoUniverseProducerMCTruthTask { // trackCuts.fillQA(track); // the bit-wise container of the systematic variations is obtained - // auto cutContainer = trackCuts.getCutContainer(track); + // auto cutContainer = trackCuts.getCutContainer(track); // instead of the bitmask, the PDG of the particle is stored as uint32_t // now the table is filled diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerReducedTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerReducedTask.cxx index 23b289e7876..382559100e4 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerReducedTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerReducedTask.cxx @@ -63,9 +63,9 @@ using FemtoFullTracks = soa::Join outputCollision; + Produces outputCollision; Produces outputParts; - Produces outputPartsMC; + Produces outputPartsMC; Produces outputDebugParts; Produces outputPartsMCLabels; Produces outputDebugPartsMC; @@ -138,7 +138,7 @@ struct femtoUniverseProducerReducedTask { trackCuts.setnSigmaPIDOffset(ConfPIDnSigmaOffsetTPC, ConfPIDnSigmaOffsetTOF); trackCuts.init(&qaRegistry); + aod::femtouniverseparticle::CutContainerType>(&qaRegistry); mRunNumber = 0; mMagField = 0.0; /// Initializing CCDB @@ -267,7 +267,7 @@ struct femtoUniverseProducerReducedTask { trackCuts.fillQA(track); // an array of two bit-wise containers of the systematic variations is obtained // one container for the track quality cuts and one for the PID cuts - auto cutContainer = trackCuts.getCutContainer(track); + auto cutContainer = trackCuts.getCutContainer(track); // now the table is filled outputParts(outputCollision.lastIndex(), diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index 9164617bed1..b50e35c87e3 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -104,10 +104,10 @@ int getRowDaughters(int daughID, T const& vecID) } struct FemtoUniverseProducerTask { - Produces outputCollision; + Produces outputCollision; Produces outputCollExtra; Produces outputParts; - Produces outputPartsMC; + Produces outputPartsMC; Produces outputDebugParts; Produces outputPartsMCLabels; Produces outputDebugPartsMC; @@ -483,7 +483,7 @@ struct FemtoUniverseProducerTask { trackCuts.setSelection(confTrkPIDnSigmaMax, femto_universe_track_selection::kPIDnSigmaMax, femto_universe_selection::kAbsUpperLimit); trackCuts.setPIDSpecies(confTrkPIDspecies); trackCuts.setnSigmaPIDOffset(confTrkPIDnSigmaOffsetTPC, confTrkPIDnSigmaOffsetTOF); - trackCuts.init(&qaRegistry); + trackCuts.init(&qaRegistry); /// \todo fix how to pass array to setSelection, getRow() passing a /// different type! @@ -512,7 +512,7 @@ struct FemtoUniverseProducerTask { v0Cuts.setChildCuts(femto_universe_v0_selection::kNegTrack, ConfV0Selection.confChildPIDnSigmaMax, femto_universe_track_selection::kPIDnSigmaMax, femto_universe_selection::kAbsUpperLimit); v0Cuts.setChildPIDSpecies(femto_universe_v0_selection::kPosTrack, ConfV0Selection.confChildPIDspecies); v0Cuts.setChildPIDSpecies(femto_universe_v0_selection::kNegTrack, ConfV0Selection.confChildPIDspecies); - v0Cuts.init(&qaRegistry); + v0Cuts.init(&qaRegistry); v0Cuts.setInvMassLimits(ConfV0Selection.confV0InvMassLowLimit, ConfV0Selection.confV0InvMassUpLimit); v0Cuts.setChildRejectNotPropagatedTracks(femto_universe_v0_selection::kPosTrack, confTrkRejectNotPropagated); @@ -576,7 +576,7 @@ struct FemtoUniverseProducerTask { cascadeCuts.setChildPIDSpecies(femto_universe_cascade_selection::kBachTrack, ConfCascadeSelection.confCascChildPIDspecies); // check if works correctly for bachelor track - cascadeCuts.init(&cascadeQaRegistry, confIsSelectCascOmega); + cascadeCuts.init(&cascadeQaRegistry, confIsSelectCascOmega); // invmass cuts cascadeCuts.setInvMassLimits(ConfCascadeSelection.confCascInvMassLowLimit, ConfCascadeSelection.confCascInvMassUpLimit); @@ -587,7 +587,7 @@ struct FemtoUniverseProducerTask { if (confIsActivatePhi) { // initializing for Phi meson - phiCuts.init(&qaRegistry); + phiCuts.init(&qaRegistry); } mRunNumber = 0; @@ -904,7 +904,7 @@ struct FemtoUniverseProducerTask { trackCuts.fillQA(track); // the bit-wise container of the systematic variations is obtained - auto cutContainer = trackCuts.getCutContainer(track); + auto cutContainer = trackCuts.getCutContainer(track); // now the table is filled if (!confIsActivateCascade) { @@ -964,7 +964,7 @@ struct FemtoUniverseProducerTask { // } v0Cuts.fillQA(col, v0, postrack, negtrack); ///\todo fill QA also for daughters - auto cutContainerV0 = v0Cuts.getCutContainer(col, v0, postrack, negtrack); + auto cutContainerV0 = v0Cuts.getCutContainer(col, v0, postrack, negtrack); int postrackID = v0.posTrackId(); int rowInPrimaryTrackTablePos = -1; @@ -1267,8 +1267,8 @@ struct FemtoUniverseProducerTask { hfCand.eta(), hfCand.phi(), aod::femtouniverseparticle::ParticleType::kD0, - -999, // cut, cutContainerType - -999, // PID, cutContainerType + -999, // cut, CutContainerType + -999, // PID, CutContainerType -999, indexChildID, invMassD0, // D0 mass (mLambda) @@ -1468,7 +1468,7 @@ struct FemtoUniverseProducerTask { // trackCuts.fillQA(track); // the bit-wise container of the systematic variations is obtained - // auto cutContainer = trackCuts.getCutContainer(track); + // auto cutContainer = trackCuts.getCutContainer(track); // instead of the bitmask, the PDG of the particle is stored as uint32_t // now the table is filled diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTaskV0Only.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTaskV0Only.cxx index f834a51b49d..09ac22d0e30 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTaskV0Only.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTaskV0Only.cxx @@ -77,7 +77,7 @@ int getRowDaughters(int daughID, T const& vecID) struct femtoUniverseProducerTaskV0Only { - Produces outputCollision; + Produces outputCollision; Produces outputParts; Produces outputDebugParts; @@ -279,7 +279,7 @@ struct femtoUniverseProducerTaskV0Only { ConfV0DaughTPIDspecies); v0Cuts.init(&qaRegistry); + aod::femtouniverseparticle::CutContainerType>(&qaRegistry); v0Cuts.setInvMassLimits(ConfInvMassLowLimit, ConfInvMassUpLimit); v0Cuts.setChildRejectNotPropagatedTracks(femto_universe_v0_selection::kPosTrack, ConfRejectNotPropagatedTracks); @@ -419,7 +419,7 @@ struct femtoUniverseProducerTaskV0Only { aod::femtouniverseparticle::ParticleType::kV0Child>( col, v0, postrack, negtrack); ///\todo fill QA also for daughters auto cutContainerV0 = - v0Cuts.getCutContainer( + v0Cuts.getCutContainer( col, v0, postrack, negtrack); if ((cutContainerV0.at( diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniverseDebugTrack.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniverseDebugTrack.cxx index 444469de52b..0e07e4f4b03 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniverseDebugTrack.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniverseDebugTrack.cxx @@ -223,14 +223,14 @@ struct femtoUniverseDebugTrack { /// Porduce QA plots for sigle track selection in FemtoUniverse framework template - void FillDebugHistos(o2::aod::FDCollision& col, PartitionType& groupPartsOne) + void FillDebugHistos(o2::aod::FdCollision& col, PartitionType& groupPartsOne) { eventHisto.fillQA(col); for (auto& part : groupPartsOne) { // if (part.p() > ConfCutTable->get("MaxP") || part.pt() > ConfCutTable->get("MaxPt")) { // continue; // } - // if (!isFullPIDSelected(part.pidcut(), part.p(), ConfCutTable->get("PIDthr"), vPIDPartOne, ConfNspecies, kNsigma, ConfCutTable->get("nSigmaTPC"), ConfCutTable->get("nSigmaTPCTOF"))) { + // if (!isFullPIDSelected(part.pidCut(), part.p(), ConfCutTable->get("PIDthr"), vPIDPartOne, ConfNspecies, kNsigma, ConfCutTable->get("nSigmaTPC"), ConfCutTable->get("nSigmaTPCTOF"))) { // continue; // } if (trackonefilter.ConfIsTrackIdentified) { @@ -245,7 +245,7 @@ struct femtoUniverseDebugTrack { /// process function when runnning over data/ Monte Carlo reconstructed only /// \param col subscribe to FemtoUniverseCollision table /// \param parts subscribe to FemtoUniverseParticles table - void processData(o2::aod::FDCollision& col, FemtoFullParticles&) + void processData(o2::aod::FdCollision& col, FemtoFullParticles&) { auto groupPartsOne = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); FillDebugHistos(col, groupPartsOne); @@ -257,7 +257,7 @@ struct femtoUniverseDebugTrack { /// \param col subscribe to FemtoUniverseCollision table /// \param parts subscribe to the joined table of FemtoUniverseParticles and FemtoUniverseMCLabels table /// \param FemtoDramMCParticles subscribe to the table containing the Monte Carlo Truth information - void processMC(o2::aod::FDCollision& col, FemtoFullParticlesMC&, o2::aod::FDMCParticles&) + void processMC(o2::aod::FdCollision& col, FemtoFullParticlesMC&, o2::aod::FdMCParticles&) { auto groupPartsOne = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); FillDebugHistos(col, groupPartsOne); diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniverseDebugV0.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniverseDebugV0.cxx index c1d1bef3122..219c43472dd 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniverseDebugV0.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniverseDebugV0.cxx @@ -81,7 +81,7 @@ struct femtoUniverseDebugV0 { } /// Porduce QA plots for V0 selection in FemtoUniverse framework - void process(o2::aod::FDCollision const& col, FemtoFullParticles const& parts) + void process(o2::aod::FdCollision const& col, FemtoFullParticles const& parts) { auto groupPartsOne = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); eventHisto.fillQA(col); @@ -98,8 +98,8 @@ struct femtoUniverseDebugV0 { // check cuts on V0 children if ((posChild.partType() == uint8_t(aod::femtouniverseparticle::ParticleType::kV0Child) && (posChild.cut() & ConfCutChildPos) == ConfCutChildPos) && (negChild.partType() == uint8_t(aod::femtouniverseparticle::ParticleType::kV0Child) && (negChild.cut() & ConfCutChildNeg) == ConfCutChildNeg) && - isFullPIDSelected(posChild.pidcut(), posChild.p(), 999.f, ConfChildPosIndex.value, ConfChildnSpecies.value, ConfChildPIDnSigmaMax.value, ConfChildPosPidnSigmaMax.value, 1.f) && - isFullPIDSelected(negChild.pidcut(), negChild.p(), 999.f, ConfChildNegIndex.value, ConfChildnSpecies.value, ConfChildPIDnSigmaMax.value, ConfChildNegPidnSigmaMax.value, 1.f)) { + isFullPIDSelected(posChild.pidCut(), posChild.p(), 999.f, ConfChildPosIndex.value, ConfChildnSpecies.value, ConfChildPIDnSigmaMax.value, ConfChildPosPidnSigmaMax.value, 1.f) && + isFullPIDSelected(negChild.pidCut(), negChild.p(), 999.f, ConfChildNegIndex.value, ConfChildnSpecies.value, ConfChildPIDnSigmaMax.value, ConfChildNegPidnSigmaMax.value, 1.f)) { V0Histos.fillQA(part); posChildHistos.fillQA(posChild); negChildHistos.fillQA(negChild); diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx index c357fa284f7..cad94a05c60 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx @@ -41,7 +41,7 @@ struct femtoUniverseEfficiencyBase { Configurable ConfZVertex{"ConfZVertex", 10.f, "Event sel: Maximum z-Vertex (cm)"}; Filter collisionFilter = (nabs(aod::collision::posZ) < ConfZVertex); - using FilteredFDCollisions = soa::Filtered; + using FilteredFDCollisions = soa::Filtered; using FilteredFDCollision = FilteredFDCollisions::iterator; /// Particle selection part @@ -559,7 +559,7 @@ struct femtoUniverseEfficiencyBase { /// process function for to call doMCRecTrackTrack with Data /// \param col subscribe to the collision table (Data) void processTrackTrack(FilteredFDCollision& col, - FemtoFullParticles&, aod::FDMCParticles const&) + FemtoFullParticles&, aod::FdMCParticles const&) { fillCollision(col); // MCGen @@ -580,7 +580,7 @@ struct femtoUniverseEfficiencyBase { /// process function for to call doMCRecTrackPhi with Data /// \param col subscribe to the collision table (Data) void processTrackPhi(FilteredFDCollision& col, - FemtoFullParticles&, aod::FDMCParticles const&) + FemtoFullParticles&, aod::FdMCParticles const&) { fillCollision(col); // MCGen @@ -602,7 +602,7 @@ struct femtoUniverseEfficiencyBase { /// \param col subscribe to the collision table (Data) /// \param parts subscribe to the femtoUniverseParticleTable void processV0V0(FilteredFDCollision& col, - FemtoFullParticles& parts, aod::FDMCParticles const&) + FemtoFullParticles& parts, aod::FdMCParticles const&) { fillCollision(col); // MCGen @@ -625,7 +625,7 @@ struct femtoUniverseEfficiencyBase { /// \param col subscribe to the collision table (Data) /// \param parts subscribe to the femtoUniverseParticleTable void processTrackV0(FilteredFDCollision& col, - FemtoFullParticles& parts, aod::FDMCParticles const&) + FemtoFullParticles& parts, aod::FdMCParticles const&) { fillCollision(col); // MCGen diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniverseHashTask.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniverseHashTask.cxx index 773f6649d97..7f30fda061f 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniverseHashTask.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniverseHashTask.cxx @@ -40,7 +40,7 @@ struct FemtoUniverseHashTask { castCfgMultBins = (std::vector)cfgMultBins; } - void process(o2::aod::FDCollision const& col) + void process(o2::aod::FdCollision const& col) { /// the hash of the collision is computed and written to table hashes(eventmixing::getMixingBin(castCfgVtxBins, castCfgMultBins, col.posZ(), col.multV0M())); diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx index 926ac6d8a94..e76f71e7910 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx @@ -46,7 +46,7 @@ struct femtoUniversePairTaskTrackCascadeExtended { // o2-linter: disable=name/st Configurable confZVertexCut{"ConfZVertexCut", 10.f, "Event sel: Maximum z-Vertex (cm)"}; // o2-linter: disable=name/configurable Filter collisionFilter = (nabs(aod::collision::posZ) < confZVertexCut); - using FilteredFDCollisions = soa::Filtered; + using FilteredFDCollisions = soa::Filtered; using FilteredFDCollision = FilteredFDCollisions::iterator; ConfigurableAxis confChildTempFitVarpTBins{"ConfChildTempFitVarpTBins", {20, 0.5, 4.05}, "V0 child: pT binning of the pT vs. TempFitVar plot"}; // o2-linter: disable=name/configurable diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx index fc51aa9218e..979a500b240 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx @@ -421,7 +421,7 @@ struct FemtoUniversePairTaskTrackD0 { eventHisto.fillQA(col); } - void processQAD0D0barSel(o2::aod::FDCollision const& col, FemtoFullParticles const&) + void processQAD0D0barSel(o2::aod::FdCollision const& col, FemtoFullParticles const&) { auto groupPartsD0s = partsD0s->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); auto groupPartsD0bars = partsD0bars->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); @@ -441,7 +441,7 @@ struct FemtoUniversePairTaskTrackD0 { } PROCESS_SWITCH(FemtoUniversePairTaskTrackD0, processQAD0D0barSel, "Enable filling QA plots for selected D0/D0bar cand.", true); - void processD0mesons(o2::aod::FDCollision const& col, FemtoFullParticles const&) + void processD0mesons(o2::aod::FdCollision const& col, FemtoFullParticles const&) { auto groupPartsOnlyD0D0bar = partsOnlyD0D0bar->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); auto groupPartsAllDmesons = partsAllDmesons->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); @@ -509,7 +509,7 @@ struct FemtoUniversePairTaskTrackD0 { PROCESS_SWITCH(FemtoUniversePairTaskTrackD0, processD0mesons, "Enable processing D0 mesons", true); // D0-D0bar pair correlations (side-band methode) - void processSideBand(o2::aod::FDCollision const& col, FemtoFullParticles const&) + void processSideBand(o2::aod::FdCollision const& col, FemtoFullParticles const&) { auto groupPartsOnlyD0D0bar = partsOnlyD0D0bar->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); @@ -636,7 +636,7 @@ struct FemtoUniversePairTaskTrackD0 { /// process function for to call doSameEvent with Data /// \param col subscribe to the collision table (Data) /// \param parts subscribe to the femtoUniverseParticleTable - void processSameEvent(o2::aod::FDCollision const& col, + void processSameEvent(o2::aod::FdCollision const& col, FemtoFullParticles const& parts) { fillCollision(col); @@ -670,9 +670,9 @@ struct FemtoUniversePairTaskTrackD0 { /// \param col subscribe to the collision table (Monte Carlo Reconstructed reconstructed) /// \param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// \param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processSameEventMC(o2::aod::FDCollision const& col, + void processSameEventMC(o2::aod::FdCollision const& col, soa::Join const& parts, - o2::aod::FDMCParticles const&) + o2::aod::FdMCParticles const&) { fillCollision(col); @@ -718,7 +718,7 @@ struct FemtoUniversePairTaskTrackD0 { /// process function for to call doMixedEvent with Data /// @param cols subscribe to the collisions table (Data) /// @param parts subscribe to the femtoUniverseParticleTable - void processMixedEvent(o2::aod::FDCollisions const& cols, + void processMixedEvent(o2::aod::FdCollisions const& cols, FemtoFullParticles const& parts) { for (auto const& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { @@ -765,9 +765,9 @@ struct FemtoUniversePairTaskTrackD0 { /// @param cols subscribe to the collisions table (Monte Carlo Reconstructed reconstructed) /// @param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// @param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processMixedEventMC(o2::aod::FDCollisions const& cols, + void processMixedEventMC(o2::aod::FdCollisions const& cols, soa::Join const& parts, - o2::aod::FDMCParticles const&) + o2::aod::FdMCParticles const&) { for (auto const& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx index 595211f78ab..156d6f43292 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx @@ -593,7 +593,7 @@ struct femtoUniversePairTaskTrackNucleus { /// Process function to call doSameEvent with Data /// \param col subscribe to the collision table (Data) /// \param parts subscribe to the femtoUniverseParticleTable - void processSameEvent(soa::Filtered::iterator& col, + void processSameEvent(soa::Filtered::iterator& col, FilteredFemtoFullParticles& parts) { fillCollision(col); @@ -626,9 +626,9 @@ struct femtoUniversePairTaskTrackNucleus { /// \param col subscribe to the collision table (Monte Carlo Reconstructed reconstructed) /// \param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// \param FemtoUniverseMCParticles subscribe to the Monte Carlo Truth table - void processSameEventMC(o2::aod::FDCollision& col, + void processSameEventMC(o2::aod::FdCollision& col, soa::Join& parts, - o2::aod::FDMCParticles&) + o2::aod::FdMCParticles&) { fillCollision(col); @@ -743,7 +743,7 @@ struct femtoUniversePairTaskTrackNucleus { /// Process function to call doMixedEvent with Data /// \param cols subscribe to the collisions table (Data) /// \param parts subscribe to the femtoUniverseParticleTable - void processMixedEvent(soa::Filtered& cols, + void processMixedEvent(soa::Filtered& cols, FilteredFemtoFullParticles& parts) { for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { @@ -789,9 +789,9 @@ struct femtoUniversePairTaskTrackNucleus { /// \param cols subscribe to the collisions table (Monte Carlo Reconstructed reconstructed) /// \param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// \param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processMixedEventMC(o2::aod::FDCollisions& cols, + void processMixedEventMC(o2::aod::FdCollisions& cols, soa::Join& parts, - o2::aod::FDMCParticles&) + o2::aod::FdMCParticles&) { for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx index 4ee98317da0..00816d630f5 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx @@ -593,7 +593,7 @@ struct FemtoUniversePairTaskTrackPhi { /// process function for to call doSameEvent with Data /// \param col subscribe to the collision table (Data) /// \param parts subscribe to the femtoUniverseParticleTable - void processSameEvent(o2::aod::FDCollision const& col, + void processSameEvent(o2::aod::FdCollision const& col, FemtoFullParticles const& parts) { fillCollision(col); @@ -611,9 +611,9 @@ struct FemtoUniversePairTaskTrackPhi { /// \param col subscribe to the collision table (Monte Carlo Reconstructed reconstructed) /// \param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// \param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processSameEventMC(o2::aod::FDCollision const& col, + void processSameEventMC(o2::aod::FdCollision const& col, soa::Join const& parts, - o2::aod::FDMCParticles const&) + o2::aod::FdMCParticles const&) { fillCollision(col); @@ -672,7 +672,7 @@ struct FemtoUniversePairTaskTrackPhi { /// process function for to call doMixedEvent with Data /// @param cols subscribe to the collisions table (Data) /// @param parts subscribe to the femtoUniverseParticleTable - void processMixedEvent(o2::aod::FDCollisions const& cols, + void processMixedEvent(o2::aod::FdCollisions const& cols, FemtoFullParticles const& parts) { for (auto const& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { @@ -701,9 +701,9 @@ struct FemtoUniversePairTaskTrackPhi { /// @param cols subscribe to the collisions table (Monte Carlo Reconstructed reconstructed) /// @param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// @param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processMixedEventMC(o2::aod::FDCollisions const& cols, + void processMixedEventMC(o2::aod::FdCollisions const& cols, soa::Join const& parts, - o2::aod::FDMCParticles const&) + o2::aod::FdMCParticles const&) { for (auto const& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { @@ -736,7 +736,7 @@ struct FemtoUniversePairTaskTrackPhi { if (part.partType() != uint8_t(aod::femtouniverseparticle::ParticleType::kMCTruthTrack)) continue; - int pdgCode = static_cast(part.pidcut()); + int pdgCode = static_cast(part.pidCut()); const auto& pdgParticle = pdgMC->GetParticle(pdgCode); if (!pdgParticle) { continue; @@ -771,7 +771,7 @@ struct FemtoUniversePairTaskTrackPhi { } PROCESS_SWITCH(FemtoUniversePairTaskTrackPhi, processMCTruth, "Process MC truth data", false); - void processMCReco(FemtoRecoParticles const& parts, aod::FDMCParticles const& mcparts) + void processMCReco(FemtoRecoParticles const& parts, aod::FdMCParticles const& mcparts) { for (auto const& part : parts) { auto mcPartId = part.fdMCParticleId(); diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack.cxx index 7449aa4433c..8bb56e9d53a 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack.cxx @@ -197,7 +197,7 @@ struct FemtoUniversePairTaskTrackTrack { if (part.p() > confCutTable->get("PartOne", "MaxP") || part.pt() > confCutTable->get("PartOne", "MaxPt")) { continue; } - if (!isFullPIDSelected(part.pidcut(), + if (!isFullPIDSelected(part.pidCut(), part.p(), confCutTable->get("PartOne", "PIDthr"), vPIDPartOne, @@ -216,7 +216,7 @@ struct FemtoUniversePairTaskTrackTrack { if (part.p() > confCutTable->get("PartTwo", "MaxP") || part.pt() > confCutTable->get("PartTwo", "MaxPt")) { continue; } - if (!isFullPIDSelected(part.pidcut(), + if (!isFullPIDSelected(part.pidCut(), part.p(), confCutTable->get("PartTwo", "PIDthr"), vPIDPartTwo, @@ -234,7 +234,7 @@ struct FemtoUniversePairTaskTrackTrack { if (p1.p() > confCutTable->get("PartOne", "MaxP") || p1.pt() > confCutTable->get("PartOne", "MaxPt") || p2.p() > confCutTable->get("PartTwo", "MaxP") || p2.pt() > confCutTable->get("PartTwo", "MaxPt")) { continue; } - if (!isFullPIDSelected(p1.pidcut(), + if (!isFullPIDSelected(p1.pidCut(), p1.p(), confCutTable->get("PartOne", "PIDthr"), vPIDPartOne, @@ -242,7 +242,7 @@ struct FemtoUniversePairTaskTrackTrack { kNsigma, confCutTable->get("PartOne", "nSigmaTPC"), confCutTable->get("PartOne", "nSigmaTPCTOF")) || - !isFullPIDSelected(p2.pidcut(), + !isFullPIDSelected(p2.pidCut(), p2.p(), confCutTable->get("PartTwo", "PIDthr"), vPIDPartTwo, @@ -272,7 +272,7 @@ struct FemtoUniversePairTaskTrackTrack { /// process function for to call doSameEvent with Data /// \param col subscribe to the collision table (Data) /// \param parts subscribe to the femtoUniverseParticleTable - void processSameEvent(const o2::aod::FDCollision& col, + void processSameEvent(const o2::aod::FdCollision& col, const o2::aod::FDParticles& parts) { fillCollision(col); @@ -288,9 +288,9 @@ struct FemtoUniversePairTaskTrackTrack { /// \param col subscribe to the collision table (Monte Carlo Reconstructed reconstructed) /// \param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// \param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processSameEventMC(const o2::aod::FDCollision& col, + void processSameEventMC(const o2::aod::FdCollision& col, const soa::Join& parts, - const o2::aod::FDMCParticles&) + const o2::aod::FdMCParticles&) { fillCollision(col); @@ -319,7 +319,7 @@ struct FemtoUniversePairTaskTrackTrack { if (p1.p() > confCutTable->get("PartOne", "MaxP") || p1.pt() > confCutTable->get("PartOne", "MaxPt") || p2.p() > confCutTable->get("PartTwo", "MaxP") || p2.pt() > confCutTable->get("PartTwo", "MaxPt")) { continue; } - if (!isFullPIDSelected(p1.pidcut(), + if (!isFullPIDSelected(p1.pidCut(), p1.p(), confCutTable->get("PartOne", "PIDthr"), vPIDPartOne, @@ -327,7 +327,7 @@ struct FemtoUniversePairTaskTrackTrack { kNsigma, confCutTable->get("PartOne", "nSigmaTPC"), confCutTable->get("PartOne", "nSigmaTPCTOF")) || - !isFullPIDSelected(p2.pidcut(), + !isFullPIDSelected(p2.pidCut(), p2.p(), confCutTable->get("PartTwo", "PIDthr"), vPIDPartTwo, @@ -352,7 +352,7 @@ struct FemtoUniversePairTaskTrackTrack { /// process function for to call doMixedEvent with Data /// @param cols subscribe to the collisions table (Data) /// @param parts subscribe to the femtoUniverseParticleTable - void processMixedEvent(const o2::aod::FDCollisions& cols, + void processMixedEvent(const o2::aod::FdCollisions& cols, const o2::aod::FDParticles& parts) { for (const auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { @@ -381,9 +381,9 @@ struct FemtoUniversePairTaskTrackTrack { /// @param cols subscribe to the collisions table (Monte Carlo Reconstructed reconstructed) /// @param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// @param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processMixedEventMC(const o2::aod::FDCollisions& cols, + void processMixedEventMC(const o2::aod::FdCollisions& cols, const soa::Join& parts, - const o2::aod::FDMCParticles&) + const o2::aod::FdMCParticles&) { for (const auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx index 8e10d1269a0..49c932fc008 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx @@ -138,7 +138,7 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended { Filter collfilter = (o2::aod::femtouniversecollision::multV0M > ConfV0MLow) && (o2::aod::femtouniversecollision::multV0M < ConfV0MHigh) && (o2::aod::femtouniversecollision::occupancy > ConfTPCOccupancyLow) && (o2::aod::femtouniversecollision::occupancy < ConfTPCOccupancyHigh); - using FilteredFDCollisions = soa::Filtered>; + using FilteredFDCollisions = soa::Filtered>; using FilteredFDCollision = FilteredFDCollisions::iterator; /// Particle part @@ -599,9 +599,9 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended { /// \param col subscribe to the collision table (Monte Carlo Reconstructed reconstructed) /// \param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// \param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processSameEventMC(o2::aod::FDCollision& col, + void processSameEventMC(o2::aod::FdCollision& col, soa::Join& parts, - o2::aod::FDMCParticles&) + o2::aod::FdMCParticles&) { fillCollision(col); @@ -770,9 +770,9 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended { /// @param cols subscribe to the collisions table (Monte Carlo Reconstructed reconstructed) /// @param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// @param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processMixedEventMC(o2::aod::FDCollisions& cols, + void processMixedEventMC(o2::aod::FdCollisions& cols, soa::Join& parts, - o2::aod::FDMCParticles&) + o2::aod::FdMCParticles&) { for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, ConfNEventsMix, -1, cols, cols)) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackExtended.cxx index 324d48d5bce..340096ae350 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackExtended.cxx @@ -350,7 +350,7 @@ struct FemtoUniversePairTaskTrackTrackExtended { // if (part.p() > twotracksconfigs.confCutTable->get("PartOne", "MaxP") || part.pt() > twotracksconfigs.confCutTable->get("PartOne", "MaxPt")) { // continue; // } - // if (!isFullPIDSelected(part.pidcut(), + // if (!isFullPIDSelected(part.pidCut(), // part.p(), // twotracksconfigs.confCutTable->get("PartOne", "PIDthr"), // vPIDPartOne, @@ -374,7 +374,7 @@ struct FemtoUniversePairTaskTrackTrackExtended { // if (part.p() > twotracksconfigs.confCutTable->get("PartTwo", "MaxP") || part.pt() > twotracksconfigs.confCutTable->get("PartTwo", "MaxPt")) { // continue; // } - // if (!isFullPIDSelected(part.pidcut(), + // if (!isFullPIDSelected(part.pidCut(), // part.p(), // twotracksconfigs.confCutTable->get("PartTwo", "PIDthr"), // vPIDPartTwo, @@ -397,7 +397,7 @@ struct FemtoUniversePairTaskTrackTrackExtended { // if (p1.p() > twotracksconfigs.confCutTable->get("PartOne", "MaxP") || p1.pt() > twotracksconfigs.confCutTable->get("PartOne", "MaxPt") || p2.p() > twotracksconfigs.confCutTable->get("PartTwo", "MaxP") || p2.pt() > twotracksconfigs.confCutTable->get("PartTwo", "MaxPt")) { // continue; // } - // if (!isFullPIDSelected(p1.pidcut(), + // if (!isFullPIDSelected(p1.pidCut(), // p1.p(), // twotracksconfigs.confCutTable->get("PartOne", "PIDthr"), // vPIDPartOne, @@ -405,7 +405,7 @@ struct FemtoUniversePairTaskTrackTrackExtended { // kNsigma, // twotracksconfigs.confCutTable->get("PartOne", "nSigmaTPC"), // twotracksconfigs.confCutTable->get("PartOne", "nSigmaTPCTOF")) || - // !isFullPIDSelected(p2.pidcut(), + // !isFullPIDSelected(p2.pidCut(), // p2.p(), // twotracksconfigs.confCutTable->get("PartTwo", "PIDthr"), // vPIDPartTwo, @@ -453,7 +453,7 @@ struct FemtoUniversePairTaskTrackTrackExtended { // if (p1.p() > twotracksconfigs.confCutTable->get("PartOne", "MaxP") || p1.pt() > twotracksconfigs.confCutTable->get("PartOne", "MaxPt") || p2.p() > twotracksconfigs.confCutTable->get("PartTwo", "MaxP") || p2.pt() > twotracksconfigs.confCutTable->get("PartTwo", "MaxPt")) { // continue; // } - // if (!isFullPIDSelected(p1.pidcut(), + // if (!isFullPIDSelected(p1.pidCut(), // p1.p(), // twotracksconfigs.confCutTable->get("PartOne", "PIDthr"), // vPIDPartOne, @@ -461,7 +461,7 @@ struct FemtoUniversePairTaskTrackTrackExtended { // kNsigma, // twotracksconfigs.confCutTable->get("PartOne", "nSigmaTPC"), // twotracksconfigs.confCutTable->get("PartOne", "nSigmaTPCTOF")) || - // !isFullPIDSelected(p2.pidcut(), + // !isFullPIDSelected(p2.pidCut(), // p2.p(), // twotracksconfigs.confCutTable->get("PartTwo", "PIDthr"), // vPIDPartTwo, @@ -502,7 +502,7 @@ struct FemtoUniversePairTaskTrackTrackExtended { /// process function for to call doSameEvent with Data /// \param col subscribe to the collision table (Data) /// \param parts subscribe to the femtoUniverseParticleTable - void processSameEvent(const o2::aod::FDCollision& col, + void processSameEvent(const o2::aod::FdCollision& col, const FilteredFemtoFullParticles& parts) { fillCollision(col); @@ -518,9 +518,9 @@ struct FemtoUniversePairTaskTrackTrackExtended { /// \param col subscribe to the collision table (Monte Carlo Reconstructed reconstructed) /// \param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// \param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processSameEventMC(const o2::aod::FDCollision& col, + void processSameEventMC(const o2::aod::FdCollision& col, const soa::Join& parts, - const o2::aod::FDMCParticles&) + const o2::aod::FdMCParticles&) { fillCollision(col); @@ -553,7 +553,7 @@ struct FemtoUniversePairTaskTrackTrackExtended { // if (p1.p() > twotracksconfigs.confCutTable->get("PartOne", "MaxP") || p1.pt() > twotracksconfigs.confCutTable->get("PartOne", "MaxPt") || p2.p() > twotracksconfigs.confCutTable->get("PartTwo", "MaxP") || p2.pt() > twotracksconfigs.confCutTable->get("PartTwo", "MaxPt")) { // continue; // } - // if (!isFullPIDSelected(p1.pidcut(), + // if (!isFullPIDSelected(p1.pidCut(), // p1.p(), // twotracksconfigs.confCutTable->get("PartOne", "PIDthr"), // vPIDPartOne, @@ -561,7 +561,7 @@ struct FemtoUniversePairTaskTrackTrackExtended { // kNsigma, // twotracksconfigs.confCutTable->get("PartOne", "nSigmaTPC"), // twotracksconfigs.confCutTable->get("PartOne", "nSigmaTPCTOF")) || - // !isFullPIDSelected(p2.pidcut(), + // !isFullPIDSelected(p2.pidCut(), // p2.p(), // twotracksconfigs.confCutTable->get("PartTwo", "PIDthr"), // vPIDPartTwo, @@ -601,7 +601,7 @@ struct FemtoUniversePairTaskTrackTrackExtended { /// process function for to call doMixedEvent with Data /// @param cols subscribe to the collisions table (Data) /// @param parts subscribe to the femtoUniverseParticleTable - void processMixedEvent(const o2::aod::FDCollisions& cols, + void processMixedEvent(const o2::aod::FdCollisions& cols, const FilteredFemtoFullParticles& parts) { for (const auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { @@ -630,9 +630,9 @@ struct FemtoUniversePairTaskTrackTrackExtended { /// @param cols subscribe to the collisions table (Monte Carlo Reconstructed reconstructed) /// @param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// @param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processMixedEventMC(const o2::aod::FDCollisions& cols, + void processMixedEventMC(const o2::aod::FdCollisions& cols, const soa::Join& parts, - const o2::aod::FDMCParticles&) + const o2::aod::FdMCParticles&) { for (const auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMC.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMC.cxx index c1ece63158b..09386709a01 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMC.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMC.cxx @@ -524,7 +524,7 @@ struct femtoUniversePairTaskTrackTrackMC { /// process function for to call doSameEvent with Data /// \param col subscribe to the collision table (Data) /// \param parts subscribe to the femtoUniverseParticleTable - void processSameEvent(o2::aod::FDCollision& col, + void processSameEvent(o2::aod::FdCollision& col, FilteredFemtoFullParticles& parts) { fillCollision(col); @@ -549,9 +549,9 @@ struct femtoUniversePairTaskTrackTrackMC { /// \param col subscribe to the collision table (Monte Carlo Reconstructed reconstructed) /// \param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// \param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processSameEventMC(o2::aod::FDCollision& col, + void processSameEventMC(o2::aod::FdCollision& col, soa::Join& parts, - o2::aod::FDMCParticles&) + o2::aod::FdMCParticles&) { fillCollision(col); @@ -641,7 +641,7 @@ struct femtoUniversePairTaskTrackTrackMC { /// process function for to call doMixedEvent with Data /// @param cols subscribe to the collisions table (Data) /// @param parts subscribe to the femtoUniverseParticleTable - void processMixedEvent(o2::aod::FDCollisions& cols, + void processMixedEvent(o2::aod::FdCollisions& cols, FilteredFemtoFullParticles& parts) { for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { @@ -679,9 +679,9 @@ struct femtoUniversePairTaskTrackTrackMC { /// @param cols subscribe to the collisions table (Monte Carlo Reconstructed reconstructed) /// @param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// @param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processMixedEventMC(o2::aod::FDCollisions& cols, + void processMixedEventMC(o2::aod::FdCollisions& cols, soa::Join& parts, - o2::aod::FDMCParticles&) + o2::aod::FdMCParticles&) { for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMcTruth.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMcTruth.cxx index 753f528d53f..91da795ca2f 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMcTruth.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMcTruth.cxx @@ -215,7 +215,7 @@ struct femtoUniversePairTaskTrackTrackMcTruth { /// process function for to call doSameEvent with Data /// \param col subscribe to the collision table (Data) /// \param parts subscribe to the femtoUniverseParticleTable - void processSameEvent(o2::aod::FDCollision& col, + void processSameEvent(o2::aod::FdCollision& col, o2::aod::FDParticles& parts) { fillCollision(col); @@ -259,7 +259,7 @@ struct femtoUniversePairTaskTrackTrackMcTruth { /// process function for to call doMixedEvent with Data /// @param cols subscribe to the collisions table (Data) /// @param parts subscribe to the femtoUniverseParticleTable - void processMixedEvent(o2::aod::FDCollisions& cols, + void processMixedEvent(o2::aod::FdCollisions& cols, o2::aod::FDParticles& parts) { for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx index d243bf9f96f..9d862855874 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx @@ -517,7 +517,7 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { /// process function for to call doSameEvent with Data /// \param col subscribe to the collision table (Data) /// \param parts subscribe to the femtoUniverseParticleTable - void processSameEvent(soa::Filtered::iterator& col, + void processSameEvent(soa::Filtered::iterator& col, FilteredFemtoFullParticles& parts) { fillCollision(col); @@ -543,9 +543,9 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { /// \param col subscribe to the collision table (Monte Carlo Reconstructed reconstructed) /// \param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// \param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processSameEventMC(o2::aod::FDCollision& col, + void processSameEventMC(o2::aod::FdCollision& col, soa::Join& parts, - o2::aod::FDMCParticles&) + o2::aod::FdMCParticles&) { fillCollision(col); @@ -654,7 +654,7 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { /// process function for to call doMixedEvent with Data /// \param cols subscribe to the collisions table (Data) /// \param parts subscribe to the femtoUniverseParticleTable - void processMixedEvent(soa::Filtered& cols, + void processMixedEvent(soa::Filtered& cols, FilteredFemtoFullParticles& parts) { for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { @@ -692,9 +692,9 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { /// \param cols subscribe to the collisions table (Monte Carlo Reconstructed reconstructed) /// \param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// \param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processMixedEventMC(o2::aod::FDCollisions& cols, + void processMixedEventMC(o2::aod::FdCollisions& cols, soa::Join& parts, - o2::aod::FDMCParticles&) + o2::aod::FdMCParticles&) { for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx index 93374bf2a16..807a8e96dba 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -139,9 +139,9 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { Configurable ConfIntRateHigh{"ConfIntRateHigh", 10000.0, "Higher limit for interaction rate"}; Filter collfilterFDtable = (o2::aod::femtouniversecollision::multV0M > ConfV0MLow) && (o2::aod::femtouniversecollision::multV0M < ConfV0MHigh); - Filter collfilterFDExttable = (o2::aod::femtouniversecollision::irrate > ConfIntRateLow) && (o2::aod::femtouniversecollision::irrate < ConfIntRateHigh) && + Filter collfilterFDExttable = (o2::aod::femtouniversecollision::interactionRate > ConfIntRateLow) && (o2::aod::femtouniversecollision::interactionRate < ConfIntRateHigh) && (o2::aod::femtouniversecollision::occupancy > ConfTPCOccupancyLow) && (o2::aod::femtouniversecollision::occupancy < ConfTPCOccupancyHigh); - using FilteredFDCollisions = soa::Filtered>; + using FilteredFDCollisions = soa::Filtered>; using FilteredFDCollision = FilteredFDCollisions::iterator; // Filter trackAdditionalfilter = (nabs(aod::femtouniverseparticle::eta) < twotracksconfigs.ConfEtaMax); // example filtering on configurable @@ -571,9 +571,9 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { /// \param col subscribe to the collision table (Monte Carlo Reconstructed reconstructed) /// \param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// \param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processSameEventMC(o2::aod::FDCollision& col, + void processSameEventMC(o2::aod::FdCollision& col, soa::Join& /*parts*/, - o2::aod::FDMCParticles&) + o2::aod::FdMCParticles&) { fillCollision(col); @@ -692,7 +692,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { /// process function for to fill covariance histograms /// \param col subscribe to the collision table (Data) /// \param parts subscribe to the femtoUniverseParticleTable - void processCov(soa::Filtered::iterator& /*col*/, + void processCov(soa::Filtered::iterator& /*col*/, FilteredFemtoFullParticles& /*parts*/) { int JMax = (ConfLMax + 1) * (ConfLMax + 1); @@ -715,9 +715,9 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { /// @param cols subscribe to the collisions table (Monte Carlo Reconstructed reconstructed) /// @param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// @param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processMixedEventMC(o2::aod::FDCollisions& cols, + void processMixedEventMC(o2::aod::FdCollisions& cols, soa::Join& /*parts*/, - o2::aod::FDMCParticles&) + o2::aod::FdMCParticles&) { for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, ConfNEventsMix, -1, cols, cols)) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx index 87706527e71..2b61f46291d 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx @@ -71,7 +71,7 @@ struct FemtoUniversePairTaskTrackV0Extended { Configurable confNsigmaCombinedParticle{"confNsigmaCombinedParticle", 3.0, "TPC and TOF Sigma (combined) for particle momentum > confmom"}; Filter collisionFilter = (nabs(aod::collision::posZ) < confZVertexCut); - using FilteredFDCollisions = soa::Filtered; + using FilteredFDCollisions = soa::Filtered; using FilteredFDCollision = FilteredFDCollisions::iterator; /// Partition for particle 1 @@ -380,7 +380,7 @@ struct FemtoUniversePairTaskTrackV0Extended { } PROCESS_SWITCH(FemtoUniversePairTaskTrackV0Extended, processSameEvent, "Enable processing same event for track - V0", false); - void processSameEventMCReco(FilteredFDCollision const& col, FemtoRecoParticles const& parts, aod::FDMCParticles const& mcparts) + void processSameEventMCReco(FilteredFDCollision const& col, FemtoRecoParticles const& parts, aod::FdMCParticles const& mcparts) { auto groupPartsOne = partsOneMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); auto groupPartsTwo = partsTwoMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); @@ -477,14 +477,14 @@ struct FemtoUniversePairTaskTrackV0Extended { /// Histogramming same event for (const auto& part : groupPartsTwo) { - int pdgCode = static_cast(part.pidcut()); + int pdgCode = static_cast(part.pidCut()); if ((confV0Type1 == 0 && pdgCode != 3122) || (confV0Type1 == 1 && pdgCode != -3122)) continue; trackHistoPartTwo.fillQA(part); } for (const auto& part : groupPartsOne) { - int pdgCode = static_cast(part.pidcut()); + int pdgCode = static_cast(part.pidCut()); if (pdgCode != confTrkPDGCodePartOne) continue; const auto& pdgParticle = pdgMC->GetParticle(pdgCode); @@ -501,9 +501,9 @@ struct FemtoUniversePairTaskTrackV0Extended { /// Now build the combinations for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { - if (static_cast(p1.pidcut()) != confTrkPDGCodePartOne) + if (static_cast(p1.pidCut()) != confTrkPDGCodePartOne) continue; - int pdgCode2 = static_cast(p2.pidcut()); + int pdgCode2 = static_cast(p2.pidCut()); if ((confV0Type1 == 0 && pdgCode2 != 3122) || (confV0Type1 == 1 && pdgCode2 != -3122)) continue; // track cleaning @@ -528,17 +528,17 @@ struct FemtoUniversePairTaskTrackV0Extended { /// Histogramming same event for (const auto& part : groupPartsTwo) { - int pdgCode = static_cast(part.pidcut()); + int pdgCode = static_cast(part.pidCut()); if ((confV0Type1 == 0 && pdgCode != 3122) || (confV0Type1 == 1 && pdgCode != -3122)) continue; trackHistoPartTwo.fillQA(part); } auto pairProcessFunc = [&](auto& p1, auto& p2) -> void { - int pdgCode1 = static_cast(p1.pidcut()); + int pdgCode1 = static_cast(p1.pidCut()); if ((confV0Type1 == 0 && pdgCode1 != 3122) || (confV0Type1 == 1 && pdgCode1 != -3122)) return; - int pdgCode2 = static_cast(p2.pidcut()); + int pdgCode2 = static_cast(p2.pidCut()); if ((confV0Type2 == 0 && pdgCode2 != 3122) || (confV0Type2 == 1 && pdgCode2 != -3122)) return; sameEventCont.setPair(p1, p2, multCol, confUse3D); @@ -632,7 +632,7 @@ struct FemtoUniversePairTaskTrackV0Extended { } PROCESS_SWITCH(FemtoUniversePairTaskTrackV0Extended, processMixedEvent, "Enable processing mixed event for track - V0", false); - void processMixedEventMCReco(FilteredFDCollisions const& cols, FemtoRecoParticles const& parts, aod::FDMCParticles const& mcparts) + void processMixedEventMCReco(FilteredFDCollisions const& cols, FemtoRecoParticles const& parts, aod::FdMCParticles const& mcparts) { doMixedEvent(cols, parts, partsOneMCReco, partsTwoMCReco, mcparts); } @@ -725,9 +725,9 @@ struct FemtoUniversePairTaskTrackV0Extended { return; } for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { - if (static_cast(p1.pidcut()) != confTrkPDGCodePartOne) + if (static_cast(p1.pidCut()) != confTrkPDGCodePartOne) continue; - int pdgCode2 = static_cast(p2.pidcut()); + int pdgCode2 = static_cast(p2.pidCut()); if ((confV0Type1 == 0 && pdgCode2 != 3122) || (confV0Type1 == 1 && pdgCode2 != -3122)) continue; if (confIsCPR.value) { @@ -767,10 +767,10 @@ struct FemtoUniversePairTaskTrackV0Extended { auto groupPartsTwo = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { - int pdgCode1 = static_cast(p1.pidcut()); + int pdgCode1 = static_cast(p1.pidCut()); if ((confV0Type1 == 0 && pdgCode1 != 3122) || (confV0Type1 == 1 && pdgCode1 != -3122)) continue; - int pdgCode2 = static_cast(p2.pidcut()); + int pdgCode2 = static_cast(p2.pidCut()); if ((confV0Type2 == 0 && pdgCode2 != 3122) || (confV0Type2 == 1 && pdgCode2 != -3122)) continue; mixedEventCont.setPair(p1, p2, multCol, confUse3D); @@ -800,7 +800,7 @@ struct FemtoUniversePairTaskTrackV0Extended { if (part.partType() != uint8_t(aod::femtouniverseparticle::ParticleType::kMCTruthTrack)) continue; - int pdgCode = static_cast(part.pidcut()); + int pdgCode = static_cast(part.pidCut()); const auto& pdgParticle = pdgMC->GetParticle(pdgCode); if (!pdgParticle) { continue; @@ -842,7 +842,7 @@ struct FemtoUniversePairTaskTrackV0Extended { PROCESS_SWITCH(FemtoUniversePairTaskTrackV0Extended, processMCTruth, "Process MC truth data", false); - void processMCReco(FemtoRecoParticles const& parts, aod::FDMCParticles const& mcparts) + void processMCReco(FemtoRecoParticles const& parts, aod::FdMCParticles const& mcparts) { for (const auto& part : parts) { auto mcPartId = part.fdMCParticleId(); diff --git a/PWGCF/Tasks/matchRecoGen.cxx b/PWGCF/Tasks/matchRecoGen.cxx index 254d5ba0c1e..486eae85e37 100644 --- a/PWGCF/Tasks/matchRecoGen.cxx +++ b/PWGCF/Tasks/matchRecoGen.cxx @@ -56,30 +56,10 @@ std::vector> mclabelpos[2]; std::vector> mclabelneg[2]; } // namespace o2::analysis::recogenmap -namespace o2::analysis::dptdptfilter -{ -TpcExcludeTrack tpcExcluder; ///< the TPC excluder object instance -} // namespace o2::analysis::dptdptfilter - /// \brief Checks the correspondence generator level <=> detector level struct MatchRecoGen { - Configurable cfgTrackType{"cfgTrackType", 1, "Type of selected tracks: 0 = no selection, 1 = global tracks FB96"}; - Configurable cfgCentMultEstimator{"cfgCentMultEstimator", "V0M", "Centrality/multiplicity estimator detector: V0M, NOCM: none. Default V0M"}; - Configurable cfgSystem{"cfgSystem", "PbPb", "System: pp, PbPb, Pbp, pPb, XeXe, ppRun3. Default PbPb"}; - Configurable cfgDataType{"cfgDataType", "data", "Data type: data, datanoevsel, MC, FastMC, OnTheFlyMC. Default data"}; - Configurable cfgTriggSel{"cfgTriggSel", "MB", "Trigger selection: MB, None. Default MB"}; - Configurable cfgOverallMinP{"cfgOverallMinP", 0.0f, "The overall minimum momentum for the analysis. Default: 0.0"}; - Configurable cfgBinning{"cfgBinning", - {28, -7.0, 7.0, 18, 0.2, 2.0, 16, -0.8, 0.8, 72, 0.5}, - "triplets - nbins, min, max - for z_vtx, pT, eta and phi, binning plus bin fraction of phi origin shift"}; - struct : ConfigurableGroup { - std::string prefix = "cfgTpcExclusion"; - Configurable method{"method", 0, "The method for excluding tracks within the TPC. 0: no exclusion; 1: static; 2: dynamic. Default: 0"}; - } cfgTpcExclusion; Configurable cfgTraceDCAOutliers{"cfgTraceDCAOutliers", {false, 0.0, 0.0}, "Track the generator level DCAxy outliers: false/true, low dcaxy, up dcaxy. Default {false,0.0,0.0}"}; Configurable cfgTraceOutOfSpeciesParticles{"cfgTraceOutOfSpeciesParticles", false, "Track the particles which are not e,mu,pi,K,p: false/true. Default false"}; - Configurable cfgRecoIdMethod{"cfgRecoIdMethod", 0, "Method for identifying reconstructed tracks: 0 PID, 1 mcparticle. Default 0"}; - Configurable cfgTuneTrackSelection{"cfgTuneTrackSelection", {}, "Track selection: {useit: true/false, tpccls-useit, tpcxrws-useit, tpcxrfc-useit, dcaxy-useit, dcaz-useit}. Default {false,0.70,false,0.8,false,2.4,false,3.2,false}"}; Configurable cfgTraceCollId0{"cfgTraceCollId0", false, "Trace particles in collisions id 0. Default false"}; Configurable cfgTrackMultiRec{"cfgTrackMultiRec", false, "Track muli-reconstructed particles: true, false. Default false"}; Configurable cfgTrackCollAssoc{"cfgTrackCollAssoc", false, "Track collision id association, track-mcparticle-mccollision vs. track-collision-mccollision: true, false. Default false"}; @@ -99,51 +79,20 @@ struct MatchRecoGen { using namespace o2::analysis::dptdptfilter; /* update with the configurable values */ - overallminp = cfgOverallMinP.value; - /* the binning */ - ptbins = cfgBinning->mPTbins; - ptlow = cfgBinning->mPTmin; - ptup = cfgBinning->mPTmax; - etabins = cfgBinning->mEtabins; - etalow = cfgBinning->mEtamin; - etaup = cfgBinning->mEtamax; - zvtxbins = cfgBinning->mZVtxbins; - zvtxlow = cfgBinning->mZVtxmin; - zvtxup = cfgBinning->mZVtxmax; - phibins = cfgBinning->mPhibins; - phibinshift = cfgBinning->mPhibinshift; - - /* the TPC excluder object instance */ - TpcExclusionMethod tpcExclude = kNOEXCLUSION; ///< exclude tracks within the TPC according to this method - tpcExclude = static_cast(cfgTpcExclusion.method.value); - tpcExcluder = TpcExcludeTrack(tpcExclude); - - /* the track types and combinations */ - tracktype = cfgTrackType.value; - initializeTrackSelection(cfgTuneTrackSelection.value); - /* the centrality/multiplicity estimation */ - fCentMultEstimator = getCentMultEstimator(cfgCentMultEstimator); - /* the trigger selection */ - fTriggerSelection = getTriggerSelection(cfgTriggSel); traceDCAOutliers = cfgTraceDCAOutliers; traceOutOfSpeciesParticles = cfgTraceOutOfSpeciesParticles; - recoIdMethod = cfgRecoIdMethod; traceCollId0 = cfgTraceCollId0; - /* if the system type is not known at this time, we have to put the initialization somewhere else */ - fSystem = getSystemType(cfgSystem); - fDataType = getDataType(cfgDataType); - AxisSpec deltaEta = {100, -2, 2, "#Delta#eta"}; AxisSpec deltaPhi = {100, 0, constants::math::TwoPI, "#Delta#varphi (rad)"}; AxisSpec deltaPt = {1000, 0, 4, "#Delta#it{p}_{T} (GeV/#it{c})"}; AxisSpec mrectimes = {11, -0.5f, 10.5f, "##/particle"}; AxisSpec detectors = {32, -0.5, 31.5, "Detectors"}; - std::vector detectorlbls = {"", "ITS", "TPC", "ITS+TPC", "TRD", "ITS+TRD", "TPC+TRD", "ITS+TPC+TRD", - "TOF", "ITS+TOF", "TPC+TOF", "ITS+TPC+TOF", "TRD+TOF", "ITS+TRD+TOF", "TPC+TRD+TOF", "ITS+TPC+TRD+TOF", - "UNKN", "ITS+UNKN", "TPC+UNKN", "ITS+TPC+UNKN", "TRD+UNKN", "ITS+TRD+UNKN", "TPC+TRD+UNKN", "ITS+TPC+TRD+UNKN", - "TOF+UNKN", "ITS+TOF+UNKN", "TPC+TOF+UNKN", "ITS+TPC+TOF+UNKN", "TRD+TOF+UNKN", "ITS+TRD+TOF+UNKN", "TPC+TRD+TOF+UNKN", "ITS+TPC+TRD+TOF+UNKN"}; - std::vector matchlbs = {"match", "don't match"}; + std::vector detectorLabels = {"", "ITS", "TPC", "ITS+TPC", "TRD", "ITS+TRD", "TPC+TRD", "ITS+TPC+TRD", + "TOF", "ITS+TOF", "TPC+TOF", "ITS+TPC+TOF", "TRD+TOF", "ITS+TRD+TOF", "TPC+TRD+TOF", "ITS+TPC+TRD+TOF", + "UNKN", "ITS+UNKN", "TPC+UNKN", "ITS+TPC+UNKN", "TRD+UNKN", "ITS+TRD+UNKN", "TPC+TRD+UNKN", "ITS+TPC+TRD+UNKN", + "TOF+UNKN", "ITS+TOF+UNKN", "TPC+TOF+UNKN", "ITS+TPC+TOF+UNKN", "TRD+TOF+UNKN", "ITS+TRD+TOF+UNKN", "TPC+TRD+TOF+UNKN", "ITS+TPC+TRD+TOF+UNKN"}; + std::vector matchLabels = {"match", "don't match"}; histos.add("before/positivecolid/mrDeltaEta", "#Delta#eta multirec tracks", kTH1F, {deltaEta}); histos.add("before/positivecolid/mrDeltaPhi", "#Delta#varphi multirec tracks", kTH1F, {deltaPhi}); @@ -170,13 +119,13 @@ struct MatchRecoGen { histos.add("before/positivecolid/dcazmr", "DCA_{z} Reconstructed (mr)", kTH1F, {{1000, -4.0, 4.0, "DCA_{z} (cm)"}}); histos.add("before/positivecolid/finedcaxymr", "DCA_{xy} Reconstructed (mr)", kTH1F, {{2000, -1.0, 1.0, "DCA_{xy} (cm)"}}); histos.add("before/positivecolid/finedcazmr", "DCA_{z} Reconstructed (mr)", kTH1F, {{2000, -1.0, 1.0, "DCA_{z} (cm)"}}); - for (unsigned int i = 0; i < detectorlbls.size(); ++i) { - histos.get(HIST("before/positivecolid/detectormap"))->GetXaxis()->SetBinLabel(i + 1, detectorlbls[i].c_str()); - histos.get(HIST("before/positivecolid/detectormapmr"))->GetXaxis()->SetBinLabel(i + 1, detectorlbls[i].c_str()); + for (unsigned int i = 0; i < detectorLabels.size(); ++i) { + histos.get(HIST("before/positivecolid/detectormap"))->GetXaxis()->SetBinLabel(i + 1, detectorLabels[i].c_str()); + histos.get(HIST("before/positivecolid/detectormapmr"))->GetXaxis()->SetBinLabel(i + 1, detectorLabels[i].c_str()); } - for (unsigned int i = 0; i < matchlbs.size(); ++i) { - histos.get(HIST("before/positivecolid/matchcollid"))->GetXaxis()->SetBinLabel(i + 1, matchlbs[i].c_str()); - histos.get(HIST("before/positivecolid/matchcollidmr"))->GetXaxis()->SetBinLabel(i + 1, matchlbs[i].c_str()); + for (unsigned int i = 0; i < matchLabels.size(); ++i) { + histos.get(HIST("before/positivecolid/matchcollid"))->GetXaxis()->SetBinLabel(i + 1, matchLabels[i].c_str()); + histos.get(HIST("before/positivecolid/matchcollidmr"))->GetXaxis()->SetBinLabel(i + 1, matchLabels[i].c_str()); } /* clone the set for the other cases */ @@ -260,8 +209,7 @@ struct MatchRecoGen { "END multi-reconstructed: " "=================================================================="); } - histos.get(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("pdgcodemr")) - ->Fill(TString::Format("%d", particle.pdgCode()).Data(), 1.0); + histos.get(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("pdgcodemr"))->Fill(TString::Format("%d", particle.pdgCode()).Data(), 1.0); } } @@ -285,10 +233,10 @@ struct MatchRecoGen { histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("detectormapmr"), track1.detectorMap()); histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("dcaxymr"), track1.dcaXY()); histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("dcazmr"), track1.dcaZ()); - if (track1.dcaXY() < 1.0) { + if (std::fabs(track1.dcaXY()) < 1.0) { histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("finedcaxymr"), track1.dcaXY()); } - if (track1.dcaZ() < 1.0) { + if (std::fabs(track1.dcaZ()) < 1.0) { histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("finedcazmr"), track1.dcaZ()); } histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("genrecomreta"), track1.eta(), particle.eta()); @@ -308,10 +256,10 @@ struct MatchRecoGen { histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("detectormap"), track.detectorMap()); histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("dcaxy"), track.dcaXY()); histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("dcaz"), track.dcaZ()); - if (track.dcaXY() < 1.0) { + if (std::fabs(track.dcaXY()) < 1.0) { histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("finedcaxy"), track.dcaXY()); } - if (track.dcaZ() < 1.0) { + if (std::fabs(track.dcaZ()) < 1.0) { histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("finedcaz"), track.dcaZ()); } if (particle.mcCollisionId() != colls.iteratorAt(track.collisionId()).mcCollisionId()) { @@ -425,10 +373,9 @@ struct MatchRecoGen { if (!(label < 0)) { if (!(track.collisionId() < 0)) { typename CollisionsObject::iterator coll = collisions.iteratorAt(track.collisionId()); - float centormult = -100.0f; - if (isEventSelected(coll, centormult)) { + if (coll.collisionaccepted() == uint8_t(true)) { /* TODO: AcceptTrack does not consider PID */ - if (acceptTrack(track)) { + if (!(track.trackacceptedid() < 0)) { /* the track has been accepted */ nreco++; LOGF(MATCHRECGENLOGTRACKS, "Accepted track with global Id %d and collision Id %d has label %d associated to MC collision %d", recix, track.collisionId(), label, track.template mcParticle_as().mcCollisionId()); @@ -443,23 +390,14 @@ struct MatchRecoGen { collectData(tracks, mcParticles, collisions); } - void processMapChecksWithCent(soa::Join const& tracks, - soa::Join const& collisions, - aod::McParticles const& mcParticles) - { - processMapChecksBeforeCuts(tracks, collisions, mcParticles); - processMapChecksAfterCuts(tracks, collisions, mcParticles); - } - PROCESS_SWITCH(MatchRecoGen, processMapChecksWithCent, "Process detector <=> generator levels with centrality/multiplicity information", false); - - void processMapChecksWithoutCent(soa::Join const& tracks, - soa::Join const& collisions, - aod::McParticles const& mcParticles) + void processMapChecks(soa::Join const& tracks, + soa::Join const& collisions, + aod::McParticles const& mcParticles) { processMapChecksBeforeCuts(tracks, collisions, mcParticles); processMapChecksAfterCuts(tracks, collisions, mcParticles); } - PROCESS_SWITCH(MatchRecoGen, processMapChecksWithoutCent, "Process detector <=> generator levels without centrality/multiplicity information", true); + PROCESS_SWITCH(MatchRecoGen, processMapChecks, "Process detector <=> generator levels", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGEM/Dilepton/Core/PhotonHBT.h b/PWGEM/Dilepton/Core/PhotonHBT.h index fa1b2865d2c..699fdeded90 100644 --- a/PWGEM/Dilepton/Core/PhotonHBT.h +++ b/PWGEM/Dilepton/Core/PhotonHBT.h @@ -243,11 +243,16 @@ struct PhotonHBT { struct : ConfigurableGroup { std::string prefix = "ggpaircut_group"; Configurable applydRdZ{"applydRdZ", false, "apply dr-dz cut to avoid track splitting/merging only for kPCMPCM"}; - Configurable applydEtadPhi{"applydEtadPhi", false, "apply deta-dphi cut to avoid track splitting/merging"}; - Configurable cfgMinDeltaEta{"cfgMinDeltaEta", 0.f, "min. delta-eta between 2 photons"}; - Configurable cfgMinDeltaPhi{"cfgMinDeltaPhi", 0.f, "min. delta-phi between 2 photons"}; - Configurable cfgMinDeltaR{"cfgMinDeltaR", 0.f, "min. delta-r between 2 photons"}; - Configurable cfgMinDeltaZ{"cfgMinDeltaZ", 0.f, "min. delta-z between 2 photons"}; + Configurable cfgMinDeltaR{"cfgMinDeltaR", 20.f, "min. delta-r between 2 conversion points only for kPCMPCM"}; + Configurable cfgMinDeltaZ{"cfgMinDeltaZ", 20.f, "min. delta-z between 2 conversion points only for kPCMPCM"}; + + Configurable applydEtadPhi_Photon{"applydEtadPhi_Photon", false, "apply deta-dphi cut to avoid track splitting/merging"}; + Configurable cfgMinDeltaEta_Photon{"cfgMinDeltaEta_Photon", 0.1f, "min. delta-eta between 2 photons"}; + Configurable cfgMinDeltaPhi_Photon{"cfgMinDeltaPhi_Photon", 0.3f, "min. delta-phi between 2 photons"}; + + Configurable applydEtadPhi_Leg{"applydEtadPhi_Leg", false, "apply deta-dphi cut to avoid track splitting/merging"}; + Configurable cfgMinDeltaEta_Leg{"cfgMinDeltaEta_Leg", 0.1f, "min. delta-eta between 2 LS tracks"}; + Configurable cfgMinDeltaPhi_Leg{"cfgMinDeltaPhi_Leg", 0.3f, "min. delta-phi between 2 LS tracks"}; } ggpaircuts; ~PhotonHBT() @@ -461,7 +466,8 @@ struct PhotonHBT { } } - fRegistry.add("Pair/same/hDeltaEtaDeltaPhi", "distance between 2 LS tracks in #eta-#varphi plane;#Delta#varphi (rad.);#Delta#eta", kTH2D, {{180, -M_PI, M_PI}, {200, -1, +1}}, true); // deta, dphi of track momentum + fRegistry.add("Pair/same/hDeltaEtaDeltaPhi_Photon", "distance between 2 photons in #eta-#varphi plane;#Delta#varphi (rad.);#Delta#eta", kTH2D, {{180, -M_PI, M_PI}, {200, -1, +1}}, true); // deta, dphi of photon momentum + fRegistry.add("Pair/same/hDeltaEtaDeltaPhi_Leg", "distance between 2 LS tracks in #eta-#varphi plane;#Delta#varphi (rad.);#Delta#eta", kTH2D, {{180, -M_PI, M_PI}, {200, -1, +1}}, true); // deta, dphi of track momentum if constexpr (pairtype == ggHBTPairType::kPCMPCM) { fRegistry.add("Pair/same/hDeltaRDeltaZ", "diphoton distance in RZ;#Deltar = #sqrt{(#Deltax)^{2} + (#Deltay)^{2}} (cm);|#Deltaz| (cm)", kTH2D, {{100, 0, 50}, {100, 0, 50}}, true); // dr, dz of conversion points } @@ -783,16 +789,23 @@ struct PhotonHBT { float deta_ele = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? ele1.eta() - ele2.eta() : ele2.eta() - ele1.eta(); float dphi_ele = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? ele1.phi() - ele2.phi() : ele2.phi() - ele1.phi(); o2::math_utils::bringToPMPi(dphi_ele); - if (ggpaircuts.applydEtadPhi && std::pow(deta_pos / ggpaircuts.cfgMinDeltaEta, 2) + std::pow(dphi_pos / ggpaircuts.cfgMinDeltaPhi, 2) < 1.f) { + if (ggpaircuts.applydEtadPhi_Leg && std::pow(deta_pos / ggpaircuts.cfgMinDeltaEta_Leg, 2) + std::pow(dphi_pos / ggpaircuts.cfgMinDeltaPhi_Leg, 2) < 1.f) { continue; } - if (ggpaircuts.applydEtadPhi && std::pow(deta_ele / ggpaircuts.cfgMinDeltaEta, 2) + std::pow(dphi_ele / ggpaircuts.cfgMinDeltaPhi, 2) < 1.f) { + if (ggpaircuts.applydEtadPhi_Leg && std::pow(deta_ele / ggpaircuts.cfgMinDeltaEta_Leg, 2) + std::pow(dphi_ele / ggpaircuts.cfgMinDeltaPhi_Leg, 2) < 1.f) { + continue; + } + + float deta_photon = v1.Pt() > v2.Pt() ? v1.Eta() - v2.Eta() : v2.Eta() - v1.Eta(); + float dphi_photon = v1.Pt() > v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); + if (ggpaircuts.applydEtadPhi_Photon && std::pow(deta_photon / ggpaircuts.cfgMinDeltaEta_Photon, 2) + std::pow(dphi_photon / ggpaircuts.cfgMinDeltaPhi_Photon, 2) < 1.f) { continue; } + fRegistry.fill(HIST("Pair/same/hDeltaEtaDeltaPhi_Photon"), dphi_photon, deta_photon, 1.f); // distance between 2 photons fRegistry.fill(HIST("Pair/same/hDeltaRDeltaZ"), dr, fabs(dz), 1.f); - fRegistry.fill(HIST("Pair/same/hDeltaEtaDeltaPhi"), pos1.phi() - pos2.phi(), pos1.eta() - pos2.eta(), 1.f); // distance between 2 LS tracks - fRegistry.fill(HIST("Pair/same/hDeltaEtaDeltaPhi"), ele1.phi() - ele2.phi(), ele1.eta() - ele2.eta(), 1.f); // distance between 2 LS tracks + fRegistry.fill(HIST("Pair/same/hDeltaEtaDeltaPhi_Leg"), pos1.phi() - pos2.phi(), pos1.eta() - pos2.eta(), 1.f); // distance between 2 LS tracks + fRegistry.fill(HIST("Pair/same/hDeltaEtaDeltaPhi_Leg"), ele1.phi() - ele2.phi(), ele1.eta() - ele2.eta(), 1.f); // distance between 2 LS tracks fillPairHistogram<0>(collision, v1, v2, 1.f); ndiphoton++; @@ -892,15 +905,22 @@ struct PhotonHBT { float deta_ele = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? ele1.eta() - ele2.eta() : ele2.eta() - ele1.eta(); float dphi_ele = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? ele1.phi() - ele2.phi() : ele2.phi() - ele1.phi(); o2::math_utils::bringToPMPi(dphi_ele); - if (ggpaircuts.applydEtadPhi && std::pow(deta_pos / ggpaircuts.cfgMinDeltaEta, 2) + std::pow(dphi_pos / ggpaircuts.cfgMinDeltaPhi, 2) < 1.f) { + if (ggpaircuts.applydEtadPhi_Leg && std::pow(deta_pos / ggpaircuts.cfgMinDeltaEta_Leg, 2) + std::pow(dphi_pos / ggpaircuts.cfgMinDeltaPhi_Leg, 2) < 1.f) { continue; } - if (ggpaircuts.applydEtadPhi && std::pow(deta_ele / ggpaircuts.cfgMinDeltaEta, 2) + std::pow(dphi_ele / ggpaircuts.cfgMinDeltaPhi, 2) < 1.f) { + if (ggpaircuts.applydEtadPhi_Leg && std::pow(deta_ele / ggpaircuts.cfgMinDeltaEta_Leg, 2) + std::pow(dphi_ele / ggpaircuts.cfgMinDeltaPhi_Leg, 2) < 1.f) { continue; } - fRegistry.fill(HIST("Pair/same/hDeltaEtaDeltaPhi"), dphi_pos, deta_pos, weight1 * weight2); // distance between 2 LS tracks - fRegistry.fill(HIST("Pair/same/hDeltaEtaDeltaPhi"), dphi_ele, deta_ele, weight1 * weight2); // distance between 2 LS tracks + float deta_photon = v1_ee.Pt() > v2_ee.Pt() ? v1_ee.Eta() - v2_ee.Eta() : v2_ee.Eta() - v1_ee.Eta(); + float dphi_photon = v1_ee.Pt() > v2_ee.Pt() ? v1_ee.Phi() - v2_ee.Phi() : v2_ee.Phi() - v1_ee.Phi(); + if (ggpaircuts.applydEtadPhi_Photon && std::pow(deta_photon / ggpaircuts.cfgMinDeltaEta_Photon, 2) + std::pow(dphi_photon / ggpaircuts.cfgMinDeltaPhi_Photon, 2) < 1.f) { + continue; + } + fRegistry.fill(HIST("Pair/same/hDeltaEtaDeltaPhi_Photon"), dphi_photon, deta_photon, weight1 * weight2); // distance between 2 photons + + fRegistry.fill(HIST("Pair/same/hDeltaEtaDeltaPhi_Leg"), dphi_pos, deta_pos, weight1 * weight2); // distance between 2 LS tracks + fRegistry.fill(HIST("Pair/same/hDeltaEtaDeltaPhi_Leg"), dphi_ele, deta_ele, weight1 * weight2); // distance between 2 LS tracks fillPairHistogram<0>(collision, v1_ee, v2_ee, weight1 * weight2); ndiphoton++; used_pairs_per_collision.emplace_back(std::make_pair(pair_tmp.first, pair_tmp.second)); @@ -1001,15 +1021,22 @@ struct PhotonHBT { float deta_ele = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? ele1.eta() - ele2.eta() : ele2.eta() - ele1.eta(); float dphi_ele = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? ele1.phi() - ele2.phi() : ele2.phi() - ele1.phi(); o2::math_utils::bringToPMPi(dphi_ele); - if (ggpaircuts.applydEtadPhi && std::pow(deta_pos / ggpaircuts.cfgMinDeltaEta, 2) + std::pow(dphi_pos / ggpaircuts.cfgMinDeltaPhi, 2) < 1.f) { + if (ggpaircuts.applydEtadPhi_Leg && std::pow(deta_pos / ggpaircuts.cfgMinDeltaEta_Leg, 2) + std::pow(dphi_pos / ggpaircuts.cfgMinDeltaPhi_Leg, 2) < 1.f) { + continue; + } + if (ggpaircuts.applydEtadPhi_Leg && std::pow(deta_ele / ggpaircuts.cfgMinDeltaEta_Leg, 2) + std::pow(dphi_ele / ggpaircuts.cfgMinDeltaPhi_Leg, 2) < 1.f) { continue; } - if (ggpaircuts.applydEtadPhi && std::pow(deta_ele / ggpaircuts.cfgMinDeltaEta, 2) + std::pow(dphi_ele / ggpaircuts.cfgMinDeltaPhi, 2) < 1.f) { + + float deta_photon = v1_gamma.Pt() > v2_ee.Pt() ? v1_gamma.Eta() - v2_ee.Eta() : v2_ee.Eta() - v1_gamma.Eta(); + float dphi_photon = v1_gamma.Pt() > v2_ee.Pt() ? v1_gamma.Phi() - v2_ee.Phi() : v2_ee.Phi() - v1_gamma.Phi(); + if (ggpaircuts.applydEtadPhi_Photon && std::pow(deta_photon / ggpaircuts.cfgMinDeltaEta_Photon, 2) + std::pow(dphi_photon / ggpaircuts.cfgMinDeltaPhi_Photon, 2) < 1.f) { continue; } + fRegistry.fill(HIST("Pair/same/hDeltaEtaDeltaPhi_Photon"), dphi_photon, deta_photon, weight); // distance between 2 photons - fRegistry.fill(HIST("Pair/same/hDeltaEtaDeltaPhi"), dphi_pos, deta_pos, weight); - fRegistry.fill(HIST("Pair/same/hDeltaEtaDeltaPhi"), dphi_ele, deta_ele, weight); + fRegistry.fill(HIST("Pair/same/hDeltaEtaDeltaPhi_Leg"), dphi_pos, deta_pos, weight); + fRegistry.fill(HIST("Pair/same/hDeltaEtaDeltaPhi_Leg"), dphi_ele, deta_ele, weight); fillPairHistogram<0>(collision, v1_gamma, v2_ee, weight); ndiphoton++; @@ -1088,16 +1115,23 @@ struct PhotonHBT { float deta_ele = ele1.Pt() < ele2.Pt() ? ele1.Eta() - ele2.Eta() : ele2.Eta() - ele1.Eta(); // flipped float dphi_ele = ele1.Pt() < ele2.Pt() ? ele1.Phi() - ele2.Phi() : ele2.Phi() - ele1.Phi(); // flipped o2::math_utils::bringToPMPi(dphi_ele); - if (ggpaircuts.applydEtadPhi && std::pow(deta_pos / ggpaircuts.cfgMinDeltaEta, 2) + std::pow(dphi_pos / ggpaircuts.cfgMinDeltaPhi, 2) < 1.f) { + if (ggpaircuts.applydEtadPhi_Leg && std::pow(deta_pos / ggpaircuts.cfgMinDeltaEta_Leg, 2) + std::pow(dphi_pos / ggpaircuts.cfgMinDeltaPhi_Leg, 2) < 1.f) { continue; } - if (ggpaircuts.applydEtadPhi && std::pow(deta_ele / ggpaircuts.cfgMinDeltaEta, 2) + std::pow(dphi_ele / ggpaircuts.cfgMinDeltaPhi, 2) < 1.f) { + if (ggpaircuts.applydEtadPhi_Leg && std::pow(deta_ele / ggpaircuts.cfgMinDeltaEta_Leg, 2) + std::pow(dphi_ele / ggpaircuts.cfgMinDeltaPhi_Leg, 2) < 1.f) { continue; } + float deta_photon = v1.Pt() > v2.Pt() ? v1.Eta() - v2.Eta() : v2.Eta() - v1.Eta(); + float dphi_photon = v1.Pt() > v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); + if (ggpaircuts.applydEtadPhi_Photon && std::pow(deta_photon / ggpaircuts.cfgMinDeltaEta_Photon, 2) + std::pow(dphi_photon / ggpaircuts.cfgMinDeltaPhi_Photon, 2) < 1.f) { + continue; + } + fRegistry.fill(HIST("Pair/mix/hDeltaEtaDeltaPhi_Photon"), dphi_photon, deta_photon, 1.f); // distance between 2 photons + fRegistry.fill(HIST("Pair/mix/hDeltaRDeltaZ"), dr, fabs(dz), 1.f); - fRegistry.fill(HIST("Pair/mix/hDeltaEtaDeltaPhi"), dphi_pos, deta_pos, 1.f); // distance between 2 LS tracks - fRegistry.fill(HIST("Pair/mix/hDeltaEtaDeltaPhi"), dphi_ele, deta_ele, 1.f); // distance between 2 LS tracks + fRegistry.fill(HIST("Pair/mix/hDeltaEtaDeltaPhi_Leg"), dphi_pos, deta_pos, 1.f); // distance between 2 LS tracks + fRegistry.fill(HIST("Pair/mix/hDeltaEtaDeltaPhi_Leg"), dphi_ele, deta_ele, 1.f); // distance between 2 LS tracks fillPairHistogram<1>(collision, v1, v2, 1.f); } } @@ -1152,14 +1186,20 @@ struct PhotonHBT { float deta_ele = ele1.Eta() - ele2.Eta(); float dphi_ele = ele1.Phi() - ele2.Phi(); o2::math_utils::bringToPMPi(dphi_ele); - if (ggpaircuts.applydEtadPhi && std::pow(deta_pos / ggpaircuts.cfgMinDeltaEta, 2) + std::pow(dphi_pos / ggpaircuts.cfgMinDeltaPhi, 2) < 1.f) { + if (ggpaircuts.applydEtadPhi_Leg && std::pow(deta_pos / ggpaircuts.cfgMinDeltaEta_Leg, 2) + std::pow(dphi_pos / ggpaircuts.cfgMinDeltaPhi_Leg, 2) < 1.f) { + continue; + } + if (ggpaircuts.applydEtadPhi_Leg && std::pow(deta_ele / ggpaircuts.cfgMinDeltaEta_Leg, 2) + std::pow(dphi_ele / ggpaircuts.cfgMinDeltaPhi_Leg, 2) < 1.f) { continue; } - if (ggpaircuts.applydEtadPhi && std::pow(deta_ele / ggpaircuts.cfgMinDeltaEta, 2) + std::pow(dphi_ele / ggpaircuts.cfgMinDeltaPhi, 2) < 1.f) { + float deta_photon = v1.Pt() > v2.Pt() ? v1.Eta() - v2.Eta() : v2.Eta() - v1.Eta(); + float dphi_photon = v1.Pt() > v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); + if (ggpaircuts.applydEtadPhi_Photon && std::pow(deta_photon / ggpaircuts.cfgMinDeltaEta_Photon, 2) + std::pow(dphi_photon / ggpaircuts.cfgMinDeltaPhi_Photon, 2) < 1.f) { continue; } - fRegistry.fill(HIST("Pair/mix/hDeltaEtaDeltaPhi"), dphi_pos, deta_pos, 1.f); // distance between 2 LS tracks - fRegistry.fill(HIST("Pair/mix/hDeltaEtaDeltaPhi"), dphi_ele, deta_ele, 1.f); // distance between 2 LS tracks + fRegistry.fill(HIST("Pair/mix/hDeltaEtaDeltaPhi_Photon"), dphi_photon, deta_photon, 1.f); // distance between 2 photons + fRegistry.fill(HIST("Pair/mix/hDeltaEtaDeltaPhi_Leg"), dphi_pos, deta_pos, 1.f); // distance between 2 LS tracks + fRegistry.fill(HIST("Pair/mix/hDeltaEtaDeltaPhi_Leg"), dphi_ele, deta_ele, 1.f); // distance between 2 LS tracks fillPairHistogram<1>(collision, v1, v2, 1.f); } } @@ -1198,15 +1238,21 @@ struct PhotonHBT { float deta_ele = ele1.Eta() - ele2.Eta(); float dphi_ele = ele1.Phi() - ele2.Phi(); o2::math_utils::bringToPMPi(dphi_ele); - if (ggpaircuts.applydEtadPhi && std::pow(deta_pos / ggpaircuts.cfgMinDeltaEta, 2) + std::pow(dphi_pos / ggpaircuts.cfgMinDeltaPhi, 2) < 1.f) { + if (ggpaircuts.applydEtadPhi_Leg && std::pow(deta_pos / ggpaircuts.cfgMinDeltaEta_Leg, 2) + std::pow(dphi_pos / ggpaircuts.cfgMinDeltaPhi_Leg, 2) < 1.f) { continue; } - if (ggpaircuts.applydEtadPhi && std::pow(deta_ele / ggpaircuts.cfgMinDeltaEta, 2) + std::pow(dphi_ele / ggpaircuts.cfgMinDeltaPhi, 2) < 1.f) { + if (ggpaircuts.applydEtadPhi_Leg && std::pow(deta_ele / ggpaircuts.cfgMinDeltaEta_Leg, 2) + std::pow(dphi_ele / ggpaircuts.cfgMinDeltaPhi_Leg, 2) < 1.f) { continue; } - fRegistry.fill(HIST("Pair/mix/hDeltaEtaDeltaPhi"), dphi_pos, deta_pos, 1.f); // distance between 2 LS tracks - fRegistry.fill(HIST("Pair/mix/hDeltaEtaDeltaPhi"), dphi_ele, deta_ele, 1.f); // distance between 2 LS tracks + float deta_photon = v1.Pt() > v2.Pt() ? v1.Eta() - v2.Eta() : v2.Eta() - v1.Eta(); + float dphi_photon = v1.Pt() > v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); + if (ggpaircuts.applydEtadPhi_Photon && std::pow(deta_photon / ggpaircuts.cfgMinDeltaEta_Photon, 2) + std::pow(dphi_photon / ggpaircuts.cfgMinDeltaPhi_Photon, 2) < 1.f) { + continue; + } + fRegistry.fill(HIST("Pair/mix/hDeltaEtaDeltaPhi_Photon"), dphi_photon, deta_photon, 1.f); // distance between 2 photons + fRegistry.fill(HIST("Pair/mix/hDeltaEtaDeltaPhi_Leg"), dphi_pos, deta_pos, 1.f); // distance between 2 LS tracks + fRegistry.fill(HIST("Pair/mix/hDeltaEtaDeltaPhi_Leg"), dphi_ele, deta_ele, 1.f); // distance between 2 LS tracks fillPairHistogram<1>(collision, v1, v2, 1.f); } } @@ -1245,15 +1291,21 @@ struct PhotonHBT { float deta_ele = ele1.Eta() - ele2.Eta(); float dphi_ele = ele1.Phi() - ele2.Phi(); o2::math_utils::bringToPMPi(dphi_ele); - if (ggpaircuts.applydEtadPhi && std::pow(deta_pos / ggpaircuts.cfgMinDeltaEta, 2) + std::pow(dphi_pos / ggpaircuts.cfgMinDeltaPhi, 2) < 1.f) { + if (ggpaircuts.applydEtadPhi_Leg && std::pow(deta_pos / ggpaircuts.cfgMinDeltaEta_Leg, 2) + std::pow(dphi_pos / ggpaircuts.cfgMinDeltaPhi_Leg, 2) < 1.f) { + continue; + } + if (ggpaircuts.applydEtadPhi_Leg && std::pow(deta_ele / ggpaircuts.cfgMinDeltaEta_Leg, 2) + std::pow(dphi_ele / ggpaircuts.cfgMinDeltaPhi_Leg, 2) < 1.f) { continue; } - if (ggpaircuts.applydEtadPhi && std::pow(deta_ele / ggpaircuts.cfgMinDeltaEta, 2) + std::pow(dphi_ele / ggpaircuts.cfgMinDeltaPhi, 2) < 1.f) { + float deta_photon = v1.Pt() > v2.Pt() ? v1.Eta() - v2.Eta() : v2.Eta() - v1.Eta(); + float dphi_photon = v1.Pt() > v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); + if (ggpaircuts.applydEtadPhi_Photon && std::pow(deta_photon / ggpaircuts.cfgMinDeltaEta_Photon, 2) + std::pow(dphi_photon / ggpaircuts.cfgMinDeltaPhi_Photon, 2) < 1.f) { continue; } + fRegistry.fill(HIST("Pair/mix/hDeltaEtaDeltaPhi_Photon"), dphi_photon, deta_photon, 1.f); // distance between 2 photons - fRegistry.fill(HIST("Pair/mix/hDeltaEtaDeltaPhi"), dphi_pos, deta_pos, 1.f); // distance between 2 LS tracks - fRegistry.fill(HIST("Pair/mix/hDeltaEtaDeltaPhi"), dphi_ele, deta_ele, 1.f); // distance between 2 LS tracks + fRegistry.fill(HIST("Pair/mix/hDeltaEtaDeltaPhi_Leg"), dphi_pos, deta_pos, 1.f); // distance between 2 LS tracks + fRegistry.fill(HIST("Pair/mix/hDeltaEtaDeltaPhi_Leg"), dphi_ele, deta_ele, 1.f); // distance between 2 LS tracks fillPairHistogram<1>(collision, v1, v2, 1.f); } } diff --git a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx index 894acd0a3f9..bfd7034ef11 100644 --- a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx @@ -44,8 +44,17 @@ using namespace o2::analysis::hf_derived; /// Writes the full information in an output TTree struct HfDerivedDataCreatorBplusToD0Pi { + HfProducesDerivedData< + o2::aod::HfBplusBases, + o2::aod::HfBplusCollBases, + o2::aod::HfBplusCollIds, + o2::aod::HfBplusMcCollBases, + o2::aod::HfBplusMcCollIds, + o2::aod::HfBplusMcRCollIds, + o2::aod::HfBplusPBases, + o2::aod::HfBplusPIds> + rowsCommon; // Candidates - Produces rowCandidateBase; Produces rowCandidatePar; Produces rowCandidateParD0; Produces rowCandidateParE; @@ -54,19 +63,9 @@ struct HfDerivedDataCreatorBplusToD0Pi { Produces rowCandidateMlD0; Produces rowCandidateId; Produces rowCandidateMc; - // Collisions - Produces rowCollBase; - Produces rowCollId; - // MC collisions - Produces rowMcCollBase; - Produces rowMcCollId; - Produces rowMcRCollId; - // MC particles - Produces rowParticleBase; - Produces rowParticleId; // Switches for filling tables - Configurable fillCandidateBase{"fillCandidateBase", true, "Fill candidate base properties"}; + HfConfigurableDerivedData confDerData; Configurable fillCandidatePar{"fillCandidatePar", true, "Fill candidate parameters"}; Configurable fillCandidateParD0{"fillCandidateParD0", true, "Fill D0 candidate parameters"}; Configurable fillCandidateParE{"fillCandidateParE", true, "Fill candidate extended parameters"}; @@ -75,21 +74,13 @@ struct HfDerivedDataCreatorBplusToD0Pi { Configurable fillCandidateMlD0{"fillCandidateMlD0", true, "Fill D0 candidate selection ML scores"}; Configurable fillCandidateId{"fillCandidateId", true, "Fill original indices from the candidate table"}; Configurable fillCandidateMc{"fillCandidateMc", true, "Fill candidate MC info"}; - Configurable fillCollBase{"fillCollBase", true, "Fill collision base properties"}; - Configurable fillCollId{"fillCollId", true, "Fill original collision indices"}; - Configurable fillMcCollBase{"fillMcCollBase", true, "Fill MC collision base properties"}; - Configurable fillMcCollId{"fillMcCollId", true, "Fill original MC collision indices"}; - Configurable fillMcRCollId{"fillMcRCollId", true, "Fill indices of saved derived reconstructed collisions matched to saved derived MC collisions"}; - Configurable fillParticleBase{"fillParticleBase", true, "Fill MC particle properties"}; - Configurable fillParticleId{"fillParticleId", true, "Fill original MC indices"}; // Parameters for production of training samples Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"}; Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; HfHelper hfHelper; SliceCache cache; - std::map> matchedCollisions; // indices of derived reconstructed collisions matched to the global indices of MC collisions - std::map hasMcParticles; // flags for MC collisions with HF particles + static constexpr double mass{o2::constants::physics::MassBPlus}; using CollisionsWCentMult = soa::Join; using CollisionsWMcCentMult = soa::Join; @@ -129,73 +120,14 @@ struct HfDerivedDataCreatorBplusToD0Pi { if (std::accumulate(doprocess.begin(), doprocess.end(), 0) != 1) { LOGP(fatal, "Only one process function can be enabled at a time."); } - } - - template - // void fillTablesCollision(const T& collision, int isEventReject, int runNumber) - void fillTablesCollision(const T& collision) - { - if (fillCollBase) { - rowCollBase( - collision.posX(), - collision.posY(), - collision.posZ(), - collision.numContrib(), - collision.centFT0A(), - collision.centFT0C(), - collision.centFT0M(), - collision.centFV0A(), - collision.multZeqNTracksPV()); - // isEventReject, - // runNumber); - } - if (fillCollId) { - rowCollId( - collision.globalIndex()); - } - if constexpr (isMC) { - if (fillMcRCollId && collision.has_mcCollision()) { - // Save rowCollBase.lastIndex() at key collision.mcCollisionId() - LOGF(debug, "Rec. collision %d: Filling derived-collision index %d for MC collision %d", collision.globalIndex(), rowCollBase.lastIndex(), collision.mcCollisionId()); - matchedCollisions[collision.mcCollisionId()].push_back(rowCollBase.lastIndex()); // [] inserts an empty element if it does not exist - } - } - } - - template - void fillTablesMcCollision(const T& mcCollision) - { - if (fillMcCollBase) { - rowMcCollBase( - mcCollision.posX(), - mcCollision.posY(), - mcCollision.posZ(), - mcCollision.centFT0M()); - } - if (fillMcCollId) { - rowMcCollId( - mcCollision.globalIndex()); - } - if (fillMcRCollId) { - // Fill the table with the vector of indices of derived reconstructed collisions matched to mcCollision.globalIndex() - rowMcRCollId( - matchedCollisions[mcCollision.globalIndex()]); - } + rowsCommon.init(confDerData); } template void fillTablesCandidate(const T& candidate, const U& prongCharm, const V& prongBachelor, int candFlag, double invMass, double ct, double y, int8_t flagMc, int8_t origin, float mlScore, const std::vector& mlScoresCharm) { - if (fillCandidateBase) { - rowCandidateBase( - rowCollBase.lastIndex(), - candidate.pt(), - candidate.eta(), - candidate.phi(), - invMass, - y); - } + rowsCommon.fillTablesCandidate(candidate, invMass, y); if (fillCandidatePar) { rowCandidatePar( candidate.chi2PCA(), @@ -294,26 +226,6 @@ struct HfDerivedDataCreatorBplusToD0Pi { } } - template - void fillTablesParticle(const T& particle, U mass) - { - if (fillParticleBase) { - rowParticleBase( - rowMcCollBase.lastIndex(), - particle.pt(), - particle.eta(), - particle.phi(), - RecoDecayPtEtaPhi::y(particle.pt(), particle.eta(), mass), - particle.flagMcMatchGen(), - particle.originMcGen()); - } - if (fillParticleId) { - rowParticleId( - particle.mcCollisionId(), - particle.globalIndex()); - } - } - template void processCandidates(CollType const& collisions, Partition& candidates, @@ -323,13 +235,12 @@ struct HfDerivedDataCreatorBplusToD0Pi { { // Fill collision properties if constexpr (isMc) { - if (fillMcRCollId) { - matchedCollisions.clear(); + if (confDerData.fillMcRCollId) { + rowsCommon.matchedCollisions.clear(); } } auto sizeTableColl = collisions.size(); - reserveTable(rowCollBase, fillCollBase, sizeTableColl); - reserveTable(rowCollId, fillCollId, sizeTableColl); + rowsCommon.reserveTablesColl(sizeTableColl); for (const auto& collision : collisions) { auto thisCollId = collision.globalIndex(); auto candidatesThisColl = candidates->sliceByCached(aod::hf_cand::collisionId, thisCollId, cache); // FIXME @@ -338,19 +249,18 @@ struct HfDerivedDataCreatorBplusToD0Pi { // Skip collisions without HF candidates (and without HF particles in matched MC collisions if saving indices of reconstructed collisions matched to MC collisions) bool mcCollisionHasMcParticles{false}; if constexpr (isMc) { - mcCollisionHasMcParticles = fillMcRCollId && collision.has_mcCollision() && hasMcParticles[collision.mcCollisionId()]; + mcCollisionHasMcParticles = confDerData.fillMcRCollId && collision.has_mcCollision() && rowsCommon.hasMcParticles[collision.mcCollisionId()]; LOGF(debug, "Rec. collision %d has MC collision %d with MC particles? %s", thisCollId, collision.mcCollisionId(), mcCollisionHasMcParticles ? "yes" : "no"); } - if (sizeTableCand == 0 && (!fillMcRCollId || !mcCollisionHasMcParticles)) { + if (sizeTableCand == 0 && (!confDerData.fillMcRCollId || !mcCollisionHasMcParticles)) { LOGF(debug, "Skipping rec. collision %d", thisCollId); continue; } - LOGF(debug, "Filling rec. collision %d at derived index %d", thisCollId, rowCollBase.lastIndex() + 1); - // fillTablesCollision(collision, 0, collision.bc().runNumber()); - fillTablesCollision(collision); + LOGF(debug, "Filling rec. collision %d at derived index %d", thisCollId, rowsCommon.rowCollBase.lastIndex() + 1); + rowsCommon.fillTablesCollision(collision); // Fill candidate properties - reserveTable(rowCandidateBase, fillCandidateBase, sizeTableCand); + rowsCommon.reserveTablesCandidates(sizeTableCand); reserveTable(rowCandidatePar, fillCandidatePar, sizeTableCand); reserveTable(rowCandidateParD0, fillCandidateParD0, sizeTableCand); reserveTable(rowCandidateParE, fillCandidateParE, sizeTableCand); @@ -405,55 +315,6 @@ struct HfDerivedDataCreatorBplusToD0Pi { } } - template - void preProcessMcCollisions(CollisionType const& mcCollisions, - ParticleType const& mcParticles) - { - if (!fillMcRCollId) { - return; - } - hasMcParticles.clear(); - // Fill MC collision flags - for (const auto& mcCollision : mcCollisions) { - auto thisMcCollId = mcCollision.globalIndex(); - auto particlesThisMcColl = mcParticles.sliceBy(mcParticlesPerMcCollision, thisMcCollId); - LOGF(debug, "MC collision %d has %d MC particles (preprocess)", thisMcCollId, particlesThisMcColl.size()); - hasMcParticles[thisMcCollId] = (particlesThisMcColl.size() > 0); - } - } - - template - void processMcParticles(CollisionType const& mcCollisions, - ParticleType const& mcParticles) - { - // Fill MC collision properties - auto sizeTableMcColl = mcCollisions.size(); - reserveTable(rowMcCollBase, fillMcCollBase, sizeTableMcColl); - reserveTable(rowMcCollId, fillMcCollId, sizeTableMcColl); - reserveTable(rowMcRCollId, fillMcRCollId, sizeTableMcColl); - for (const auto& mcCollision : mcCollisions) { - auto thisMcCollId = mcCollision.globalIndex(); - auto particlesThisMcColl = mcParticles.sliceBy(mcParticlesPerMcCollision, thisMcCollId); - auto sizeTablePart = particlesThisMcColl.size(); - LOGF(debug, "MC collision %d has %d MC particles", thisMcCollId, sizeTablePart); - // Skip MC collisions without HF particles (and without HF candidates in matched reconstructed collisions if saving indices of reconstructed collisions matched to MC collisions) - LOGF(debug, "MC collision %d has %d saved derived rec. collisions", thisMcCollId, matchedCollisions[thisMcCollId].size()); - if (sizeTablePart == 0 && (!fillMcRCollId || matchedCollisions[thisMcCollId].empty())) { - LOGF(debug, "Skipping MC collision %d", thisMcCollId); - continue; - } - LOGF(debug, "Filling MC collision %d at derived index %d", thisMcCollId, rowMcCollBase.lastIndex() + 1); - fillTablesMcCollision(mcCollision); - - // Fill MC particle properties - reserveTable(rowParticleBase, fillParticleBase, sizeTablePart); - reserveTable(rowParticleId, fillParticleId, sizeTablePart); - for (const auto& particle : particlesThisMcColl) { - fillTablesParticle(particle, o2::constants::physics::MassBPlus); - } - } - } - void processData(CollisionsWCentMult const& collisions, SelectedCandidates const&, THfCandDaughters const& candidatesDaughters, @@ -472,9 +333,9 @@ struct HfDerivedDataCreatorBplusToD0Pi { TracksWPid const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcSig, candidatesDaughters, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcSig, "Process MC only for signals", false); @@ -486,9 +347,9 @@ struct HfDerivedDataCreatorBplusToD0Pi { TracksWPid const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcBkg, candidatesDaughters, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcBkg, "Process MC only for background", false); @@ -500,9 +361,9 @@ struct HfDerivedDataCreatorBplusToD0Pi { TracksWPid const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcAll, candidatesDaughters, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcAll, "Process MC", false); @@ -526,9 +387,9 @@ struct HfDerivedDataCreatorBplusToD0Pi { TracksWPid const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcMlSig, candidatesDaughters, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcMlSig, "Process MC with ML only for signals", false); @@ -540,9 +401,9 @@ struct HfDerivedDataCreatorBplusToD0Pi { TracksWPid const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcMlBkg, candidatesDaughters, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcMlBkg, "Process MC with ML only for background", false); @@ -554,9 +415,9 @@ struct HfDerivedDataCreatorBplusToD0Pi { TracksWPid const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcMlAll, candidatesDaughters, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcMlAll, "Process MC with ML", false); }; diff --git a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx index 212916981d7..92fdd9089b8 100644 --- a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx @@ -44,48 +44,39 @@ using namespace o2::analysis::hf_derived; /// Writes the full information in an output TTree struct HfDerivedDataCreatorD0ToKPi { + HfProducesDerivedData< + o2::aod::HfD0Bases, + o2::aod::HfD0CollBases, + o2::aod::HfD0CollIds, + o2::aod::HfD0McCollBases, + o2::aod::HfD0McCollIds, + o2::aod::HfD0McRCollIds, + o2::aod::HfD0PBases, + o2::aod::HfD0PIds> + rowsCommon; // Candidates - Produces rowCandidateBase; Produces rowCandidatePar; Produces rowCandidateParE; Produces rowCandidateSel; Produces rowCandidateMl; Produces rowCandidateId; Produces rowCandidateMc; - // Collisions - Produces rowCollBase; - Produces rowCollId; - // MC collisions - Produces rowMcCollBase; - Produces rowMcCollId; - Produces rowMcRCollId; - // MC particles - Produces rowParticleBase; - Produces rowParticleId; // Switches for filling tables - Configurable fillCandidateBase{"fillCandidateBase", true, "Fill candidate base properties"}; + HfConfigurableDerivedData confDerData; Configurable fillCandidatePar{"fillCandidatePar", true, "Fill candidate parameters"}; Configurable fillCandidateParE{"fillCandidateParE", true, "Fill candidate extended parameters"}; Configurable fillCandidateSel{"fillCandidateSel", true, "Fill candidate selection flags"}; Configurable fillCandidateMl{"fillCandidateMl", true, "Fill candidate selection ML scores"}; Configurable fillCandidateId{"fillCandidateId", true, "Fill original indices from the candidate table"}; Configurable fillCandidateMc{"fillCandidateMc", true, "Fill candidate MC info"}; - Configurable fillCollBase{"fillCollBase", true, "Fill collision base properties"}; - Configurable fillCollId{"fillCollId", true, "Fill original collision indices"}; - Configurable fillMcCollBase{"fillMcCollBase", true, "Fill MC collision base properties"}; - Configurable fillMcCollId{"fillMcCollId", true, "Fill original MC collision indices"}; - Configurable fillMcRCollId{"fillMcRCollId", true, "Fill indices of saved derived reconstructed collisions matched to saved derived MC collisions"}; - Configurable fillParticleBase{"fillParticleBase", true, "Fill MC particle properties"}; - Configurable fillParticleId{"fillParticleId", true, "Fill original MC indices"}; // Parameters for production of training samples Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"}; Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; HfHelper hfHelper; SliceCache cache; - std::map> matchedCollisions; // indices of derived reconstructed collisions matched to the global indices of MC collisions - std::map hasMcParticles; // flags for MC collisions with HF particles + static constexpr double mass{o2::constants::physics::MassD0}; using CollisionsWCentMult = soa::Join; using CollisionsWMcCentMult = soa::Join; @@ -140,73 +131,14 @@ struct HfDerivedDataCreatorD0ToKPi { if (std::accumulate(doprocess.begin(), doprocess.end(), 0) != 1) { LOGP(fatal, "Only one process function can be enabled at a time."); } - } - - template - // void fillTablesCollision(const T& collision, int isEventReject, int runNumber) - void fillTablesCollision(const T& collision) - { - if (fillCollBase) { - rowCollBase( - collision.posX(), - collision.posY(), - collision.posZ(), - collision.numContrib(), - collision.centFT0A(), - collision.centFT0C(), - collision.centFT0M(), - collision.centFV0A(), - collision.multZeqNTracksPV()); - // isEventReject, - // runNumber); - } - if (fillCollId) { - rowCollId( - collision.globalIndex()); - } - if constexpr (isMC) { - if (fillMcRCollId && collision.has_mcCollision()) { - // Save rowCollBase.lastIndex() at key collision.mcCollisionId() - LOGF(debug, "Rec. collision %d: Filling derived-collision index %d for MC collision %d", collision.globalIndex(), rowCollBase.lastIndex(), collision.mcCollisionId()); - matchedCollisions[collision.mcCollisionId()].push_back(rowCollBase.lastIndex()); // [] inserts an empty element if it does not exist - } - } - } - - template - void fillTablesMcCollision(const T& mcCollision) - { - if (fillMcCollBase) { - rowMcCollBase( - mcCollision.posX(), - mcCollision.posY(), - mcCollision.posZ(), - mcCollision.centFT0M()); - } - if (fillMcCollId) { - rowMcCollId( - mcCollision.globalIndex()); - } - if (fillMcRCollId) { - // Fill the table with the vector of indices of derived reconstructed collisions matched to mcCollision.globalIndex() - rowMcRCollId( - matchedCollisions[mcCollision.globalIndex()]); - } + rowsCommon.init(confDerData); } template void fillTablesCandidate(const T& candidate, int candFlag, double invMass, double cosThetaStar, double topoChi2, double ct, double y, int8_t flagMc, int8_t origin, const std::vector& mlScores) { - if (fillCandidateBase) { - rowCandidateBase( - rowCollBase.lastIndex(), - candidate.pt(), - candidate.eta(), - candidate.phi(), - invMass, - y); - } + rowsCommon.fillTablesCandidate(candidate, invMass, y); if (fillCandidatePar) { std::array, 2>, 2> sigmas{}; // PID nSigma [Expected][Hypothesis][TPC/TOF/TPC+TOF] if (candFlag == 0) { @@ -292,26 +224,6 @@ struct HfDerivedDataCreatorD0ToKPi { } } - template - void fillTablesParticle(const T& particle, U mass) - { - if (fillParticleBase) { - rowParticleBase( - rowMcCollBase.lastIndex(), - particle.pt(), - particle.eta(), - particle.phi(), - RecoDecayPtEtaPhi::y(particle.pt(), particle.eta(), mass), - particle.flagMcMatchGen(), - particle.originMcGen()); - } - if (fillParticleId) { - rowParticleId( - particle.mcCollisionId(), - particle.globalIndex()); - } - } - template void processCandidates(CollType const& collisions, Partition& candidates, @@ -320,13 +232,12 @@ struct HfDerivedDataCreatorD0ToKPi { { // Fill collision properties if constexpr (isMc) { - if (fillMcRCollId) { - matchedCollisions.clear(); + if (confDerData.fillMcRCollId) { + rowsCommon.matchedCollisions.clear(); } } auto sizeTableColl = collisions.size(); - reserveTable(rowCollBase, fillCollBase, sizeTableColl); - reserveTable(rowCollId, fillCollId, sizeTableColl); + rowsCommon.reserveTablesColl(sizeTableColl); for (const auto& collision : collisions) { auto thisCollId = collision.globalIndex(); auto candidatesThisColl = candidates->sliceByCached(aod::hf_cand::collisionId, thisCollId, cache); // FIXME @@ -335,19 +246,18 @@ struct HfDerivedDataCreatorD0ToKPi { // Skip collisions without HF candidates (and without HF particles in matched MC collisions if saving indices of reconstructed collisions matched to MC collisions) bool mcCollisionHasMcParticles{false}; if constexpr (isMc) { - mcCollisionHasMcParticles = fillMcRCollId && collision.has_mcCollision() && hasMcParticles[collision.mcCollisionId()]; + mcCollisionHasMcParticles = confDerData.fillMcRCollId && collision.has_mcCollision() && rowsCommon.hasMcParticles[collision.mcCollisionId()]; LOGF(debug, "Rec. collision %d has MC collision %d with MC particles? %s", thisCollId, collision.mcCollisionId(), mcCollisionHasMcParticles ? "yes" : "no"); } - if (sizeTableCand == 0 && (!fillMcRCollId || !mcCollisionHasMcParticles)) { + if (sizeTableCand == 0 && (!confDerData.fillMcRCollId || !mcCollisionHasMcParticles)) { LOGF(debug, "Skipping rec. collision %d", thisCollId); continue; } - LOGF(debug, "Filling rec. collision %d at derived index %d", thisCollId, rowCollBase.lastIndex() + 1); - // fillTablesCollision(collision, 0, collision.bc().runNumber()); - fillTablesCollision(collision); + LOGF(debug, "Filling rec. collision %d at derived index %d", thisCollId, rowsCommon.rowCollBase.lastIndex() + 1); + rowsCommon.fillTablesCollision(collision); // Fill candidate properties - reserveTable(rowCandidateBase, fillCandidateBase, sizeTableCand); + rowsCommon.reserveTablesCandidates(sizeTableCand); reserveTable(rowCandidatePar, fillCandidatePar, sizeTableCand); reserveTable(rowCandidateParE, fillCandidateParE, sizeTableCand); reserveTable(rowCandidateSel, fillCandidateSel, sizeTableCand); @@ -413,55 +323,6 @@ struct HfDerivedDataCreatorD0ToKPi { } } - template - void preProcessMcCollisions(CollisionType const& mcCollisions, - ParticleType const& mcParticles) - { - if (!fillMcRCollId) { - return; - } - hasMcParticles.clear(); - // Fill MC collision flags - for (const auto& mcCollision : mcCollisions) { - auto thisMcCollId = mcCollision.globalIndex(); - auto particlesThisMcColl = mcParticles.sliceBy(mcParticlesPerMcCollision, thisMcCollId); - LOGF(debug, "MC collision %d has %d MC particles (preprocess)", thisMcCollId, particlesThisMcColl.size()); - hasMcParticles[thisMcCollId] = (particlesThisMcColl.size() > 0); - } - } - - template - void processMcParticles(CollisionType const& mcCollisions, - ParticleType const& mcParticles) - { - // Fill MC collision properties - auto sizeTableMcColl = mcCollisions.size(); - reserveTable(rowMcCollBase, fillMcCollBase, sizeTableMcColl); - reserveTable(rowMcCollId, fillMcCollId, sizeTableMcColl); - reserveTable(rowMcRCollId, fillMcRCollId, sizeTableMcColl); - for (const auto& mcCollision : mcCollisions) { - auto thisMcCollId = mcCollision.globalIndex(); - auto particlesThisMcColl = mcParticles.sliceBy(mcParticlesPerMcCollision, thisMcCollId); - auto sizeTablePart = particlesThisMcColl.size(); - LOGF(debug, "MC collision %d has %d MC particles", thisMcCollId, sizeTablePart); - // Skip MC collisions without HF particles (and without HF candidates in matched reconstructed collisions if saving indices of reconstructed collisions matched to MC collisions) - LOGF(debug, "MC collision %d has %d saved derived rec. collisions", thisMcCollId, matchedCollisions[thisMcCollId].size()); - if (sizeTablePart == 0 && (!fillMcRCollId || matchedCollisions[thisMcCollId].empty())) { - LOGF(debug, "Skipping MC collision %d", thisMcCollId); - continue; - } - LOGF(debug, "Filling MC collision %d at derived index %d", thisMcCollId, rowMcCollBase.lastIndex() + 1); - fillTablesMcCollision(mcCollision); - - // Fill MC particle properties - reserveTable(rowParticleBase, fillParticleBase, sizeTablePart); - reserveTable(rowParticleId, fillParticleId, sizeTablePart); - for (const auto& particle : particlesThisMcColl) { - fillTablesParticle(particle, o2::constants::physics::MassD0); - } - } - } - void processDataWithDCAFitterN(CollisionsWCentMult const& collisions, SelectedCandidates const&, aod::Tracks const& tracks, @@ -487,9 +348,9 @@ struct HfDerivedDataCreatorD0ToKPi { aod::Tracks const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcSig, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithDCAFitterSig, "Process MC with DCAFitterN only for signals", false); @@ -500,9 +361,9 @@ struct HfDerivedDataCreatorD0ToKPi { aod::Tracks const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcBkg, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithDCAFitterBkg, "Process MC with DCAFitterN only for background", false); @@ -513,9 +374,9 @@ struct HfDerivedDataCreatorD0ToKPi { aod::Tracks const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcAll, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithDCAFitterAll, "Process MC with DCAFitterN", false); @@ -526,9 +387,9 @@ struct HfDerivedDataCreatorD0ToKPi { aod::Tracks const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcKfSig, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithKFParticleSig, "Process MC with KFParticle only for signals", false); @@ -539,9 +400,9 @@ struct HfDerivedDataCreatorD0ToKPi { aod::Tracks const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcKfBkg, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithKFParticleBkg, "Process MC with KFParticle only for background", false); @@ -552,9 +413,9 @@ struct HfDerivedDataCreatorD0ToKPi { aod::Tracks const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcKfAll, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithKFParticleAll, "Process MC with KFParticle", false); @@ -585,9 +446,9 @@ struct HfDerivedDataCreatorD0ToKPi { aod::Tracks const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcMlSig, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithDCAFitterMlSig, "Process MC with DCAFitterN and ML only for signals", false); @@ -598,9 +459,9 @@ struct HfDerivedDataCreatorD0ToKPi { aod::Tracks const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcMlBkg, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithDCAFitterMlBkg, "Process MC with DCAFitterN and ML only for background", false); @@ -611,9 +472,9 @@ struct HfDerivedDataCreatorD0ToKPi { aod::Tracks const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcMlAll, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithDCAFitterMlAll, "Process MC with DCAFitterN and ML", false); @@ -624,9 +485,9 @@ struct HfDerivedDataCreatorD0ToKPi { aod::Tracks const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcKfMlSig, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithKFParticleMlSig, "Process MC with KFParticle and ML only for signals", false); @@ -637,9 +498,9 @@ struct HfDerivedDataCreatorD0ToKPi { aod::Tracks const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcKfMlBkg, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithKFParticleMlBkg, "Process MC with KFParticle and ML only for background", false); @@ -650,9 +511,9 @@ struct HfDerivedDataCreatorD0ToKPi { aod::Tracks const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcKfMlAll, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithKFParticleMlAll, "Process MC with KFParticle and ML", false); }; diff --git a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx index 6353241bc38..c574611228d 100644 --- a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx @@ -42,48 +42,39 @@ using namespace o2::analysis::hf_derived; /// Writes the full information in an output TTree struct HfDerivedDataCreatorLcToPKPi { + HfProducesDerivedData< + o2::aod::HfLcBases, + o2::aod::HfLcCollBases, + o2::aod::HfLcCollIds, + o2::aod::HfLcMcCollBases, + o2::aod::HfLcMcCollIds, + o2::aod::HfLcMcRCollIds, + o2::aod::HfLcPBases, + o2::aod::HfLcPIds> + rowsCommon; // Candidates - Produces rowCandidateBase; Produces rowCandidatePar; Produces rowCandidateParE; Produces rowCandidateSel; Produces rowCandidateMl; Produces rowCandidateId; Produces rowCandidateMc; - // Collisions - Produces rowCollBase; - Produces rowCollId; - // MC collisions - Produces rowMcCollBase; - Produces rowMcCollId; - Produces rowMcRCollId; - // MC particles - Produces rowParticleBase; - Produces rowParticleId; // Switches for filling tables - Configurable fillCandidateBase{"fillCandidateBase", true, "Fill candidate base properties"}; + HfConfigurableDerivedData confDerData; Configurable fillCandidatePar{"fillCandidatePar", true, "Fill candidate parameters"}; Configurable fillCandidateParE{"fillCandidateParE", true, "Fill candidate extended parameters"}; Configurable fillCandidateSel{"fillCandidateSel", true, "Fill candidate selection flags"}; Configurable fillCandidateMl{"fillCandidateMl", true, "Fill candidate selection ML scores"}; Configurable fillCandidateId{"fillCandidateId", true, "Fill original indices from the candidate table"}; Configurable fillCandidateMc{"fillCandidateMc", true, "Fill candidate MC info"}; - Configurable fillCollBase{"fillCollBase", true, "Fill collision base properties"}; - Configurable fillCollId{"fillCollId", true, "Fill original collision indices"}; - Configurable fillMcCollBase{"fillMcCollBase", true, "Fill MC collision base properties"}; - Configurable fillMcCollId{"fillMcCollId", true, "Fill original MC collision indices"}; - Configurable fillMcRCollId{"fillMcRCollId", true, "Fill indices of saved derived reconstructed collisions matched to saved derived MC collisions"}; - Configurable fillParticleBase{"fillParticleBase", true, "Fill MC particle properties"}; - Configurable fillParticleId{"fillParticleId", true, "Fill original MC indices"}; // Parameters for production of training samples Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"}; Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; HfHelper hfHelper; SliceCache cache; - std::map> matchedCollisions; // indices of derived reconstructed collisions matched to the global indices of MC collisions - std::map hasMcParticles; // flags for MC collisions with HF particles + static constexpr double mass{o2::constants::physics::MassLambdaCPlus}; using CollisionsWCentMult = soa::Join; using CollisionsWMcCentMult = soa::Join; @@ -121,73 +112,14 @@ struct HfDerivedDataCreatorLcToPKPi { if (std::accumulate(doprocess.begin(), doprocess.end(), 0) != 1) { LOGP(fatal, "Only one process function can be enabled at a time."); } - } - - template - // void fillTablesCollision(const T& collision, int isEventReject, int runNumber) - void fillTablesCollision(const T& collision) - { - if (fillCollBase) { - rowCollBase( - collision.posX(), - collision.posY(), - collision.posZ(), - collision.numContrib(), - collision.centFT0A(), - collision.centFT0C(), - collision.centFT0M(), - collision.centFV0A(), - collision.multZeqNTracksPV()); - // isEventReject, - // runNumber); - } - if (fillCollId) { - rowCollId( - collision.globalIndex()); - } - if constexpr (isMC) { - if (fillMcRCollId && collision.has_mcCollision()) { - // Save rowCollBase.lastIndex() at key collision.mcCollisionId() - LOGF(debug, "Rec. collision %d: Filling derived-collision index %d for MC collision %d", collision.globalIndex(), rowCollBase.lastIndex(), collision.mcCollisionId()); - matchedCollisions[collision.mcCollisionId()].push_back(rowCollBase.lastIndex()); // [] inserts an empty element if it does not exist - } - } - } - - template - void fillTablesMcCollision(const T& mcCollision) - { - if (fillMcCollBase) { - rowMcCollBase( - mcCollision.posX(), - mcCollision.posY(), - mcCollision.posZ(), - mcCollision.centFT0M()); - } - if (fillMcCollId) { - rowMcCollId( - mcCollision.globalIndex()); - } - if (fillMcRCollId) { - // Fill the table with the vector of indices of derived reconstructed collisions matched to mcCollision.globalIndex() - rowMcRCollId( - matchedCollisions[mcCollision.globalIndex()]); - } + rowsCommon.init(confDerData); } template void fillTablesCandidate(const T& candidate, const U& prong0, const U& prong1, const U& prong2, int candFlag, double invMass, double ct, double y, int8_t flagMc, int8_t origin, int8_t swapping, const std::vector& mlScores) { - if (fillCandidateBase) { - rowCandidateBase( - rowCollBase.lastIndex(), - candidate.pt(), - candidate.eta(), - candidate.phi(), - invMass, - y); - } + rowsCommon.fillTablesCandidate(candidate, invMass, y); if (fillCandidatePar) { rowCandidatePar( candidate.chi2PCA(), @@ -271,26 +203,6 @@ struct HfDerivedDataCreatorLcToPKPi { } } - template - void fillTablesParticle(const T& particle, U mass) - { - if (fillParticleBase) { - rowParticleBase( - rowMcCollBase.lastIndex(), - particle.pt(), - particle.eta(), - particle.phi(), - RecoDecayPtEtaPhi::y(particle.pt(), particle.eta(), mass), - particle.flagMcMatchGen(), - particle.originMcGen()); - } - if (fillParticleId) { - rowParticleId( - particle.mcCollisionId(), - particle.globalIndex()); - } - } - template void processCandidates(CollType const& collisions, Partition& candidates, @@ -299,13 +211,12 @@ struct HfDerivedDataCreatorLcToPKPi { { // Fill collision properties if constexpr (isMc) { - if (fillMcRCollId) { - matchedCollisions.clear(); + if (confDerData.fillMcRCollId) { + rowsCommon.matchedCollisions.clear(); } } auto sizeTableColl = collisions.size(); - reserveTable(rowCollBase, fillCollBase, sizeTableColl); - reserveTable(rowCollId, fillCollId, sizeTableColl); + rowsCommon.reserveTablesColl(sizeTableColl); for (const auto& collision : collisions) { auto thisCollId = collision.globalIndex(); auto candidatesThisColl = candidates->sliceByCached(aod::hf_cand::collisionId, thisCollId, cache); // FIXME @@ -314,19 +225,18 @@ struct HfDerivedDataCreatorLcToPKPi { // Skip collisions without HF candidates (and without HF particles in matched MC collisions if saving indices of reconstructed collisions matched to MC collisions) bool mcCollisionHasMcParticles{false}; if constexpr (isMc) { - mcCollisionHasMcParticles = fillMcRCollId && collision.has_mcCollision() && hasMcParticles[collision.mcCollisionId()]; + mcCollisionHasMcParticles = confDerData.fillMcRCollId && collision.has_mcCollision() && rowsCommon.hasMcParticles[collision.mcCollisionId()]; LOGF(debug, "Rec. collision %d has MC collision %d with MC particles? %s", thisCollId, collision.mcCollisionId(), mcCollisionHasMcParticles ? "yes" : "no"); } - if (sizeTableCand == 0 && (!fillMcRCollId || !mcCollisionHasMcParticles)) { + if (sizeTableCand == 0 && (!confDerData.fillMcRCollId || !mcCollisionHasMcParticles)) { LOGF(debug, "Skipping rec. collision %d", thisCollId); continue; } - LOGF(debug, "Filling rec. collision %d at derived index %d", thisCollId, rowCollBase.lastIndex() + 1); - // fillTablesCollision(collision, 0, collision.bc().runNumber()); - fillTablesCollision(collision); + LOGF(debug, "Filling rec. collision %d at derived index %d", thisCollId, rowsCommon.rowCollBase.lastIndex() + 1); + rowsCommon.fillTablesCollision(collision); // Fill candidate properties - reserveTable(rowCandidateBase, fillCandidateBase, sizeTableCand); + rowsCommon.reserveTablesCandidates(sizeTableCand); reserveTable(rowCandidatePar, fillCandidatePar, sizeTableCand); reserveTable(rowCandidateParE, fillCandidateParE, sizeTableCand); reserveTable(rowCandidateSel, fillCandidateSel, sizeTableCand); @@ -380,55 +290,6 @@ struct HfDerivedDataCreatorLcToPKPi { } } - template - void preProcessMcCollisions(CollisionType const& mcCollisions, - ParticleType const& mcParticles) - { - if (!fillMcRCollId) { - return; - } - hasMcParticles.clear(); - // Fill MC collision flags - for (const auto& mcCollision : mcCollisions) { - auto thisMcCollId = mcCollision.globalIndex(); - auto particlesThisMcColl = mcParticles.sliceBy(mcParticlesPerMcCollision, thisMcCollId); - LOGF(debug, "MC collision %d has %d MC particles (preprocess)", thisMcCollId, particlesThisMcColl.size()); - hasMcParticles[thisMcCollId] = (particlesThisMcColl.size() > 0); - } - } - - template - void processMcParticles(CollisionType const& mcCollisions, - ParticleType const& mcParticles) - { - // Fill MC collision properties - auto sizeTableMcColl = mcCollisions.size(); - reserveTable(rowMcCollBase, fillMcCollBase, sizeTableMcColl); - reserveTable(rowMcCollId, fillMcCollId, sizeTableMcColl); - reserveTable(rowMcRCollId, fillMcRCollId, sizeTableMcColl); - for (const auto& mcCollision : mcCollisions) { - auto thisMcCollId = mcCollision.globalIndex(); - auto particlesThisMcColl = mcParticles.sliceBy(mcParticlesPerMcCollision, thisMcCollId); - auto sizeTablePart = particlesThisMcColl.size(); - LOGF(debug, "MC collision %d has %d MC particles", thisMcCollId, sizeTablePart); - // Skip MC collisions without HF particles (and without HF candidates in matched reconstructed collisions if saving indices of reconstructed collisions matched to MC collisions) - LOGF(debug, "MC collision %d has %d saved derived rec. collisions", thisMcCollId, matchedCollisions[thisMcCollId].size()); - if (sizeTablePart == 0 && (!fillMcRCollId || matchedCollisions[thisMcCollId].empty())) { - LOGF(debug, "Skipping MC collision %d", thisMcCollId); - continue; - } - LOGF(debug, "Filling MC collision %d at derived index %d", thisMcCollId, rowMcCollBase.lastIndex() + 1); - fillTablesMcCollision(mcCollision); - - // Fill MC particle properties - reserveTable(rowParticleBase, fillParticleBase, sizeTablePart); - reserveTable(rowParticleId, fillParticleId, sizeTablePart); - for (const auto& particle : particlesThisMcColl) { - fillTablesParticle(particle, o2::constants::physics::MassLambdaCPlus); - } - } - } - void processData(CollisionsWCentMult const& collisions, SelectedCandidates const&, TracksWPid const& tracks, @@ -445,9 +306,9 @@ struct HfDerivedDataCreatorLcToPKPi { TracksWPid const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcSig, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorLcToPKPi, processMcSig, "Process MC only for signals", false); @@ -458,9 +319,9 @@ struct HfDerivedDataCreatorLcToPKPi { TracksWPid const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcBkg, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorLcToPKPi, processMcBkg, "Process MC only for background", false); @@ -471,9 +332,9 @@ struct HfDerivedDataCreatorLcToPKPi { TracksWPid const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcAll, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorLcToPKPi, processMcAll, "Process MC", false); @@ -495,9 +356,9 @@ struct HfDerivedDataCreatorLcToPKPi { TracksWPid const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcMlSig, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorLcToPKPi, processMcMlSig, "Process MC with ML only for signals", false); @@ -508,9 +369,9 @@ struct HfDerivedDataCreatorLcToPKPi { TracksWPid const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcMlBkg, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorLcToPKPi, processMcMlBkg, "Process MC with ML only for background", false); @@ -521,9 +382,9 @@ struct HfDerivedDataCreatorLcToPKPi { TracksWPid const& tracks, aod::BCs const& bcs) { - preProcessMcCollisions(mcCollisions, mcParticles); + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcMlAll, tracks, bcs); - processMcParticles(mcCollisions, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorLcToPKPi, processMcMlAll, "Process MC with ML", false); }; diff --git a/PWGHF/Utils/utilsDerivedData.h b/PWGHF/Utils/utilsDerivedData.h index ad3bf57e25e..c5eb6cc3b89 100644 --- a/PWGHF/Utils/utilsDerivedData.h +++ b/PWGHF/Utils/utilsDerivedData.h @@ -16,7 +16,18 @@ #ifndef PWGHF_UTILS_UTILSDERIVEDDATA_H_ #define PWGHF_UTILS_UTILSDERIVEDDATA_H_ -#include +#include +#include + +#include "fairlogger/Logger.h" + +#include "Framework/AnalysisHelpers.h" +#include "Framework/Configurable.h" +#include "Framework/ASoA.h" + +#include "Common/Core/RecoDecay.h" + +#include "PWGHF/DataModel/DerivedTables.h" // Macro to store nSigma for prong _id_ with PID hypothesis _hyp_ in an array #define GET_N_SIGMA_PRONG(_array_, _candidate_, _id_, _hyp_) \ @@ -36,6 +47,215 @@ void reserveTable(T& cursor, const o2::framework::Configurable& enabled, c if (enabled.value) { cursor.reserve(size); } +} + +struct HfConfigurableDerivedData : o2::framework::ConfigurableGroup { + // Candidates + o2::framework::Configurable fillCandidateBase{"fillCandidateBase", true, "Fill candidate base properties"}; + // Collisions + o2::framework::Configurable fillCollBase{"fillCollBase", true, "Fill collision base properties"}; + o2::framework::Configurable fillCollId{"fillCollId", true, "Fill original collision indices"}; + // MC collisions + o2::framework::Configurable fillMcCollBase{"fillMcCollBase", true, "Fill MC collision base properties"}; + o2::framework::Configurable fillMcCollId{"fillMcCollId", true, "Fill original MC collision indices"}; + o2::framework::Configurable fillMcRCollId{"fillMcRCollId", true, "Fill indices of saved derived reconstructed collisions matched to saved derived MC collisions"}; + // MC particles + o2::framework::Configurable fillParticleBase{"fillParticleBase", true, "Fill MC particle properties"}; + o2::framework::Configurable fillParticleId{"fillParticleId", true, "Fill original MC indices"}; +}; + +template < + typename HfBases, + typename HfCollBases, + typename HfCollIds, + typename HfMcCollBases, + typename HfMcCollIds, + typename HfMcRCollIds, + typename HfPBases, + typename HfPIds> +struct HfProducesDerivedData : o2::framework::ProducesGroup { + // Candidates + o2::framework::Produces rowCandidateBase; + // Collisions + o2::framework::Produces rowCollBase; + o2::framework::Produces rowCollId; + // MC collisions + o2::framework::Produces rowMcCollBase; + o2::framework::Produces rowMcCollId; + o2::framework::Produces rowMcRCollId; + // MC particles + o2::framework::Produces rowParticleBase; + o2::framework::Produces rowParticleId; + + HfConfigurableDerivedData const* conf; + std::map> matchedCollisions; // indices of derived reconstructed collisions matched to the global indices of MC collisions + std::map hasMcParticles; // flags for MC collisions with HF particles + + void init(HfConfigurableDerivedData const& c) + { + conf = &c; + } + + template + void reserveTablesCandidates(T size) + { + o2::analysis::hf_derived::reserveTable(rowCandidateBase, conf->fillCandidateBase, size); + } + + template + void reserveTablesColl(T size) + { + o2::analysis::hf_derived::reserveTable(rowCollBase, conf->fillCollBase, size); + o2::analysis::hf_derived::reserveTable(rowCollId, conf->fillCollId, size); + } + + template + void reserveTablesMcColl(T size) + { + o2::analysis::hf_derived::reserveTable(rowMcCollBase, conf->fillMcCollBase, size); + o2::analysis::hf_derived::reserveTable(rowMcCollId, conf->fillMcCollId, size); + o2::analysis::hf_derived::reserveTable(rowMcRCollId, conf->fillMcRCollId, size); + } + + template + void reserveTablesParticles(T size) + { + o2::analysis::hf_derived::reserveTable(rowParticleBase, conf->fillParticleBase, size); + o2::analysis::hf_derived::reserveTable(rowParticleId, conf->fillParticleId, size); + } + + template + void fillTablesCandidate(const T& candidate, double invMass, double y) + { + if (conf->fillCandidateBase.value) { + rowCandidateBase( + rowCollBase.lastIndex(), + candidate.pt(), + candidate.eta(), + candidate.phi(), + invMass, + y); + } + } + + template + // void fillTablesCollision(const T& collision, int isEventReject, int runNumber) + void fillTablesCollision(const T& collision) + { + if (conf->fillCollBase.value) { + rowCollBase( + collision.posX(), + collision.posY(), + collision.posZ(), + collision.numContrib(), + collision.centFT0A(), + collision.centFT0C(), + collision.centFT0M(), + collision.centFV0A(), + collision.multZeqNTracksPV()); + } + if (conf->fillCollId.value) { + rowCollId( + collision.globalIndex()); + } + if constexpr (isMC) { + if (conf->fillMcRCollId.value && collision.has_mcCollision()) { + // Save rowCollBase.lastIndex() at key collision.mcCollisionId() + LOGF(debug, "Rec. collision %d: Filling derived-collision index %d for MC collision %d", collision.globalIndex(), rowCollBase.lastIndex(), collision.mcCollisionId()); + matchedCollisions[collision.mcCollisionId()].push_back(rowCollBase.lastIndex()); // [] inserts an empty element if it does not exist + } + } + } + + template + void fillTablesMcCollision(const T& mcCollision) + { + if (conf->fillMcCollBase.value) { + rowMcCollBase( + mcCollision.posX(), + mcCollision.posY(), + mcCollision.posZ(), + mcCollision.centFT0M()); + } + if (conf->fillMcCollId.value) { + rowMcCollId( + mcCollision.globalIndex()); + } + if (conf->fillMcRCollId.value) { + // Fill the table with the vector of indices of derived reconstructed collisions matched to mcCollision.globalIndex() + rowMcRCollId( + matchedCollisions[mcCollision.globalIndex()]); + } + } + + template + void fillTablesParticle(const T& particle, U mass) + { + if (conf->fillParticleBase.value) { + rowParticleBase( + rowMcCollBase.lastIndex(), + particle.pt(), + particle.eta(), + particle.phi(), + RecoDecayPtEtaPhi::y(particle.pt(), particle.eta(), mass), + particle.flagMcMatchGen(), + particle.originMcGen()); + } + if (conf->fillParticleId.value) { + rowParticleId( + particle.mcCollisionId(), + particle.globalIndex()); + } + } + + template + void preProcessMcCollisions(CollisionType const& mcCollisions, + o2::framework::Preslice const& mcParticlesPerMcCollision, + ParticleType const& mcParticles) + { + if (!conf->fillMcRCollId.value) { + return; + } + hasMcParticles.clear(); + // Fill MC collision flags + for (const auto& mcCollision : mcCollisions) { + auto thisMcCollId = mcCollision.globalIndex(); + auto particlesThisMcColl = mcParticles.sliceBy(mcParticlesPerMcCollision, thisMcCollId); + LOGF(debug, "MC collision %d has %d MC particles (preprocess)", thisMcCollId, particlesThisMcColl.size()); + hasMcParticles[thisMcCollId] = (particlesThisMcColl.size() > 0); + } + } + + template + void processMcParticles(CollisionType const& mcCollisions, + o2::framework::Preslice const& mcParticlesPerMcCollision, + ParticleType const& mcParticles, + TMass const massParticle) + { + // Fill MC collision properties + auto sizeTableMcColl = mcCollisions.size(); + reserveTablesMcColl(sizeTableMcColl); + for (const auto& mcCollision : mcCollisions) { + auto thisMcCollId = mcCollision.globalIndex(); + auto particlesThisMcColl = mcParticles.sliceBy(mcParticlesPerMcCollision, thisMcCollId); + auto sizeTablePart = particlesThisMcColl.size(); + LOGF(debug, "MC collision %d has %d MC particles", thisMcCollId, sizeTablePart); + // Skip MC collisions without HF particles (and without HF candidates in matched reconstructed collisions if saving indices of reconstructed collisions matched to MC collisions) + LOGF(debug, "MC collision %d has %d saved derived rec. collisions", thisMcCollId, matchedCollisions[thisMcCollId].size()); + if (sizeTablePart == 0 && (!conf->fillMcRCollId.value || matchedCollisions[thisMcCollId].empty())) { + LOGF(debug, "Skipping MC collision %d", thisMcCollId); + continue; + } + LOGF(debug, "Filling MC collision %d at derived index %d", thisMcCollId, rowMcCollBase.lastIndex() + 1); + fillTablesMcCollision(mcCollision); + + // Fill MC particle properties + reserveTablesParticles(sizeTablePart); + for (const auto& particle : particlesThisMcColl) { + fillTablesParticle(particle, massParticle); + } + } + } }; } // namespace o2::analysis::hf_derived diff --git a/PWGLF/TableProducer/Common/spvector.cxx b/PWGLF/TableProducer/Common/spvector.cxx index d3318cd1aa7..12dae20d07d 100644 --- a/PWGLF/TableProducer/Common/spvector.cxx +++ b/PWGLF/TableProducer/Common/spvector.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. // -// \author: prottay das 07/09/2024 +// \author: prottay das 23/12/2024 // \email: prottay.das@cern.ch // C++/ROOT includes. @@ -87,20 +87,11 @@ struct spvector { Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; Configurable cfgCutCentralityMax{"cfgCutCentralityMax", 80.0f, "Centrality cut Max"}; Configurable cfgCutCentralityMin{"cfgCutCentralityMin", 0.0f, "Centrality cut Min"}; - Configurable cfgCutPT{"cfgCutPT", 0.15, "PT cut on daughter track"}; - Configurable cfgCutPTMax{"cfgCutPTMax", 3.0, "Max PT cut on daughter track"}; - Configurable cfgCutEta{"cfgCutEta", 0.8, "Eta cut on daughter track"}; - Configurable cfgMinEta{"cfgMinEta", 0.1, "Min Eta cut on daughter track"}; - Configurable cfgCutDCAxy{"cfgCutDCAxy", 2.0f, "DCAxy range for tracks"}; - Configurable cfgCutDCAz{"cfgCutDCAz", 2.0f, "DCAz range for tracks"}; Configurable QxyNbins{"QxyNbins", 100, "Number of bins in QxQy histograms"}; Configurable PhiNbins{"PhiNbins", 100, "Number of bins in phi histogram"}; Configurable lbinQxy{"lbinQxy", -5.0, "lower bin value in QxQy histograms"}; Configurable hbinQxy{"hbinQxy", 5.0, "higher bin value in QxQy histograms"}; - // Configurable ZDCgainNbins{"ZDCgainNbins", 500, "Number of bins in Gaineq histograms"}; - // Configurable lbinZDCgain{"lbinZDCgain", 0.0, "lower bin value in Gaineq histograms"}; - // Configurable hbinZDCgain{"hbinZDCgain", 1000.0, "higher bin value in Gaineq histograms"}; Configurable VxNbins{"VxNbins", 25, "Number of bins in Vx histograms"}; Configurable lbinVx{"lbinVx", -0.05, "lower bin value in Vx histograms"}; Configurable hbinVx{"hbinVx", 0.0, "higher bin value in Vx histograms"}; @@ -125,71 +116,79 @@ struct spvector { Configurable CentfineNbins{"CentfineNbins", 16, "Number of bins in cent fine histograms"}; Configurable lfinebinCent{"lfinebinCent", 0.0, "lower bin value in cent fine histograms"}; Configurable hfinebinCent{"hfinebinCent", 80.0, "higher bin value in cent fine histograms"}; - Configurable QA{"QA", false, "QA histograms"}; Configurable useShift{"useShift", false, "shift histograms"}; - Configurable nshift{"nshift", 10, "no. of iterations in shifting"}; Configurable ispolarization{"ispolarization", false, "Flag to check polarization"}; - Configurable finecorrection{"finecorrection", false, "Flag to check fine correction"}; - Configurable rejbadevent{"rejbadevent", true, "Flag to check bad events"}; - Configurable rejbadeventcent{"rejbadeventcent", true, "Flag to check bad events for cent"}; - Configurable rejbadeventvx{"rejbadeventvx", true, "Flag to check bad events for vx"}; - Configurable rejbadeventvy{"rejbadeventvy", true, "Flag to check bad events for vy"}; - Configurable rejbadeventvz{"rejbadeventvz", true, "Flag to check bad events for vz"}; - Configurable usesparse{"usesparse", false, "flag to use sparse histogram"}; - Configurable usenormqn{"usenormqn", true, "flag to use normalized qs"}; - Configurable refsys{"refsys", true, "flag to use own reference system"}; Configurable followpub{"followpub", true, "flag to use alphaZDC"}; Configurable useGainCallib{"useGainCallib", false, "use gain calibration"}; + Configurable useCallibvertex{"useCallibvertex", false, "use calibration for vxy"}; + Configurable coarse1{"coarse1", false, "RE1"}; + Configurable fine1{"fine1", false, "REfine1"}; + Configurable coarse2{"coarse2", false, "RE2"}; + Configurable fine2{"fine2", false, "REfine2"}; + Configurable coarse3{"coarse3", false, "RE3"}; + Configurable fine3{"fine3", false, "REfine3"}; + Configurable coarse4{"coarse4", false, "RE4"}; + Configurable fine4{"fine4", false, "REfine4"}; + Configurable coarse5{"coarse5", false, "RE5"}; + Configurable fine5{"fine5", false, "REfine5"}; + Configurable coarse6{"coarse6", false, "RE6"}; Configurable useRecentereSp{"useRecentereSp", false, "use Recentering with Sparse or THn"}; - Configurable useRecenterefineSp{"useRecenterefineSp", false, "use fine Recentering with Sparse or THn"}; - Configurable useRecenteresqSp{"useRecenteresqSp", false, "use Recenteringsq with Sparse or THn"}; - Configurable recwitherror{"recwitherror", false, "use Recentering with error"}; - Configurable recfinewitherror{"recfinewitherror", false, "use Recentering fine with error"}; + Configurable useRecenterefineSp{"useRecenterefineSp", false, "use fine Recentering with THn"}; Configurable ConfGainPath{"ConfGainPath", "Users/p/prottay/My/Object/NewPbPbpass4_10092024/gaincallib", "Path to gain calibration"}; + Configurable ConfGainPathvxy{"ConfGainPathvxy", "Users/p/prottay/My/Object/swapcoords/PbPbpass4_20112024/recentervert", "Path to gain calibration for vxy"}; Configurable ConfRecentereSp{"ConfRecentereSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for recentere"}; + Configurable ConfRecentereSp2{"ConfRecentereSp2", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for recentere2"}; + Configurable ConfRecentereSp3{"ConfRecentereSp3", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for recentere3"}; + Configurable ConfRecentereSp4{"ConfRecentereSp4", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for recentere4"}; + Configurable ConfRecentereSp5{"ConfRecentereSp5", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for recentere5"}; + Configurable ConfRecentereSp6{"ConfRecentereSp6", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for recentere6"}; Configurable ConfRecenterecentSp{"ConfRecenterecentSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for cent recentere"}; Configurable ConfRecenterevxSp{"ConfRecenterevxSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vx recentere"}; Configurable ConfRecenterevySp{"ConfRecenterevySp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vy recentere"}; Configurable ConfRecenterevzSp{"ConfRecenterevzSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vz recentere"}; - Configurable ConfRecenteresqSp{"ConfRecenteresqSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for recenteresq"}; + Configurable ConfRecenterecentSp2{"ConfRecenterecentSp2", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for cent recentere2"}; + Configurable ConfRecenterevxSp2{"ConfRecenterevxSp2", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vx recentere2"}; + Configurable ConfRecenterevySp2{"ConfRecenterevySp2", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vy recentere2"}; + Configurable ConfRecenterevzSp2{"ConfRecenterevzSp2", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vz recentere2"}; + Configurable ConfRecenterecentSp3{"ConfRecenterecentSp3", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for cent recentere3"}; + Configurable ConfRecenterevxSp3{"ConfRecenterevxSp3", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vx recentere3"}; + Configurable ConfRecenterevySp3{"ConfRecenterevySp3", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vy recentere3"}; + Configurable ConfRecenterevzSp3{"ConfRecenterevzSp3", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vz recentere3"}; + Configurable ConfRecenterecentSp4{"ConfRecenterecentSp4", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for cent recentere4"}; + Configurable ConfRecenterevxSp4{"ConfRecenterevxSp4", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vx recentere4"}; + Configurable ConfRecenterevySp4{"ConfRecenterevySp4", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vy recentere4"}; + Configurable ConfRecenterevzSp4{"ConfRecenterevzSp4", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vz recentere4"}; + Configurable ConfRecenterecentSp5{"ConfRecenterecentSp5", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for cent recentere5"}; + Configurable ConfRecenterevxSp5{"ConfRecenterevxSp5", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vx recentere5"}; + Configurable ConfRecenterevySp5{"ConfRecenterevySp5", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vy recentere5"}; + Configurable ConfRecenterevzSp5{"ConfRecenterevzSp5", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vz recentere5"}; Configurable ConfShiftC{"ConfShiftC", "Users/p/prottay/My/Object/Testinglocaltree/shiftcallib2", "Path to shift C"}; Configurable ConfShiftA{"ConfShiftA", "Users/p/prottay/My/Object/Testinglocaltree/shiftcallib2", "Path to shift A"}; // Event selection cuts - Alex + /* TF1* fMultPVCutLow = nullptr; TF1* fMultPVCutHigh = nullptr; TF1* fMultCutLow = nullptr; TF1* fMultCutHigh = nullptr; TF1* fMultMultPVCut = nullptr; - - int mRunNumber{-1}; - + */ + /* template bool eventSelected(TCollision collision, const double& centrality) { - auto multNTracksPV = collision.multNTracksPV(); - if (multNTracksPV < fMultPVCutLow->Eval(centrality)) - return 0; - if (multNTracksPV > fMultPVCutHigh->Eval(centrality)) - return 0; + auto multNTracksPV = collision.multNTracksPV(); + if (multNTracksPV < fMultPVCutLow->Eval(centrality)) + return 0; + if (multNTracksPV > fMultPVCutHigh->Eval(centrality)) + return 0; return 1; } - - void initCCDB(BCsRun3::iterator const& bc) - { - if (mRunNumber == bc.runNumber()) { - return; - } - mRunNumber = bc.runNumber(); - } - + */ void init(o2::framework::InitContext&) { - // const AxisSpec centAxis{configAxisCentrality, "V0M (%)"}; - // AxisSpec amplitudeZDC = {configAxisZDCgain, "ZDC amplitude"}; - // AxisSpec amplitudeZDC = {ZDCgainNbins, lbinZDCgain, hbinZDCgain, "ZDC amplitude"}; AxisSpec channelZDCAxis = {8, 0.0, 8.0, "ZDC tower"}; AxisSpec qxZDCAxis = {QxyNbins, lbinQxy, hbinQxy, "Qx"}; AxisSpec phiAxis = {PhiNbins, -6.28, 6.28, "phi"}; @@ -203,66 +202,54 @@ struct spvector { AxisSpec centfineAxis = {CentfineNbins, lfinebinCent, hfinebinCent, "V0M (%) fine"}; AxisSpec shiftAxis = {10, 0, 10, "shift"}; AxisSpec basisAxis = {2, 0, 2, "basis"}; + AxisSpec VxyAxis = {2, 0, 2, "Vxy"}; histos.add("hCentrality", "hCentrality", kTH1F, {{centfineAxis}}); + histos.add("Vz", "Vz", kTH1F, {vzfineAxis}); histos.add("hpQxZDCAC", "hpQxZDCAC", kTProfile, {centfineAxis}); histos.add("hpQyZDCAC", "hpQyZDCAC", kTProfile, {centfineAxis}); histos.add("hpQxZDCAQyZDCC", "hpQxZDCAQyZDCC", kTProfile, {centfineAxis}); histos.add("hpQxZDCCQyZDCA", "hpQxZDCCQyZDCA", kTProfile, {centfineAxis}); if (!ispolarization) { - if (usesparse == 1) { - histos.add("hsQxZDCA", "hsQxZDCA", kTHnSparseF, {{centAxis}, {vxAxis}, {vyAxis}, {vzAxis}, {qxZDCAxis}}); - histos.add("hsQyZDCA", "hsQyZDCA", kTHnSparseF, {{centAxis}, {vxAxis}, {vyAxis}, {vzAxis}, {qxZDCAxis}}); - histos.add("hsQxZDCC", "hsQxZDCC", kTHnSparseF, {{centAxis}, {vxAxis}, {vyAxis}, {vzAxis}, {qxZDCAxis}}); - histos.add("hsQyZDCC", "hsQyZDCC", kTHnSparseF, {{centAxis}, {vxAxis}, {vyAxis}, {vzAxis}, {qxZDCAxis}}); - } else { - histos.add("hnQxZDCA", "hnQxZDCA", kTHnF, {{centAxis}, {vxAxis}, {vyAxis}, {vzAxis}, {qxZDCAxis}}); - histos.add("hnQyZDCA", "hnQyZDCA", kTHnF, {{centAxis}, {vxAxis}, {vyAxis}, {vzAxis}, {qxZDCAxis}}); - histos.add("hnQxZDCC", "hnQxZDCC", kTHnF, {{centAxis}, {vxAxis}, {vyAxis}, {vzAxis}, {qxZDCAxis}}); - histos.add("hnQyZDCC", "hnQyZDCC", kTHnF, {{centAxis}, {vxAxis}, {vyAxis}, {vzAxis}, {qxZDCAxis}}); - - if (finecorrection) { - histos.add("hcentQxZDCA", "hcentQxZDCA", kTH2F, {{centfineAxis}, {qxZDCAxis}}); - histos.add("hcentQyZDCA", "hcentQyZDCA", kTH2F, {{centfineAxis}, {qxZDCAxis}}); - histos.add("hcentQxZDCC", "hcentQxZDCC", kTH2F, {{centfineAxis}, {qxZDCAxis}}); - histos.add("hcentQyZDCC", "hcentQyZDCC", kTH2F, {{centfineAxis}, {qxZDCAxis}}); - - histos.add("hvxQxZDCA", "hvxQxZDCA", kTH2F, {{vxfineAxis}, {qxZDCAxis}}); - histos.add("hvxQyZDCA", "hvxQyZDCA", kTH2F, {{vxfineAxis}, {qxZDCAxis}}); - histos.add("hvxQxZDCC", "hvxQxZDCC", kTH2F, {{vxfineAxis}, {qxZDCAxis}}); - histos.add("hvxQyZDCC", "hvxQyZDCC", kTH2F, {{vxfineAxis}, {qxZDCAxis}}); - - histos.add("hvyQxZDCA", "hvyQxZDCA", kTH2F, {{vyfineAxis}, {qxZDCAxis}}); - histos.add("hvyQyZDCA", "hvyQyZDCA", kTH2F, {{vyfineAxis}, {qxZDCAxis}}); - histos.add("hvyQxZDCC", "hvyQxZDCC", kTH2F, {{vyfineAxis}, {qxZDCAxis}}); - histos.add("hvyQyZDCC", "hvyQyZDCC", kTH2F, {{vyfineAxis}, {qxZDCAxis}}); - - histos.add("hvzQxZDCA", "hvzQxZDCA", kTH2F, {{vzfineAxis}, {qxZDCAxis}}); - histos.add("hvzQyZDCA", "hvzQyZDCA", kTH2F, {{vzfineAxis}, {qxZDCAxis}}); - histos.add("hvzQxZDCC", "hvzQxZDCC", kTH2F, {{vzfineAxis}, {qxZDCAxis}}); - histos.add("hvzQyZDCC", "hvzQyZDCC", kTH2F, {{vzfineAxis}, {qxZDCAxis}}); - } - } + histos.add("hnQxZDCA", "hnQxZDCA", kTHnF, {{centAxis}, {vxAxis}, {vyAxis}, {vzAxis}, {qxZDCAxis}}); + histos.add("hnQyZDCA", "hnQyZDCA", kTHnF, {{centAxis}, {vxAxis}, {vyAxis}, {vzAxis}, {qxZDCAxis}}); + histos.add("hnQxZDCC", "hnQxZDCC", kTHnF, {{centAxis}, {vxAxis}, {vyAxis}, {vzAxis}, {qxZDCAxis}}); + histos.add("hnQyZDCC", "hnQyZDCC", kTHnF, {{centAxis}, {vxAxis}, {vyAxis}, {vzAxis}, {qxZDCAxis}}); + + histos.add("hcentQxZDCA", "hcentQxZDCA", kTH2F, {{centfineAxis}, {qxZDCAxis}}); + histos.add("hcentQyZDCA", "hcentQyZDCA", kTH2F, {{centfineAxis}, {qxZDCAxis}}); + histos.add("hcentQxZDCC", "hcentQxZDCC", kTH2F, {{centfineAxis}, {qxZDCAxis}}); + histos.add("hcentQyZDCC", "hcentQyZDCC", kTH2F, {{centfineAxis}, {qxZDCAxis}}); + + histos.add("hvxQxZDCA", "hvxQxZDCA", kTH2F, {{vxfineAxis}, {qxZDCAxis}}); + histos.add("hvxQyZDCA", "hvxQyZDCA", kTH2F, {{vxfineAxis}, {qxZDCAxis}}); + histos.add("hvxQxZDCC", "hvxQxZDCC", kTH2F, {{vxfineAxis}, {qxZDCAxis}}); + histos.add("hvxQyZDCC", "hvxQyZDCC", kTH2F, {{vxfineAxis}, {qxZDCAxis}}); + + histos.add("hvyQxZDCA", "hvyQxZDCA", kTH2F, {{vyfineAxis}, {qxZDCAxis}}); + histos.add("hvyQyZDCA", "hvyQyZDCA", kTH2F, {{vyfineAxis}, {qxZDCAxis}}); + histos.add("hvyQxZDCC", "hvyQxZDCC", kTH2F, {{vyfineAxis}, {qxZDCAxis}}); + histos.add("hvyQyZDCC", "hvyQyZDCC", kTH2F, {{vyfineAxis}, {qxZDCAxis}}); + + histos.add("hvzQxZDCA", "hvzQxZDCA", kTH2F, {{vzfineAxis}, {qxZDCAxis}}); + histos.add("hvzQyZDCA", "hvzQyZDCA", kTH2F, {{vzfineAxis}, {qxZDCAxis}}); + histos.add("hvzQxZDCC", "hvzQxZDCC", kTH2F, {{vzfineAxis}, {qxZDCAxis}}); + histos.add("hvzQyZDCC", "hvzQyZDCC", kTH2F, {{vzfineAxis}, {qxZDCAxis}}); } histos.add("PsiZDCC", "PsiZDCC", kTH2F, {centfineAxis, phiAxis}); histos.add("PsiZDCA", "PsiZDCA", kTH2F, {centfineAxis, phiAxis}); - // histos.add("ZDCAmp", "ZDCAmp", kTProfile3D, {channelZDCAxis, vzfineAxis, centfineAxis}); histos.add("ZDCAmp", "ZDCAmp", kTProfile2D, {channelZDCAxis, vzfineAxis}); histos.add("ZDCAmpCommon", "ZDCAmpCommon", kTProfile2D, {{2, 0.0, 2.0}, vzfineAxis}); - // histos.add("ZDCAmpCommon", "ZDCAmpCommon", kTProfile3D, {{2,0.0,2.0}, vzfineAxis, centfineAxis}); histos.add("ShiftZDCC", "ShiftZDCC", kTProfile3D, {centfineAxis, basisAxis, shiftAxis}); histos.add("ShiftZDCA", "ShiftZDCA", kTProfile3D, {centfineAxis, basisAxis, shiftAxis}); - - if (QA) { - histos.add("Vz", "Vz", kTH1F, {vzfineAxis}); - histos.add("hpCosPsiAPsiC", "hpCosPsiAPsiC", kTProfile, {centfineAxis}); - histos.add("hpSinPsiAPsiC", "hpSinPsiAPsiC", kTProfile, {centfineAxis}); - } - // histos.add("hZDCAmp", "hZDCAmp", kTHnF, {channelZDCAxis, vzAxis, centfineAxis, {1000, 0, 1000}}); + histos.add("hpCosPsiAPsiC", "hpCosPsiAPsiC", kTProfile, {centfineAxis}); + histos.add("hpSinPsiAPsiC", "hpSinPsiAPsiC", kTProfile, {centfineAxis}); + histos.add("AvgVxy", "AvgVxy", kTProfile, {VxyAxis}); // Event selection cut additional - Alex + /* fMultPVCutLow = new TF1("fMultPVCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x - 2.5*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)", 0, 100); fMultPVCutLow->SetParameters(2834.66, -87.0127, 0.915126, -0.00330136, 332.513, -12.3476, 0.251663, -0.00272819, 1.12242e-05); fMultPVCutHigh = new TF1("fMultPVCutHigh", "[0]+[1]*x+[2]*x*x+[3]*x*x*x + 2.5*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)", 0, 100); @@ -273,7 +260,7 @@ struct spvector { fMultCutHigh->SetParameters(1893.94, -53.86, 0.502913, -0.0015122, 109.625, -1.19253); fMultMultPVCut = new TF1("fMultMultPVCut", "[0]+[1]*x+[2]*x*x", 0, 5000); fMultMultPVCut->SetParameters(-0.1, 0.785, -4.7e-05); - + */ ccdb->setURL(cfgCcdbParam.cfgURL); ccdbApi.init("http://alice-ccdb.cern.ch"); ccdb->setCaching(true); @@ -283,25 +270,103 @@ struct spvector { int currentRunNumber = -999; int lastRunNumber = -999; - // TH3D* gainprofile; TH2D* gainprofile; + TProfile* gainprofilevxy; THnF* hrecentereSp; TH2F* hrecenterecentSp; TH2F* hrecenterevxSp; TH2F* hrecenterevySp; TH2F* hrecenterevzSp; - THnF* hrecenteresqSp; TProfile3D* shiftprofileA; TProfile3D* shiftprofileC; - // Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; - // Filter centralityFilter = (nabs(aod::cent::centFT0C) < cfgCutCentralityMax && nabs(aod::cent::centFT0C) > cfgCutCentralityMin); - // Filter acceptanceFilter = (nabs(aod::track::eta) < cfgCutEta && nabs(aod::track::pt) > cfgCutPT); - // Filter DCAcutFilter = (nabs(aod::track::dcaXY) < cfgCutDCAxy) && (nabs(aod::track::dcaZ) < cfgCutDCAz); + Bool_t Correctcoarse(int64_t ts, Configurable& ConfRecentereSpp, bool useRecentereSp, int currentRunNumber, int lastRunNumber, auto centrality, auto vx, auto vy, auto vz, auto& qxZDCA, auto& qyZDCA, auto& qxZDCC, auto& qyZDCC) + { - using MyCollisions = soa::Join; - // using MyTracks = soa::Filtered>; + if (useRecentereSp && (currentRunNumber != lastRunNumber)) { + hrecentereSp = ccdb->getForTimeStamp(ConfRecentereSpp.value, ts); + } + + int binCoords[5]; + + // Get axes of the THnSparse + TAxis* centralityAxis = hrecentereSp->GetAxis(0); // Axis 0: centrality + TAxis* vxAxis = hrecentereSp->GetAxis(1); // Axis 1: vx + TAxis* vyAxis = hrecentereSp->GetAxis(2); // Axis 2: vy + TAxis* vzAxis = hrecentereSp->GetAxis(3); // Axis 3: vz + TAxis* channelAxis = hrecentereSp->GetAxis(4); // Axis 4: channel + + // Find bin indices for centrality, vx, vy, vz, and channel (for meanxA, 0.5) + binCoords[0] = centralityAxis->FindBin(centrality); // Centrality + binCoords[1] = vxAxis->FindBin(vx); // vx + binCoords[2] = vyAxis->FindBin(vy); // vy + binCoords[3] = vzAxis->FindBin(vz); // vz + binCoords[4] = channelAxis->FindBin(0.5); // Channel for meanxA + + // Get the global bin for meanxA + int globalBinMeanxA = hrecentereSp->GetBin(binCoords); + float meanxA = hrecentereSp->GetBinContent(globalBinMeanxA); + + // Repeat for other channels (meanyA, meanxC, meanyC) + binCoords[4] = channelAxis->FindBin(1.5); // Channel for meanyA + int globalBinMeanyA = hrecentereSp->GetBin(binCoords); + float meanyA = hrecentereSp->GetBinContent(globalBinMeanyA); + + binCoords[4] = channelAxis->FindBin(2.5); // Channel for meanxC + int globalBinMeanxC = hrecentereSp->GetBin(binCoords); + float meanxC = hrecentereSp->GetBinContent(globalBinMeanxC); + + binCoords[4] = channelAxis->FindBin(3.5); // Channel for meanyC + int globalBinMeanyC = hrecentereSp->GetBin(binCoords); + float meanyC = hrecentereSp->GetBinContent(globalBinMeanyC); + + qxZDCA = qxZDCA - meanxA; + qyZDCA = qyZDCA - meanyA; + qxZDCC = qxZDCC - meanxC; + qyZDCC = qyZDCC - meanyC; + + return kTRUE; + } + + Bool_t Correctfine(int64_t ts, Configurable& ConfRecenterecentSpp, Configurable& ConfRecenterevxSpp, Configurable& ConfRecenterevySpp, Configurable& ConfRecenterevzSpp, bool useRecenterefineSp, int currentRunNumber, int lastRunNumber, auto centrality, auto vx, auto vy, auto vz, auto& qxZDCA, auto& qyZDCA, auto& qxZDCC, auto& qyZDCC) + { + + if (useRecenterefineSp && (currentRunNumber != lastRunNumber)) { + hrecenterecentSp = ccdb->getForTimeStamp(ConfRecenterecentSpp.value, ts); + hrecenterevxSp = ccdb->getForTimeStamp(ConfRecenterevxSpp.value, ts); + hrecenterevySp = ccdb->getForTimeStamp(ConfRecenterevySpp.value, ts); + hrecenterevzSp = ccdb->getForTimeStamp(ConfRecenterevzSpp.value, ts); + } + + double meanxAcent = hrecenterecentSp->GetBinContent(hrecenterecentSp->FindBin(centrality, 0.5)); + double meanyAcent = hrecenterecentSp->GetBinContent(hrecenterecentSp->FindBin(centrality, 1.5)); + double meanxCcent = hrecenterecentSp->GetBinContent(hrecenterecentSp->FindBin(centrality, 2.5)); + double meanyCcent = hrecenterecentSp->GetBinContent(hrecenterecentSp->FindBin(centrality, 3.5)); + + double meanxAvx = hrecenterevxSp->GetBinContent(hrecenterevxSp->FindBin(vx, 0.5)); + double meanyAvx = hrecenterevxSp->GetBinContent(hrecenterevxSp->FindBin(vx, 1.5)); + double meanxCvx = hrecenterevxSp->GetBinContent(hrecenterevxSp->FindBin(vx, 2.5)); + double meanyCvx = hrecenterevxSp->GetBinContent(hrecenterevxSp->FindBin(vx, 3.5)); + + double meanxAvy = hrecenterevySp->GetBinContent(hrecenterevySp->FindBin(vy, 0.5)); + double meanyAvy = hrecenterevySp->GetBinContent(hrecenterevySp->FindBin(vy, 1.5)); + double meanxCvy = hrecenterevySp->GetBinContent(hrecenterevySp->FindBin(vy, 2.5)); + double meanyCvy = hrecenterevySp->GetBinContent(hrecenterevySp->FindBin(vy, 3.5)); + + double meanxAvz = hrecenterevzSp->GetBinContent(hrecenterevzSp->FindBin(vz, 0.5)); + double meanyAvz = hrecenterevzSp->GetBinContent(hrecenterevzSp->FindBin(vz, 1.5)); + double meanxCvz = hrecenterevzSp->GetBinContent(hrecenterevzSp->FindBin(vz, 2.5)); + double meanyCvz = hrecenterevzSp->GetBinContent(hrecenterevzSp->FindBin(vz, 3.5)); + qxZDCA = qxZDCA - meanxAcent - meanxAvx - meanxAvy - meanxAvz; + qyZDCA = qyZDCA - meanyAcent - meanyAvx - meanyAvy - meanyAvz; + qxZDCC = qxZDCC - meanxCcent - meanxCvx - meanxCvy - meanxCvz; + qyZDCC = qyZDCC - meanyCcent - meanyCvx - meanyCvy - meanyCvz; + + return kTRUE; + } + + using MyCollisions = soa::Join; Preslice zdcPerCollision = aod::collision::bcId; void process(MyCollisions::iterator const& collision, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0s*/, BCsRun3 const& bcs, aod::Zdcs const&) @@ -359,31 +424,24 @@ struct spvector { return; } - if (collision.sel8() && centrality > cfgCutCentralityMin && centrality < cfgCutCentralityMax && TMath::Abs(vz) < cfgCutVertex && collision.has_foundFT0() && eventSelected(collision, centrality) && collision.selection_bit(aod::evsel::kNoTimeFrameBorder) && collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) { + // if (collision.sel8() && centrality > cfgCutCentralityMin && centrality < cfgCutCentralityMax && TMath::Abs(vz) < cfgCutVertex && collision.has_foundFT0() && eventSelected(collision, centrality) && collision.selection_bit(aod::evsel::kNoTimeFrameBorder) && collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) { + if (collision.sel8() && centrality > cfgCutCentralityMin && centrality < cfgCutCentralityMax && TMath::Abs(vz) < cfgCutVertex && collision.has_foundFT0() && collision.selection_bit(aod::evsel::kNoTimeFrameBorder) && collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) { triggerevent = true; if (useGainCallib && (currentRunNumber != lastRunNumber)) { - // gainprofile = ccdb->getForTimeStamp(ConfGainPath.value, bc.timestamp()); gainprofile = ccdb->getForTimeStamp(ConfGainPath.value, bc.timestamp()); } - // initCCDB(bc); - auto gainequal = 1.0; auto alphaZDC = 0.395; constexpr double x[4] = {-1.75, 1.75, -1.75, 1.75}; constexpr double y[4] = {-1.75, -1.75, 1.75, 1.75}; - // histos.fill(HIST("ZDCAmpCommon"), 0.5, vz, centrality, znaEnergycommon); - // histos.fill(HIST("ZDCAmpCommon"), 1.5, vz, centrality, zncEnergycommon); histos.fill(HIST("ZDCAmpCommon"), 0.5, vz, znaEnergycommon); histos.fill(HIST("ZDCAmpCommon"), 1.5, vz, zncEnergycommon); - // LOG(info) << "**********energy values************" << znaEnergycommon<<" "<GetBinContent(gainprofile->FindBin(vz, centrality, chanelid + 0.5)); gainequal = gainprofile->GetBinContent(gainprofile->FindBin(vz, chanelid + 0.5)); } @@ -402,7 +460,6 @@ struct spvector { qyZDCA = qyZDCA + ampl * y[iChA]; sumA = sumA + ampl; histos.fill(HIST("ZDCAmp"), chanelid + 0.5, vz, ampl); - // histos.fill(HIST("hZDCAmp"), chanelid + 0.5, vz, centrality, ampl); } } else { if (zncEnergy[iChA - 4] <= 0.0) { @@ -418,21 +475,19 @@ struct spvector { qyZDCC = qyZDCC + ampl * y[iChA - 4]; sumC = sumC + ampl; histos.fill(HIST("ZDCAmp"), chanelid + 0.5, vz, ampl); - // histos.fill(HIST("hZDCAmp"), chanelid + 0.5, vz, centrality, ampl); } } } - if (usenormqn) { - if (sumA > 0) { - qxZDCA = qxZDCA / sumA; - qyZDCA = qyZDCA / sumA; - } - if (sumC > 0) { - qxZDCC = qxZDCC / sumC; - qyZDCC = qyZDCC / sumC; - } + if (sumA > 0) { + qxZDCA = qxZDCA / sumA; + qyZDCA = qyZDCA / sumA; + } + if (sumC > 0) { + qxZDCC = qxZDCC / sumC; + qyZDCC = qyZDCC / sumC; } + if (sumA <= 1e-4 || sumC <= 1e-4) { qxZDCA = 0.0; qxZDCC = 0.0; @@ -446,228 +501,77 @@ struct spvector { histos.fill(HIST("hCentrality"), centrality); histos.fill(HIST("Vz"), vz); - if (useRecentereSp && (currentRunNumber != lastRunNumber)) { - hrecentereSp = ccdb->getForTimeStamp(ConfRecentereSp.value, bc.timestamp()); - } - if (useRecenterefineSp && (currentRunNumber != lastRunNumber)) { - hrecenterecentSp = ccdb->getForTimeStamp(ConfRecenterecentSp.value, bc.timestamp()); - hrecenterevxSp = ccdb->getForTimeStamp(ConfRecenterevxSp.value, bc.timestamp()); - hrecenterevySp = ccdb->getForTimeStamp(ConfRecenterevySp.value, bc.timestamp()); - hrecenterevzSp = ccdb->getForTimeStamp(ConfRecenterevzSp.value, bc.timestamp()); - } - if (useRecenteresqSp && (currentRunNumber != lastRunNumber)) { - hrecenteresqSp = ccdb->getForTimeStamp(ConfRecenteresqSp.value, bc.timestamp()); - } + histos.fill(HIST("AvgVxy"), 0.5, vx); + histos.fill(HIST("AvgVxy"), 1.5, vy); - if (useRecentereSp && hrecentereSp) { - - int binCoords[5]; - - // Get axes of the THnSparse - TAxis* centralityAxis = hrecentereSp->GetAxis(0); // Axis 0: centrality - TAxis* vxAxis = hrecentereSp->GetAxis(1); // Axis 1: vx - TAxis* vyAxis = hrecentereSp->GetAxis(2); // Axis 2: vy - TAxis* vzAxis = hrecentereSp->GetAxis(3); // Axis 3: vz - TAxis* channelAxis = hrecentereSp->GetAxis(4); // Axis 4: channel - - // Find bin indices for centrality, vx, vy, vz, and channel (for meanxA, 0.5) - binCoords[0] = centralityAxis->FindBin(centrality); // Centrality - binCoords[1] = vxAxis->FindBin(vx); // vx - binCoords[2] = vyAxis->FindBin(vy); // vy - binCoords[3] = vzAxis->FindBin(vz); // vz - binCoords[4] = channelAxis->FindBin(0.5); // Channel for meanxA - - // Get the global bin for meanxA - int globalBinMeanxA = hrecentereSp->GetBin(binCoords); - double meanxA = hrecentereSp->GetBinContent(globalBinMeanxA); - double meanxAerror = hrecentereSp->GetBinError(globalBinMeanxA); - - // Repeat for other channels (meanyA, meanxC, meanyC) - binCoords[4] = channelAxis->FindBin(1.5); // Channel for meanyA - int globalBinMeanyA = hrecentereSp->GetBin(binCoords); - double meanyA = hrecentereSp->GetBinContent(globalBinMeanyA); - double meanyAerror = hrecentereSp->GetBinError(globalBinMeanyA); - - binCoords[4] = channelAxis->FindBin(2.5); // Channel for meanxC - int globalBinMeanxC = hrecentereSp->GetBin(binCoords); - double meanxC = hrecentereSp->GetBinContent(globalBinMeanxC); - double meanxCerror = hrecentereSp->GetBinError(globalBinMeanxC); - - binCoords[4] = channelAxis->FindBin(3.5); // Channel for meanyC - int globalBinMeanyC = hrecentereSp->GetBin(binCoords); - double meanyC = hrecentereSp->GetBinContent(globalBinMeanyC); - double meanyCerror = hrecentereSp->GetBinError(globalBinMeanyC); - - if (rejbadevent) { - if ((TMath::Abs(meanxA) > 90000.0 || TMath::Abs(meanxC) > 90000.0 || TMath::Abs(meanyA) > 90000.0 || TMath::Abs(meanyC) > 90000.0) && (TMath::Abs(meanxAerror) > 9000.0 || TMath::Abs(meanxCerror) > 9000.0 || TMath::Abs(meanyAerror) > 9000.0 || TMath::Abs(meanyCerror) > 9000.0)) { - triggerevent = false; - spcalibrationtable(triggerevent, currentRunNumber, centrality, vx, vy, vz, znaEnergycommon, zncEnergycommon, znaEnergy[0], znaEnergy[1], znaEnergy[2], znaEnergy[3], zncEnergy[0], zncEnergy[1], zncEnergy[2], zncEnergy[3], qxZDCA, qxZDCC, qyZDCA, qyZDCC, psiZDCC, psiZDCA); - return; - } - } - - qxZDCA = qxZDCA - meanxA; - qyZDCA = qyZDCA - meanyA; - qxZDCC = qxZDCC - meanxC; - qyZDCC = qyZDCC - meanyC; - - if (recwitherror) { - if (meanxAerror != 0.0) { - qxZDCA = qxZDCA / meanxAerror; - } - if (meanyAerror != 0.0) { - qyZDCA = qyZDCA / meanyAerror; - } - if (meanxCerror != 0.0) { - qxZDCC = qxZDCC / meanxCerror; - } - if (meanyCerror != 0.0) { - qyZDCC = qyZDCC / meanyCerror; - } - } + if (useCallibvertex && (currentRunNumber != lastRunNumber)) { + gainprofilevxy = ccdb->getForTimeStamp(ConfGainPathvxy.value, bc.timestamp()); } - if (useRecenterefineSp && hrecenterecentSp) { - - double meanxAcent = hrecenterecentSp->GetBinContent(hrecenterecentSp->FindBin(centrality, 0.5)); - double meanyAcent = hrecenterecentSp->GetBinContent(hrecenterecentSp->FindBin(centrality, 1.5)); - double meanxCcent = hrecenterecentSp->GetBinContent(hrecenterecentSp->FindBin(centrality, 2.5)); - double meanyCcent = hrecenterecentSp->GetBinContent(hrecenterecentSp->FindBin(centrality, 3.5)); - - double meanxAcenterror = hrecenterecentSp->GetBinError(hrecenterecentSp->FindBin(centrality, 0.5)); - double meanyAcenterror = hrecenterecentSp->GetBinError(hrecenterecentSp->FindBin(centrality, 1.5)); - double meanxCcenterror = hrecenterecentSp->GetBinError(hrecenterecentSp->FindBin(centrality, 2.5)); - double meanyCcenterror = hrecenterecentSp->GetBinError(hrecenterecentSp->FindBin(centrality, 3.5)); - - if (rejbadeventcent) { - if ((TMath::Abs(meanxAcent) > 90000.0 || TMath::Abs(meanxCcent) > 90000.0 || TMath::Abs(meanyAcent) > 90000.0 || TMath::Abs(meanyCcent) > 90000.0) && (TMath::Abs(meanxAcenterror) > 9000.0 || TMath::Abs(meanxCcenterror) > 9000.0 || TMath::Abs(meanyAcenterror) > 9000.0 || TMath::Abs(meanyCcenterror) > 9000.0)) { - triggerevent = false; - spcalibrationtable(triggerevent, currentRunNumber, centrality, vx, vy, vz, znaEnergycommon, zncEnergycommon, znaEnergy[0], znaEnergy[1], znaEnergy[2], znaEnergy[3], zncEnergy[0], zncEnergy[1], zncEnergy[2], zncEnergy[3], qxZDCA, qxZDCC, qyZDCA, qyZDCC, psiZDCC, psiZDCA); - return; - } - } - - qxZDCA = qxZDCA - hrecenterecentSp->GetBinContent(hrecenterecentSp->FindBin(centrality, 0.5)); - qyZDCA = qyZDCA - hrecenterecentSp->GetBinContent(hrecenterecentSp->FindBin(centrality, 1.5)); - qxZDCC = qxZDCC - hrecenterecentSp->GetBinContent(hrecenterecentSp->FindBin(centrality, 2.5)); - qyZDCC = qyZDCC - hrecenterecentSp->GetBinContent(hrecenterecentSp->FindBin(centrality, 3.5)); - - if (recfinewitherror) { - qxZDCA = qxZDCA / meanxAcenterror; - qyZDCA = qyZDCA / meanyAcenterror; - qxZDCC = qxZDCC / meanxCcenterror; - qyZDCC = qyZDCC / meanyCcenterror; - } + if (useCallibvertex) { + vx = vx - gainprofilevxy->GetBinContent(1); + vy = vy - gainprofilevxy->GetBinContent(2); } - if (useRecenterefineSp && hrecenterevxSp) { - - double meanxAvx = hrecenterevxSp->GetBinContent(hrecenterevxSp->FindBin(vx, 0.5)); - double meanyAvx = hrecenterevxSp->GetBinContent(hrecenterevxSp->FindBin(vx, 1.5)); - double meanxCvx = hrecenterevxSp->GetBinContent(hrecenterevxSp->FindBin(vx, 2.5)); - double meanyCvx = hrecenterevxSp->GetBinContent(hrecenterevxSp->FindBin(vx, 3.5)); - - double meanxAvxerror = hrecenterevxSp->GetBinError(hrecenterevxSp->FindBin(vx, 0.5)); - double meanyAvxerror = hrecenterevxSp->GetBinError(hrecenterevxSp->FindBin(vx, 1.5)); - double meanxCvxerror = hrecenterevxSp->GetBinError(hrecenterevxSp->FindBin(vx, 2.5)); - double meanyCvxerror = hrecenterevxSp->GetBinError(hrecenterevxSp->FindBin(vx, 3.5)); + Bool_t res = 0; + Bool_t resfine = 0; - if (rejbadeventvx) { - if ((TMath::Abs(meanxAvx) > 90000.0 || TMath::Abs(meanxCvx) > 90000.0 || TMath::Abs(meanyAvx) > 90000.0 || TMath::Abs(meanyCvx) > 90000.0) && (TMath::Abs(meanxAvxerror) > 9000.0 || TMath::Abs(meanxCvxerror) > 9000.0 || TMath::Abs(meanyAvxerror) > 9000.0 || TMath::Abs(meanyCvxerror) > 9000.0)) { - triggerevent = false; - spcalibrationtable(triggerevent, currentRunNumber, centrality, vx, vy, vz, znaEnergycommon, zncEnergycommon, znaEnergy[0], znaEnergy[1], znaEnergy[2], znaEnergy[3], zncEnergy[0], zncEnergy[1], zncEnergy[2], zncEnergy[3], qxZDCA, qxZDCC, qyZDCA, qyZDCC, psiZDCC, psiZDCA); - return; - } - } - - qxZDCA = qxZDCA - hrecenterevxSp->GetBinContent(hrecenterevxSp->FindBin(vx, 0.5)); - qyZDCA = qyZDCA - hrecenterevxSp->GetBinContent(hrecenterevxSp->FindBin(vx, 1.5)); - qxZDCC = qxZDCC - hrecenterevxSp->GetBinContent(hrecenterevxSp->FindBin(vx, 2.5)); - qyZDCC = qyZDCC - hrecenterevxSp->GetBinContent(hrecenterevxSp->FindBin(vx, 3.5)); - - if (recfinewitherror) { - qxZDCA = qxZDCA / meanxAvxerror; - qyZDCA = qyZDCA / meanyAvxerror; - qxZDCC = qxZDCC / meanxCvxerror; - qyZDCC = qyZDCC / meanyCvxerror; - } + if (coarse1) { + res = Correctcoarse(bc.timestamp(), ConfRecentereSp, useRecentereSp, currentRunNumber, lastRunNumber, centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); } - if (useRecenterefineSp && hrecenterevySp) { - - double meanxAvy = hrecenterevySp->GetBinContent(hrecenterevySp->FindBin(vy, 0.5)); - double meanyAvy = hrecenterevySp->GetBinContent(hrecenterevySp->FindBin(vy, 1.5)); - double meanxCvy = hrecenterevySp->GetBinContent(hrecenterevySp->FindBin(vy, 2.5)); - double meanyCvy = hrecenterevySp->GetBinContent(hrecenterevySp->FindBin(vy, 3.5)); - - double meanxAvyerror = hrecenterevySp->GetBinError(hrecenterevySp->FindBin(vy, 0.5)); - double meanyAvyerror = hrecenterevySp->GetBinError(hrecenterevySp->FindBin(vy, 1.5)); - double meanxCvyerror = hrecenterevySp->GetBinError(hrecenterevySp->FindBin(vy, 2.5)); - double meanyCvyerror = hrecenterevySp->GetBinError(hrecenterevySp->FindBin(vy, 3.5)); - - if (rejbadeventvy) { - if ((TMath::Abs(meanxAvy) > 90000.0 || TMath::Abs(meanxCvy) > 90000.0 || TMath::Abs(meanyAvy) > 90000.0 || TMath::Abs(meanyCvy) > 90000.0) && (TMath::Abs(meanxAvyerror) > 9000.0 || TMath::Abs(meanxCvyerror) > 9000.0 || TMath::Abs(meanyAvyerror) > 9000.0 || TMath::Abs(meanyCvyerror) > 9000.0)) { - triggerevent = false; - spcalibrationtable(triggerevent, currentRunNumber, centrality, vx, vy, vz, znaEnergycommon, zncEnergycommon, znaEnergy[0], znaEnergy[1], znaEnergy[2], znaEnergy[3], zncEnergy[0], zncEnergy[1], zncEnergy[2], zncEnergy[3], qxZDCA, qxZDCC, qyZDCA, qyZDCC, psiZDCC, psiZDCA); - return; - } - } + if (fine1) { + resfine = Correctfine(bc.timestamp(), ConfRecenterecentSp, ConfRecenterevxSp, ConfRecenterevySp, ConfRecenterevzSp, useRecenterefineSp, currentRunNumber, lastRunNumber, centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); + } - qxZDCA = qxZDCA - hrecenterevySp->GetBinContent(hrecenterevySp->FindBin(vy, 0.5)); - qyZDCA = qyZDCA - hrecenterevySp->GetBinContent(hrecenterevySp->FindBin(vy, 1.5)); - qxZDCC = qxZDCC - hrecenterevySp->GetBinContent(hrecenterevySp->FindBin(vy, 2.5)); - qyZDCC = qyZDCC - hrecenterevySp->GetBinContent(hrecenterevySp->FindBin(vy, 3.5)); + if (coarse2) { + res = Correctcoarse(bc.timestamp(), ConfRecentereSp2, useRecentereSp, currentRunNumber, lastRunNumber, centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); + } - if (recfinewitherror) { - qxZDCA = qxZDCA / meanxAvyerror; - qyZDCA = qyZDCA / meanyAvyerror; - qxZDCC = qxZDCC / meanxCvyerror; - qyZDCC = qyZDCC / meanyCvyerror; - } + if (fine2) { + resfine = Correctfine(bc.timestamp(), ConfRecenterecentSp2, ConfRecenterevxSp2, ConfRecenterevySp2, ConfRecenterevzSp2, useRecenterefineSp, currentRunNumber, lastRunNumber, centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); } - if (useRecenterefineSp && hrecenterevzSp) { + if (coarse3) { + res = Correctcoarse(bc.timestamp(), ConfRecentereSp3, useRecentereSp, currentRunNumber, lastRunNumber, centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); + } - double meanxAvz = hrecenterevzSp->GetBinContent(hrecenterevzSp->FindBin(vz, 0.5)); - double meanyAvz = hrecenterevzSp->GetBinContent(hrecenterevzSp->FindBin(vz, 1.5)); - double meanxCvz = hrecenterevzSp->GetBinContent(hrecenterevzSp->FindBin(vz, 2.5)); - double meanyCvz = hrecenterevzSp->GetBinContent(hrecenterevzSp->FindBin(vz, 3.5)); + if (fine3) { + resfine = Correctfine(bc.timestamp(), ConfRecenterecentSp3, ConfRecenterevxSp3, ConfRecenterevySp3, ConfRecenterevzSp3, useRecenterefineSp, currentRunNumber, lastRunNumber, centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); + } - double meanxAvzerror = hrecenterevzSp->GetBinError(hrecenterevzSp->FindBin(vz, 0.5)); - double meanyAvzerror = hrecenterevzSp->GetBinError(hrecenterevzSp->FindBin(vz, 1.5)); - double meanxCvzerror = hrecenterevzSp->GetBinError(hrecenterevzSp->FindBin(vz, 2.5)); - double meanyCvzerror = hrecenterevzSp->GetBinError(hrecenterevzSp->FindBin(vz, 3.5)); + if (coarse4) { + res = Correctcoarse(bc.timestamp(), ConfRecentereSp4, useRecentereSp, currentRunNumber, lastRunNumber, centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); + } - if (rejbadeventvz) { - if ((TMath::Abs(meanxAvz) > 90000.0 || TMath::Abs(meanxCvz) > 90000.0 || TMath::Abs(meanyAvz) > 90000.0 || TMath::Abs(meanyCvz) > 90000.0) && (TMath::Abs(meanxAvzerror) > 9000.0 || TMath::Abs(meanxCvzerror) > 9000.0 || TMath::Abs(meanyAvzerror) > 9000.0 || TMath::Abs(meanyCvzerror) > 9000.0)) { - triggerevent = false; - spcalibrationtable(triggerevent, currentRunNumber, centrality, vx, vy, vz, znaEnergycommon, zncEnergycommon, znaEnergy[0], znaEnergy[1], znaEnergy[2], znaEnergy[3], zncEnergy[0], zncEnergy[1], zncEnergy[2], zncEnergy[3], qxZDCA, qxZDCC, qyZDCA, qyZDCC, psiZDCC, psiZDCA); - return; - } - } + if (fine4) { + resfine = Correctfine(bc.timestamp(), ConfRecenterecentSp4, ConfRecenterevxSp4, ConfRecenterevySp4, ConfRecenterevzSp4, useRecenterefineSp, currentRunNumber, lastRunNumber, centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); + } - qxZDCA = qxZDCA - hrecenterevzSp->GetBinContent(hrecenterevzSp->FindBin(vz, 0.5)); - qyZDCA = qyZDCA - hrecenterevzSp->GetBinContent(hrecenterevzSp->FindBin(vz, 1.5)); - qxZDCC = qxZDCC - hrecenterevzSp->GetBinContent(hrecenterevzSp->FindBin(vz, 2.5)); - qyZDCC = qyZDCC - hrecenterevzSp->GetBinContent(hrecenterevzSp->FindBin(vz, 3.5)); + if (coarse5) { + res = Correctcoarse(bc.timestamp(), ConfRecentereSp5, useRecentereSp, currentRunNumber, lastRunNumber, centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); + } - if (recfinewitherror) { - qxZDCA = qxZDCA / meanxAvzerror; - qyZDCA = qyZDCA / meanyAvzerror; - qxZDCC = qxZDCC / meanxCvzerror; - qyZDCC = qyZDCC / meanyCvzerror; - } + if (fine5) { + resfine = Correctfine(bc.timestamp(), ConfRecenterecentSp5, ConfRecenterevxSp5, ConfRecenterevySp5, ConfRecenterevzSp5, useRecenterefineSp, currentRunNumber, lastRunNumber, centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); } - // LOG(info) << "**********qxa values in spvector************" << qxZDCA<<" "<getForTimeStamp(ConfShiftC.value, bc.timestamp()); shiftprofileA = ccdb->getForTimeStamp(ConfShiftA.value, bc.timestamp()); } + if (useShift) { auto deltapsiZDCC = 0.0; auto deltapsiZDCA = 0.0; @@ -696,45 +600,34 @@ struct spvector { histos.fill(HIST("hpQxZDCCQyZDCA"), centrality, (qxZDCC * qyZDCA)); if (!ispolarization) { - if (usesparse) { - histos.fill(HIST("hsQxZDCA"), centrality, vx, vy, vz, qxZDCA); - histos.fill(HIST("hsQyZDCA"), centrality, vx, vy, vz, qyZDCA); - histos.fill(HIST("hsQxZDCC"), centrality, vx, vy, vz, qxZDCC); - histos.fill(HIST("hsQyZDCC"), centrality, vx, vy, vz, qyZDCC); - } else { - histos.fill(HIST("hnQxZDCA"), centrality, vx, vy, vz, qxZDCA); - histos.fill(HIST("hnQyZDCA"), centrality, vx, vy, vz, qyZDCA); - histos.fill(HIST("hnQxZDCC"), centrality, vx, vy, vz, qxZDCC); - histos.fill(HIST("hnQyZDCC"), centrality, vx, vy, vz, qyZDCC); - - if (finecorrection) { - histos.fill(HIST("hcentQxZDCA"), centrality, qxZDCA); - histos.fill(HIST("hcentQyZDCA"), centrality, qyZDCA); - histos.fill(HIST("hcentQxZDCC"), centrality, qxZDCC); - histos.fill(HIST("hcentQyZDCC"), centrality, qyZDCC); - - histos.fill(HIST("hvxQxZDCA"), vx, qxZDCA); - histos.fill(HIST("hvxQyZDCA"), vx, qyZDCA); - histos.fill(HIST("hvxQxZDCC"), vx, qxZDCC); - histos.fill(HIST("hvxQyZDCC"), vx, qyZDCC); - - histos.fill(HIST("hvyQxZDCA"), vy, qxZDCA); - histos.fill(HIST("hvyQyZDCA"), vy, qyZDCA); - histos.fill(HIST("hvyQxZDCC"), vy, qxZDCC); - histos.fill(HIST("hvyQyZDCC"), vy, qyZDCC); - - histos.fill(HIST("hvzQxZDCA"), vz, qxZDCA); - histos.fill(HIST("hvzQyZDCA"), vz, qyZDCA); - histos.fill(HIST("hvzQxZDCC"), vz, qxZDCC); - histos.fill(HIST("hvzQyZDCC"), vz, qyZDCC); - } - } + histos.fill(HIST("hnQxZDCA"), centrality, vx, vy, vz, qxZDCA); + histos.fill(HIST("hnQyZDCA"), centrality, vx, vy, vz, qyZDCA); + histos.fill(HIST("hnQxZDCC"), centrality, vx, vy, vz, qxZDCC); + histos.fill(HIST("hnQyZDCC"), centrality, vx, vy, vz, qyZDCC); + + histos.fill(HIST("hcentQxZDCA"), centrality, qxZDCA); + histos.fill(HIST("hcentQyZDCA"), centrality, qyZDCA); + histos.fill(HIST("hcentQxZDCC"), centrality, qxZDCC); + histos.fill(HIST("hcentQyZDCC"), centrality, qyZDCC); + + histos.fill(HIST("hvxQxZDCA"), vx, qxZDCA); + histos.fill(HIST("hvxQyZDCA"), vx, qyZDCA); + histos.fill(HIST("hvxQxZDCC"), vx, qxZDCC); + histos.fill(HIST("hvxQyZDCC"), vx, qyZDCC); + + histos.fill(HIST("hvyQxZDCA"), vy, qxZDCA); + histos.fill(HIST("hvyQyZDCA"), vy, qyZDCA); + histos.fill(HIST("hvyQxZDCC"), vy, qxZDCC); + histos.fill(HIST("hvyQyZDCC"), vy, qyZDCC); + + histos.fill(HIST("hvzQxZDCA"), vz, qxZDCA); + histos.fill(HIST("hvzQyZDCA"), vz, qyZDCA); + histos.fill(HIST("hvzQxZDCC"), vz, qxZDCC); + histos.fill(HIST("hvzQyZDCC"), vz, qyZDCC); } - if (QA) { - histos.fill(HIST("hpCosPsiAPsiC"), centrality, (TMath::Cos(psiZDCA - psiZDCC))); - histos.fill(HIST("hpSinPsiAPsiC"), centrality, (TMath::Sin(psiZDCA - psiZDCC))); - } + histos.fill(HIST("hpCosPsiAPsiC"), centrality, (TMath::Cos(psiZDCA - psiZDCC))); + histos.fill(HIST("hpSinPsiAPsiC"), centrality, (TMath::Sin(psiZDCA - psiZDCC))); histos.fill(HIST("PsiZDCA"), centrality, psiZDCA); histos.fill(HIST("PsiZDCC"), centrality, psiZDCC);