From c11e472790bc4c41337ab1bc957fc674adeb624d Mon Sep 17 00:00:00 2001 From: AlexianL Date: Wed, 19 Jun 2024 13:37:56 +0200 Subject: [PATCH 01/31] Uniformization of the name of the correlation containers --- PWGHF/HFC/Tasks/taskFlow.cxx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 2053295e740..dd46e7278b4 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -101,11 +101,11 @@ struct HfTaskFlow { HistogramRegistry registry{"registry"}; OutputObj sameTPCTPCCh{"sameEventTPCTPCChHadrons"}; - OutputObj sameTPCMFTCh{"sameEventTPCMFTChHadrons"}; - OutputObj sameHF{"sameEventHFHadrons"}; OutputObj mixedTPCTPCCh{"mixedEventTPCTPCChHadrons"}; - OutputObj mixedHF{"mixedEventHFHadrons"}; - OutputObj mixedMFT{"mixedEventTPCMFTChHadrons"}; + OutputObj sameHFTPCCh{"sameEventHFTPCChHadrons"}; + OutputObj mixedHFTPCCh{"mixedEventHFTPCChHadrons"}; + OutputObj sameTPCMFTCh{"sameEventTPCMFTChHadrons"}; + OutputObj mixedTPCMFTCh{"mixedEventTPCMFTChHadrons"}; // ========================= // init() @@ -196,11 +196,11 @@ struct HfTaskFlow { std::vector userAxis = {{axisMass, "m_{inv} (GeV/c^{2})"}}; sameTPCTPCCh.setObject(new CorrelationContainer("sameEventTPCTPCChHadrons", "sameEventTPCTPCChHadrons", corrAxis, effAxis, {})); - sameTPCMFTCh.setObject(new CorrelationContainer("sameEventTPCMFTChHadrons", "sameEventTPCMFTChHadrons", corrAxis, effAxis, {})); - sameHF.setObject(new CorrelationContainer("sameEventHFHadrons", "sameEventHFHadrons", corrAxis, effAxis, userAxis)); mixedTPCTPCCh.setObject(new CorrelationContainer("mixedEventTPCTPCChHadrons", "mixedEventTPCTPCChHadrons", corrAxis, effAxis, {})); - mixedHF.setObject(new CorrelationContainer("mixedEventHFHadrons", "mixedEventHFHadrons", corrAxis, effAxis, userAxis)); - mixedMFT.setObject(new CorrelationContainer("mixedEventTPCMFTChHadrons", "mixedEventTPCMFTChHadrons", corrAxis, effAxis, {})); + sameHFTPCCh.setObject(new CorrelationContainer("sameEventHFTPCChHadrons", "sameEventHFHadrons", corrAxis, effAxis, userAxis)); + mixedHFTPCCh.setObject(new CorrelationContainer("mixedEventHFTPCChHadrons", "mixedEventHFHadrons", corrAxis, effAxis, userAxis)); + sameTPCMFTCh.setObject(new CorrelationContainer("sameEventTPCMFTChHadrons", "sameEventTPCMFTChHadrons", corrAxis, effAxis, {})); + mixedTPCMFTCh.setObject(new CorrelationContainer("mixedEventTPCMFTChHadrons", "mixedEventTPCMFTChHadrons", corrAxis, effAxis, {})); } // --------------- @@ -507,10 +507,10 @@ struct HfTaskFlow { } const auto multiplicity = tracks.size(); - sameHF->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); + sameHFTPCCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); fillCandidateQA(candidates); - fillCorrelations(sameHF, candidates, tracks, multiplicity, collision.posZ()); + fillCorrelations(sameHFTPCCh, candidates, tracks, multiplicity, collision.posZ()); } PROCESS_SWITCH(HfTaskFlow, processSameHfHadrons, "Process same-event correlations for HF-h case", true); @@ -564,7 +564,7 @@ struct HfTaskFlow { return size; }; - mixCollisions(collisions, candidates, tracks, getTracksSize, mixedHF); + mixCollisions(collisions, candidates, tracks, getTracksSize, mixedHFTPCCh); } PROCESS_SWITCH(HfTaskFlow, processMixedHfHadrons, "Process mixed-event correlations for HF-h case", true); @@ -582,7 +582,7 @@ struct HfTaskFlow { return size; }; - mixCollisions(collisions, tracks, mfttracks, getTracksSize, mixedMFT); + mixCollisions(collisions, tracks, mfttracks, getTracksSize, mixedTPCMFTCh); } PROCESS_SWITCH(HfTaskFlow, processMixedTpcMftHH, "Process mixed-event correlations for h-MFT case", true); }; // End of struct From c63bd5f20de7ed86cacd663a7fdef280ebefd38c Mon Sep 17 00:00:00 2001 From: AlexianL Date: Tue, 2 Jul 2024 14:29:04 +0200 Subject: [PATCH 02/31] ONGOING WORK : adding TPC-TPC Monte-Carlo process functions --- PWGHF/HFC/Tasks/taskFlow.cxx | 136 +++++++++++++++++++++++++++++------ 1 file changed, 115 insertions(+), 21 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index dd46e7278b4..5384d6d70ff 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -66,22 +66,50 @@ struct HfTaskFlow { HfHelper hfHelper; SliceCache cache; - using FilteredCollisionsWSelMult = soa::Filtered>; - using TracksWDcaSel = soa::Filtered>; - using HfCandidatesSel = soa::Filtered>; + // ========================= + // DATA : Filters & partitions + // ========================= + + //using FilteredCollisionsWSelMult = soa::Filtered>; + //using TracksWDcaSel = soa::Filtered>; + //using HfCandidatesSel = soa::Filtered>; + + // Without filters + using FilteredCollisionsWSelMult = soa::Join; + using TracksWDcaSel = soa::Join; + using HfCandidatesSel = soa::Join; + // Collision filters // FIXME: The filter is applied also on the candidates! Beware! - Filter collisionVtxZFilter = nabs(aod::collision::posZ) < zVertexMax; + //Filter collisionVtxZFilter = nabs(aod::collision::posZ) < zVertexMax; // Charged track filters + /* Filter trackFilter = (nabs(aod::track::eta) < etaTrackAssocMax) && (aod::track::pt > ptTrackAssocMin) && requireGlobalTrackWoPtEtaInFilter(); + */ // HF candidate filter // TODO: use Partition instead of filter - Filter candidateFilter = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; + //Filter candidateFilter = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; + + //Preslice perCol = aod::track::collisionId; + + // ========================= + // MONTE-CARLO : Filters & partitions + // ========================= + + //using FilteredCollisionsWSelMultMC = soa::Filtered>; + //using FilteredCollisionsWSelMultMC = soa::Filtered>; + // Without filters + using FilteredCollisionsWSelMultMC = soa::Join; + // Even add McCollisions in the join ? + //using FilteredCollisionsWSelMultMC = soa::Filtered>; + //using TracksWDcaSelMC = soa::Filtered>; + // Without filters + using TracksWDcaSelMC = soa::Join; + // McTracks ???? - Preslice perCol = aod::track::collisionId; // configurables for containers ConfigurableAxis axisVertex{"axisVertex", {14, -7, 7}, "vertex axis for histograms"}; @@ -100,6 +128,7 @@ struct HfTaskFlow { HistogramRegistry registry{"registry"}; + // Correlation containers used for data OutputObj sameTPCTPCCh{"sameEventTPCTPCChHadrons"}; OutputObj mixedTPCTPCCh{"mixedEventTPCTPCChHadrons"}; OutputObj sameHFTPCCh{"sameEventHFTPCChHadrons"}; @@ -107,6 +136,10 @@ struct HfTaskFlow { OutputObj sameTPCMFTCh{"sameEventTPCMFTChHadrons"}; OutputObj mixedTPCMFTCh{"mixedEventTPCMFTChHadrons"}; + // Correlation containers used for Monte-Carlo + OutputObj sameTPCTPCChMC{"sameEventTPCTPCChHadronsMC"}; + OutputObj mixedTPCTPCChMC{"mixedEventTPCTPCChHadronsMC"}; + // ========================= // init() // ========================= @@ -195,12 +228,17 @@ struct HfTaskFlow { {axisVertexEfficiency, "z-vtx (cm)"}}; std::vector userAxis = {{axisMass, "m_{inv} (GeV/c^{2})"}}; + // initialization of correlation containers for data sameTPCTPCCh.setObject(new CorrelationContainer("sameEventTPCTPCChHadrons", "sameEventTPCTPCChHadrons", corrAxis, effAxis, {})); mixedTPCTPCCh.setObject(new CorrelationContainer("mixedEventTPCTPCChHadrons", "mixedEventTPCTPCChHadrons", corrAxis, effAxis, {})); sameHFTPCCh.setObject(new CorrelationContainer("sameEventHFTPCChHadrons", "sameEventHFHadrons", corrAxis, effAxis, userAxis)); mixedHFTPCCh.setObject(new CorrelationContainer("mixedEventHFTPCChHadrons", "mixedEventHFHadrons", corrAxis, effAxis, userAxis)); sameTPCMFTCh.setObject(new CorrelationContainer("sameEventTPCMFTChHadrons", "sameEventTPCMFTChHadrons", corrAxis, effAxis, {})); mixedTPCMFTCh.setObject(new CorrelationContainer("mixedEventTPCMFTChHadrons", "mixedEventTPCMFTChHadrons", corrAxis, effAxis, {})); + + // initialization of correlation containes for monte-carlo + sameTPCTPCChMC.setObject(new CorrelationContainer("sameEventTPCTPCChHadronsMC", "sameEventTPCTPCChHadronsMC", corrAxis, effAxis, {})); + mixedTPCTPCChMC.setObject(new CorrelationContainer("mixedEventTPCTPCChHadronsMC", "mixedEventTPCTPCChHadronsMC", corrAxis, effAxis, {})); } // --------------- @@ -429,13 +467,15 @@ struct HfTaskFlow { } } - template - void mixCollisions(FilteredCollisionsWSelMult const& collisions, TTracksTrig const& tracks1, TTracksAssoc const& tracks2, TLambda getPartsSize, OutputObj& corrContainer) + //template + //void mixCollisions(FilteredCollisionsWSelMult const& collisions, TTracksTrig const& tracks1, TTracksAssoc const& tracks2, TLambda getPartsSize, OutputObj& corrContainer) + template + void mixCollisions(TCollisions const& collisions, TTracksTrig const& tracks1, TTracksAssoc const& tracks2, TLambda getPartsSize, OutputObj& corrContainer) { using BinningType = FlexibleBinningPolicy, aod::collision::PosZ, decltype(getPartsSize)>; BinningType binningWithTracksSize{{getPartsSize}, {axisVertex, axisMultiplicity}, true}; auto tracksTuple = std::make_tuple(tracks1, tracks2); - Pair pair{binningWithTracksSize, nMixedEvents, -1, collisions, tracksTuple, &cache}; + Pair pair{binningWithTracksSize, nMixedEvents, -1, collisions, tracksTuple, &cache}; for (const auto& [collision1, tracks1, collision2, tracks2] : pair) { @@ -460,13 +500,15 @@ struct HfTaskFlow { fillMixingQA(multiplicity, vz, tracks1); } + // TO-DO : add the same thing above but for MC + corrContainer->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); fillCorrelations(corrContainer, tracks1, tracks2, multiplicity, collision1.posZ()); } } // ===================================== - // process same event correlations: h-h case + // DATA : process same event correlations: h-h case // ===================================== void processSameTpcTpcHH(FilteredCollisionsWSelMult::iterator const& collision, TracksWDcaSel const& tracks) @@ -493,10 +535,10 @@ struct HfTaskFlow { fillQA(multiplicity, tracks); fillCorrelations(sameTPCTPCCh, tracks, tracks, multiplicity, collision.posZ()); } - PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcHH, "Process same-event correlations for h-h case", true); + PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcHH, "DATA : Process same-event correlations for h-h case", true); // ===================================== - // process same event correlations: HF-h case + // DATA : process same event correlations: HF-h case // ===================================== void processSameHfHadrons(FilteredCollisionsWSelMult::iterator const& collision, TracksWDcaSel const& tracks, @@ -512,10 +554,10 @@ struct HfTaskFlow { fillCandidateQA(candidates); fillCorrelations(sameHFTPCCh, candidates, tracks, multiplicity, collision.posZ()); } - PROCESS_SWITCH(HfTaskFlow, processSameHfHadrons, "Process same-event correlations for HF-h case", true); + PROCESS_SWITCH(HfTaskFlow, processSameHfHadrons, "DATA : Process same-event correlations for HF-h case", true); // ===================================== - // process same event correlations: h-MFT case + // DATA : process same event correlations: h-MFT case // ===================================== void processSameTpcMftHH(FilteredCollisionsWSelMult::iterator const& collision, TracksWDcaSel const& tracks, @@ -531,10 +573,36 @@ struct HfTaskFlow { fillMFTQA(multiplicity, mfttracks); fillCorrelations(sameTPCMFTCh, tracks, mfttracks, multiplicity, collision.posZ()); } - PROCESS_SWITCH(HfTaskFlow, processSameTpcMftHH, "Process same-event correlations for h-MFT case", true); + PROCESS_SWITCH(HfTaskFlow, processSameTpcMftHH, "DATA : Process same-event correlations for h-MFT case", true); + + // ===================================== + // MONTE-CARLO : process same event correlations: h-h case + // ===================================== + + void processSameTpcTpcHHmc(FilteredCollisionsWSelMultMC::iterator const& mccollision, + TracksWDcaSelMC const& mctracks) + { + if (!(isCollisionSelected(mccollision, true))) { + return; + } + + const auto multiplicity = mctracks.size(); + registry.fill(HIST("MC/HadronHadron/SameEvent/hMultiplicity"), multiplicity); + registry.fill(HIST("MC/HadronHadron/SameEvent/hVtxZ"), mccollision.posZ()); + + BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; + int bin = baseBinning.getBin(std::make_tuple(mccollision.posZ(), multiplicity)); + registry.fill(HIST("MC/HadronHadron/SameEvent/hEventCountSame"), bin); + + sameTPCTPCChMC->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); + + fillCorrelations(sameTPCTPCChMC, mctracks, mctracks, multiplicity, mccollision.posZ()); + } + PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcHHmc, "MONTE-CARLO : Process same-event correlations for h-h case", true); + // ===================================== - // process mixed event correlations: h-h case + // DATA : process mixed event correlations: h-h case // ===================================== void processMixedTpcTpcHH(FilteredCollisionsWSelMult const& collisions, TracksWDcaSel const& tracks) @@ -548,10 +616,10 @@ struct HfTaskFlow { mixCollisions(collisions, tracks, tracks, getTracksSize, mixedTPCTPCCh); } - PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcHH, "Process mixed-event correlations for h-h case", true); + PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcHH, "DATA : Process mixed-event correlations for h-h case", true); // ===================================== - // process mixed event correlations: h-HF case + // DATA : process mixed event correlations: h-HF case // ===================================== void processMixedHfHadrons(FilteredCollisionsWSelMult const& collisions, TracksWDcaSel const& tracks, @@ -566,10 +634,10 @@ struct HfTaskFlow { mixCollisions(collisions, candidates, tracks, getTracksSize, mixedHFTPCCh); } - PROCESS_SWITCH(HfTaskFlow, processMixedHfHadrons, "Process mixed-event correlations for HF-h case", true); + PROCESS_SWITCH(HfTaskFlow, processMixedHfHadrons, "DATA : Process mixed-event correlations for HF-h case", true); // ===================================== - // process mixed event correlations: h-MFT case + // DATA : process mixed event correlations: h-MFT case // ===================================== void processMixedTpcMftHH(FilteredCollisionsWSelMult const& collisions, TracksWDcaSel const& tracks, @@ -584,7 +652,33 @@ struct HfTaskFlow { mixCollisions(collisions, tracks, mfttracks, getTracksSize, mixedTPCMFTCh); } - PROCESS_SWITCH(HfTaskFlow, processMixedTpcMftHH, "Process mixed-event correlations for h-MFT case", true); + PROCESS_SWITCH(HfTaskFlow, processMixedTpcMftHH, "DATA : Process mixed-event correlations for h-MFT case", true); + + + + // ===================================== + // MONTE-CARLO : process mixed event correlations: h-h case + // ===================================== + + void processMixedTpcTpcHHmc(FilteredCollisionsWSelMultMC const& mccollisions, + TracksWDcaSelMC const& mctracks) + { + // use normal index instead of globalIndex for MixedEvent ?? + + + // we want to group collisions based on charged-track multiplicity + auto getTracksSize = [&mctracks, this](FilteredCollisionsWSelMultMC::iterator const& mccol) { + //auto associatedTracks = mctracks.sliceByCached(o2::aod::track::collisionId, mccol.globalIndex(), this->cache); // it's cached, so slicing/grouping happens only once + auto associatedTracks = mctracks.sliceByCached(o2::aod::mcparticle::mcCollisionId, mccol.globalIndex(), this->cache); // it's cached, so slicing/grouping happens only once + auto size = associatedTracks.size(); + return size; + }; + + mixCollisions(mccollisions, mctracks, mctracks, getTracksSize, mixedTPCTPCChMC); + } + PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcHHmc, "MONTE-CARLO : Process mixed-event correlations for h-h case", true); + + }; // End of struct WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 133d65f8a6111c510adf9efc15717bb856188a02 Mon Sep 17 00:00:00 2001 From: AlexianL Date: Tue, 2 Jul 2024 16:08:55 +0200 Subject: [PATCH 03/31] ONGOING WORK : Uniformize the name of Correlations containers --- PWGHF/HFC/Tasks/taskFlow.cxx | 242 +++++++++++++++++------------------ 1 file changed, 121 insertions(+), 121 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index dd46e7278b4..78ef19627a1 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -100,12 +100,12 @@ struct HfTaskFlow { HistogramRegistry registry{"registry"}; - OutputObj sameTPCTPCCh{"sameEventTPCTPCChHadrons"}; - OutputObj mixedTPCTPCCh{"mixedEventTPCTPCChHadrons"}; - OutputObj sameHFTPCCh{"sameEventHFTPCChHadrons"}; - OutputObj mixedHFTPCCh{"mixedEventHFTPCChHadrons"}; - OutputObj sameTPCMFTCh{"sameEventTPCMFTChHadrons"}; - OutputObj mixedTPCMFTCh{"mixedEventTPCMFTChHadrons"}; + OutputObj sameTPCTPCChCh{"sameTPCTPCChCh"}; + OutputObj mixedTPCTPCChCh{"mixedTPCTPCChCh"}; + OutputObj sameTPCTPCHfCh{"sameTPCTPCHfChs"}; + OutputObj mixedTPCTPCHfCh{"mixedTPCTPCHfCh"}; + OutputObj sameTPCMFTChCh{"sameTPCMFTChCh"}; + OutputObj mixedTPCMFTChCh{"mixedTPCMFTChC"}; // ========================= // init() @@ -123,65 +123,65 @@ struct HfTaskFlow { for (int iBin = 0; iBin < kNBinsEvents; iBin++) { registry.get(HIST("Data/hEventCounter"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); } - registry.add("Data/HadronHadron/SameEvent/hMultiplicity", "hMultiplicity", {HistType::kTH1F, {{500, 0, 500}}}); - registry.add("Data/HadronHadron/SameEvent/hVtxZ", "hVtxZ", {HistType::kTH1F, {{400, -50, 50}}}); - registry.add("Data/HadronHadron/SameEvent/hNtracks", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("Data/TpcTpc/HadronHadron/SameEvent/hMultiplicity", "hMultiplicity", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("Data/TpcTpc/HadronHadron/SameEvent/hVtxZ", "hVtxZ", {HistType::kTH1F, {{400, -50, 50}}}); + registry.add("Data/TpcTpc/HadronHadron/SameEvent/hNtracks", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); // histograms for event mixing const int maxMixBin = axisMultiplicity->size() * 14; // 14 bins for z-vertex - registry.add("Data/HadronHadron/MixedEvent/hEventCountMixing", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); - registry.add("Data/HadronHf/MixedEvent/hEventCountHFMixing", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); - registry.add("Data/HadronHadron/SameEvent/hEventCountSame", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); - registry.add("Data/HadronHadron/MixedEvent/hMultiplicityMixing", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); - registry.add("Data/HadronHadron/MixedEvent/hVtxZMixing", "hVtxZMixing", {HistType::kTH1F, {{100, -10, 10}}}); - registry.add("Data/HadronHadron/MixedEvent/hNtracksMixing", "hNtracksMixing", {HistType::kTH1F, {{500, 0, 500}}}); - registry.add("Data/HadronHf/MixedEvent/hMultiplicityHFMixing", "hMultiplicityHFMixing", {HistType::kTH1F, {{500, 0, 500}}}); - registry.add("Data/HadronHf/MixedEvent/hVtxZHFMixing", "hVtxZHFMixing", {HistType::kTH1F, {{100, -10, 10}}}); - registry.add("Data/HadronHf/MixedEvent/hNtracksHFMixing", "hNtracksHFMixing", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); + registry.add("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); + registry.add("Data/TpcTpc/HadronHadron/SameEvent/hEventCountSame", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); + registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hMultiplicityMixing", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hVtxZMixing", "hVtxZMixing", {HistType::kTH1F, {{100, -10, 10}}}); + registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing", "hNtracksMixing", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("Data/TpcTpc/HfHadron/MixedEvent/hMultiplicityHFMixing", "hMultiplicityHFMixing", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("Data/TpcTpc/HfHadron/MixedEvent/hVtxZHFMixing", "hVtxZHFMixing", {HistType::kTH1F, {{100, -10, 10}}}); + registry.add("Data/TpcTpc/HfHadron/MixedEvent/hNtracksHFMixing", "hNtracksHFMixing", {HistType::kTH1F, {{500, 0, 500}}}); // TRACK HISTOGRAMS // histograms for associated particles - registry.add("Data/HadronHadron/SameEvent/hYields", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); - registry.add("Data/HadronHadron/SameEvent/hEtaPhi", "multiplicity vs eta vs phi", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); - registry.add("Data/HadronHadron/SameEvent/hPt", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); - registry.add("Data/HadronHadron/SameEvent/hEta", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); - registry.add("Data/HadronHadron/SameEvent/hPhi", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcTpc/HadronHadron/SameEvent/hYields", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); + registry.add("Data/TpcTpc/HadronHadron/SameEvent/hEtaPhi", "multiplicity vs eta vs phi", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcTpc/HadronHadron/SameEvent/hPt", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); + registry.add("Data/TpcTpc/HadronHadron/SameEvent/hEta", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); + registry.add("Data/TpcTpc/HadronHadron/SameEvent/hPhi", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); // histograms for particles in event mixing - registry.add("Data/HadronHadron/MixedEvent/hPtMixing", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); - registry.add("Data/HadronHadron/MixedEvent/hEtaMixing", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); - registry.add("Data/HadronHadron/MixedEvent/hPhiMixing", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hPtMixing", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); + registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hEtaMixing", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); + registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hPhiMixing", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); // histograms for MFT tracks - registry.add("Data/HadronMft/hEtaPhiMFT", "multiplicity vs eta vs phi in MFT", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); - registry.add("Data/HadronMft/hEtaMFT", "etaMFT", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); - registry.add("Data/HadronMft/hPhiMFT", "phiMFT", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcMft/HadronHadron/hEtaPhiMFT", "multiplicity vs eta vs phi in MFT", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcMft/HadronHadron/hEtaMFT", "etaMFT", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); + registry.add("Data/TpcMft/HadronHadron/hPhiMFT", "phiMFT", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); // histograms for candidates auto vbins = (std::vector)binsPt; - registry.add("Data/HadronHf/hPtCand", "2-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); - registry.add("Data/HadronHf/hPtProng0", "2-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); - registry.add("Data/HadronHf/hPtProng1", "2-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); - registry.add("Data/HadronHf/hMass", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0., 5.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/HadronHf/hDecLength", "2-prong candidates;decay length (cm);entries", {HistType::kTH2F, {{200, 0., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/HadronHf/hDecLengthXY", "2-prong candidates;decay length xy (cm);entries", {HistType::kTH2F, {{200, 0., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/HadronHf/hd0Prong0", "2-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/HadronHf/hd0Prong1", "2-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/HadronHf/hd0d0", "2-prong candidates;product of DCAxy to prim. vertex (cm^{2});entries", {HistType::kTH2F, {{500, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/HadronHf/hCTS", "2-prong candidates;cos #it{#theta}* (D^{0});entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/HadronHf/hCt", "2-prong candidates;proper lifetime (D^{0}) * #it{c} (cm);entries", {HistType::kTH2F, {{120, -20., 100.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/HadronHf/hCPA", "2-prong candidates;cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/HadronHf/hEtaCand", "2-prong candidates;candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/HadronHf/hSelectionStatus", "2-prong candidates;selection status;entries", {HistType::kTH2F, {{5, -0.5, 4.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/HadronHf/hImpParErr", "2-prong candidates;impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/HadronHf/hDecLenErr", "2-prong candidates;decay length error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/HadronHf/hDecLenXYErr", "2-prong candidates;decay length xy error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/hPtCand", "2-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); + registry.add("Data/TpcTpc/HfHadron/hPtProng0", "2-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); + registry.add("Data/TpcTpc/HfHadron/hPtProng1", "2-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); + registry.add("Data/TpcTpc/HfHadron/hMass", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0., 5.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/hDecLength", "2-prong candidates;decay length (cm);entries", {HistType::kTH2F, {{200, 0., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/hDecLengthXY", "2-prong candidates;decay length xy (cm);entries", {HistType::kTH2F, {{200, 0., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/hd0Prong0", "2-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/hd0Prong1", "2-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/hd0d0", "2-prong candidates;product of DCAxy to prim. vertex (cm^{2});entries", {HistType::kTH2F, {{500, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/hCTS", "2-prong candidates;cos #it{#theta}* (D^{0});entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/hCt", "2-prong candidates;proper lifetime (D^{0}) * #it{c} (cm);entries", {HistType::kTH2F, {{120, -20., 100.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/hCPA", "2-prong candidates;cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/hEtaCand", "2-prong candidates;candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/hSelectionStatus", "2-prong candidates;selection status;entries", {HistType::kTH2F, {{5, -0.5, 4.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/hImpParErr", "2-prong candidates;impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/hDecLenErr", "2-prong candidates;decay length error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/hDecLenXYErr", "2-prong candidates;decay length xy error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); // histograms for candidates in event mixing - registry.add("Data/HadronHf/MixedEvent/hPtHFMixing", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); - registry.add("Data/HadronHf/MixedEvent/hEtaHFMixing", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); - registry.add("Data/HadronHf/MixedEvent/hPhiHFMixing", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcTpc/HfHadron/MixedEvent/hPtHFMixing", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); + registry.add("Data/TpcTpc/HfHadron/MixedEvent/hEtaHFMixing", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); + registry.add("Data/TpcTpc/HfHadron/MixedEvent/hPhiHFMixing", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); // set axes of the correlation container std::vector corrAxis = {{axisDeltaEta, "#Delta#eta"}, @@ -195,12 +195,12 @@ struct HfTaskFlow { {axisVertexEfficiency, "z-vtx (cm)"}}; std::vector userAxis = {{axisMass, "m_{inv} (GeV/c^{2})"}}; - sameTPCTPCCh.setObject(new CorrelationContainer("sameEventTPCTPCChHadrons", "sameEventTPCTPCChHadrons", corrAxis, effAxis, {})); - mixedTPCTPCCh.setObject(new CorrelationContainer("mixedEventTPCTPCChHadrons", "mixedEventTPCTPCChHadrons", corrAxis, effAxis, {})); - sameHFTPCCh.setObject(new CorrelationContainer("sameEventHFTPCChHadrons", "sameEventHFHadrons", corrAxis, effAxis, userAxis)); - mixedHFTPCCh.setObject(new CorrelationContainer("mixedEventHFTPCChHadrons", "mixedEventHFHadrons", corrAxis, effAxis, userAxis)); - sameTPCMFTCh.setObject(new CorrelationContainer("sameEventTPCMFTChHadrons", "sameEventTPCMFTChHadrons", corrAxis, effAxis, {})); - mixedTPCMFTCh.setObject(new CorrelationContainer("mixedEventTPCMFTChHadrons", "mixedEventTPCMFTChHadrons", corrAxis, effAxis, {})); + sameTPCTPCChCh.setObject(new CorrelationContainer("sameTPCTPCChCh", "sameTPCTPCChCh", corrAxis, effAxis, {})); + mixedTPCTPCChCh.setObject(new CorrelationContainer("ixedTPCTPCChCh", "ixedTPCTPCChCh", corrAxis, effAxis, {})); + sameTPCTPCHfCh.setObject(new CorrelationContainer("sameTPCTPCHfCh", "sameTPCTPCHfCh", corrAxis, effAxis, userAxis)); + mixedTPCTPCHfCh.setObject(new CorrelationContainer("mixedTPCTPCHfCh", "mixedTPCTPCHfCh", corrAxis, effAxis, userAxis)); + sameTPCMFTChCh.setObject(new CorrelationContainer("sameTPCMFTChCh", "sameTPCMFTChCh", corrAxis, effAxis, {})); + mixedTPCMFTChCh.setObject(new CorrelationContainer("mixedTPCMFTChCh", "mixedTPCMFTChCh", corrAxis, effAxis, {})); } // --------------- @@ -246,56 +246,56 @@ struct HfTaskFlow { int Ntracks = 0; for (const auto& track1 : tracks) { Ntracks++; - registry.fill(HIST("Data/HadronHadron/SameEvent/hPt"), track1.pt()); - registry.fill(HIST("Data/HadronHadron/SameEvent/hEta"), track1.eta()); - registry.fill(HIST("Data/HadronHadron/SameEvent/hPhi"), track1.phi()); - registry.fill(HIST("Data/HadronHadron/SameEvent/hYields"), multiplicity, track1.pt(), track1.eta()); - registry.fill(HIST("Data/HadronHadron/SameEvent/hEtaPhi"), multiplicity, track1.eta(), track1.phi()); + registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hPt"), track1.pt()); + registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hEta"), track1.eta()); + registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hPhi"), track1.phi()); + registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hYields"), multiplicity, track1.pt(), track1.eta()); + registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hEtaPhi"), multiplicity, track1.eta(), track1.phi()); } - registry.fill(HIST("Data/HadronHadron/SameEvent/hNtracks"), Ntracks); + registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hNtracks"), Ntracks); } template void fillMixingQA(float multiplicity, float vz, TTracks const& tracks) { - registry.fill(HIST("Data/HadronHadron/MixedEvent/hMultiplicityMixing"), multiplicity); - registry.fill(HIST("Data/HadronHadron/MixedEvent/hVtxZMixing"), vz); + registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hMultiplicityMixing"), multiplicity); + registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hVtxZMixing"), vz); int Ntracks = 0; for (const auto& track1 : tracks) { Ntracks++; - registry.fill(HIST("Data/HadronHadron/MixedEvent/hPtMixing"), track1.pt()); - registry.fill(HIST("Data/HadronHadron/MixedEvent/hEtaMixing"), track1.eta()); - registry.fill(HIST("Data/HadronHadron/MixedEvent/hPhiMixing"), track1.phi()); + registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hPtMixing"), track1.pt()); + registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEtaMixing"), track1.eta()); + registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hPhiMixing"), track1.phi()); } - registry.fill(HIST("Data/HadronHadron/MixedEvent/hNtracksMixing"), Ntracks); + registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing"), Ntracks); } template void fillHFMixingQA(float multiplicity, float vz, TTracks const& tracks) { - registry.fill(HIST("Data/HadronHf/MixedEvent/hMultiplicityHFMixing"), multiplicity); - registry.fill(HIST("Data/HadronHf/MixedEvent/hVtxZHFMixing"), vz); + registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hMultiplicityHFMixing"), multiplicity); + registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hVtxZHFMixing"), vz); int Ntracks = 0; for (const auto& track1 : tracks) { Ntracks++; - registry.fill(HIST("Data/HadronHf/MixedEvent/hPtHFMixing"), track1.pt()); - registry.fill(HIST("Data/HadronHf/MixedEvent/hEtaHFMixing"), track1.eta()); - registry.fill(HIST("Data/HadronHf/MixedEvent/hPhiHFMixing"), track1.phi()); + registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hPtHFMixing"), track1.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEtaHFMixing"), track1.eta()); + registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hPhiHFMixing"), track1.phi()); } - registry.fill(HIST("Data/HadronHf/MixedEvent/hNtracksHFMixing"), Ntracks); + registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hNtracksHFMixing"), Ntracks); } template void fillMFTQA(float multiplicity, TTracks const& tracks) { for (const auto& track1 : tracks) { - registry.fill(HIST("Data/HadronMft/hEtaMFT"), track1.eta()); + registry.fill(HIST("Data/TpcMft/HadronHadron/hEtaMFT"), track1.eta()); float phi = track1.phi(); o2::math_utils::bringTo02Pi(phi); - registry.fill(HIST("Data/HadronMft/hPhiMFT"), phi); - registry.fill(HIST("Data/HadronMft/hEtaPhiMFT"), multiplicity, track1.eta(), phi); + registry.fill(HIST("Data/TpcMft/HadronHadron/hPhiMFT"), phi); + registry.fill(HIST("Data/TpcMft/HadronHadron/hEtaPhiMFT"), multiplicity, track1.eta(), phi); } } @@ -322,29 +322,29 @@ struct HfTaskFlow { } if (candidate.isSelD0() >= selectionFlagD0) { - registry.fill(HIST("Data/HadronHf/hMass"), hfHelper.invMassD0ToPiK(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/hMass"), hfHelper.invMassD0ToPiK(candidate), candidate.pt()); } if (candidate.isSelD0bar() >= selectionFlagD0bar) { - registry.fill(HIST("Data/HadronHf/hMass"), hfHelper.invMassD0barToKPi(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/hMass"), hfHelper.invMassD0barToKPi(candidate), candidate.pt()); } - registry.fill(HIST("Data/HadronHf/hPtCand"), candidate.pt()); - registry.fill(HIST("Data/HadronHf/hPtProng0"), candidate.ptProng0()); - registry.fill(HIST("Data/HadronHf/hPtProng1"), candidate.ptProng1()); - registry.fill(HIST("Data/HadronHf/hDecLength"), candidate.decayLength(), candidate.pt()); - registry.fill(HIST("Data/HadronHf/hDecLengthXY"), candidate.decayLengthXY(), candidate.pt()); - registry.fill(HIST("Data/HadronHf/hd0Prong0"), candidate.impactParameter0(), candidate.pt()); - registry.fill(HIST("Data/HadronHf/hd0Prong1"), candidate.impactParameter1(), candidate.pt()); - registry.fill(HIST("Data/HadronHf/hd0d0"), candidate.impactParameterProduct(), candidate.pt()); - registry.fill(HIST("Data/HadronHf/hCTS"), hfHelper.cosThetaStarD0(candidate), candidate.pt()); - registry.fill(HIST("Data/HadronHf/hCt"), hfHelper.ctD0(candidate), candidate.pt()); - registry.fill(HIST("Data/HadronHf/hCPA"), candidate.cpa(), candidate.pt()); - registry.fill(HIST("Data/HadronHf/hEtaCand"), candidate.eta(), candidate.pt()); - registry.fill(HIST("Data/HadronHf/hSelectionStatus"), candidate.isSelD0() + (candidate.isSelD0bar() * 2), candidate.pt()); - registry.fill(HIST("Data/HadronHf/hImpParErr"), candidate.errorImpactParameter0(), candidate.pt()); - registry.fill(HIST("Data/HadronHf/hImpParErr"), candidate.errorImpactParameter1(), candidate.pt()); - registry.fill(HIST("Data/HadronHf/hDecLenErr"), candidate.errorDecayLength(), candidate.pt()); - registry.fill(HIST("Data/HadronHf/hDecLenXYErr"), candidate.errorDecayLengthXY(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/hPtCand"), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/hPtProng0"), candidate.ptProng0()); + registry.fill(HIST("Data/TpcTpc/HfHadron/hPtProng1"), candidate.ptProng1()); + registry.fill(HIST("Data/TpcTpc/HfHadron/hDecLength"), candidate.decayLength(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/hDecLengthXY"), candidate.decayLengthXY(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/hd0Prong0"), candidate.impactParameter0(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/hd0Prong1"), candidate.impactParameter1(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/hd0d0"), candidate.impactParameterProduct(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/hCTS"), hfHelper.cosThetaStarD0(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/hCt"), hfHelper.ctD0(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/hCPA"), candidate.cpa(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/hEtaCand"), candidate.eta(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/hSelectionStatus"), candidate.isSelD0() + (candidate.isSelD0bar() * 2), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/hImpParErr"), candidate.errorImpactParameter0(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/hImpParErr"), candidate.errorImpactParameter1(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/hDecLenErr"), candidate.errorDecayLength(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/hDecLenXYErr"), candidate.errorDecayLengthXY(), candidate.pt()); } } @@ -453,10 +453,10 @@ struct HfTaskFlow { const auto vz = collision1.posZ(); if constexpr (std::is_same_v) { - registry.fill(HIST("Data/HadronHf/MixedEvent/hEventCountHFMixing"), bin); + registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); fillHFMixingQA(multiplicity, vz, tracks1); } else { - registry.fill(HIST("Data/HadronHadron/MixedEvent/hEventCountMixing"), bin); + registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); fillMixingQA(multiplicity, vz, tracks1); } @@ -468,7 +468,7 @@ struct HfTaskFlow { // ===================================== // process same event correlations: h-h case // ===================================== - void processSameTpcTpcHH(FilteredCollisionsWSelMult::iterator const& collision, + void processSameTpcTpcChCh(FilteredCollisionsWSelMult::iterator const& collision, TracksWDcaSel const& tracks) { if (!(isCollisionSelected(collision, true))) { @@ -481,24 +481,24 @@ struct HfTaskFlow { // temporary solution, since other correlation options always have to be ran with h-h, too // TODO: rewrite it in a more intelligent way const auto multiplicity = tracks.size(); - registry.fill(HIST("Data/HadronHadron/SameEvent/hMultiplicity"), multiplicity); - registry.fill(HIST("Data/HadronHadron/SameEvent/hVtxZ"), collision.posZ()); + registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hMultiplicity"), multiplicity); + registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hVtxZ"), collision.posZ()); BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; int bin = baseBinning.getBin(std::make_tuple(collision.posZ(), multiplicity)); - registry.fill(HIST("Data/HadronHadron/SameEvent/hEventCountSame"), bin); + registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hEventCountSame"), bin); - sameTPCTPCCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); + sameTPCTPCChCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); fillQA(multiplicity, tracks); - fillCorrelations(sameTPCTPCCh, tracks, tracks, multiplicity, collision.posZ()); + fillCorrelations(sameTPCTPCChCh, tracks, tracks, multiplicity, collision.posZ()); } - PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcHH, "Process same-event correlations for h-h case", true); + PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcChCh, "Process same-event correlations for TPC-TPC h-h case", true); // ===================================== // process same event correlations: HF-h case // ===================================== - void processSameHfHadrons(FilteredCollisionsWSelMult::iterator const& collision, + void processSameTpcTpcHfCh(FilteredCollisionsWSelMult::iterator const& collision, TracksWDcaSel const& tracks, HfCandidatesSel const& candidates) { @@ -507,17 +507,17 @@ struct HfTaskFlow { } const auto multiplicity = tracks.size(); - sameHFTPCCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); + sameTPCTPCChCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); fillCandidateQA(candidates); - fillCorrelations(sameHFTPCCh, candidates, tracks, multiplicity, collision.posZ()); + fillCorrelations(sameTPCTPCChCh, candidates, tracks, multiplicity, collision.posZ()); } - PROCESS_SWITCH(HfTaskFlow, processSameHfHadrons, "Process same-event correlations for HF-h case", true); + PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcHfCh, "Process same-event correlations for TPC-TPC HF-h case", true); // ===================================== // process same event correlations: h-MFT case // ===================================== - void processSameTpcMftHH(FilteredCollisionsWSelMult::iterator const& collision, + void processSameTpcMftChCh(FilteredCollisionsWSelMult::iterator const& collision, TracksWDcaSel const& tracks, aod::MFTTracks const& mfttracks) { @@ -527,16 +527,16 @@ struct HfTaskFlow { const auto multiplicity = tracks.size(); - sameTPCMFTCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); + sameTPCMFTChCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); fillMFTQA(multiplicity, mfttracks); - fillCorrelations(sameTPCMFTCh, tracks, mfttracks, multiplicity, collision.posZ()); + fillCorrelations(sameTPCMFTChCh, tracks, mfttracks, multiplicity, collision.posZ()); } - PROCESS_SWITCH(HfTaskFlow, processSameTpcMftHH, "Process same-event correlations for h-MFT case", true); + PROCESS_SWITCH(HfTaskFlow, processSameTpcMftChCh, "Process same-event correlations for TPC-MFT h-h case", true); // ===================================== // process mixed event correlations: h-h case // ===================================== - void processMixedTpcTpcHH(FilteredCollisionsWSelMult const& collisions, + void processMixedTpcTpcChCh(FilteredCollisionsWSelMult const& collisions, TracksWDcaSel const& tracks) { // we want to group collisions based on charged-track multiplicity @@ -546,14 +546,14 @@ struct HfTaskFlow { return size; }; - mixCollisions(collisions, tracks, tracks, getTracksSize, mixedTPCTPCCh); + mixCollisions(collisions, tracks, tracks, getTracksSize, mixedTPCTPCChCh); } - PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcHH, "Process mixed-event correlations for h-h case", true); + PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcChCh, "Process mixed-event correlations for TPC-TPC h-h case", true); // ===================================== // process mixed event correlations: h-HF case // ===================================== - void processMixedHfHadrons(FilteredCollisionsWSelMult const& collisions, + void processMixedTpcTpcHfCh(FilteredCollisionsWSelMult const& collisions, TracksWDcaSel const& tracks, HfCandidatesSel const& candidates) { @@ -564,14 +564,14 @@ struct HfTaskFlow { return size; }; - mixCollisions(collisions, candidates, tracks, getTracksSize, mixedHFTPCCh); + mixCollisions(collisions, candidates, tracks, getTracksSize, mixedTPCTPCHfCh); } - PROCESS_SWITCH(HfTaskFlow, processMixedHfHadrons, "Process mixed-event correlations for HF-h case", true); + PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcHfCh, "Process mixed-event correlations for TPC-TPC HF-h case", true); // ===================================== // process mixed event correlations: h-MFT case // ===================================== - void processMixedTpcMftHH(FilteredCollisionsWSelMult const& collisions, + void processMixedTpcMftChCh(FilteredCollisionsWSelMult const& collisions, TracksWDcaSel const& tracks, aod::MFTTracks const& mfttracks) { @@ -582,9 +582,9 @@ struct HfTaskFlow { return size; }; - mixCollisions(collisions, tracks, mfttracks, getTracksSize, mixedTPCMFTCh); + mixCollisions(collisions, tracks, mfttracks, getTracksSize, mixedTPCMFTChCh); } - PROCESS_SWITCH(HfTaskFlow, processMixedTpcMftHH, "Process mixed-event correlations for h-MFT case", true); + PROCESS_SWITCH(HfTaskFlow, processMixedTpcMftChCh, "Process mixed-event correlations for TPC-MFT h-h case", true); }; // End of struct WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 393d11b5f47176da137fc8456bce5905c79190d5 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 2 Jul 2024 14:09:23 +0000 Subject: [PATCH 04/31] Please consider the following formatting changes --- PWGHF/HFC/Tasks/taskFlow.cxx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 78ef19627a1..ea982b21501 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -469,7 +469,7 @@ struct HfTaskFlow { // process same event correlations: h-h case // ===================================== void processSameTpcTpcChCh(FilteredCollisionsWSelMult::iterator const& collision, - TracksWDcaSel const& tracks) + TracksWDcaSel const& tracks) { if (!(isCollisionSelected(collision, true))) { return; @@ -499,8 +499,8 @@ struct HfTaskFlow { // process same event correlations: HF-h case // ===================================== void processSameTpcTpcHfCh(FilteredCollisionsWSelMult::iterator const& collision, - TracksWDcaSel const& tracks, - HfCandidatesSel const& candidates) + TracksWDcaSel const& tracks, + HfCandidatesSel const& candidates) { if (!(isCollisionSelected(collision, true))) { return; @@ -518,8 +518,8 @@ struct HfTaskFlow { // process same event correlations: h-MFT case // ===================================== void processSameTpcMftChCh(FilteredCollisionsWSelMult::iterator const& collision, - TracksWDcaSel const& tracks, - aod::MFTTracks const& mfttracks) + TracksWDcaSel const& tracks, + aod::MFTTracks const& mfttracks) { if (!(isCollisionSelected(collision, true))) { return; @@ -537,7 +537,7 @@ struct HfTaskFlow { // process mixed event correlations: h-h case // ===================================== void processMixedTpcTpcChCh(FilteredCollisionsWSelMult const& collisions, - TracksWDcaSel const& tracks) + TracksWDcaSel const& tracks) { // we want to group collisions based on charged-track multiplicity auto getTracksSize = [&tracks, this](FilteredCollisionsWSelMult::iterator const& col) { @@ -554,8 +554,8 @@ struct HfTaskFlow { // process mixed event correlations: h-HF case // ===================================== void processMixedTpcTpcHfCh(FilteredCollisionsWSelMult const& collisions, - TracksWDcaSel const& tracks, - HfCandidatesSel const& candidates) + TracksWDcaSel const& tracks, + HfCandidatesSel const& candidates) { // we want to group collisions based on charged-track multiplicity auto getTracksSize = [&tracks, this](FilteredCollisionsWSelMult::iterator const& col) { @@ -572,8 +572,8 @@ struct HfTaskFlow { // process mixed event correlations: h-MFT case // ===================================== void processMixedTpcMftChCh(FilteredCollisionsWSelMult const& collisions, - TracksWDcaSel const& tracks, - aod::MFTTracks const& mfttracks) + TracksWDcaSel const& tracks, + aod::MFTTracks const& mfttracks) { // we want to group collisions based on charged-track multiplicity auto getTracksSize = [&tracks, this](FilteredCollisionsWSelMult::iterator const& col) { From 25b629e5d0fd29447943ee0984bbd3522a343a48 Mon Sep 17 00:00:00 2001 From: AlexianL Date: Thu, 11 Jul 2024 10:27:57 +0200 Subject: [PATCH 05/31] Solved typos in the declaration of 2 correlation containers --- PWGHF/HFC/Tasks/taskFlow.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 78ef19627a1..d61f6bc408f 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -102,10 +102,10 @@ struct HfTaskFlow { OutputObj sameTPCTPCChCh{"sameTPCTPCChCh"}; OutputObj mixedTPCTPCChCh{"mixedTPCTPCChCh"}; - OutputObj sameTPCTPCHfCh{"sameTPCTPCHfChs"}; + OutputObj sameTPCTPCHfCh{"sameTPCTPCHfCh"}; OutputObj mixedTPCTPCHfCh{"mixedTPCTPCHfCh"}; OutputObj sameTPCMFTChCh{"sameTPCMFTChCh"}; - OutputObj mixedTPCMFTChCh{"mixedTPCMFTChC"}; + OutputObj mixedTPCMFTChCh{"mixedTPCMFTChCh"}; // ========================= // init() From 773b95cdd8a619691e1afa44b5925be29158e3e3 Mon Sep 17 00:00:00 2001 From: AlexianL Date: Thu, 11 Jul 2024 10:35:40 +0200 Subject: [PATCH 06/31] Solved the same typos as the container_labels branch --- PWGHF/HFC/Tasks/taskFlow.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index e89816de6fa..8b16bf0857c 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -131,10 +131,10 @@ struct HfTaskFlow { // Correlation containers used for data OutputObj sameTPCTPCChCh{"sameTPCTPCChCh"}; OutputObj mixedTPCTPCChCh{"mixedTPCTPCChCh"}; - OutputObj sameTPCTPCHfCh{"sameTPCTPCHfChs"}; + OutputObj sameTPCTPCHfCh{"sameTPCTPCHfCh"}; OutputObj mixedTPCTPCHfCh{"mixedTPCTPCHfCh"}; OutputObj sameTPCMFTChCh{"sameTPCMFTChCh"}; - OutputObj mixedTPCMFTChCh{"mixedTPCMFTChC"}; + OutputObj mixedTPCMFTChCh{"mixedTPCMFTChCh"}; // Correlation containers used for Monte-Carlo OutputObj sameTPCTPCChChMC{"sameTPCTPCChChMC"}; From e136d0dc6194a575e415404df114a1e738eee7d0 Mon Sep 17 00:00:00 2001 From: AlexianL Date: Fri, 12 Jul 2024 16:14:06 +0200 Subject: [PATCH 07/31] The newly added MC process functions for TPC-TPC h-h case compile and run, and most of post-processing macros works on it too --- PWGHF/HFC/Tasks/taskFlow.cxx | 117 ++++++++++++++++++++++++++--------- 1 file changed, 87 insertions(+), 30 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 8b16bf0857c..f37a851ac06 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -13,6 +13,8 @@ /// \author Katarina Krizkova Gajdosova , CERN /// \author Maja Kabus , CERN +#include + #include #include #include @@ -70,28 +72,31 @@ struct HfTaskFlow { // DATA : Filters & partitions // ========================= - //using FilteredCollisionsWSelMult = soa::Filtered>; - //using TracksWDcaSel = soa::Filtered>; - //using HfCandidatesSel = soa::Filtered>; + using FilteredCollisionsWSelMult = soa::Filtered>; + using TracksWDcaSel = soa::Filtered>; + using HfCandidatesSel = soa::Filtered>; + + /* // Without filters using FilteredCollisionsWSelMult = soa::Join; using TracksWDcaSel = soa::Join; using HfCandidatesSel = soa::Join; - + */ // Collision filters // FIXME: The filter is applied also on the candidates! Beware! - //Filter collisionVtxZFilter = nabs(aod::collision::posZ) < zVertexMax; + Filter collisionVtxZFilter = nabs(aod::collision::posZ) < zVertexMax; + // Charged track filters - /* Filter trackFilter = (nabs(aod::track::eta) < etaTrackAssocMax) && (aod::track::pt > ptTrackAssocMin) && requireGlobalTrackWoPtEtaInFilter(); - */ + // HF candidate filter // TODO: use Partition instead of filter - //Filter candidateFilter = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; + Filter candidateFilter = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || + aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; //Preslice perCol = aod::track::collisionId; @@ -101,14 +106,12 @@ struct HfTaskFlow { //using FilteredCollisionsWSelMultMC = soa::Filtered>; //using FilteredCollisionsWSelMultMC = soa::Filtered>; - // Without filters - using FilteredCollisionsWSelMultMC = soa::Join; + // Even add McCollisions in the join ? //using FilteredCollisionsWSelMultMC = soa::Filtered>; - //using TracksWDcaSelMC = soa::Filtered>; - // Without filters - using TracksWDcaSelMC = soa::Join; - // McTracks ???? + using FilteredCollisionsWSelMultMC = soa::Filtered>; + using TracksWDcaSelMC = soa::Filtered>; + // configurables for containers @@ -216,6 +219,13 @@ struct HfTaskFlow { registry.add("Data/TpcTpc/HfHadron/MixedEvent/hEtaHFMixing", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); registry.add("Data/TpcTpc/HfHadron/MixedEvent/hPhiHFMixing", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + + registry.add("MC/TpcTpc/HadronHadron/SameEvent/hMultiplicity", "hMultiplicity", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("MC/TpcTpc/HadronHadron/SameEvent/hVtxZ", "hVtxZ", {HistType::kTH1F, {{400, -50, 50}}}); + registry.add("MC/TpcTpc/HadronHadron/SameEvent/hEventCountSame", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + + registry.add("MC/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); + // set axes of the correlation container std::vector corrAxis = {{axisDeltaEta, "#Delta#eta"}, {axisPtAssoc, "p_{T} (GeV/c)"}, @@ -269,8 +279,11 @@ struct HfTaskFlow { // Run 3: selection if (fillHistograms) registry.fill(HIST("Data/hEventCounter"), 1); - if (!collision.sel8()) { - return false; + + if (processMc == false) { + if (!collision.sel8()) { + return false; + } } if (fillHistograms) registry.fill(HIST("Data/hEventCounter"), 3); @@ -472,6 +485,7 @@ struct HfTaskFlow { template void mixCollisions(TCollisions const& collisions, TTracksTrig const& tracks1, TTracksAssoc const& tracks2, TLambda getPartsSize, OutputObj& corrContainer) { + using BinningType = FlexibleBinningPolicy, aod::collision::PosZ, decltype(getPartsSize)>; BinningType binningWithTracksSize{{getPartsSize}, {axisVertex, axisMultiplicity}, true}; auto tracksTuple = std::make_tuple(tracks1, tracks2); @@ -492,13 +506,32 @@ struct HfTaskFlow { const auto multiplicity = tracks2.size(); // get multiplicity of charged hadrons, which is used for slicing in mixing const auto vz = collision1.posZ(); - if constexpr (std::is_same_v) { - registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); - fillHFMixingQA(multiplicity, vz, tracks1); - } else { - registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); - fillMixingQA(multiplicity, vz, tracks1); + + // TO BE DONE : ADD ONE MORE IF CONDITION TO FILL THE MC CASE + if constexpr (std::is_same_v) { + registry.fill(HIST("MC/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); + // TO BE DONE : ADD QA FUNCTION FOR MC + //fillMixingQA(multiplicity, vz, tracks1); + /* + if constexpr (std::is_same_v) { + registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); + fillHFMixingQA(multiplicity, vz, tracks1); + } else { + registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); + fillMixingQA(multiplicity, vz, tracks1); + } + */ } + else { + if constexpr (std::is_same_v) { + registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); + fillHFMixingQA(multiplicity, vz, tracks1); + } else { + registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); + fillMixingQA(multiplicity, vz, tracks1); + } + } + // TO-DO : add the same thing above but for MC @@ -579,33 +612,35 @@ struct HfTaskFlow { // MONTE-CARLO : process same event correlations: h-h case // ===================================== - void processSameTpcTpcHHmc(FilteredCollisionsWSelMultMC::iterator const& mccollision, + void processSameTpcTpcChChmc(FilteredCollisionsWSelMultMC::iterator const& mccollision, TracksWDcaSelMC const& mctracks) { + /* if (!(isCollisionSelected(mccollision, true))) { return; } + */ const auto multiplicity = mctracks.size(); - registry.fill(HIST("MC/HadronHadron/SameEvent/hMultiplicity"), multiplicity); - registry.fill(HIST("MC/HadronHadron/SameEvent/hVtxZ"), mccollision.posZ()); + registry.fill(HIST("MC/TpcTpc/HadronHadron/SameEvent/hMultiplicity"), multiplicity); + registry.fill(HIST("MC/TpcTpc/HadronHadron/SameEvent/hVtxZ"), mccollision.posZ()); BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; int bin = baseBinning.getBin(std::make_tuple(mccollision.posZ(), multiplicity)); - registry.fill(HIST("MC/HadronHadron/SameEvent/hEventCountSame"), bin); + registry.fill(HIST("MC/TpcTpc/HadronHadron/SameEvent/hEventCountSame"), bin); - sameTPCTPCChMC->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); + sameTPCTPCChChMC->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); - fillCorrelations(sameTPCTPCChMC, mctracks, mctracks, multiplicity, mccollision.posZ()); + fillCorrelations(sameTPCTPCChChMC, mctracks, mctracks, multiplicity, mccollision.posZ()); } - PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcHHmc, "MONTE-CARLO : Process same-event correlations for TPC-TPC h-h case", true); + PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcChChmc, "MONTE-CARLO : Process same-event correlations for TPC-TPC h-h case", true); // ===================================== // DATA : process mixed event correlations: h-h case // ===================================== void processMixedTpcTpcChCh(FilteredCollisionsWSelMult const& collisions, - TracksWDcaSel const& tracks) + TracksWDcaSel const& tracks) { // we want to group collisions based on charged-track multiplicity auto getTracksSize = [&tracks, this](FilteredCollisionsWSelMult::iterator const& col) { @@ -653,6 +688,28 @@ struct HfTaskFlow { mixCollisions(collisions, tracks, mfttracks, getTracksSize, mixedTPCMFTChCh); } PROCESS_SWITCH(HfTaskFlow, processMixedTpcMftChCh, "DATA : Process mixed-event correlations for TPC-MFT h-h case", true); + + // ===================================== + // MONTE-CARLO : process mixed event correlations: h-h case + // ===================================== + + void processMixedTpcTpcChChmc(FilteredCollisionsWSelMultMC const& mccollisions, + TracksWDcaSelMC const& mctracks) + { + // use normal index instead of globalIndex for MixedEvent ?? + + + // we want to group collisions based on charged-track multiplicity + auto getTracksSize = [&mctracks, this](FilteredCollisionsWSelMultMC::iterator const& mccol) { + //auto associatedTracks = mctracks.sliceByCached(o2::aod::track::collisionId, mccol.globalIndex(), this->cache); // it's cached, so slicing/grouping happens only once + auto associatedTracks = mctracks.sliceByCached(o2::aod::track::collisionId, mccol.globalIndex(), this->cache); // it's cached, so slicing/grouping happens only once + auto size = associatedTracks.size(); + return size; + }; + + mixCollisions(mccollisions, mctracks, mctracks, getTracksSize, mixedTPCTPCChChMC); + } + PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcChChmc, "MONTE-CARLO : Process mixed-event correlations for TPC-TPC h-h case", true); }; // End of struct WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From f5825f2d439e6f87f02f29d75ad2a755b26108c4 Mon Sep 17 00:00:00 2001 From: AlexianL Date: Mon, 15 Jul 2024 11:00:46 +0200 Subject: [PATCH 08/31] Corrected a typo --- PWGHF/HFC/Tasks/taskFlow.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index c7cbca07331..5162b99bdc4 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -196,7 +196,7 @@ struct HfTaskFlow { std::vector userAxis = {{axisMass, "m_{inv} (GeV/c^{2})"}}; sameTPCTPCChCh.setObject(new CorrelationContainer("sameTPCTPCChCh", "sameTPCTPCChCh", corrAxis, effAxis, {})); - mixedTPCTPCChCh.setObject(new CorrelationContainer("ixedTPCTPCChCh", "ixedTPCTPCChCh", corrAxis, effAxis, {})); + mixedTPCTPCChCh.setObject(new CorrelationContainer("mixedTPCTPCChCh", "mixedTPCTPCChCh", corrAxis, effAxis, {})); sameTPCTPCHfCh.setObject(new CorrelationContainer("sameTPCTPCHfCh", "sameTPCTPCHfCh", corrAxis, effAxis, userAxis)); mixedTPCTPCHfCh.setObject(new CorrelationContainer("mixedTPCTPCHfCh", "mixedTPCTPCHfCh", corrAxis, effAxis, userAxis)); sameTPCMFTChCh.setObject(new CorrelationContainer("sameTPCMFTChCh", "sameTPCMFTChCh", corrAxis, effAxis, {})); From 1c646a02dbd8e35300835211b4efea3b75cc4711 Mon Sep 17 00:00:00 2001 From: AlexianL Date: Mon, 15 Jul 2024 15:51:27 +0200 Subject: [PATCH 09/31] Typo correction --- PWGHF/HFC/Tasks/taskFlow.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 5162b99bdc4..eb157918baa 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -13,6 +13,8 @@ /// \author Katarina Krizkova Gajdosova , CERN /// \author Maja Kabus , CERN +#include + #include #include #include @@ -420,7 +422,6 @@ struct HfTaskFlow { eta1 - eta2, pt2, pt1, multiplicity, deltaPhi, posZ, triggerWeight * associatedWeight); } else { - target->getPairHist()->Fill(CorrelationContainer::kCFStepReconstructed, eta1 - eta2, pt2, pt1, multiplicity, deltaPhi, posZ, invmass, triggerWeight * associatedWeight); @@ -510,7 +511,7 @@ struct HfTaskFlow { sameTPCTPCChCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); fillCandidateQA(candidates); - fillCorrelations(sameTPCTPCChCh, candidates, tracks, multiplicity, collision.posZ()); + fillCorrelations(sameTPCTPCHfCh, candidates, tracks, multiplicity, collision.posZ()); } PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcHfCh, "Process same-event correlations for TPC-TPC HF-h case", true); From 835f4ceb6cbc17aca04b0a2a81bc22843888a2d4 Mon Sep 17 00:00:00 2001 From: AlexianL Date: Mon, 15 Jul 2024 16:28:26 +0200 Subject: [PATCH 10/31] Typo correction : everything case can run successfully now --- PWGHF/HFC/Tasks/taskFlow.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index eb157918baa..5f6a5b2a95a 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -13,8 +13,6 @@ /// \author Katarina Krizkova Gajdosova , CERN /// \author Maja Kabus , CERN -#include - #include #include #include @@ -508,7 +506,7 @@ struct HfTaskFlow { } const auto multiplicity = tracks.size(); - sameTPCTPCChCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); + sameTPCTPCHfCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); fillCandidateQA(candidates); fillCorrelations(sameTPCTPCHfCh, candidates, tracks, multiplicity, collision.posZ()); From f46b6d1811f684b1f83f3b1d80d234d965617ddc Mon Sep 17 00:00:00 2001 From: AlexianL Date: Tue, 6 Aug 2024 09:15:41 +0200 Subject: [PATCH 11/31] Implemented both rec MC and gen MC --- PWGHF/HFC/Tasks/taskFlow.cxx | 633 ++++++++++++++++++++++++++++------- 1 file changed, 508 insertions(+), 125 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 19630a9786a..4590b454b00 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -25,6 +25,7 @@ #include "Framework/AnalysisTask.h" #include "Framework/ASoAHelpers.h" #include "Framework/HistogramRegistry.h" +#include "Framework/O2DatabasePDGPlugin.h" #include "Framework/runDataProcessing.h" #include "Framework/RunningWorkflowInfo.h" #include "Framework/StepTHn.h" @@ -49,6 +50,8 @@ using namespace o2::framework; using namespace o2::framework::expressions; struct HfTaskFlow { + Service pdg; + // configurables for processing options Configurable processRun2{"processRun2", false, "Flag to run on Run 2 data"}; Configurable processRun3{"processRun3", true, "Flag to run on Run 3 data"}; @@ -72,47 +75,64 @@ struct HfTaskFlow { // DATA : Filters & partitions // ========================= - using FilteredCollisionsWSelMult = soa::Filtered>; - using TracksWDcaSel = soa::Filtered>; - using HfCandidatesSel = soa::Filtered>; - - - /* - // Without filters - using FilteredCollisionsWSelMult = soa::Join; - using TracksWDcaSel = soa::Join; - using HfCandidatesSel = soa::Join; - */ - // Collision filters // FIXME: The filter is applied also on the candidates! Beware! Filter collisionVtxZFilter = nabs(aod::collision::posZ) < zVertexMax; - // Charged track filters + using FilteredCollisionsWSelMult = soa::Filtered>; + using TracksWDcaSel = soa::Filtered>; + using HfCandidatesSel = soa::Filtered>; + Filter trackFilter = (nabs(aod::track::eta) < etaTrackAssocMax) && (aod::track::pt > ptTrackAssocMin) && requireGlobalTrackWoPtEtaInFilter(); - + // HF candidate filter // TODO: use Partition instead of filter Filter candidateFilter = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; - //Preslice perCol = aod::track::collisionId; + Preslice dataPerCol = aod::track::collisionId; + //Do I have to adapt this preslice to MC ? How does it work exactly ? + //Preslice mcRecPerCol = aod::track::collisionId; + Preslice mcTruthPerCol = aod::mcparticle::mcCollisionId; // ========================= // MONTE-CARLO : Filters & partitions // ========================= - - //using FilteredCollisionsWSelMultMC = soa::Filtered>; - //using FilteredCollisionsWSelMultMC = soa::Filtered>; // Even add McCollisions in the join ? + // Kata adds subscribes to it but do not add it in the join //using FilteredCollisionsWSelMultMC = soa::Filtered>; using FilteredCollisionsWSelMultMC = soa::Filtered>; using TracksWDcaSelMC = soa::Filtered>; + //using aodCollisions = soa::Filtered>; + + // From Katarina's code, but not sure if I use it + Filter mcCollisionFilter = nabs(aod::mccollision::posZ) < zVertexMax; + using aodMcCollisions = soa::Filtered; + + + // From Katarina's code + Filter mcParticlesFilter = (nabs(aod::mcparticle::eta) < etaTrackAssocMax) && + (aod::mcparticle::pt > ptTrackAssocMin); //&& + //(aod::mcparticle::sign != 0) + using aodMcParticles = soa::Filtered; + + + // Katarina had this in her code : + // Charged track filters + /* + Filter trackFilter = (nabs(aod::track::eta) < etaTrackAssocMax) && + (aod::track::pt > ptTrackAssocMin) && + requireGlobalTrackWoPtEtaInFilter(); + */ + + using aodTracks = soa::Filtered>; + + // configurables for containers ConfigurableAxis axisVertex{"axisVertex", {14, -7, 7}, "vertex axis for histograms"}; @@ -138,7 +158,6 @@ struct HfTaskFlow { OutputObj mixedTPCTPCHfCh{"mixedTPCTPCHfCh"}; OutputObj sameTPCMFTChCh{"sameTPCMFTChCh"}; OutputObj mixedTPCMFTChCh{"mixedTPCMFTChCh"}; - OutputObj mixedTPCMFTChCh{"mixedTPCMFTChCh"}; // Correlation containers used for Monte-Carlo OutputObj sameTPCTPCChChMC{"sameTPCTPCChChMC"}; @@ -149,7 +168,10 @@ struct HfTaskFlow { // ========================= void init(InitContext&) { - // EVENT HISTOGRAMS + // ========================= + // Event histograms + // TO-DO : do i have to separate event histograms between DATA and MC ? + // ========================= constexpr int kNBinsEvents = 3; registry.add("Data/hEventCounter", "hEventCounter", {HistType::kTH1F, {{kNBinsEvents, 0.5, 0.5 + kNBinsEvents}}}); // set axes of the event counter histogram @@ -157,46 +179,57 @@ struct HfTaskFlow { labels[0] = "all"; labels[1] = "after trigger selection (Run 2)"; labels[2] = "after Physics selection"; + + const int maxMixBin = axisMultiplicity->size() * 14; // 14 bins for z-vertex + for (int iBin = 0; iBin < kNBinsEvents; iBin++) { registry.get(HIST("Data/hEventCounter"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); } + + // ========================= + // DATA : histograms for TPC-TPC h-h case + // ========================= + + // DATA : event histograms for TPC-TPC h-h same event registry.add("Data/TpcTpc/HadronHadron/SameEvent/hMultiplicity", "hMultiplicity", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("Data/TpcTpc/HadronHadron/SameEvent/hVtxZ", "hVtxZ", {HistType::kTH1F, {{400, -50, 50}}}); - registry.add("Data/TpcTpc/HadronHadron/SameEvent/hNtracks", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); - - // histograms for event mixing - const int maxMixBin = axisMultiplicity->size() * 14; // 14 bins for z-vertex - registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); - registry.add("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); registry.add("Data/TpcTpc/HadronHadron/SameEvent/hEventCountSame", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); - registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hMultiplicityMixing", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); - registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hVtxZMixing", "hVtxZMixing", {HistType::kTH1F, {{100, -10, 10}}}); - registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing", "hNtracksMixing", {HistType::kTH1F, {{500, 0, 500}}}); - registry.add("Data/TpcTpc/HfHadron/MixedEvent/hMultiplicityHFMixing", "hMultiplicityHFMixing", {HistType::kTH1F, {{500, 0, 500}}}); - registry.add("Data/TpcTpc/HfHadron/MixedEvent/hVtxZHFMixing", "hVtxZHFMixing", {HistType::kTH1F, {{100, -10, 10}}}); - registry.add("Data/TpcTpc/HfHadron/MixedEvent/hNtracksHFMixing", "hNtracksHFMixing", {HistType::kTH1F, {{500, 0, 500}}}); - // TRACK HISTOGRAMS - // histograms for associated particles - registry.add("Data/TpcTpc/HadronHadron/SameEvent/hYields", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); - registry.add("Data/TpcTpc/HadronHadron/SameEvent/hEtaPhi", "multiplicity vs eta vs phi", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); + // DATA : associated particles histograms for TPC-TPC h-h same event registry.add("Data/TpcTpc/HadronHadron/SameEvent/hPt", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); registry.add("Data/TpcTpc/HadronHadron/SameEvent/hEta", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); registry.add("Data/TpcTpc/HadronHadron/SameEvent/hPhi", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcTpc/HadronHadron/SameEvent/hYields", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); + registry.add("Data/TpcTpc/HadronHadron/SameEvent/hEtaPhi", "multiplicity vs eta vs phi", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcTpc/HadronHadron/SameEvent/hNtracks", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + + //Katarina had this : + registry.add("Data/TpcTpc/HadronHadron/SameEvent/hVzEta", "eta vs. Vz", {HistType::kTH2F, {{100, -4, 4, "#eta"}, {20, -10, 10, "Vz"}}}); - // histograms for particles in event mixing + // DATA : event mixing histograms for TPC-TPC h-h mixed event + registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); + registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hMultiplicityMixing", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hVtxZMixing", "hVtxZMixing", {HistType::kTH1F, {{100, -10, 10}}}); + registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing", "hNtracksMixing", {HistType::kTH1F, {{500, 0, 500}}}); + + // DATA : particles histograms for TPC-TPC h-h mixed event registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hPtMixing", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hEtaMixing", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hPhiMixing", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + + // ========================= + // DATA : histograms for TPC-TPC HF-h case + // ========================= - // histograms for MFT tracks - registry.add("Data/TpcMft/HadronHadron/hEtaPhiMFT", "multiplicity vs eta vs phi in MFT", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); - registry.add("Data/TpcMft/HadronHadron/hEtaMFT", "etaMFT", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); - registry.add("Data/TpcMft/HadronHadron/hPhiMFT", "phiMFT", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + // DATA : event histograms for TPC-TPC HF-h same event + registry.add("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); + registry.add("Data/TpcTpc/HfHadron/MixedEvent/hMultiplicityHFMixing", "hMultiplicityHFMixing", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("Data/TpcTpc/HfHadron/MixedEvent/hVtxZHFMixing", "hVtxZHFMixing", {HistType::kTH1F, {{100, -10, 10}}}); + registry.add("Data/TpcTpc/HfHadron/MixedEvent/hNtracksHFMixing", "hNtracksHFMixing", {HistType::kTH1F, {{500, 0, 500}}}); - // histograms for candidates + + // DATA : trigger particles (candidates) histograms for TPC-TPC h-h same event auto vbins = (std::vector)binsPt; - registry.add("Data/TpcTpc/HfHadron/hPtCand", "2-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); registry.add("Data/TpcTpc/HfHadron/hPtProng0", "2-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); registry.add("Data/TpcTpc/HfHadron/hPtProng1", "2-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); @@ -215,19 +248,85 @@ struct HfTaskFlow { registry.add("Data/TpcTpc/HfHadron/hDecLenErr", "2-prong candidates;decay length error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("Data/TpcTpc/HfHadron/hDecLenXYErr", "2-prong candidates;decay length xy error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - // histograms for candidates in event mixing + // DATA : trigger particles (candidates) histograms for TPC-TPC h-h mixed event registry.add("Data/TpcTpc/HfHadron/MixedEvent/hPtHFMixing", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); registry.add("Data/TpcTpc/HfHadron/MixedEvent/hEtaHFMixing", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); registry.add("Data/TpcTpc/HfHadron/MixedEvent/hPhiHFMixing", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); - - registry.add("MC/TpcTpc/HadronHadron/SameEvent/hMultiplicity", "hMultiplicity", {HistType::kTH1F, {{500, 0, 500}}}); - registry.add("MC/TpcTpc/HadronHadron/SameEvent/hVtxZ", "hVtxZ", {HistType::kTH1F, {{400, -50, 50}}}); - registry.add("MC/TpcTpc/HadronHadron/SameEvent/hEventCountSame", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); - registry.add("MC/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); + // ========================= + // DATA : histograms for TPC-MFT h-h case + // ========================= + + + // DATA : associated particles (MFT tracks) histograms for TPC-MFT h-h same event + registry.add("Data/TpcMft/HadronHadron/hEtaPhiMFT", "multiplicity vs eta vs phi in MFT", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcMft/HadronHadron/hEtaMFT", "etaMFT", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); + registry.add("Data/TpcMft/HadronHadron/hPhiMFT", "phiMFT", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + + // DATA : histograms for TPC-MFT h-h event mixing + registry.add("Data/TpcMft/HadronHadron/MixedEvent/hMultiplicityMixing", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("Data/TpcMft/HadronHadron/MixedEvent/hVtxZMixing", "hVtxZMixing", {HistType::kTH1F, {{100, -10, 10}}}); + registry.add("Data/TpcMft/HadronHadron/MixedEvent/hPtMixing", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); + registry.add("Data/TpcMft/HadronHadron/MixedEvent/hEtaMixing", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); + registry.add("Data/TpcMft/HadronHadron/MixedEvent/hPhiMixing", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcMft/HadronHadron/MixedEvent/hNtracksMixing", "hNtracksMixing", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("Data/TpcMft/HadronHadron/MixedEvent/hEventCountMixing", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); + + // ========================= + // MC : histograms for TPC-MFT h-h case + // ========================= + + // MC reconstructed + + registry.add("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicity", "hMultiplicity", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("MC/Rec/TpcTpc/HadronHadron/SameEvent/hVtxZ", "hVtxZ", {HistType::kTH1F, {{400, -50, 50}}}); + registry.add("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEventCountSame", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + // Katarina had this : + registry.add("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicityPrimary", "hMultiplicityPrimary", {HistType::kTH1F, {{500, 0, 500}}}); + // histograms for MC associated particles + registry.add("MC/Rec/TpcTpc/HadronHadron/SameEvent/hPt", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); + registry.add("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEta", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); + registry.add("MC/Rec/TpcTpc/HadronHadron/SameEvent/hPhi", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + registry.add("MC/Rec/TpcTpc/HadronHadron/SameEvent/hYields", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); + registry.add("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEtaPhi", "multiplicity vs eta vs phi", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); + registry.add("MC/Rec/TpcTpc/HadronHadron/SameEvent/hNtracks", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + // histograms for MC particles in event mixing + registry.add("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); + registry.add("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hMultiplicityMixing", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hVtxZMixing", "hVtxZMixing", {HistType::kTH1F, {{100, -10, 10}}}); + registry.add("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hPtMixing", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); + registry.add("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hEtaMixing", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); + registry.add("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hPhiMixing", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + registry.add("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing", "hNtracksMixing", {HistType::kTH1F, {{500, 0, 500}}}); + + // MC Truth + + registry.add("MC/Gen/TpcTpc/HadronHadron/SameEvent/hMultiplicity", "hMultiplicity", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("MC/Gen/TpcTpc/HadronHadron/SameEvent/hVtxZ", "hVtxZ", {HistType::kTH1F, {{400, -50, 50}}}); + registry.add("MC/Gen/TpcTpc/HadronHadron/SameEvent/hEventCountSame", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + // Katarina had this : + registry.add("MC/Gen/TpcTpc/HadronHadron/SameEvent/hMultiplicityPrimary", "hMultiplicityPrimary", {HistType::kTH1F, {{500, 0, 500}}}); + // histograms for MC associated particles + registry.add("MC/Gen/TpcTpc/HadronHadron/SameEvent/hPt", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); + registry.add("MC/Gen/TpcTpc/HadronHadron/SameEvent/hEta", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); + registry.add("MC/Gen/TpcTpc/HadronHadron/SameEvent/hPhi", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + registry.add("MC/Gen/TpcTpc/HadronHadron/SameEvent/hYields", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); + registry.add("MC/Gen/TpcTpc/HadronHadron/SameEvent/hEtaPhi", "multiplicity vs eta vs phi", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); + registry.add("MC/Gen/TpcTpc/HadronHadron/SameEvent/hNtracks", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + // histograms for MC particles in event mixing + registry.add("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); + registry.add("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hMultiplicityMixing", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hVtxZMixing", "hVtxZMixing", {HistType::kTH1F, {{100, -10, 10}}}); + registry.add("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hPtMixing", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); + registry.add("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hEtaMixing", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); + registry.add("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hPhiMixing", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + registry.add("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing", "hNtracksMixing", {HistType::kTH1F, {{500, 0, 500}}}); + + // ========================= + // Declaration of correlation containers and their respective axis + // ========================= - // set axes of the correlation container std::vector corrAxis = {{axisDeltaEta, "#Delta#eta"}, {axisPtAssoc, "p_{T} (GeV/c)"}, {axisPtTrigger, "p_{T} (GeV/c)"}, @@ -250,50 +349,38 @@ struct HfTaskFlow { // initialization of correlation containes for monte-carlo sameTPCTPCChChMC.setObject(new CorrelationContainer("sameTPCTPCChChMC", "sameTPCTPCChChMC", corrAxis, effAxis, {})); mixedTPCTPCChChMC.setObject(new CorrelationContainer("mixedTPCTPCChChMC", "mixedTPCTPCChChMC", corrAxis, effAxis, {})); - } + } // End of init() function - // --------------- + // ========================= // templates // FIXME: Some collisions are rejected here, what causes (part of) differences with the D0 task - // --------------- + // ========================= template bool isCollisionSelected(TCollision const& collision, bool fillHistograms = false) { - if (processRun2 == true) { - // Run 2: trigger selection for data case - if (fillHistograms) - registry.fill(HIST("Data/hEventCounter"), 1); - if (!processMc) { - if (!collision.alias_bit(kINT7)) { - return false; - } - } - // Run 2: further offline selection - if (fillHistograms) - registry.fill(HIST("Data/hEventCounter"), 2); - if (!collision.sel7()) { - return false; - } - if (fillHistograms) - registry.fill(HIST("Data/hEventCounter"), 3); - } else { - // Run 3: selection - if (fillHistograms) - registry.fill(HIST("Data/hEventCounter"), 1); + if (fillHistograms) + registry.fill(HIST("Data/hEventCounter"), 1); - if (processMc == false) { - if (!collision.sel8()) { - return false; - } + if (processMc == false) { + if (!collision.sel8()) { + return false; } - if (fillHistograms) - registry.fill(HIST("Data/hEventCounter"), 3); } + + if (fillHistograms) + registry.fill(HIST("Data/hEventCounter"), 3); + return true; } + + // ========================= + // Quality Assesment plots + // ========================= + + // ---- DATA : TPC-TPC h-h Same Event QA ---- template - void fillQA(float multiplicity, TTracks const& tracks) + void fillTpcTpcChChSameEventQA(float multiplicity, TTracks const& tracks) { int Ntracks = 0; for (const auto& track1 : tracks) { @@ -307,8 +394,37 @@ struct HfTaskFlow { registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hNtracks"), Ntracks); } + // ---- MC : TPC-TPC h-h Same Event QA ---- + // Changed quickly void for int type + added the return for a test + template + int fillTpcTpcChChSameEventQAmc(float multiplicity, TTracks const& tracks) + { + int Ntracks = 0; + for (const auto& track1 : tracks) { + // TO-DO : DEBUG THIS + + + if (!isMcParticleSelected(track1)) { + continue; + } + + + Ntracks++; + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hPt"), track1.pt()); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEta"), track1.eta()); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hPhi"), track1.phi()); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hYields"), multiplicity, track1.pt(), track1.eta()); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEtaPhi"), multiplicity, track1.eta(), track1.phi()); + } + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hNtracks"), Ntracks); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicityPrimary"), Ntracks); + return Ntracks; + } + + + // ---- DATA : TPC-TPC h-h Mixed Event QA ---- template - void fillMixingQA(float multiplicity, float vz, TTracks const& tracks) + void fillTpcTpcChChMixedEventQA(float multiplicity, float vz, TTracks const& tracks) { registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hMultiplicityMixing"), multiplicity); registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hVtxZMixing"), vz); @@ -323,8 +439,26 @@ struct HfTaskFlow { registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing"), Ntracks); } + // ---- MC : TPC-TPC h-h Mixed Event QA ---- template - void fillHFMixingQA(float multiplicity, float vz, TTracks const& tracks) + void fillTpcTpcChChMixedEventQAmc(float multiplicity, float vz, TTracks const& tracks) + { + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hMultiplicityMixing"), multiplicity); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hVtxZMixing"), vz); + + int Ntracks = 0; + for (const auto& track1 : tracks) { + Ntracks++; + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hPtMixing"), track1.pt()); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hEtaMixing"), track1.eta()); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hPhiMixing"), track1.phi()); + } + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing"), Ntracks); + } + + // ---- DATA : TPC-TPC HF-h Mixed Event QA ---- + template + void fillTpcTpcHfChMixedEventQA(float multiplicity, float vz, TTracks const& tracks) { registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hMultiplicityHFMixing"), multiplicity); registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hVtxZHFMixing"), vz); @@ -339,8 +473,10 @@ struct HfTaskFlow { registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hNtracksHFMixing"), Ntracks); } + + // ---- DATA : TPC-MFT h-h Same Event QA ---- template - void fillMFTQA(float multiplicity, TTracks const& tracks) + void fillTpcMftChChSameEventQA(float multiplicity, TTracks const& tracks) { for (const auto& track1 : tracks) { registry.fill(HIST("Data/TpcMft/HadronHadron/hEtaMFT"), track1.eta()); @@ -351,6 +487,24 @@ struct HfTaskFlow { } } + + // ---- DATA : TPC-MFT h-h Mixed Event QA ---- + template + void fillTpcMftChChMixedEventQA(float multiplicity, float vz, TTracks const& tracks) + { + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hMultiplicityMixing"), multiplicity); + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hVtxZMixing"), vz); + + int Ntracks = 0; + for (const auto& track1 : tracks) { + Ntracks++; + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hPtMixing"), track1.pt()); + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hEtaMixing"), track1.eta()); + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hPhiMixing"), track1.phi()); + } + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hNtracksMixing"), Ntracks); + } + // TODO: Check how to put this into a Filter template bool isAcceptedCandidate(TTrack const& candidate) @@ -364,6 +518,28 @@ struct HfTaskFlow { return true; } + template + bool isMcParticleSelected(TTrack& track) + { + // remove MC particles with charge = 0 + int8_t sign = 0; + TParticlePDG* pdgparticle = pdg->GetParticle(track.pdgCode()); + if (pdgparticle != nullptr) { + sign = (pdgparticle->Charge() > 0) ? 1.0 : ((pdgparticle->Charge() < 0) ? -1.0 : 0.0); + } + if (sign == 0) { + return false; + } + + // MC particle has to be primary + if constexpr (step <= CorrelationContainer::kCFStepAnaTopology) { + return track.isPhysicalPrimary(); + } + return true; + } + + + // ---- DATA : TPC-TPC HF-h Same Event (Candidates) QA ---- // TODO: Note: we do not need all these plots since they are in D0 and Lc task -> remove it after we are sure this works template void fillCandidateQA(TTracks const& candidates) @@ -400,7 +576,11 @@ struct HfTaskFlow { } } - template + // ========================= + // Correlation functions + // ========================= + + template void fillCorrelations(TTarget target, TTracksTrig const& tracks1, TTracksAssoc const& tracks2, float multiplicity, float posZ) { auto triggerWeight = 1; @@ -417,6 +597,7 @@ struct HfTaskFlow { // calculating inv. mass to be filled into the container below // Note: this is needed only in case of HF-hadron correlations + // TO DO ? Add one more if condition if its MC ? bool fillingHFcontainer = false; double invmass = 0; if constexpr (std::is_same_v) { @@ -428,6 +609,21 @@ struct HfTaskFlow { invmass = hfHelper.invMassD0ToPiK(track1); } + // TO-DO : DEBUG THIS + + // From Katarina's code + // in case of MC-generated, do additional selection on MCparticles : charge and isPhysicalPrimary + //if (processMc) { + // NOTE : this version with aodMcParticles is only for Katarina's way of doing MC + if constexpr (std::is_same_v || std::is_same_v) { + if (!isMcParticleSelected(track1)) { + continue; + } + // TO-DO : add other if constexpr conditions when I will have more MC cases + } + + + // fill single-track distributions if (!fillingHFcontainer) { target->getTriggerHist()->Fill(CorrelationContainer::kCFStepReconstructed, pt1, multiplicity, posZ, triggerWeight); @@ -453,6 +649,21 @@ struct HfTaskFlow { } } + + // TO DO : DEBUG THIS + + + // in case of MC-generated, do additional selection on MCparticles : charge and isPhysicalPrimary + //if (processMc) { + if constexpr (std::is_same_v || std::is_same_v) { + if (!isMcParticleSelected(track2)) { + continue; + } + // Note : no need for HF if condition as this will always be normal track, but maybe for MFT + } + + + float eta2 = track2.eta(); float pt2 = track2.pt(); float phi2 = track2.phi(); @@ -485,20 +696,27 @@ struct HfTaskFlow { template void mixCollisions(TCollisions const& collisions, TTracksTrig const& tracks1, TTracksAssoc const& tracks2, TLambda getPartsSize, OutputObj& corrContainer) { + //The first one that I call "Data" should work for data and mc rec + using BinningTypeData = FlexibleBinningPolicy, aod::collision::PosZ, decltype(getPartsSize)>; - using BinningType = FlexibleBinningPolicy, aod::collision::PosZ, decltype(getPartsSize)>; - BinningType binningWithTracksSize{{getPartsSize}, {axisVertex, axisMultiplicity}, true}; + BinningTypeData binningWithTracksSize{{getPartsSize}, {axisVertex, axisMultiplicity}, true}; auto tracksTuple = std::make_tuple(tracks1, tracks2); - Pair pair{binningWithTracksSize, nMixedEvents, -1, collisions, tracksTuple, &cache}; + Pair pair{binningWithTracksSize, nMixedEvents, -1, collisions, tracksTuple, &cache}; for (const auto& [collision1, tracks1, collision2, tracks2] : pair) { - if (!(isCollisionSelected(collision1, false))) { - continue; - } - if (!(isCollisionSelected(collision2, false))) { - continue; + + // added this to try to compile when doing mixed event with aodMcParticles and aodMcCollisions (MC truth) + // TO DO, TO GET RID OF THIS WHEN I FINISHED MIXCOLLISIONS FOR MCTRUTH + if constexpr (!std::is_same_v) { + if (!(isCollisionSelected(collision1, false))) { + continue; + } + if (!(isCollisionSelected(collision2, false))) { + continue; + } } + auto binningValues = binningWithTracksSize.getBinningValues(collision1, collisions); int bin = binningWithTracksSize.getBin(binningValues); @@ -508,10 +726,9 @@ struct HfTaskFlow { // TO BE DONE : ADD ONE MORE IF CONDITION TO FILL THE MC CASE - if constexpr (std::is_same_v) { - registry.fill(HIST("MC/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); - // TO BE DONE : ADD QA FUNCTION FOR MC - //fillMixingQA(multiplicity, vz, tracks1); + if constexpr (std::is_same_v) { // If MC + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); + fillTpcTpcChChMixedEventQAmc(multiplicity, vz, tracks1); /* if constexpr (std::is_same_v) { registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); @@ -522,27 +739,87 @@ struct HfTaskFlow { } */ } - else { - if constexpr (std::is_same_v) { + else { // If not MC + if constexpr (std::is_same_v) { // DATA : If TPC-TPC Hf-h case registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); - fillHFMixingQA(multiplicity, vz, tracks1); - } else { + fillTpcTpcHfChMixedEventQA(multiplicity, vz, tracks1); + } + else if constexpr (std::is_same_v) { // DATA : If TPC-MFT h-h case + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hEventCountMixing"), bin); + fillTpcMftChChMixedEventQA(multiplicity, vz, tracks1); + } + else { // DATA : If TPC-TPC h-h case registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); - fillMixingQA(multiplicity, vz, tracks1); + fillTpcTpcChChMixedEventQA(multiplicity, vz, tracks1); + + } + } + + corrContainer->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); + // TO-DO : probably put the step of the correlation container in the template of this function + fillCorrelations(corrContainer, tracks1, tracks2, multiplicity, collision1.posZ()); + } + } + + + //template + //void mixCollisions(FilteredCollisionsWSelMult const& collisions, TTracksTrig const& tracks1, TTracksAssoc const& tracks2, TLambda getPartsSize, OutputObj& corrContainer) + template + void mixCollisionsMcTruth(TCollisions const& collisions, TTracksTrig const& tracks1, TTracksAssoc const& tracks2, TLambda getPartsSize, OutputObj& corrContainer) + { + using BinningTypeMcTruth = FlexibleBinningPolicy, aod::mccollision::PosZ, decltype(getPartsSize)>; + + BinningTypeMcTruth binningWithTracksSize{{getPartsSize}, {axisVertex, axisMultiplicity}, true}; + auto tracksTuple = std::make_tuple(tracks1, tracks2); + Pair pair{binningWithTracksSize, nMixedEvents, -1, collisions, tracksTuple, &cache}; + + + for (const auto& [collision1, tracks1, collision2, tracks2] : pair) { + + + // added this to try to compile when doing mixed event with aodMcParticles and aodMcCollisions (MC truth) + // TODO : GET RID OF THE COLLISION SELECTION FOR MC TRUTH + if constexpr (!std::is_same_v) { + if (!(isCollisionSelected(collision1, false))) { + continue; + } + if (!(isCollisionSelected(collision2, false))) { + continue; } } + + + auto binningValues = binningWithTracksSize.getBinningValues(collision1, collisions); + int bin = binningWithTracksSize.getBin(binningValues); + const auto multiplicity = tracks2.size(); // get multiplicity of charged hadrons, which is used for slicing in mixing + const auto vz = collision1.posZ(); - // TO-DO : add the same thing above but for MC + + // TO BE DONE : ADD ONE MORE IF CONDITION TO FILL THE MC CASE + // TODO : FILL NEW PLOTS FOR MCTRUTH ONLY + registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); + fillTpcTpcChChMixedEventQAmc(multiplicity, vz, tracks1); + /* + if constexpr (std::is_same_v) { + registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); + fillHFMixingQA(multiplicity, vz, tracks1); + } else { + registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); + fillMixingQA(multiplicity, vz, tracks1); + } + */ corrContainer->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); - fillCorrelations(corrContainer, tracks1, tracks2, multiplicity, collision1.posZ()); + // TO-DO : probably put the step of the correlation container in the template of this function + fillCorrelations(corrContainer, tracks1, tracks2, multiplicity, collision1.posZ()); } } // ===================================== - // DATA : process same event correlations: h-h case + // DATA : process same event correlations: TPC-TPC h-h case // ===================================== + void processSameTpcTpcChCh(FilteredCollisionsWSelMult::iterator const& collision, TracksWDcaSel const& tracks) { @@ -565,14 +842,16 @@ struct HfTaskFlow { sameTPCTPCChCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); - fillQA(multiplicity, tracks); - fillCorrelations(sameTPCTPCChCh, tracks, tracks, multiplicity, collision.posZ()); + fillTpcTpcChChSameEventQA(multiplicity, tracks); + // TO-DO : add if condition for when we will implant corrected correlations (kCFStepReconstructed -> kCFStepCorrected) + fillCorrelations(sameTPCTPCChCh, tracks, tracks, multiplicity, collision.posZ()); } PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcChCh, "DATA : Process same-event correlations for TPC-TPC h-h case", true); // ===================================== - // DATA : process same event correlations: HF-h case + // DATA : process same event correlations: TPC-TPC HF-h case // ===================================== + void processSameTpcTpcHfCh(FilteredCollisionsWSelMult::iterator const& collision, TracksWDcaSel const& tracks, HfCandidatesSel const& candidates) @@ -585,13 +864,14 @@ struct HfTaskFlow { sameTPCTPCHfCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); fillCandidateQA(candidates); - fillCorrelations(sameTPCTPCHfCh, candidates, tracks, multiplicity, collision.posZ()); + fillCorrelations(sameTPCTPCHfCh, candidates, tracks, multiplicity, collision.posZ()); } PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcHfCh, "DATA : Process same-event correlations for TPC-TPC HF-h case", true); // ===================================== - // DATA : process same event correlations: h-MFT case + // DATA : process same event correlations: TPC-MFT h-h case // ===================================== + void processSameTpcMftChCh(FilteredCollisionsWSelMult::iterator const& collision, TracksWDcaSel const& tracks, aod::MFTTracks const& mfttracks) @@ -603,42 +883,119 @@ struct HfTaskFlow { const auto multiplicity = tracks.size(); sameTPCMFTChCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); - fillMFTQA(multiplicity, mfttracks); - fillCorrelations(sameTPCMFTChCh, tracks, mfttracks, multiplicity, collision.posZ()); + fillTpcMftChChSameEventQA(multiplicity, mfttracks); + fillCorrelations(sameTPCMFTChCh, tracks, mfttracks, multiplicity, collision.posZ()); } PROCESS_SWITCH(HfTaskFlow, processSameTpcMftChCh, "DATA : Process same-event correlations for TPC-MFT h-h case", true); // ===================================== - // MONTE-CARLO : process same event correlations: h-h case + // MONTE-CARLO : process same event correlations: TPC-TPC h-h case // ===================================== + // My version = MC rec + /* void processSameTpcTpcChChmc(FilteredCollisionsWSelMultMC::iterator const& mccollision, - TracksWDcaSelMC const& mctracks) + TracksWDcaSelMC const& mctracks, + aodMcParticles const& mcParticles) { - /* + + // NEED TO COMMENT THIS if (!(isCollisionSelected(mccollision, true))) { return; } - */ + + + // INITIALLY I DID WITH mctracks, but Katarina in her code use mcParticles const auto multiplicity = mctracks.size(); - registry.fill(HIST("MC/TpcTpc/HadronHadron/SameEvent/hMultiplicity"), multiplicity); - registry.fill(HIST("MC/TpcTpc/HadronHadron/SameEvent/hVtxZ"), mccollision.posZ()); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicity"), multiplicity); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hVtxZ"), mccollision.posZ()); + + BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; + int bin = baseBinning.getBin(std::make_tuple(mccollision.posZ(), multiplicity)); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEventCountSame"), bin); + + sameTPCTPCChChMC->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); + + fillTpcTpcChChSameEventQAmc(multiplicity, mctracks); + fillCorrelations(sameTPCTPCChChMC, mctracks, mctracks, multiplicity, mccollision.posZ()); + + + + // TO COMMENT THIS BELOW + //With McParticles instead of mctracks -> IT DOESNT WORK + const auto multiplicity = mcParticles.size(); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicity"), multiplicity); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hVtxZ"), mccollision.posZ()); BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; int bin = baseBinning.getBin(std::make_tuple(mccollision.posZ(), multiplicity)); - registry.fill(HIST("MC/TpcTpc/HadronHadron/SameEvent/hEventCountSame"), bin); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEventCountSame"), bin); sameTPCTPCChChMC->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); - fillCorrelations(sameTPCTPCChChMC, mctracks, mctracks, multiplicity, mccollision.posZ()); + fillTpcTpcChChSameEventQAmc(multiplicity, mcParticles); + fillCorrelations(sameTPCTPCChChMC, mcParticles, mcParticles, multiplicity, mccollision.posZ()); + + } + PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcChChmc, "MONTE-CARLO : Process same-event correlations for TPC-TPC h-h case", true); + */ + + //Katarina's version = MC Truth + void processSameTpcTpcChChmc(aodMcCollisions::iterator const& mcCollision, + //FilteredCollisionsWSelMultMC const& collisions, + aodMcParticles const& mcParticles) + { + /* + if (!(isCollisionSelected(mccollision, true))) { + return; + } + */ + + // Not sure why to use this + /* + if (collisions.size() == 0) { + return; + } + */ + + /* + if (!collision.has_mcCollision()) { + LOGF(warning, "No MC collision for this collision, skip..."); + return; + } + */ + + const auto multiplicity = mcParticles.size(); // Note: these are all MC particles after selection (not only primary) + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicity"), multiplicity); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hVtxZ"), mcCollision.posZ()); + + // fill correlations for all MC collisions + // In Katka's code, the first time doing this does not fill the histograms, right now will be filled two times.. + auto multPrimaryCharge0 = fillTpcTpcChChSameEventQAmc(multiplicity, mcParticles); + sameTPCTPCChChMC->fillEvent(multPrimaryCharge0, CorrelationContainer::kCFStepReconstructed); + fillCorrelations(sameTPCTPCChChMC, mcParticles, mcParticles, multPrimaryCharge0, mcCollision.posZ()); + + + // NOT USED BY KATARINA APPARENTLY + //BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; + //int bin = baseBinning.getBin(std::make_tuple(mcCollision.posZ(), multiplicity)); + //registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEventCountSame"), bin); + + + // fill correlations for MC collisions that have a reconstructed collision + // got rid of the second const auto for multPrimaryCharge0 + multPrimaryCharge0 = fillTpcTpcChChSameEventQAmc(multiplicity, mcParticles); + sameTPCTPCChChMC->fillEvent(multPrimaryCharge0, CorrelationContainer::kCFStepVertex); + fillCorrelations(sameTPCTPCChChMC, mcParticles, mcParticles, multPrimaryCharge0, mcCollision.posZ()); } PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcChChmc, "MONTE-CARLO : Process same-event correlations for TPC-TPC h-h case", true); // ===================================== - // DATA : process mixed event correlations: h-h case + // DATA : process mixed event correlations:TPC-TPC h-h case // ===================================== + void processMixedTpcTpcChCh(FilteredCollisionsWSelMult const& collisions, TracksWDcaSel const& tracks) { @@ -654,8 +1011,9 @@ struct HfTaskFlow { PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcChCh, "DATA : Process mixed-event correlations for TPC-TPC h-h case", true); // ===================================== - // DATA : process mixed event correlations: h-HF case + // DATA : process mixed event correlations: TPC-TPC HF-h case // ===================================== + void processMixedTpcTpcHfCh(FilteredCollisionsWSelMult const& collisions, TracksWDcaSel const& tracks, HfCandidatesSel const& candidates) @@ -672,8 +1030,9 @@ struct HfTaskFlow { PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcHfCh, "DATA : Process mixed-event correlations for TPC-TPC HF-h case", true); // ===================================== - // DATA : process mixed event correlations: h-MFT case + // DATA : process mixed event correlations: TPC-MFT h-h case // ===================================== + void processMixedTpcMftChCh(FilteredCollisionsWSelMult const& collisions, TracksWDcaSel const& tracks, aod::MFTTracks const& mfttracks) @@ -690,18 +1049,19 @@ struct HfTaskFlow { PROCESS_SWITCH(HfTaskFlow, processMixedTpcMftChCh, "DATA : Process mixed-event correlations for TPC-MFT h-h case", true); // ===================================== - // MONTE-CARLO : process mixed event correlations: h-h case + // MONTE-CARLO : process mixed event correlations: TPC-TPC h-h case // ===================================== + /* void processMixedTpcTpcChChmc(FilteredCollisionsWSelMultMC const& mccollisions, TracksWDcaSelMC const& mctracks) { // use normal index instead of globalIndex for MixedEvent ?? + // we want to group collisions based on charged-track multiplicity auto getTracksSize = [&mctracks, this](FilteredCollisionsWSelMultMC::iterator const& mccol) { - //auto associatedTracks = mctracks.sliceByCached(o2::aod::track::collisionId, mccol.globalIndex(), this->cache); // it's cached, so slicing/grouping happens only once auto associatedTracks = mctracks.sliceByCached(o2::aod::track::collisionId, mccol.globalIndex(), this->cache); // it's cached, so slicing/grouping happens only once auto size = associatedTracks.size(); return size; @@ -710,6 +1070,29 @@ struct HfTaskFlow { mixCollisions(mccollisions, mctracks, mctracks, getTracksSize, mixedTPCTPCChChMC); } PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcChChmc, "MONTE-CARLO : Process mixed-event correlations for TPC-TPC h-h case", true); + */ + +void processMixedTpcTpcChChmc(aodMcCollisions const& mccollisions, + aodMcParticles const& mcparticles, + FilteredCollisionsWSelMultMC const& collisions) + { + // use normal index instead of globalIndex for MixedEvent ?? + + + + // we want to group collisions based on charged-track multiplicity + auto getTracksSize = [&mcparticles, this](aodMcCollisions::iterator const& mccol) { + auto associatedTracks = mcparticles.sliceByCached(o2::aod::mcparticle::mcCollisionId, mccol.globalIndex(), this->cache); // it's cached, so slicing/grouping happens only once + auto size = associatedTracks.size(); + return size; + }; + + + + mixCollisionsMcTruth(mccollisions, mcparticles, mcparticles, getTracksSize, mixedTPCTPCChChMC); + } + PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcChChmc, "MONTE-CARLO : Process mixed-event correlations for TPC-TPC h-h case", true); + }; // End of struct WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 2975e66a11e899b8b1000318370846449558de79 Mon Sep 17 00:00:00 2001 From: AlexianL Date: Mon, 23 Sep 2024 16:31:08 +0200 Subject: [PATCH 12/31] Running MC process functions for TPC-TPC h-h --- PWGHF/HFC/Tasks/taskFlow.cxx | 212 ++++++++++++++++++----------------- 1 file changed, 112 insertions(+), 100 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 4590b454b00..8a0253466e8 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -403,21 +403,38 @@ struct HfTaskFlow { for (const auto& track1 : tracks) { // TO-DO : DEBUG THIS - - if (!isMcParticleSelected(track1)) { - continue; + // in case of MC-generated, do additional selection on MCparticles : charge and isPhysicalPrimary + if constexpr ( std::is_same_v) { + if (!isMcParticleSelected(track1)) { + continue; + } + // TO-DO : add other if constexpr conditions when I will have more MC cases } Ntracks++; - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hPt"), track1.pt()); - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEta"), track1.eta()); - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hPhi"), track1.phi()); - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hYields"), multiplicity, track1.pt(), track1.eta()); - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEtaPhi"), multiplicity, track1.eta(), track1.phi()); + if constexpr ( std::is_same_v) { // if MC Rec + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hPt"), track1.pt()); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEta"), track1.eta()); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hPhi"), track1.phi()); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hYields"), multiplicity, track1.pt(), track1.eta()); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEtaPhi"), multiplicity, track1.eta(), track1.phi()); + } + else { // if MC Gen + registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hPt"), track1.pt()); + registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hEta"), track1.eta()); + registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hPhi"), track1.phi()); + registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hYields"), multiplicity, track1.pt(), track1.eta()); + registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hEtaPhi"), multiplicity, track1.eta(), track1.phi()); + } + } + if constexpr ( std::is_same_v) { // if MC Rec + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hNtracks"), Ntracks); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicityPrimary"), Ntracks); + } else { // if MC Gen + registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hNtracks"), Ntracks); + registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hMultiplicityPrimary"), Ntracks); } - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hNtracks"), Ntracks); - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicityPrimary"), Ntracks); return Ntracks; } @@ -443,17 +460,32 @@ struct HfTaskFlow { template void fillTpcTpcChChMixedEventQAmc(float multiplicity, float vz, TTracks const& tracks) { - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hMultiplicityMixing"), multiplicity); - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hVtxZMixing"), vz); + if constexpr ( std::is_same_v) { // if MC Rec + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hMultiplicityMixing"), multiplicity); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hVtxZMixing"), vz); + } else { // if MC Gen + registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hMultiplicityMixing"), multiplicity); + registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hVtxZMixing"), vz); + } int Ntracks = 0; for (const auto& track1 : tracks) { Ntracks++; - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hPtMixing"), track1.pt()); - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hEtaMixing"), track1.eta()); - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hPhiMixing"), track1.phi()); + if constexpr ( std::is_same_v) { // if MC Rec + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hPtMixing"), track1.pt()); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hEtaMixing"), track1.eta()); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hPhiMixing"), track1.phi()); + } else { // if MC Gen + registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hPtMixing"), track1.pt()); + registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hEtaMixing"), track1.eta()); + registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hPhiMixing"), track1.phi()); + } + } + if constexpr ( std::is_same_v) { // if MC Rec + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing"), Ntracks); + } else { // if MC Gen + registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing"), Ntracks); } - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing"), Ntracks); } // ---- DATA : TPC-TPC HF-h Mixed Event QA ---- @@ -609,8 +641,6 @@ struct HfTaskFlow { invmass = hfHelper.invMassD0ToPiK(track1); } - // TO-DO : DEBUG THIS - // From Katarina's code // in case of MC-generated, do additional selection on MCparticles : charge and isPhysicalPrimary //if (processMc) { @@ -642,17 +672,13 @@ struct HfTaskFlow { } // in case of HF-h correlations, remove candidate daughters from the pool of associated hadrons - // with which the candidate is being correlated + // with which the candidate is being correlated (will not have to do it for TPC-MFT case) if constexpr (std::is_same_v) { if ((track1.prong0Id() == track2.globalIndex()) || (track1.prong1Id() == track2.globalIndex())) { continue; } } - - // TO DO : DEBUG THIS - - // in case of MC-generated, do additional selection on MCparticles : charge and isPhysicalPrimary //if (processMc) { if constexpr (std::is_same_v || std::is_same_v) { @@ -725,7 +751,6 @@ struct HfTaskFlow { const auto vz = collision1.posZ(); - // TO BE DONE : ADD ONE MORE IF CONDITION TO FILL THE MC CASE if constexpr (std::is_same_v) { // If MC registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); fillTpcTpcChChMixedEventQAmc(multiplicity, vz, tracks1); @@ -810,9 +835,9 @@ struct HfTaskFlow { } */ - corrContainer->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); + corrContainer->fillEvent(multiplicity, CorrelationContainer::kCFStepAll); // TO-DO : probably put the step of the correlation container in the template of this function - fillCorrelations(corrContainer, tracks1, tracks2, multiplicity, collision1.posZ()); + fillCorrelations(corrContainer, tracks1, tracks2, multiplicity, collision1.posZ()); } } @@ -892,95 +917,70 @@ struct HfTaskFlow { // MONTE-CARLO : process same event correlations: TPC-TPC h-h case // ===================================== - // My version = MC rec - /* - void processSameTpcTpcChChmc(FilteredCollisionsWSelMultMC::iterator const& mccollision, - TracksWDcaSelMC const& mctracks, - aodMcParticles const& mcParticles) + void processSameTpcTpcChChmcREC(FilteredCollisionsWSelMultMC::iterator const& mcCollision, + TracksWDcaSelMC const& mcTracks) { // NEED TO COMMENT THIS - if (!(isCollisionSelected(mccollision, true))) { + if (!(isCollisionSelected(mcCollision, true))) { return; } - - - // INITIALLY I DID WITH mctracks, but Katarina in her code use mcParticles - const auto multiplicity = mctracks.size(); - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicity"), multiplicity); - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hVtxZ"), mccollision.posZ()); - - BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; - int bin = baseBinning.getBin(std::make_tuple(mccollision.posZ(), multiplicity)); - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEventCountSame"), bin); - - sameTPCTPCChChMC->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); - - fillTpcTpcChChSameEventQAmc(multiplicity, mctracks); - fillCorrelations(sameTPCTPCChChMC, mctracks, mctracks, multiplicity, mccollision.posZ()); - - - - // TO COMMENT THIS BELOW - //With McParticles instead of mctracks -> IT DOESNT WORK - const auto multiplicity = mcParticles.size(); + const auto multiplicity = mcTracks.size(); registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicity"), multiplicity); - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hVtxZ"), mccollision.posZ()); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hVtxZ"), mcCollision.posZ()); BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; - int bin = baseBinning.getBin(std::make_tuple(mccollision.posZ(), multiplicity)); + int bin = baseBinning.getBin(std::make_tuple(mcCollision.posZ(), multiplicity)); registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEventCountSame"), bin); sameTPCTPCChChMC->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); - fillTpcTpcChChSameEventQAmc(multiplicity, mcParticles); - fillCorrelations(sameTPCTPCChChMC, mcParticles, mcParticles, multiplicity, mccollision.posZ()); + fillTpcTpcChChSameEventQAmc(multiplicity, mcTracks); + fillCorrelations(sameTPCTPCChChMC, mcTracks, mcTracks, multiplicity, mcCollision.posZ()); } - PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcChChmc, "MONTE-CARLO : Process same-event correlations for TPC-TPC h-h case", true); - */ - + PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcChChmcREC, "MONTE-CARLO : Process same-event correlations for TPC-TPC h-h case", true); + + //Katarina's version = MC Truth - void processSameTpcTpcChChmc(aodMcCollisions::iterator const& mcCollision, + void processSameTpcTpcChChmcGEN(aodMcCollisions::iterator const& mcCollision, //FilteredCollisionsWSelMultMC const& collisions, aodMcParticles const& mcParticles) { - /* - if (!(isCollisionSelected(mccollision, true))) { - return; - } - */ + - // Not sure why to use this - /* - if (collisions.size() == 0) { - return; - } - */ + //if (!(isCollisionSelected(mcCollision, true))) { + // return; + //} + - /* - if (!collision.has_mcCollision()) { - LOGF(warning, "No MC collision for this collision, skip..."); - return; - } - */ + // Not sure why to use this + //if (collisions.size() == 0) { + // return; + //} + + //if (!collision.has_mcCollision()) { + // LOGF(warning, "No MC collision for this collision, skip..."); + // return; + //} + const auto multiplicity = mcParticles.size(); // Note: these are all MC particles after selection (not only primary) - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicity"), multiplicity); - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hVtxZ"), mcCollision.posZ()); + registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hMultiplicity"), multiplicity); + registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hVtxZ"), mcCollision.posZ()); // fill correlations for all MC collisions // In Katka's code, the first time doing this does not fill the histograms, right now will be filled two times.. - auto multPrimaryCharge0 = fillTpcTpcChChSameEventQAmc(multiplicity, mcParticles); - sameTPCTPCChChMC->fillEvent(multPrimaryCharge0, CorrelationContainer::kCFStepReconstructed); - fillCorrelations(sameTPCTPCChChMC, mcParticles, mcParticles, multPrimaryCharge0, mcCollision.posZ()); + auto multPrimaryCharge0 = fillTpcTpcChChSameEventQAmc(multiplicity, mcParticles); + sameTPCTPCChChMC->fillEvent(multPrimaryCharge0, CorrelationContainer::kCFStepAll); + fillCorrelations(sameTPCTPCChChMC, mcParticles, mcParticles, multPrimaryCharge0, mcCollision.posZ()); // NOT USED BY KATARINA APPARENTLY //BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; //int bin = baseBinning.getBin(std::make_tuple(mcCollision.posZ(), multiplicity)); - //registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEventCountSame"), bin); + //registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hEventCountSame"), bin); // fill correlations for MC collisions that have a reconstructed collision @@ -989,12 +989,13 @@ struct HfTaskFlow { sameTPCTPCChChMC->fillEvent(multPrimaryCharge0, CorrelationContainer::kCFStepVertex); fillCorrelations(sameTPCTPCChChMC, mcParticles, mcParticles, multPrimaryCharge0, mcCollision.posZ()); } - PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcChChmc, "MONTE-CARLO : Process same-event correlations for TPC-TPC h-h case", true); + PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcChChmcGEN, "MONTE-CARLO : Process same-event correlations for TPC-TPC h-h case", true); // ===================================== // DATA : process mixed event correlations:TPC-TPC h-h case // ===================================== + // TO BECOME DATA & MC REC ? void processMixedTpcTpcChCh(FilteredCollisionsWSelMult const& collisions, TracksWDcaSel const& tracks) @@ -1025,6 +1026,16 @@ struct HfTaskFlow { return size; }; + + /* + auto getTracksSize = [&candidates, this](FilteredCollisionsWSelMult::iterator const& col) { + auto associatedTracks = candidates.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); + auto size = associatedTracks.size(); + return size; + }; + */ + + mixCollisions(collisions, candidates, tracks, getTracksSize, mixedTPCTPCHfCh); } PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcHfCh, "DATA : Process mixed-event correlations for TPC-TPC HF-h case", true); @@ -1052,28 +1063,30 @@ struct HfTaskFlow { // MONTE-CARLO : process mixed event correlations: TPC-TPC h-h case // ===================================== - /* - void processMixedTpcTpcChChmc(FilteredCollisionsWSelMultMC const& mccollisions, - TracksWDcaSelMC const& mctracks) + + // MC rec + void processMixedTpcTpcChChmcREC(FilteredCollisionsWSelMultMC const& mcCollisions, + TracksWDcaSelMC const& mcTracks) { // use normal index instead of globalIndex for MixedEvent ?? // we want to group collisions based on charged-track multiplicity - auto getTracksSize = [&mctracks, this](FilteredCollisionsWSelMultMC::iterator const& mccol) { - auto associatedTracks = mctracks.sliceByCached(o2::aod::track::collisionId, mccol.globalIndex(), this->cache); // it's cached, so slicing/grouping happens only once + auto getTracksSize = [&mcTracks, this](FilteredCollisionsWSelMultMC::iterator const& mcCol) { + auto associatedTracks = mcTracks.sliceByCached(o2::aod::track::collisionId, mcCol.globalIndex(), this->cache); // it's cached, so slicing/grouping happens only once auto size = associatedTracks.size(); return size; }; - mixCollisions(mccollisions, mctracks, mctracks, getTracksSize, mixedTPCTPCChChMC); + mixCollisions(mcCollisions, mcTracks, mcTracks, getTracksSize, mixedTPCTPCChChMC); } - PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcChChmc, "MONTE-CARLO : Process mixed-event correlations for TPC-TPC h-h case", true); - */ + PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcChChmcREC, "MONTE-CARLO : Process mixed-event correlations for TPC-TPC h-h case", true); + -void processMixedTpcTpcChChmc(aodMcCollisions const& mccollisions, - aodMcParticles const& mcparticles, +// MC gen +void processMixedTpcTpcChChmcGEN(aodMcCollisions const& mcCollisions, + aodMcParticles const& mcParticles, FilteredCollisionsWSelMultMC const& collisions) { // use normal index instead of globalIndex for MixedEvent ?? @@ -1081,18 +1094,17 @@ void processMixedTpcTpcChChmc(aodMcCollisions const& mccollisions, // we want to group collisions based on charged-track multiplicity - auto getTracksSize = [&mcparticles, this](aodMcCollisions::iterator const& mccol) { - auto associatedTracks = mcparticles.sliceByCached(o2::aod::mcparticle::mcCollisionId, mccol.globalIndex(), this->cache); // it's cached, so slicing/grouping happens only once + auto getTracksSize = [&mcParticles, this](aodMcCollisions::iterator const& mcCol) { + auto associatedTracks = mcParticles.sliceByCached(o2::aod::mcparticle::mcCollisionId, mcCol.globalIndex(), this->cache); // it's cached, so slicing/grouping happens only once auto size = associatedTracks.size(); return size; }; - mixCollisionsMcTruth(mccollisions, mcparticles, mcparticles, getTracksSize, mixedTPCTPCChChMC); + mixCollisionsMcTruth(mcCollisions, mcParticles, mcParticles, getTracksSize, mixedTPCTPCChChMC); } - PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcChChmc, "MONTE-CARLO : Process mixed-event correlations for TPC-TPC h-h case", true); - + PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcChChmcGEN, "MONTE-CARLO : Process mixed-event correlations for TPC-TPC h-h case", true); }; // End of struct WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 0de6f92be00eda4d61099eb3635b2c66a9bac957 Mon Sep 17 00:00:00 2001 From: AlexianL Date: Thu, 26 Sep 2024 14:43:29 +0200 Subject: [PATCH 13/31] Added process functions for the TPC-MFT HF-h case --- PWGHF/HFC/Tasks/taskFlow.cxx | 549 +++++++++++++++++++++++++---------- 1 file changed, 391 insertions(+), 158 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 8a0253466e8..d83c1572bda 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -89,39 +89,36 @@ struct HfTaskFlow { // HF candidate filter // TODO: use Partition instead of filter - Filter candidateFilter = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || + Filter candidateFilter = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; Preslice dataPerCol = aod::track::collisionId; - //Do I have to adapt this preslice to MC ? How does it work exactly ? - //Preslice mcRecPerCol = aod::track::collisionId; + // Do I have to adapt this preslice to MC ? How does it work exactly ? + // Preslice mcRecPerCol = aod::track::collisionId; Preslice mcTruthPerCol = aod::mcparticle::mcCollisionId; // ========================= // MONTE-CARLO : Filters & partitions // ========================= - + // Even add McCollisions in the join ? // Kata adds subscribes to it but do not add it in the join - //using FilteredCollisionsWSelMultMC = soa::Filtered>; + // using FilteredCollisionsWSelMultMC = soa::Filtered>; using FilteredCollisionsWSelMultMC = soa::Filtered>; using TracksWDcaSelMC = soa::Filtered>; - - //using aodCollisions = soa::Filtered>; + // using aodCollisions = soa::Filtered>; // From Katarina's code, but not sure if I use it Filter mcCollisionFilter = nabs(aod::mccollision::posZ) < zVertexMax; using aodMcCollisions = soa::Filtered; - // From Katarina's code Filter mcParticlesFilter = (nabs(aod::mcparticle::eta) < etaTrackAssocMax) && (aod::mcparticle::pt > ptTrackAssocMin); //&& - //(aod::mcparticle::sign != 0) + //(aod::mcparticle::sign != 0) using aodMcParticles = soa::Filtered; - // Katarina had this in her code : // Charged track filters /* @@ -129,10 +126,8 @@ struct HfTaskFlow { (aod::track::pt > ptTrackAssocMin) && requireGlobalTrackWoPtEtaInFilter(); */ - - using aodTracks = soa::Filtered>; - + using aodTracks = soa::Filtered>; // configurables for containers ConfigurableAxis axisVertex{"axisVertex", {14, -7, 7}, "vertex axis for histograms"}; @@ -158,6 +153,8 @@ struct HfTaskFlow { OutputObj mixedTPCTPCHfCh{"mixedTPCTPCHfCh"}; OutputObj sameTPCMFTChCh{"sameTPCMFTChCh"}; OutputObj mixedTPCMFTChCh{"mixedTPCMFTChCh"}; + OutputObj sameTPCMFTHfCh{"sameTPCMFTHfCh"}; + OutputObj mixedTPCMFTHfCh{"mixedTPCMFTHfCh"}; // Correlation containers used for Monte-Carlo OutputObj sameTPCTPCChChMC{"sameTPCTPCChChMC"}; @@ -179,7 +176,7 @@ struct HfTaskFlow { labels[0] = "all"; labels[1] = "after trigger selection (Run 2)"; labels[2] = "after Physics selection"; - + const int maxMixBin = axisMultiplicity->size() * 14; // 14 bins for z-vertex for (int iBin = 0; iBin < kNBinsEvents; iBin++) { @@ -202,8 +199,8 @@ struct HfTaskFlow { registry.add("Data/TpcTpc/HadronHadron/SameEvent/hYields", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); registry.add("Data/TpcTpc/HadronHadron/SameEvent/hEtaPhi", "multiplicity vs eta vs phi", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); registry.add("Data/TpcTpc/HadronHadron/SameEvent/hNtracks", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); - - //Katarina had this : + + // Katarina had this : registry.add("Data/TpcTpc/HadronHadron/SameEvent/hVzEta", "eta vs. Vz", {HistType::kTH2F, {{100, -4, 4, "#eta"}, {20, -10, 10, "Vz"}}}); // DATA : event mixing histograms for TPC-TPC h-h mixed event @@ -211,12 +208,12 @@ struct HfTaskFlow { registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hMultiplicityMixing", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hVtxZMixing", "hVtxZMixing", {HistType::kTH1F, {{100, -10, 10}}}); registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing", "hNtracksMixing", {HistType::kTH1F, {{500, 0, 500}}}); - + // DATA : particles histograms for TPC-TPC h-h mixed event registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hPtMixing", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hEtaMixing", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hPhiMixing", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); - + // ========================= // DATA : histograms for TPC-TPC HF-h case // ========================= @@ -227,7 +224,6 @@ struct HfTaskFlow { registry.add("Data/TpcTpc/HfHadron/MixedEvent/hVtxZHFMixing", "hVtxZHFMixing", {HistType::kTH1F, {{100, -10, 10}}}); registry.add("Data/TpcTpc/HfHadron/MixedEvent/hNtracksHFMixing", "hNtracksHFMixing", {HistType::kTH1F, {{500, 0, 500}}}); - // DATA : trigger particles (candidates) histograms for TPC-TPC h-h same event auto vbins = (std::vector)binsPt; registry.add("Data/TpcTpc/HfHadron/hPtCand", "2-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); @@ -253,26 +249,105 @@ struct HfTaskFlow { registry.add("Data/TpcTpc/HfHadron/MixedEvent/hEtaHFMixing", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); registry.add("Data/TpcTpc/HfHadron/MixedEvent/hPhiHFMixing", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); - // ========================= // DATA : histograms for TPC-MFT h-h case // ========================= + // DATA : trigger particles (TPC tracks) histograms for TPC-MFT h-h same event + registry.add("Data/TpcMft/HadronHadron/SameEvent/hEtaPhiTPC", "multiplicity vs eta vs phi in TPC", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcMft/HadronHadron/SameEvent/hEtaTPC", "etaTPC", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); + registry.add("Data/TpcMft/HadronHadron/SameEvent/hPhiTPC", "phiTPC", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcMft/HadronHadron/SameEvent/hPtTPC", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); + registry.add("Data/TpcMft/HadronHadron/SameEvent/hYieldsTPC", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); + registry.add("Data/TpcTpc/HadronHadron/SameEvent/hNtracksTPC", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); // DATA : associated particles (MFT tracks) histograms for TPC-MFT h-h same event - registry.add("Data/TpcMft/HadronHadron/hEtaPhiMFT", "multiplicity vs eta vs phi in MFT", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); - registry.add("Data/TpcMft/HadronHadron/hEtaMFT", "etaMFT", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); - registry.add("Data/TpcMft/HadronHadron/hPhiMFT", "phiMFT", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); - - // DATA : histograms for TPC-MFT h-h event mixing - registry.add("Data/TpcMft/HadronHadron/MixedEvent/hMultiplicityMixing", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); - registry.add("Data/TpcMft/HadronHadron/MixedEvent/hVtxZMixing", "hVtxZMixing", {HistType::kTH1F, {{100, -10, 10}}}); - registry.add("Data/TpcMft/HadronHadron/MixedEvent/hPtMixing", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); - registry.add("Data/TpcMft/HadronHadron/MixedEvent/hEtaMixing", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); - registry.add("Data/TpcMft/HadronHadron/MixedEvent/hPhiMixing", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); - registry.add("Data/TpcMft/HadronHadron/MixedEvent/hNtracksMixing", "hNtracksMixing", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("Data/TpcMft/HadronHadron/SameEvent/hEtaPhiMFT", "multiplicity vs eta vs phi in MFT", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcMft/HadronHadron/SameEvent/hEtaMFT", "etaMFT", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); + registry.add("Data/TpcMft/HadronHadron/SameEvent/hPhiMFT", "phiMFT", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcMft/HadronHadron/SameEvent/hPtMFT", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); + registry.add("Data/TpcMft/HadronHadron/SameEvent/hYieldsMFT", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); + registry.add("Data/TpcTpc/HadronHadron/SameEvent/hNtracksMFT", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + + + // DATA : histograms for TPC-MFT h-h event mixing for TPC tracks + registry.add("Data/TpcMft/HadronHadron/MixedEvent/hMultiplicityMixingTPC", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("Data/TpcMft/HadronHadron/MixedEvent/hVtxZMixingTPC", "hVtxZMixing", {HistType::kTH1F, {{100, -10, 10}}}); + registry.add("Data/TpcMft/HadronHadron/MixedEvent/hPtMixingTPC", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); + registry.add("Data/TpcMft/HadronHadron/MixedEvent/hEtaMixingTPC", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); + registry.add("Data/TpcMft/HadronHadron/MixedEvent/hPhiMixingTPC", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcMft/HadronHadron/MixedEvent/hNtracksMixingTPC", "hNtracksMixing", {HistType::kTH1F, {{500, 0, 500}}}); + + // DATA : histograms for TPC-MFT h-h event mixing for MFT tracks + registry.add("Data/TpcMft/HadronHadron/MixedEvent/hMultiplicityMixingMFT", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("Data/TpcMft/HadronHadron/MixedEvent/hVtxZMixingMFT", "hVtxZMixing", {HistType::kTH1F, {{100, -10, 10}}}); + registry.add("Data/TpcMft/HadronHadron/MixedEvent/hPtMixingMFT", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); + registry.add("Data/TpcMft/HadronHadron/MixedEvent/hEtaMixingMFT", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); + registry.add("Data/TpcMft/HadronHadron/MixedEvent/hPhiMixingMFT", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcMft/HadronHadron/MixedEvent/hNtracksMixingMFT", "hNtracksMixing", {HistType::kTH1F, {{500, 0, 500}}}); + + // DATA : histograms for TPC-MFT h-h event mixing for events QA registry.add("Data/TpcMft/HadronHadron/MixedEvent/hEventCountMixing", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); + // ========================= + // DATA : histograms for TPC-MFT HF-h case + // ========================= + + // DATA : trigger particles (candidates) histograms for TPC-MFT HF-h same event + registry.add("Data/TpcMft/HfHadron/SameEvent/hEtaPhiCandidate", "multiplicity vs eta vs phi in TPC", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hEtaCandidate", "etaTPC", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hPhiCandidate", "phiTPC", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hPtCandidate", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hYieldsCandidate", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hNtracksCandidate", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + + // DATA : trigger particles (candidates) histograms for TPC-TPC h-h same event + registry.add("Data/TpcMft/HfHadron/hPtCand", "2-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); + registry.add("Data/TpcMft/HfHadron/hPtProng0", "2-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); + registry.add("Data/TpcMft/HfHadron/hPtProng1", "2-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); + registry.add("Data/TpcMft/HfHadron/hMass", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0., 5.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/hDecLength", "2-prong candidates;decay length (cm);entries", {HistType::kTH2F, {{200, 0., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/hDecLengthXY", "2-prong candidates;decay length xy (cm);entries", {HistType::kTH2F, {{200, 0., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/hd0Prong0", "2-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/hd0Prong1", "2-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/hd0d0", "2-prong candidates;product of DCAxy to prim. vertex (cm^{2});entries", {HistType::kTH2F, {{500, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/hCTS", "2-prong candidates;cos #it{#theta}* (D^{0});entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/hCt", "2-prong candidates;proper lifetime (D^{0}) * #it{c} (cm);entries", {HistType::kTH2F, {{120, -20., 100.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/hCPA", "2-prong candidates;cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/hEtaCand", "2-prong candidates;candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/hSelectionStatus", "2-prong candidates;selection status;entries", {HistType::kTH2F, {{5, -0.5, 4.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/hImpParErr", "2-prong candidates;impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/hDecLenErr", "2-prong candidates;decay length error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/hDecLenXYErr", "2-prong candidates;decay length xy error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + + // DATA : associated particles (MFT tracks) histograms for TPC-MFT h-h same event + registry.add("Data/TpcMft/HfHadron/SameEvent/hEtaPhiMFT", "multiplicity vs eta vs phi in MFT", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hEtaMFT", "etaMFT", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hPhiMFT", "phiMFT", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hPtMFT", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hYieldsMFT", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hNtracksMFT", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + + + // DATA : histograms for TPC-MFT h-h event mixing for candidates + registry.add("Data/TpcMft/HfHadron/MixedEvent/hMultiplicityMixingCandidate", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("Data/TpcMft/HfHadron/MixedEvent/hVtxZMixingCandidate", "hVtxZMixing", {HistType::kTH1F, {{100, -10, 10}}}); + registry.add("Data/TpcMft/HfHadron/MixedEvent/hPtMixingCandidate", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); + registry.add("Data/TpcMft/HfHadron/MixedEvent/hEtaMixingCandidate", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); + registry.add("Data/TpcMft/HfHadron/MixedEvent/hPhiMixingCandidate", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcMft/HfHadron/MixedEvent/hNtracksMixingCandidate", "hNtracksMixing", {HistType::kTH1F, {{500, 0, 500}}}); + + // DATA : histograms for TPC-MFT h-h event mixing for MFT tracks + registry.add("Data/TpcMft/HfHadron/MixedEvent/hMultiplicityMixingMFT", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("Data/TpcMft/HfHadron/MixedEvent/hVtxZMixingMFT", "hVtxZMixing", {HistType::kTH1F, {{100, -10, 10}}}); + registry.add("Data/TpcMft/HfHadron/MixedEvent/hPtMixingMFT", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); + registry.add("Data/TpcMft/HfHadron/MixedEvent/hEtaMixingMFT", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); + registry.add("Data/TpcMft/HfHadron/MixedEvent/hPhiMixingMFT", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcMft/HfHadron/MixedEvent/hNtracksMixingMFT", "hNtracksMixing", {HistType::kTH1F, {{500, 0, 500}}}); + + // DATA : histograms for TPC-MFT h-h event mixing for events QA + registry.add("Data/TpcMft/HfHadron/MixedEvent/hEventCountMixing", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); + // ========================= // MC : histograms for TPC-MFT h-h case // ========================= @@ -282,7 +357,7 @@ struct HfTaskFlow { registry.add("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicity", "hMultiplicity", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("MC/Rec/TpcTpc/HadronHadron/SameEvent/hVtxZ", "hVtxZ", {HistType::kTH1F, {{400, -50, 50}}}); registry.add("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEventCountSame", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); - // Katarina had this : + // Katarina had this : registry.add("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicityPrimary", "hMultiplicityPrimary", {HistType::kTH1F, {{500, 0, 500}}}); // histograms for MC associated particles registry.add("MC/Rec/TpcTpc/HadronHadron/SameEvent/hPt", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); @@ -305,7 +380,7 @@ struct HfTaskFlow { registry.add("MC/Gen/TpcTpc/HadronHadron/SameEvent/hMultiplicity", "hMultiplicity", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("MC/Gen/TpcTpc/HadronHadron/SameEvent/hVtxZ", "hVtxZ", {HistType::kTH1F, {{400, -50, 50}}}); registry.add("MC/Gen/TpcTpc/HadronHadron/SameEvent/hEventCountSame", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); - // Katarina had this : + // Katarina had this : registry.add("MC/Gen/TpcTpc/HadronHadron/SameEvent/hMultiplicityPrimary", "hMultiplicityPrimary", {HistType::kTH1F, {{500, 0, 500}}}); // histograms for MC associated particles registry.add("MC/Gen/TpcTpc/HadronHadron/SameEvent/hPt", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); @@ -345,10 +420,12 @@ struct HfTaskFlow { mixedTPCTPCHfCh.setObject(new CorrelationContainer("mixedTPCTPCHfCh", "mixedTPCTPCHfCh", corrAxis, effAxis, userAxis)); sameTPCMFTChCh.setObject(new CorrelationContainer("sameTPCMFTChCh", "sameTPCMFTChCh", corrAxis, effAxis, {})); mixedTPCMFTChCh.setObject(new CorrelationContainer("mixedTPCMFTChCh", "mixedTPCMFTChCh", corrAxis, effAxis, {})); + sameTPCMFTHfCh.setObject(new CorrelationContainer("sameTPCMFTHfCh", "sameTPCMFTHfCh", corrAxis, effAxis, {})); + mixedTPCMFTHfCh.setObject(new CorrelationContainer("mixedTPCMFTHfCh", "mixedTPCMFTHfCh", corrAxis, effAxis, {})); // initialization of correlation containes for monte-carlo - sameTPCTPCChChMC.setObject(new CorrelationContainer("sameTPCTPCChChMC", "sameTPCTPCChChMC", corrAxis, effAxis, {})); - mixedTPCTPCChChMC.setObject(new CorrelationContainer("mixedTPCTPCChChMC", "mixedTPCTPCChChMC", corrAxis, effAxis, {})); + sameTPCTPCChChMC.setObject(new CorrelationContainer("sameTPCTPCChChMC", "sameTPCTPCChChMC", corrAxis, effAxis, userAxis)); + mixedTPCTPCChChMC.setObject(new CorrelationContainer("mixedTPCTPCChChMC", "mixedTPCTPCChChMC", corrAxis, effAxis, userAxis)); } // End of init() function // ========================= @@ -360,7 +437,7 @@ struct HfTaskFlow { { if (fillHistograms) registry.fill(HIST("Data/hEventCounter"), 1); - + if (processMc == false) { if (!collision.sel8()) { return false; @@ -369,11 +446,10 @@ struct HfTaskFlow { if (fillHistograms) registry.fill(HIST("Data/hEventCounter"), 3); - + return true; } - // ========================= // Quality Assesment plots // ========================= @@ -402,25 +478,23 @@ struct HfTaskFlow { int Ntracks = 0; for (const auto& track1 : tracks) { // TO-DO : DEBUG THIS - + // in case of MC-generated, do additional selection on MCparticles : charge and isPhysicalPrimary - if constexpr ( std::is_same_v) { + if constexpr (std::is_same_v) { if (!isMcParticleSelected(track1)) { - continue; + continue; } // TO-DO : add other if constexpr conditions when I will have more MC cases } - - + Ntracks++; - if constexpr ( std::is_same_v) { // if MC Rec + if constexpr (std::is_same_v) { // if MC Rec registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hPt"), track1.pt()); registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEta"), track1.eta()); registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hPhi"), track1.phi()); registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hYields"), multiplicity, track1.pt(), track1.eta()); registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEtaPhi"), multiplicity, track1.eta(), track1.phi()); - } - else { // if MC Gen + } else { // if MC Gen registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hPt"), track1.pt()); registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hEta"), track1.eta()); registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hPhi"), track1.phi()); @@ -428,7 +502,7 @@ struct HfTaskFlow { registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hEtaPhi"), multiplicity, track1.eta(), track1.phi()); } } - if constexpr ( std::is_same_v) { // if MC Rec + if constexpr (std::is_same_v) { // if MC Rec registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hNtracks"), Ntracks); registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicityPrimary"), Ntracks); } else { // if MC Gen @@ -438,7 +512,6 @@ struct HfTaskFlow { return Ntracks; } - // ---- DATA : TPC-TPC h-h Mixed Event QA ---- template void fillTpcTpcChChMixedEventQA(float multiplicity, float vz, TTracks const& tracks) @@ -456,11 +529,11 @@ struct HfTaskFlow { registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing"), Ntracks); } - // ---- MC : TPC-TPC h-h Mixed Event QA ---- + // ---- MC : TPC-TPC h-h Mixed Event QA ---- template void fillTpcTpcChChMixedEventQAmc(float multiplicity, float vz, TTracks const& tracks) { - if constexpr ( std::is_same_v) { // if MC Rec + if constexpr (std::is_same_v) { // if MC Rec registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hMultiplicityMixing"), multiplicity); registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hVtxZMixing"), vz); } else { // if MC Gen @@ -471,7 +544,7 @@ struct HfTaskFlow { int Ntracks = 0; for (const auto& track1 : tracks) { Ntracks++; - if constexpr ( std::is_same_v) { // if MC Rec + if constexpr (std::is_same_v) { // if MC Rec registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hPtMixing"), track1.pt()); registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hEtaMixing"), track1.eta()); registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hPhiMixing"), track1.phi()); @@ -481,7 +554,7 @@ struct HfTaskFlow { registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hPhiMixing"), track1.phi()); } } - if constexpr ( std::is_same_v) { // if MC Rec + if constexpr (std::is_same_v) { // if MC Rec registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing"), Ntracks); } else { // if MC Gen registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing"), Ntracks); @@ -505,36 +578,146 @@ struct HfTaskFlow { registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hNtracksHFMixing"), Ntracks); } - // ---- DATA : TPC-MFT h-h Same Event QA ---- template void fillTpcMftChChSameEventQA(float multiplicity, TTracks const& tracks) { + int Ntracks = 0; + bool isMFT = false; for (const auto& track1 : tracks) { - registry.fill(HIST("Data/TpcMft/HadronHadron/hEtaMFT"), track1.eta()); - float phi = track1.phi(); - o2::math_utils::bringTo02Pi(phi); - registry.fill(HIST("Data/TpcMft/HadronHadron/hPhiMFT"), phi); - registry.fill(HIST("Data/TpcMft/HadronHadron/hEtaPhiMFT"), multiplicity, track1.eta(), phi); + if constexpr (std::is_same_v) { // if MFT tracks + isMFT = true; + registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hEtaMFT"), track1.eta()); + float phi = track1.phi(); + o2::math_utils::bringTo02Pi(phi); + registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hPhiMFT"), phi); + registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hEtaPhiMFT"), multiplicity, track1.eta(), phi); + + Ntracks++; + registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hPtMFT"), track1.pt()); + registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hYieldsMFT"), multiplicity, track1.pt(), track1.eta()); + } + else { // if TPC tracks + registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hEtaTPC"), track1.eta()); + float phi = track1.phi(); + o2::math_utils::bringTo02Pi(phi); + registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hPhiTPC"), phi); + registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hEtaPhiTPC"), multiplicity, track1.eta(), phi); + + Ntracks++; + registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hPtTPC"), track1.pt()); + registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hYieldsTPC"), multiplicity, track1.pt(), track1.eta()); + } + if (isMFT) { + registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hNtracksMFT"), Ntracks); + } else { + registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hNtracksTPC"), Ntracks); + } + } } + // ---- DATA : TPC-MFT HF-h Same Event QA ---- + template + void fillTpcMftHfChSameEventQA(float multiplicity, TTracks const& tracks) + { + int Ntracks = 0; + bool isMFT = false; + for (const auto& track1 : tracks) { + if constexpr (std::is_same_v) { // if MFT tracks + isMFT = true; + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hEtaMFT"), track1.eta()); + float phi = track1.phi(); + o2::math_utils::bringTo02Pi(phi); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPhiMFT"), phi); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hEtaPhiMFT"), multiplicity, track1.eta(), phi); + + Ntracks++; + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPtMFT"), track1.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hYieldsMFT"), multiplicity, track1.pt(), track1.eta()); + } + else { // if TPC tracks + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hEtaCandidate"), track1.eta()); + float phi = track1.phi(); + o2::math_utils::bringTo02Pi(phi); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPhiCandidate"), phi); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hEtaPhiCandidate"), multiplicity, track1.eta(), phi); + + Ntracks++; + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPtCandidate"), track1.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hYieldsCandidate"), multiplicity, track1.pt(), track1.eta()); + } + if (isMFT) { + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hNtracksMFT"), Ntracks); + } else { + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hNtracksCandidate"), Ntracks); + } + + } + } // ---- DATA : TPC-MFT h-h Mixed Event QA ---- template void fillTpcMftChChMixedEventQA(float multiplicity, float vz, TTracks const& tracks) { - registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hMultiplicityMixing"), multiplicity); - registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hVtxZMixing"), vz); + if constexpr (std::is_same_v) { // if MFT tracks + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hMultiplicityMixingMFT"), multiplicity); + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hVtxZMixingMFT"), vz); + + int Ntracks = 0; + for (const auto& track1 : tracks) { + Ntracks++; + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hPtMixingMFT"), track1.pt()); + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hEtaMixingMFT"), track1.eta()); + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hPhiMixingMFT"), track1.phi()); + } + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hNtracksMixingMFT"), Ntracks); + } + else { // if TPC tracks + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hMultiplicityMixingTPC"), multiplicity); + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hVtxZMixingTPC"), vz); + + int Ntracks = 0; + for (const auto& track1 : tracks) { + Ntracks++; + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hPtMixingTPC"), track1.pt()); + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hEtaMixingTPC"), track1.eta()); + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hPhiMixingTPC"), track1.phi()); + } + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hNtracksMixingTPC"), Ntracks); + } + } - int Ntracks = 0; - for (const auto& track1 : tracks) { - Ntracks++; - registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hPtMixing"), track1.pt()); - registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hEtaMixing"), track1.eta()); - registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hPhiMixing"), track1.phi()); + // ---- DATA : TPC-MFT h-h Mixed Event QA ---- + template + void fillTpcMftHfChMixedEventQA(float multiplicity, float vz, TTracks const& tracks) + { + if constexpr (std::is_same_v) { // if MFT tracks + registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hMultiplicityMixingMFT"), multiplicity); + registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hVtxZMixingMFT"), vz); + + int Ntracks = 0; + for (const auto& track1 : tracks) { + Ntracks++; + registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hPtMixingMFT"), track1.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hEtaMixingMFT"), track1.eta()); + registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hPhiMixingMFT"), track1.phi()); + } + registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hNtracksMixingMFT"), Ntracks); + } + else { // if candidate tracks + registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hMultiplicityMixingCandidate"), multiplicity); + registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hVtxZMixingCandidate"), vz); + + int Ntracks = 0; + for (const auto& track1 : tracks) { + Ntracks++; + registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hPtMixingCandidate"), track1.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hEtaMixingCandidate"), track1.eta()); + registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hPhiMixingCandidate"), track1.phi()); + } + registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hNtracksMixingCandidate"), Ntracks); } - registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hNtracksMixing"), Ntracks); } // TODO: Check how to put this into a Filter @@ -570,11 +753,10 @@ struct HfTaskFlow { return true; } - // ---- DATA : TPC-TPC HF-h Same Event (Candidates) QA ---- // TODO: Note: we do not need all these plots since they are in D0 and Lc task -> remove it after we are sure this works template - void fillCandidateQA(TTracks const& candidates) + void fillTpcTpcCandidateQA(TTracks const& candidates) { for (const auto& candidate : candidates) { if (!isAcceptedCandidate(candidate)) { @@ -608,6 +790,43 @@ struct HfTaskFlow { } } + // ---- DATA : TPC-MFT HF-h Same Event (Candidates) QA ---- + // TODO: Note: we do not need all these plots since they are in D0 and Lc task -> remove it after we are sure this works + template + void fillTpcMftCandidateQA(TTracks const& candidates) + { + for (const auto& candidate : candidates) { + if (!isAcceptedCandidate(candidate)) { + continue; + } + + if (candidate.isSelD0() >= selectionFlagD0) { + registry.fill(HIST("Data/TpcMft/HfHadron/hMass"), hfHelper.invMassD0ToPiK(candidate), candidate.pt()); + } + if (candidate.isSelD0bar() >= selectionFlagD0bar) { + registry.fill(HIST("Data/TpcMft/HfHadron/hMass"), hfHelper.invMassD0barToKPi(candidate), candidate.pt()); + } + + registry.fill(HIST("Data/TpcMft/HfHadron/hPtCand"), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/hPtProng0"), candidate.ptProng0()); + registry.fill(HIST("Data/TpcMft/HfHadron/hPtProng1"), candidate.ptProng1()); + registry.fill(HIST("Data/TpcMft/HfHadron/hDecLength"), candidate.decayLength(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/hDecLengthXY"), candidate.decayLengthXY(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/hd0Prong0"), candidate.impactParameter0(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/hd0Prong1"), candidate.impactParameter1(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/hd0d0"), candidate.impactParameterProduct(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/hCTS"), hfHelper.cosThetaStarD0(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/hCt"), hfHelper.ctD0(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/hCPA"), candidate.cpa(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/hEtaCand"), candidate.eta(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/hSelectionStatus"), candidate.isSelD0() + (candidate.isSelD0bar() * 2), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/hImpParErr"), candidate.errorImpactParameter0(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/hImpParErr"), candidate.errorImpactParameter1(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/hDecLenErr"), candidate.errorDecayLength(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/hDecLenXYErr"), candidate.errorDecayLengthXY(), candidate.pt()); + } + } + // ========================= // Correlation functions // ========================= @@ -643,16 +862,14 @@ struct HfTaskFlow { // From Katarina's code // in case of MC-generated, do additional selection on MCparticles : charge and isPhysicalPrimary - //if (processMc) { + // if (processMc) { // NOTE : this version with aodMcParticles is only for Katarina's way of doing MC if constexpr (std::is_same_v || std::is_same_v) { if (!isMcParticleSelected(track1)) { - continue; + continue; } // TO-DO : add other if constexpr conditions when I will have more MC cases } - - // fill single-track distributions if (!fillingHFcontainer) { @@ -680,15 +897,13 @@ struct HfTaskFlow { } // in case of MC-generated, do additional selection on MCparticles : charge and isPhysicalPrimary - //if (processMc) { + // if (processMc) { if constexpr (std::is_same_v || std::is_same_v) { if (!isMcParticleSelected(track2)) { continue; } - // Note : no need for HF if condition as this will always be normal track, but maybe for MFT + // Note : no need for HF if condition as this will always be normal track, but maybe for MFT } - - float eta2 = track2.eta(); float pt2 = track2.pt(); @@ -717,12 +932,12 @@ struct HfTaskFlow { } } - //template - //void mixCollisions(FilteredCollisionsWSelMult const& collisions, TTracksTrig const& tracks1, TTracksAssoc const& tracks2, TLambda getPartsSize, OutputObj& corrContainer) + // template + // void mixCollisions(FilteredCollisionsWSelMult const& collisions, TTracksTrig const& tracks1, TTracksAssoc const& tracks2, TLambda getPartsSize, OutputObj& corrContainer) template void mixCollisions(TCollisions const& collisions, TTracksTrig const& tracks1, TTracksAssoc const& tracks2, TLambda getPartsSize, OutputObj& corrContainer) { - //The first one that I call "Data" should work for data and mc rec + // The first one that I call "Data" should work for data and mc rec using BinningTypeData = FlexibleBinningPolicy, aod::collision::PosZ, decltype(getPartsSize)>; BinningTypeData binningWithTracksSize{{getPartsSize}, {axisVertex, axisMultiplicity}, true}; @@ -731,9 +946,6 @@ struct HfTaskFlow { for (const auto& [collision1, tracks1, collision2, tracks2] : pair) { - - // added this to try to compile when doing mixed event with aodMcParticles and aodMcCollisions (MC truth) - // TO DO, TO GET RID OF THIS WHEN I FINISHED MIXCOLLISIONS FOR MCTRUTH if constexpr (!std::is_same_v) { if (!(isCollisionSelected(collision1, false))) { continue; @@ -742,18 +954,18 @@ struct HfTaskFlow { continue; } } - auto binningValues = binningWithTracksSize.getBinningValues(collision1, collisions); int bin = binningWithTracksSize.getBin(binningValues); - const auto multiplicity = tracks2.size(); // get multiplicity of charged hadrons, which is used for slicing in mixing - const auto vz = collision1.posZ(); + const auto multiplicityTracks2 = tracks2.size(); // get multiplicity of charged hadrons, which is used for slicing in mixing + const auto multiplicityTracks1 = tracks1.size(); // get multiplicity of charged hadrons, which is used for slicing in mixing + const auto vz = collision1.posZ(); if constexpr (std::is_same_v) { // If MC registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); - fillTpcTpcChChMixedEventQAmc(multiplicity, vz, tracks1); + fillTpcTpcChChMixedEventQAmc(multiplicityTracks2, vz, tracks1); /* if constexpr (std::is_same_v) { registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); @@ -763,32 +975,31 @@ struct HfTaskFlow { fillMixingQA(multiplicity, vz, tracks1); } */ - } - else { // If not MC + } else { // If not MC if constexpr (std::is_same_v) { // DATA : If TPC-TPC Hf-h case registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); - fillTpcTpcHfChMixedEventQA(multiplicity, vz, tracks1); - } - else if constexpr (std::is_same_v) { // DATA : If TPC-MFT h-h case + fillTpcTpcHfChMixedEventQA(multiplicityTracks2, vz, tracks1); + } else if constexpr (std::is_same_v) { // DATA : If TPC-MFT h-h case registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hEventCountMixing"), bin); - fillTpcMftChChMixedEventQA(multiplicity, vz, tracks1); - } - else { // DATA : If TPC-TPC h-h case + fillTpcMftChChMixedEventQA(multiplicityTracks1, vz, tracks1); // TPC tracks + fillTpcMftChChMixedEventQA(multiplicityTracks2, vz, tracks2); // MFT tracks + } else if constexpr (std::is_same_v && std::is_same_v) { // DATA : If TPC-MFT HF-h case + registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hEventCountMixing"), bin); + fillTpcMftHfChMixedEventQA(multiplicityTracks1, vz, tracks1); // Candidates + fillTpcMftHfChMixedEventQA(multiplicityTracks2, vz, tracks2); // MFT tracks + } else { // DATA : If TPC-TPC h-h case registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); - fillTpcTpcChChMixedEventQA(multiplicity, vz, tracks1); - + fillTpcTpcChChMixedEventQA(multiplicityTracks2, vz, tracks1); } } - corrContainer->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); - // TO-DO : probably put the step of the correlation container in the template of this function - fillCorrelations(corrContainer, tracks1, tracks2, multiplicity, collision1.posZ()); + corrContainer->fillEvent(multiplicityTracks2, CorrelationContainer::kCFStepReconstructed); + fillCorrelations(corrContainer, tracks1, tracks2, multiplicityTracks2, collision1.posZ()); } } - - //template - //void mixCollisions(FilteredCollisionsWSelMult const& collisions, TTracksTrig const& tracks1, TTracksAssoc const& tracks2, TLambda getPartsSize, OutputObj& corrContainer) + // template + // void mixCollisions(FilteredCollisionsWSelMult const& collisions, TTracksTrig const& tracks1, TTracksAssoc const& tracks2, TLambda getPartsSize, OutputObj& corrContainer) template void mixCollisionsMcTruth(TCollisions const& collisions, TTracksTrig const& tracks1, TTracksAssoc const& tracks2, TLambda getPartsSize, OutputObj& corrContainer) { @@ -798,10 +1009,8 @@ struct HfTaskFlow { auto tracksTuple = std::make_tuple(tracks1, tracks2); Pair pair{binningWithTracksSize, nMixedEvents, -1, collisions, tracksTuple, &cache}; - for (const auto& [collision1, tracks1, collision2, tracks2] : pair) { - // added this to try to compile when doing mixed event with aodMcParticles and aodMcCollisions (MC truth) // TODO : GET RID OF THE COLLISION SELECTION FOR MC TRUTH if constexpr (!std::is_same_v) { @@ -812,7 +1021,6 @@ struct HfTaskFlow { continue; } } - auto binningValues = binningWithTracksSize.getBinningValues(collision1, collisions); int bin = binningWithTracksSize.getBin(binningValues); @@ -820,7 +1028,6 @@ struct HfTaskFlow { const auto multiplicity = tracks2.size(); // get multiplicity of charged hadrons, which is used for slicing in mixing const auto vz = collision1.posZ(); - // TO BE DONE : ADD ONE MORE IF CONDITION TO FILL THE MC CASE // TODO : FILL NEW PLOTS FOR MCTRUTH ONLY registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); @@ -888,7 +1095,7 @@ struct HfTaskFlow { sameTPCTPCHfCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); - fillCandidateQA(candidates); + fillTpcTpcCandidateQA(candidates); fillCorrelations(sameTPCTPCHfCh, candidates, tracks, multiplicity, collision.posZ()); } PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcHfCh, "DATA : Process same-event correlations for TPC-TPC HF-h case", true); @@ -899,33 +1106,57 @@ struct HfTaskFlow { void processSameTpcMftChCh(FilteredCollisionsWSelMult::iterator const& collision, TracksWDcaSel const& tracks, - aod::MFTTracks const& mfttracks) + aod::MFTTracks const& mftTracks) { if (!(isCollisionSelected(collision, true))) { return; } - const auto multiplicity = tracks.size(); + const auto multiplicityTPC = tracks.size(); + const auto multiplicityMFT = mftTracks.size(); - sameTPCMFTChCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); - fillTpcMftChChSameEventQA(multiplicity, mfttracks); - fillCorrelations(sameTPCMFTChCh, tracks, mfttracks, multiplicity, collision.posZ()); + sameTPCMFTChCh->fillEvent(multiplicityTPC, CorrelationContainer::kCFStepReconstructed); + fillTpcMftChChSameEventQA(multiplicityTPC, tracks); + fillTpcMftChChSameEventQA(multiplicityMFT, mftTracks); + fillCorrelations(sameTPCMFTChCh, tracks, mftTracks, multiplicityTPC, collision.posZ()); } PROCESS_SWITCH(HfTaskFlow, processSameTpcMftChCh, "DATA : Process same-event correlations for TPC-MFT h-h case", true); + // ===================================== + // DATA : process same event correlations: TPC-MFT HF-h case + // ===================================== + + void processSameTpcMftHfCh(FilteredCollisionsWSelMult::iterator const& collision, + HfCandidatesSel const& candidates, + aod::MFTTracks const& mftTracks) + { + if (!(isCollisionSelected(collision, true))) { + return; + } + + const auto multiplicityCandidates = candidates.size(); + const auto multiplicityMFT = mftTracks.size(); + + sameTPCMFTHfCh->fillEvent(multiplicityCandidates, CorrelationContainer::kCFStepReconstructed); + fillTpcMftCandidateQA(candidates); + fillTpcMftHfChSameEventQA(multiplicityMFT, mftTracks); + fillCorrelations(sameTPCMFTHfCh, candidates, mftTracks, multiplicityCandidates, collision.posZ()); + } + PROCESS_SWITCH(HfTaskFlow, processSameTpcMftHfCh, "DATA : Process same-event correlations for TPC-MFT HF-h case", true); + // ===================================== // MONTE-CARLO : process same event correlations: TPC-TPC h-h case // ===================================== void processSameTpcTpcChChmcREC(FilteredCollisionsWSelMultMC::iterator const& mcCollision, - TracksWDcaSelMC const& mcTracks) + TracksWDcaSelMC const& mcTracks) { - + // NEED TO COMMENT THIS if (!(isCollisionSelected(mcCollision, true))) { return; } - + const auto multiplicity = mcTracks.size(); registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicity"), multiplicity); registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hVtxZ"), mcCollision.posZ()); @@ -938,33 +1169,28 @@ struct HfTaskFlow { fillTpcTpcChChSameEventQAmc(multiplicity, mcTracks); fillCorrelations(sameTPCTPCChChMC, mcTracks, mcTracks, multiplicity, mcCollision.posZ()); - } PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcChChmcREC, "MONTE-CARLO : Process same-event correlations for TPC-TPC h-h case", true); - - - //Katarina's version = MC Truth + + // Katarina's version = MC Truth void processSameTpcTpcChChmcGEN(aodMcCollisions::iterator const& mcCollision, - //FilteredCollisionsWSelMultMC const& collisions, - aodMcParticles const& mcParticles) + // FilteredCollisionsWSelMultMC const& collisions, + aodMcParticles const& mcParticles) { - - //if (!(isCollisionSelected(mcCollision, true))) { - // return; - //} - + // if (!(isCollisionSelected(mcCollision, true))) { + // return; + // } // Not sure why to use this - //if (collisions.size() == 0) { - // return; - //} - - //if (!collision.has_mcCollision()) { - // LOGF(warning, "No MC collision for this collision, skip..."); + // if (collisions.size() == 0) { // return; //} - + + // if (!collision.has_mcCollision()) { + // LOGF(warning, "No MC collision for this collision, skip..."); + // return; + // } const auto multiplicity = mcParticles.size(); // Note: these are all MC particles after selection (not only primary) registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hMultiplicity"), multiplicity); @@ -975,13 +1201,11 @@ struct HfTaskFlow { auto multPrimaryCharge0 = fillTpcTpcChChSameEventQAmc(multiplicity, mcParticles); sameTPCTPCChChMC->fillEvent(multPrimaryCharge0, CorrelationContainer::kCFStepAll); fillCorrelations(sameTPCTPCChChMC, mcParticles, mcParticles, multPrimaryCharge0, mcCollision.posZ()); - // NOT USED BY KATARINA APPARENTLY - //BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; - //int bin = baseBinning.getBin(std::make_tuple(mcCollision.posZ(), multiplicity)); - //registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hEventCountSame"), bin); - + // BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; + // int bin = baseBinning.getBin(std::make_tuple(mcCollision.posZ(), multiplicity)); + // registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hEventCountSame"), bin); // fill correlations for MC collisions that have a reconstructed collision // got rid of the second const auto for multPrimaryCharge0 @@ -990,12 +1214,11 @@ struct HfTaskFlow { fillCorrelations(sameTPCTPCChChMC, mcParticles, mcParticles, multPrimaryCharge0, mcCollision.posZ()); } PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcChChmcGEN, "MONTE-CARLO : Process same-event correlations for TPC-TPC h-h case", true); - // ===================================== // DATA : process mixed event correlations:TPC-TPC h-h case // ===================================== - // TO BECOME DATA & MC REC ? + // TO BECOME DATA & MC REC ? void processMixedTpcTpcChCh(FilteredCollisionsWSelMult const& collisions, TracksWDcaSel const& tracks) @@ -1026,7 +1249,6 @@ struct HfTaskFlow { return size; }; - /* auto getTracksSize = [&candidates, this](FilteredCollisionsWSelMult::iterator const& col) { auto associatedTracks = candidates.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); @@ -1035,7 +1257,6 @@ struct HfTaskFlow { }; */ - mixCollisions(collisions, candidates, tracks, getTracksSize, mixedTPCTPCHfCh); } PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcHfCh, "DATA : Process mixed-event correlations for TPC-TPC HF-h case", true); @@ -1046,7 +1267,7 @@ struct HfTaskFlow { void processMixedTpcMftChCh(FilteredCollisionsWSelMult const& collisions, TracksWDcaSel const& tracks, - aod::MFTTracks const& mfttracks) + aod::MFTTracks const& mftTracks) { // we want to group collisions based on charged-track multiplicity auto getTracksSize = [&tracks, this](FilteredCollisionsWSelMult::iterator const& col) { @@ -1055,22 +1276,39 @@ struct HfTaskFlow { return size; }; - mixCollisions(collisions, tracks, mfttracks, getTracksSize, mixedTPCMFTChCh); + mixCollisions(collisions, tracks, mftTracks, getTracksSize, mixedTPCMFTChCh); } PROCESS_SWITCH(HfTaskFlow, processMixedTpcMftChCh, "DATA : Process mixed-event correlations for TPC-MFT h-h case", true); + // ===================================== + // DATA : process mixed event correlations: TPC-MFT HF-h case + // ===================================== + + void processMixedTpcMftHfCh(FilteredCollisionsWSelMult const& collisions, + HfCandidatesSel const& candidates, + aod::MFTTracks const& mftTracks) + { + // we want to group collisions based on charged-track multiplicity + auto getTracksSize = [&candidates, this](FilteredCollisionsWSelMult::iterator const& col) { + // Still o2::aod::track::collisionId with HF ??? + auto associatedTracks = candidates.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); + auto size = associatedTracks.size(); + return size; + }; + + mixCollisions(collisions, candidates, mftTracks, getTracksSize, mixedTPCMFTHfCh); + } + PROCESS_SWITCH(HfTaskFlow, processMixedTpcMftHfCh, "DATA : Process mixed-event correlations for TPC-MFT HF-h case", true); + // ===================================== // MONTE-CARLO : process mixed event correlations: TPC-TPC h-h case // ===================================== - // MC rec void processMixedTpcTpcChChmcREC(FilteredCollisionsWSelMultMC const& mcCollisions, - TracksWDcaSelMC const& mcTracks) + TracksWDcaSelMC const& mcTracks) { // use normal index instead of globalIndex for MixedEvent ?? - - // we want to group collisions based on charged-track multiplicity auto getTracksSize = [&mcTracks, this](FilteredCollisionsWSelMultMC::iterator const& mcCol) { @@ -1082,16 +1320,13 @@ struct HfTaskFlow { mixCollisions(mcCollisions, mcTracks, mcTracks, getTracksSize, mixedTPCTPCChChMC); } PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcChChmcREC, "MONTE-CARLO : Process mixed-event correlations for TPC-TPC h-h case", true); - -// MC gen -void processMixedTpcTpcChChmcGEN(aodMcCollisions const& mcCollisions, - aodMcParticles const& mcParticles, - FilteredCollisionsWSelMultMC const& collisions) + // MC gen + void processMixedTpcTpcChChmcGEN(aodMcCollisions const& mcCollisions, + aodMcParticles const& mcParticles, + FilteredCollisionsWSelMultMC const& collisions) { // use normal index instead of globalIndex for MixedEvent ?? - - // we want to group collisions based on charged-track multiplicity auto getTracksSize = [&mcParticles, this](aodMcCollisions::iterator const& mcCol) { @@ -1100,8 +1335,6 @@ void processMixedTpcTpcChChmcGEN(aodMcCollisions const& mcCollisions, return size; }; - - mixCollisionsMcTruth(mcCollisions, mcParticles, mcParticles, getTracksSize, mixedTPCTPCChChMC); } PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcChChmcGEN, "MONTE-CARLO : Process mixed-event correlations for TPC-TPC h-h case", true); From 97bfadd884e34f40ac48f829fd44197c194c15f6 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 26 Sep 2024 13:19:14 +0000 Subject: [PATCH 14/31] Please consider the following formatting changes --- PWGHF/HFC/Tasks/taskFlow.cxx | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index d83c1572bda..ab84d2171f4 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -269,7 +269,6 @@ struct HfTaskFlow { registry.add("Data/TpcMft/HadronHadron/SameEvent/hYieldsMFT", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); registry.add("Data/TpcTpc/HadronHadron/SameEvent/hNtracksMFT", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); - // DATA : histograms for TPC-MFT h-h event mixing for TPC tracks registry.add("Data/TpcMft/HadronHadron/MixedEvent/hMultiplicityMixingTPC", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("Data/TpcMft/HadronHadron/MixedEvent/hVtxZMixingTPC", "hVtxZMixing", {HistType::kTH1F, {{100, -10, 10}}}); @@ -328,7 +327,6 @@ struct HfTaskFlow { registry.add("Data/TpcMft/HfHadron/SameEvent/hYieldsMFT", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); registry.add("Data/TpcTpc/HfHadron/SameEvent/hNtracksMFT", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); - // DATA : histograms for TPC-MFT h-h event mixing for candidates registry.add("Data/TpcMft/HfHadron/MixedEvent/hMultiplicityMixingCandidate", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("Data/TpcMft/HfHadron/MixedEvent/hVtxZMixingCandidate", "hVtxZMixing", {HistType::kTH1F, {{100, -10, 10}}}); @@ -596,8 +594,7 @@ struct HfTaskFlow { Ntracks++; registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hPtMFT"), track1.pt()); registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hYieldsMFT"), multiplicity, track1.pt(), track1.eta()); - } - else { // if TPC tracks + } else { // if TPC tracks registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hEtaTPC"), track1.eta()); float phi = track1.phi(); o2::math_utils::bringTo02Pi(phi); @@ -613,7 +610,6 @@ struct HfTaskFlow { } else { registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hNtracksTPC"), Ntracks); } - } } @@ -635,8 +631,7 @@ struct HfTaskFlow { Ntracks++; registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPtMFT"), track1.pt()); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hYieldsMFT"), multiplicity, track1.pt(), track1.eta()); - } - else { // if TPC tracks + } else { // if TPC tracks registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hEtaCandidate"), track1.eta()); float phi = track1.phi(); o2::math_utils::bringTo02Pi(phi); @@ -652,7 +647,6 @@ struct HfTaskFlow { } else { registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hNtracksCandidate"), Ntracks); } - } } @@ -672,8 +666,7 @@ struct HfTaskFlow { registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hPhiMixingMFT"), track1.phi()); } registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hNtracksMixingMFT"), Ntracks); - } - else { // if TPC tracks + } else { // if TPC tracks registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hMultiplicityMixingTPC"), multiplicity); registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hVtxZMixingTPC"), vz); @@ -704,8 +697,7 @@ struct HfTaskFlow { registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hPhiMixingMFT"), track1.phi()); } registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hNtracksMixingMFT"), Ntracks); - } - else { // if candidate tracks + } else { // if candidate tracks registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hMultiplicityMixingCandidate"), multiplicity); registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hVtxZMixingCandidate"), vz); @@ -958,7 +950,6 @@ struct HfTaskFlow { auto binningValues = binningWithTracksSize.getBinningValues(collision1, collisions); int bin = binningWithTracksSize.getBin(binningValues); - const auto multiplicityTracks2 = tracks2.size(); // get multiplicity of charged hadrons, which is used for slicing in mixing const auto multiplicityTracks1 = tracks1.size(); // get multiplicity of charged hadrons, which is used for slicing in mixing const auto vz = collision1.posZ(); @@ -981,13 +972,13 @@ struct HfTaskFlow { fillTpcTpcHfChMixedEventQA(multiplicityTracks2, vz, tracks1); } else if constexpr (std::is_same_v) { // DATA : If TPC-MFT h-h case registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hEventCountMixing"), bin); - fillTpcMftChChMixedEventQA(multiplicityTracks1, vz, tracks1); // TPC tracks - fillTpcMftChChMixedEventQA(multiplicityTracks2, vz, tracks2); // MFT tracks + fillTpcMftChChMixedEventQA(multiplicityTracks1, vz, tracks1); // TPC tracks + fillTpcMftChChMixedEventQA(multiplicityTracks2, vz, tracks2); // MFT tracks } else if constexpr (std::is_same_v && std::is_same_v) { // DATA : If TPC-MFT HF-h case registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hEventCountMixing"), bin); fillTpcMftHfChMixedEventQA(multiplicityTracks1, vz, tracks1); // Candidates fillTpcMftHfChMixedEventQA(multiplicityTracks2, vz, tracks2); // MFT tracks - } else { // DATA : If TPC-TPC h-h case + } else { // DATA : If TPC-TPC h-h case registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); fillTpcTpcChChMixedEventQA(multiplicityTracks2, vz, tracks1); } From 9804a4200fa7d69341198c0ff9c781a606aab504 Mon Sep 17 00:00:00 2001 From: AlexianL <123153896+AlexianL@users.noreply.github.com> Date: Fri, 27 Sep 2024 16:58:06 +0200 Subject: [PATCH 15/31] Update PWGHF/HFC/Tasks/taskFlow.cxx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vít Kučera --- PWGHF/HFC/Tasks/taskFlow.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index ab84d2171f4..9ea626b2666 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -539,7 +539,7 @@ struct HfTaskFlow { registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hVtxZMixing"), vz); } - int Ntracks = 0; + int nTracks = 0; for (const auto& track1 : tracks) { Ntracks++; if constexpr (std::is_same_v) { // if MC Rec From cd105639745819802f0fda98c38c7809328ce786 Mon Sep 17 00:00:00 2001 From: AlexianL Date: Fri, 27 Sep 2024 18:50:58 +0200 Subject: [PATCH 16/31] Addressing comments --- PWGHF/HFC/Tasks/taskFlow.cxx | 178 +++++++++++++++-------------------- 1 file changed, 78 insertions(+), 100 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index d83c1572bda..16f03294b11 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -13,8 +13,6 @@ /// \author Katarina Krizkova Gajdosova , CERN /// \author Maja Kabus , CERN -#include - #include #include #include @@ -50,7 +48,6 @@ using namespace o2::framework; using namespace o2::framework::expressions; struct HfTaskFlow { - Service pdg; // configurables for processing options Configurable processRun2{"processRun2", false, "Flag to run on Run 2 data"}; @@ -68,6 +65,7 @@ struct HfTaskFlow { Configurable yCandMax{"yCandMax", -1., "max. cand. rapidity"}; Configurable> binsPt{"binsPt", std::vector{hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits"}; + Service pdg; HfHelper hfHelper; SliceCache cache; @@ -75,14 +73,14 @@ struct HfTaskFlow { // DATA : Filters & partitions // ========================= - // Collision filters - // FIXME: The filter is applied also on the candidates! Beware! - Filter collisionVtxZFilter = nabs(aod::collision::posZ) < zVertexMax; - using FilteredCollisionsWSelMult = soa::Filtered>; using TracksWDcaSel = soa::Filtered>; using HfCandidatesSel = soa::Filtered>; + // Collision filters + // FIXME: The filter is applied also on the candidates! Beware! + Filter collisionVtxZFilter = nabs(aod::collision::posZ) < zVertexMax; + Filter trackFilter = (nabs(aod::track::eta) < etaTrackAssocMax) && (aod::track::pt > ptTrackAssocMin) && requireGlobalTrackWoPtEtaInFilter(); @@ -103,31 +101,32 @@ struct HfTaskFlow { // Even add McCollisions in the join ? // Kata adds subscribes to it but do not add it in the join - // using FilteredCollisionsWSelMultMC = soa::Filtered>; + //using FilteredCollisionsWSelMultMC = soa::Filtered>; using FilteredCollisionsWSelMultMC = soa::Filtered>; using TracksWDcaSelMC = soa::Filtered>; // using aodCollisions = soa::Filtered>; + using aodMcCollisions = soa::Filtered; + + using aodMcParticles = soa::Filtered; + + using aodTracks = soa::Filtered>; + // From Katarina's code, but not sure if I use it Filter mcCollisionFilter = nabs(aod::mccollision::posZ) < zVertexMax; - using aodMcCollisions = soa::Filtered; // From Katarina's code Filter mcParticlesFilter = (nabs(aod::mcparticle::eta) < etaTrackAssocMax) && (aod::mcparticle::pt > ptTrackAssocMin); //&& //(aod::mcparticle::sign != 0) - using aodMcParticles = soa::Filtered; // Katarina had this in her code : // Charged track filters - /* - Filter trackFilter = (nabs(aod::track::eta) < etaTrackAssocMax) && - (aod::track::pt > ptTrackAssocMin) && - requireGlobalTrackWoPtEtaInFilter(); - */ - - using aodTracks = soa::Filtered>; + + //Filter trackFilter = (nabs(aod::track::eta) < etaTrackAssocMax) && + // (aod::track::pt > ptTrackAssocMin) && + // requireGlobalTrackWoPtEtaInFilter(); // configurables for containers ConfigurableAxis axisVertex{"axisVertex", {14, -7, 7}, "vertex axis for histograms"}; @@ -420,12 +419,12 @@ struct HfTaskFlow { mixedTPCTPCHfCh.setObject(new CorrelationContainer("mixedTPCTPCHfCh", "mixedTPCTPCHfCh", corrAxis, effAxis, userAxis)); sameTPCMFTChCh.setObject(new CorrelationContainer("sameTPCMFTChCh", "sameTPCMFTChCh", corrAxis, effAxis, {})); mixedTPCMFTChCh.setObject(new CorrelationContainer("mixedTPCMFTChCh", "mixedTPCMFTChCh", corrAxis, effAxis, {})); - sameTPCMFTHfCh.setObject(new CorrelationContainer("sameTPCMFTHfCh", "sameTPCMFTHfCh", corrAxis, effAxis, {})); - mixedTPCMFTHfCh.setObject(new CorrelationContainer("mixedTPCMFTHfCh", "mixedTPCMFTHfCh", corrAxis, effAxis, {})); + sameTPCMFTHfCh.setObject(new CorrelationContainer("sameTPCMFTHfCh", "sameTPCMFTHfCh", corrAxis, effAxis, userAxis)); + mixedTPCMFTHfCh.setObject(new CorrelationContainer("mixedTPCMFTHfCh", "mixedTPCMFTHfCh", corrAxis, effAxis, userAxis)); // initialization of correlation containes for monte-carlo - sameTPCTPCChChMC.setObject(new CorrelationContainer("sameTPCTPCChChMC", "sameTPCTPCChChMC", corrAxis, effAxis, userAxis)); - mixedTPCTPCChChMC.setObject(new CorrelationContainer("mixedTPCTPCChChMC", "mixedTPCTPCChChMC", corrAxis, effAxis, userAxis)); + sameTPCTPCChChMC.setObject(new CorrelationContainer("sameTPCTPCChChMC", "sameTPCTPCChChMC", corrAxis, effAxis, {})); + mixedTPCTPCChChMC.setObject(new CorrelationContainer("mixedTPCTPCChChMC", "mixedTPCTPCChChMC", corrAxis, effAxis, {})); } // End of init() function // ========================= @@ -458,16 +457,15 @@ struct HfTaskFlow { template void fillTpcTpcChChSameEventQA(float multiplicity, TTracks const& tracks) { - int Ntracks = 0; + int nTracks = tracks.size(); for (const auto& track1 : tracks) { - Ntracks++; registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hPt"), track1.pt()); registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hEta"), track1.eta()); registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hPhi"), track1.phi()); registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hYields"), multiplicity, track1.pt(), track1.eta()); registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hEtaPhi"), multiplicity, track1.eta(), track1.phi()); } - registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hNtracks"), Ntracks); + registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hNtracks"), nTracks); } // ---- MC : TPC-TPC h-h Same Event QA ---- @@ -475,7 +473,7 @@ struct HfTaskFlow { template int fillTpcTpcChChSameEventQAmc(float multiplicity, TTracks const& tracks) { - int Ntracks = 0; + int nTracks = tracks.size(); for (const auto& track1 : tracks) { // TO-DO : DEBUG THIS @@ -487,7 +485,6 @@ struct HfTaskFlow { // TO-DO : add other if constexpr conditions when I will have more MC cases } - Ntracks++; if constexpr (std::is_same_v) { // if MC Rec registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hPt"), track1.pt()); registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEta"), track1.eta()); @@ -503,13 +500,13 @@ struct HfTaskFlow { } } if constexpr (std::is_same_v) { // if MC Rec - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hNtracks"), Ntracks); - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicityPrimary"), Ntracks); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hNtracks"), nTracks); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicityPrimary"), nTracks); } else { // if MC Gen - registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hNtracks"), Ntracks); - registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hMultiplicityPrimary"), Ntracks); + registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hNtracks"), nTracks); + registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hMultiplicityPrimary"), nTracks); } - return Ntracks; + return nTracks; } // ---- DATA : TPC-TPC h-h Mixed Event QA ---- @@ -519,14 +516,13 @@ struct HfTaskFlow { registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hMultiplicityMixing"), multiplicity); registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hVtxZMixing"), vz); - int Ntracks = 0; + int nTracks = tracks.size(); for (const auto& track1 : tracks) { - Ntracks++; registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hPtMixing"), track1.pt()); registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEtaMixing"), track1.eta()); registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hPhiMixing"), track1.phi()); } - registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing"), Ntracks); + registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing"), nTracks); } // ---- MC : TPC-TPC h-h Mixed Event QA ---- @@ -541,9 +537,8 @@ struct HfTaskFlow { registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hVtxZMixing"), vz); } - int Ntracks = 0; + int nTracks = tracks.size(); for (const auto& track1 : tracks) { - Ntracks++; if constexpr (std::is_same_v) { // if MC Rec registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hPtMixing"), track1.pt()); registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hEtaMixing"), track1.eta()); @@ -555,9 +550,9 @@ struct HfTaskFlow { } } if constexpr (std::is_same_v) { // if MC Rec - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing"), Ntracks); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing"), nTracks); } else { // if MC Gen - registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing"), Ntracks); + registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing"), nTracks); } } @@ -568,21 +563,20 @@ struct HfTaskFlow { registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hMultiplicityHFMixing"), multiplicity); registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hVtxZHFMixing"), vz); - int Ntracks = 0; + int nTracks = tracks.size(); for (const auto& track1 : tracks) { - Ntracks++; registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hPtHFMixing"), track1.pt()); registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEtaHFMixing"), track1.eta()); registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hPhiHFMixing"), track1.phi()); } - registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hNtracksHFMixing"), Ntracks); + registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hNtracksHFMixing"), nTracks); } // ---- DATA : TPC-MFT h-h Same Event QA ---- template void fillTpcMftChChSameEventQA(float multiplicity, TTracks const& tracks) { - int Ntracks = 0; + int nTracks = tracks.size(); bool isMFT = false; for (const auto& track1 : tracks) { if constexpr (std::is_same_v) { // if MFT tracks @@ -592,8 +586,6 @@ struct HfTaskFlow { o2::math_utils::bringTo02Pi(phi); registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hPhiMFT"), phi); registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hEtaPhiMFT"), multiplicity, track1.eta(), phi); - - Ntracks++; registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hPtMFT"), track1.pt()); registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hYieldsMFT"), multiplicity, track1.pt(), track1.eta()); } @@ -603,15 +595,13 @@ struct HfTaskFlow { o2::math_utils::bringTo02Pi(phi); registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hPhiTPC"), phi); registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hEtaPhiTPC"), multiplicity, track1.eta(), phi); - - Ntracks++; registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hPtTPC"), track1.pt()); registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hYieldsTPC"), multiplicity, track1.pt(), track1.eta()); } if (isMFT) { - registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hNtracksMFT"), Ntracks); + registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hNtracksMFT"), nTracks); } else { - registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hNtracksTPC"), Ntracks); + registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hNtracksTPC"), nTracks); } } @@ -621,7 +611,7 @@ struct HfTaskFlow { template void fillTpcMftHfChSameEventQA(float multiplicity, TTracks const& tracks) { - int Ntracks = 0; + int nTracks = tracks.size(); bool isMFT = false; for (const auto& track1 : tracks) { if constexpr (std::is_same_v) { // if MFT tracks @@ -631,8 +621,6 @@ struct HfTaskFlow { o2::math_utils::bringTo02Pi(phi); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPhiMFT"), phi); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hEtaPhiMFT"), multiplicity, track1.eta(), phi); - - Ntracks++; registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPtMFT"), track1.pt()); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hYieldsMFT"), multiplicity, track1.pt(), track1.eta()); } @@ -642,15 +630,13 @@ struct HfTaskFlow { o2::math_utils::bringTo02Pi(phi); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPhiCandidate"), phi); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hEtaPhiCandidate"), multiplicity, track1.eta(), phi); - - Ntracks++; registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPtCandidate"), track1.pt()); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hYieldsCandidate"), multiplicity, track1.pt(), track1.eta()); } if (isMFT) { - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hNtracksMFT"), Ntracks); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hNtracksMFT"), nTracks); } else { - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hNtracksCandidate"), Ntracks); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hNtracksCandidate"), nTracks); } } @@ -664,27 +650,25 @@ struct HfTaskFlow { registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hMultiplicityMixingMFT"), multiplicity); registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hVtxZMixingMFT"), vz); - int Ntracks = 0; + int nTracks = tracks.size(); for (const auto& track1 : tracks) { - Ntracks++; registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hPtMixingMFT"), track1.pt()); registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hEtaMixingMFT"), track1.eta()); registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hPhiMixingMFT"), track1.phi()); } - registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hNtracksMixingMFT"), Ntracks); + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hNtracksMixingMFT"), nTracks); } else { // if TPC tracks registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hMultiplicityMixingTPC"), multiplicity); registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hVtxZMixingTPC"), vz); - int Ntracks = 0; + int nTracks = tracks.size(); for (const auto& track1 : tracks) { - Ntracks++; registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hPtMixingTPC"), track1.pt()); registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hEtaMixingTPC"), track1.eta()); registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hPhiMixingTPC"), track1.phi()); } - registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hNtracksMixingTPC"), Ntracks); + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hNtracksMixingTPC"), nTracks); } } @@ -696,27 +680,25 @@ struct HfTaskFlow { registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hMultiplicityMixingMFT"), multiplicity); registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hVtxZMixingMFT"), vz); - int Ntracks = 0; + int nTracks = tracks.size(); for (const auto& track1 : tracks) { - Ntracks++; registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hPtMixingMFT"), track1.pt()); registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hEtaMixingMFT"), track1.eta()); registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hPhiMixingMFT"), track1.phi()); } - registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hNtracksMixingMFT"), Ntracks); + registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hNtracksMixingMFT"), nTracks); } else { // if candidate tracks registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hMultiplicityMixingCandidate"), multiplicity); registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hVtxZMixingCandidate"), vz); - int Ntracks = 0; + int nTracks = tracks.size(); for (const auto& track1 : tracks) { - Ntracks++; registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hPtMixingCandidate"), track1.pt()); registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hEtaMixingCandidate"), track1.eta()); registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hPhiMixingCandidate"), track1.phi()); } - registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hNtracksMixingCandidate"), Ntracks); + registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hNtracksMixingCandidate"), nTracks); } } @@ -737,12 +719,8 @@ struct HfTaskFlow { bool isMcParticleSelected(TTrack& track) { // remove MC particles with charge = 0 - int8_t sign = 0; TParticlePDG* pdgparticle = pdg->GetParticle(track.pdgCode()); - if (pdgparticle != nullptr) { - sign = (pdgparticle->Charge() > 0) ? 1.0 : ((pdgparticle->Charge() < 0) ? -1.0 : 0.0); - } - if (sign == 0) { + if (pdgparticle->Charge() == 0) { return false; } @@ -966,15 +944,15 @@ struct HfTaskFlow { if constexpr (std::is_same_v) { // If MC registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); fillTpcTpcChChMixedEventQAmc(multiplicityTracks2, vz, tracks1); - /* - if constexpr (std::is_same_v) { - registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); - fillHFMixingQA(multiplicity, vz, tracks1); - } else { - registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); - fillMixingQA(multiplicity, vz, tracks1); - } - */ + + //if constexpr (std::is_same_v) { + // registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); + // fillHFMixingQA(multiplicity, vz, tracks1); + //} else { + // registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); + // fillMixingQA(multiplicity, vz, tracks1); + //} + } else { // If not MC if constexpr (std::is_same_v) { // DATA : If TPC-TPC Hf-h case registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); @@ -1032,15 +1010,15 @@ struct HfTaskFlow { // TODO : FILL NEW PLOTS FOR MCTRUTH ONLY registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); fillTpcTpcChChMixedEventQAmc(multiplicity, vz, tracks1); - /* - if constexpr (std::is_same_v) { - registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); - fillHFMixingQA(multiplicity, vz, tracks1); - } else { - registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); - fillMixingQA(multiplicity, vz, tracks1); - } - */ + + //if constexpr (std::is_same_v) { + // registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); + // fillHFMixingQA(multiplicity, vz, tracks1); + //} else { + // registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); + // fillMixingQA(multiplicity, vz, tracks1); + //} + corrContainer->fillEvent(multiplicity, CorrelationContainer::kCFStepAll); // TO-DO : probably put the step of the correlation container in the template of this function @@ -1153,9 +1131,9 @@ struct HfTaskFlow { { // NEED TO COMMENT THIS - if (!(isCollisionSelected(mcCollision, true))) { - return; - } + //if (!(isCollisionSelected(mcCollision, true))) { + // return; + //} const auto multiplicity = mcTracks.size(); registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicity"), multiplicity); @@ -1249,13 +1227,13 @@ struct HfTaskFlow { return size; }; - /* - auto getTracksSize = [&candidates, this](FilteredCollisionsWSelMult::iterator const& col) { - auto associatedTracks = candidates.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); - auto size = associatedTracks.size(); - return size; - }; - */ + + //auto getTracksSize = [&candidates, this](FilteredCollisionsWSelMult::iterator const& col) { + // auto associatedTracks = candidates.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); + // auto size = associatedTracks.size(); + // return size; + //}; + mixCollisions(collisions, candidates, tracks, getTracksSize, mixedTPCTPCHfCh); } From a0f127646a8e185680f95ab0cc382e0423e046e3 Mon Sep 17 00:00:00 2001 From: AlexianL <123153896+AlexianL@users.noreply.github.com> Date: Fri, 27 Sep 2024 18:53:22 +0200 Subject: [PATCH 17/31] Addressing comments --- PWGHF/HFC/Tasks/taskFlow.cxx | 201 ++++++++++++++++------------------- 1 file changed, 94 insertions(+), 107 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 9ea626b2666..16f03294b11 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -13,8 +13,6 @@ /// \author Katarina Krizkova Gajdosova , CERN /// \author Maja Kabus , CERN -#include - #include #include #include @@ -50,7 +48,6 @@ using namespace o2::framework; using namespace o2::framework::expressions; struct HfTaskFlow { - Service pdg; // configurables for processing options Configurable processRun2{"processRun2", false, "Flag to run on Run 2 data"}; @@ -68,6 +65,7 @@ struct HfTaskFlow { Configurable yCandMax{"yCandMax", -1., "max. cand. rapidity"}; Configurable> binsPt{"binsPt", std::vector{hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits"}; + Service pdg; HfHelper hfHelper; SliceCache cache; @@ -75,14 +73,14 @@ struct HfTaskFlow { // DATA : Filters & partitions // ========================= - // Collision filters - // FIXME: The filter is applied also on the candidates! Beware! - Filter collisionVtxZFilter = nabs(aod::collision::posZ) < zVertexMax; - using FilteredCollisionsWSelMult = soa::Filtered>; using TracksWDcaSel = soa::Filtered>; using HfCandidatesSel = soa::Filtered>; + // Collision filters + // FIXME: The filter is applied also on the candidates! Beware! + Filter collisionVtxZFilter = nabs(aod::collision::posZ) < zVertexMax; + Filter trackFilter = (nabs(aod::track::eta) < etaTrackAssocMax) && (aod::track::pt > ptTrackAssocMin) && requireGlobalTrackWoPtEtaInFilter(); @@ -103,31 +101,32 @@ struct HfTaskFlow { // Even add McCollisions in the join ? // Kata adds subscribes to it but do not add it in the join - // using FilteredCollisionsWSelMultMC = soa::Filtered>; + //using FilteredCollisionsWSelMultMC = soa::Filtered>; using FilteredCollisionsWSelMultMC = soa::Filtered>; using TracksWDcaSelMC = soa::Filtered>; // using aodCollisions = soa::Filtered>; + using aodMcCollisions = soa::Filtered; + + using aodMcParticles = soa::Filtered; + + using aodTracks = soa::Filtered>; + // From Katarina's code, but not sure if I use it Filter mcCollisionFilter = nabs(aod::mccollision::posZ) < zVertexMax; - using aodMcCollisions = soa::Filtered; // From Katarina's code Filter mcParticlesFilter = (nabs(aod::mcparticle::eta) < etaTrackAssocMax) && (aod::mcparticle::pt > ptTrackAssocMin); //&& //(aod::mcparticle::sign != 0) - using aodMcParticles = soa::Filtered; // Katarina had this in her code : // Charged track filters - /* - Filter trackFilter = (nabs(aod::track::eta) < etaTrackAssocMax) && - (aod::track::pt > ptTrackAssocMin) && - requireGlobalTrackWoPtEtaInFilter(); - */ - - using aodTracks = soa::Filtered>; + + //Filter trackFilter = (nabs(aod::track::eta) < etaTrackAssocMax) && + // (aod::track::pt > ptTrackAssocMin) && + // requireGlobalTrackWoPtEtaInFilter(); // configurables for containers ConfigurableAxis axisVertex{"axisVertex", {14, -7, 7}, "vertex axis for histograms"}; @@ -269,6 +268,7 @@ struct HfTaskFlow { registry.add("Data/TpcMft/HadronHadron/SameEvent/hYieldsMFT", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); registry.add("Data/TpcTpc/HadronHadron/SameEvent/hNtracksMFT", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + // DATA : histograms for TPC-MFT h-h event mixing for TPC tracks registry.add("Data/TpcMft/HadronHadron/MixedEvent/hMultiplicityMixingTPC", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("Data/TpcMft/HadronHadron/MixedEvent/hVtxZMixingTPC", "hVtxZMixing", {HistType::kTH1F, {{100, -10, 10}}}); @@ -327,6 +327,7 @@ struct HfTaskFlow { registry.add("Data/TpcMft/HfHadron/SameEvent/hYieldsMFT", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); registry.add("Data/TpcTpc/HfHadron/SameEvent/hNtracksMFT", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + // DATA : histograms for TPC-MFT h-h event mixing for candidates registry.add("Data/TpcMft/HfHadron/MixedEvent/hMultiplicityMixingCandidate", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("Data/TpcMft/HfHadron/MixedEvent/hVtxZMixingCandidate", "hVtxZMixing", {HistType::kTH1F, {{100, -10, 10}}}); @@ -418,12 +419,12 @@ struct HfTaskFlow { mixedTPCTPCHfCh.setObject(new CorrelationContainer("mixedTPCTPCHfCh", "mixedTPCTPCHfCh", corrAxis, effAxis, userAxis)); sameTPCMFTChCh.setObject(new CorrelationContainer("sameTPCMFTChCh", "sameTPCMFTChCh", corrAxis, effAxis, {})); mixedTPCMFTChCh.setObject(new CorrelationContainer("mixedTPCMFTChCh", "mixedTPCMFTChCh", corrAxis, effAxis, {})); - sameTPCMFTHfCh.setObject(new CorrelationContainer("sameTPCMFTHfCh", "sameTPCMFTHfCh", corrAxis, effAxis, {})); - mixedTPCMFTHfCh.setObject(new CorrelationContainer("mixedTPCMFTHfCh", "mixedTPCMFTHfCh", corrAxis, effAxis, {})); + sameTPCMFTHfCh.setObject(new CorrelationContainer("sameTPCMFTHfCh", "sameTPCMFTHfCh", corrAxis, effAxis, userAxis)); + mixedTPCMFTHfCh.setObject(new CorrelationContainer("mixedTPCMFTHfCh", "mixedTPCMFTHfCh", corrAxis, effAxis, userAxis)); // initialization of correlation containes for monte-carlo - sameTPCTPCChChMC.setObject(new CorrelationContainer("sameTPCTPCChChMC", "sameTPCTPCChChMC", corrAxis, effAxis, userAxis)); - mixedTPCTPCChChMC.setObject(new CorrelationContainer("mixedTPCTPCChChMC", "mixedTPCTPCChChMC", corrAxis, effAxis, userAxis)); + sameTPCTPCChChMC.setObject(new CorrelationContainer("sameTPCTPCChChMC", "sameTPCTPCChChMC", corrAxis, effAxis, {})); + mixedTPCTPCChChMC.setObject(new CorrelationContainer("mixedTPCTPCChChMC", "mixedTPCTPCChChMC", corrAxis, effAxis, {})); } // End of init() function // ========================= @@ -456,16 +457,15 @@ struct HfTaskFlow { template void fillTpcTpcChChSameEventQA(float multiplicity, TTracks const& tracks) { - int Ntracks = 0; + int nTracks = tracks.size(); for (const auto& track1 : tracks) { - Ntracks++; registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hPt"), track1.pt()); registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hEta"), track1.eta()); registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hPhi"), track1.phi()); registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hYields"), multiplicity, track1.pt(), track1.eta()); registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hEtaPhi"), multiplicity, track1.eta(), track1.phi()); } - registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hNtracks"), Ntracks); + registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hNtracks"), nTracks); } // ---- MC : TPC-TPC h-h Same Event QA ---- @@ -473,7 +473,7 @@ struct HfTaskFlow { template int fillTpcTpcChChSameEventQAmc(float multiplicity, TTracks const& tracks) { - int Ntracks = 0; + int nTracks = tracks.size(); for (const auto& track1 : tracks) { // TO-DO : DEBUG THIS @@ -485,7 +485,6 @@ struct HfTaskFlow { // TO-DO : add other if constexpr conditions when I will have more MC cases } - Ntracks++; if constexpr (std::is_same_v) { // if MC Rec registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hPt"), track1.pt()); registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEta"), track1.eta()); @@ -501,13 +500,13 @@ struct HfTaskFlow { } } if constexpr (std::is_same_v) { // if MC Rec - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hNtracks"), Ntracks); - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicityPrimary"), Ntracks); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hNtracks"), nTracks); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicityPrimary"), nTracks); } else { // if MC Gen - registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hNtracks"), Ntracks); - registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hMultiplicityPrimary"), Ntracks); + registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hNtracks"), nTracks); + registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hMultiplicityPrimary"), nTracks); } - return Ntracks; + return nTracks; } // ---- DATA : TPC-TPC h-h Mixed Event QA ---- @@ -517,14 +516,13 @@ struct HfTaskFlow { registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hMultiplicityMixing"), multiplicity); registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hVtxZMixing"), vz); - int Ntracks = 0; + int nTracks = tracks.size(); for (const auto& track1 : tracks) { - Ntracks++; registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hPtMixing"), track1.pt()); registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEtaMixing"), track1.eta()); registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hPhiMixing"), track1.phi()); } - registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing"), Ntracks); + registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing"), nTracks); } // ---- MC : TPC-TPC h-h Mixed Event QA ---- @@ -539,9 +537,8 @@ struct HfTaskFlow { registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hVtxZMixing"), vz); } - int nTracks = 0; + int nTracks = tracks.size(); for (const auto& track1 : tracks) { - Ntracks++; if constexpr (std::is_same_v) { // if MC Rec registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hPtMixing"), track1.pt()); registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hEtaMixing"), track1.eta()); @@ -553,9 +550,9 @@ struct HfTaskFlow { } } if constexpr (std::is_same_v) { // if MC Rec - registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing"), Ntracks); + registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing"), nTracks); } else { // if MC Gen - registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing"), Ntracks); + registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing"), nTracks); } } @@ -566,21 +563,20 @@ struct HfTaskFlow { registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hMultiplicityHFMixing"), multiplicity); registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hVtxZHFMixing"), vz); - int Ntracks = 0; + int nTracks = tracks.size(); for (const auto& track1 : tracks) { - Ntracks++; registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hPtHFMixing"), track1.pt()); registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEtaHFMixing"), track1.eta()); registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hPhiHFMixing"), track1.phi()); } - registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hNtracksHFMixing"), Ntracks); + registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hNtracksHFMixing"), nTracks); } // ---- DATA : TPC-MFT h-h Same Event QA ---- template void fillTpcMftChChSameEventQA(float multiplicity, TTracks const& tracks) { - int Ntracks = 0; + int nTracks = tracks.size(); bool isMFT = false; for (const auto& track1 : tracks) { if constexpr (std::is_same_v) { // if MFT tracks @@ -590,26 +586,24 @@ struct HfTaskFlow { o2::math_utils::bringTo02Pi(phi); registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hPhiMFT"), phi); registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hEtaPhiMFT"), multiplicity, track1.eta(), phi); - - Ntracks++; registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hPtMFT"), track1.pt()); registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hYieldsMFT"), multiplicity, track1.pt(), track1.eta()); - } else { // if TPC tracks + } + else { // if TPC tracks registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hEtaTPC"), track1.eta()); float phi = track1.phi(); o2::math_utils::bringTo02Pi(phi); registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hPhiTPC"), phi); registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hEtaPhiTPC"), multiplicity, track1.eta(), phi); - - Ntracks++; registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hPtTPC"), track1.pt()); registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hYieldsTPC"), multiplicity, track1.pt(), track1.eta()); } if (isMFT) { - registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hNtracksMFT"), Ntracks); + registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hNtracksMFT"), nTracks); } else { - registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hNtracksTPC"), Ntracks); + registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hNtracksTPC"), nTracks); } + } } @@ -617,7 +611,7 @@ struct HfTaskFlow { template void fillTpcMftHfChSameEventQA(float multiplicity, TTracks const& tracks) { - int Ntracks = 0; + int nTracks = tracks.size(); bool isMFT = false; for (const auto& track1 : tracks) { if constexpr (std::is_same_v) { // if MFT tracks @@ -627,26 +621,24 @@ struct HfTaskFlow { o2::math_utils::bringTo02Pi(phi); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPhiMFT"), phi); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hEtaPhiMFT"), multiplicity, track1.eta(), phi); - - Ntracks++; registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPtMFT"), track1.pt()); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hYieldsMFT"), multiplicity, track1.pt(), track1.eta()); - } else { // if TPC tracks + } + else { // if TPC tracks registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hEtaCandidate"), track1.eta()); float phi = track1.phi(); o2::math_utils::bringTo02Pi(phi); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPhiCandidate"), phi); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hEtaPhiCandidate"), multiplicity, track1.eta(), phi); - - Ntracks++; registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPtCandidate"), track1.pt()); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hYieldsCandidate"), multiplicity, track1.pt(), track1.eta()); } if (isMFT) { - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hNtracksMFT"), Ntracks); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hNtracksMFT"), nTracks); } else { - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hNtracksCandidate"), Ntracks); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hNtracksCandidate"), nTracks); } + } } @@ -658,26 +650,25 @@ struct HfTaskFlow { registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hMultiplicityMixingMFT"), multiplicity); registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hVtxZMixingMFT"), vz); - int Ntracks = 0; + int nTracks = tracks.size(); for (const auto& track1 : tracks) { - Ntracks++; registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hPtMixingMFT"), track1.pt()); registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hEtaMixingMFT"), track1.eta()); registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hPhiMixingMFT"), track1.phi()); } - registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hNtracksMixingMFT"), Ntracks); - } else { // if TPC tracks + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hNtracksMixingMFT"), nTracks); + } + else { // if TPC tracks registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hMultiplicityMixingTPC"), multiplicity); registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hVtxZMixingTPC"), vz); - int Ntracks = 0; + int nTracks = tracks.size(); for (const auto& track1 : tracks) { - Ntracks++; registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hPtMixingTPC"), track1.pt()); registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hEtaMixingTPC"), track1.eta()); registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hPhiMixingTPC"), track1.phi()); } - registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hNtracksMixingTPC"), Ntracks); + registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hNtracksMixingTPC"), nTracks); } } @@ -689,26 +680,25 @@ struct HfTaskFlow { registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hMultiplicityMixingMFT"), multiplicity); registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hVtxZMixingMFT"), vz); - int Ntracks = 0; + int nTracks = tracks.size(); for (const auto& track1 : tracks) { - Ntracks++; registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hPtMixingMFT"), track1.pt()); registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hEtaMixingMFT"), track1.eta()); registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hPhiMixingMFT"), track1.phi()); } - registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hNtracksMixingMFT"), Ntracks); - } else { // if candidate tracks + registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hNtracksMixingMFT"), nTracks); + } + else { // if candidate tracks registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hMultiplicityMixingCandidate"), multiplicity); registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hVtxZMixingCandidate"), vz); - int Ntracks = 0; + int nTracks = tracks.size(); for (const auto& track1 : tracks) { - Ntracks++; registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hPtMixingCandidate"), track1.pt()); registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hEtaMixingCandidate"), track1.eta()); registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hPhiMixingCandidate"), track1.phi()); } - registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hNtracksMixingCandidate"), Ntracks); + registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hNtracksMixingCandidate"), nTracks); } } @@ -729,12 +719,8 @@ struct HfTaskFlow { bool isMcParticleSelected(TTrack& track) { // remove MC particles with charge = 0 - int8_t sign = 0; TParticlePDG* pdgparticle = pdg->GetParticle(track.pdgCode()); - if (pdgparticle != nullptr) { - sign = (pdgparticle->Charge() > 0) ? 1.0 : ((pdgparticle->Charge() < 0) ? -1.0 : 0.0); - } - if (sign == 0) { + if (pdgparticle->Charge() == 0) { return false; } @@ -950,6 +936,7 @@ struct HfTaskFlow { auto binningValues = binningWithTracksSize.getBinningValues(collision1, collisions); int bin = binningWithTracksSize.getBin(binningValues); + const auto multiplicityTracks2 = tracks2.size(); // get multiplicity of charged hadrons, which is used for slicing in mixing const auto multiplicityTracks1 = tracks1.size(); // get multiplicity of charged hadrons, which is used for slicing in mixing const auto vz = collision1.posZ(); @@ -957,28 +944,28 @@ struct HfTaskFlow { if constexpr (std::is_same_v) { // If MC registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); fillTpcTpcChChMixedEventQAmc(multiplicityTracks2, vz, tracks1); - /* - if constexpr (std::is_same_v) { - registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); - fillHFMixingQA(multiplicity, vz, tracks1); - } else { - registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); - fillMixingQA(multiplicity, vz, tracks1); - } - */ + + //if constexpr (std::is_same_v) { + // registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); + // fillHFMixingQA(multiplicity, vz, tracks1); + //} else { + // registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); + // fillMixingQA(multiplicity, vz, tracks1); + //} + } else { // If not MC if constexpr (std::is_same_v) { // DATA : If TPC-TPC Hf-h case registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); fillTpcTpcHfChMixedEventQA(multiplicityTracks2, vz, tracks1); } else if constexpr (std::is_same_v) { // DATA : If TPC-MFT h-h case registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hEventCountMixing"), bin); - fillTpcMftChChMixedEventQA(multiplicityTracks1, vz, tracks1); // TPC tracks - fillTpcMftChChMixedEventQA(multiplicityTracks2, vz, tracks2); // MFT tracks + fillTpcMftChChMixedEventQA(multiplicityTracks1, vz, tracks1); // TPC tracks + fillTpcMftChChMixedEventQA(multiplicityTracks2, vz, tracks2); // MFT tracks } else if constexpr (std::is_same_v && std::is_same_v) { // DATA : If TPC-MFT HF-h case registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hEventCountMixing"), bin); fillTpcMftHfChMixedEventQA(multiplicityTracks1, vz, tracks1); // Candidates fillTpcMftHfChMixedEventQA(multiplicityTracks2, vz, tracks2); // MFT tracks - } else { // DATA : If TPC-TPC h-h case + } else { // DATA : If TPC-TPC h-h case registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); fillTpcTpcChChMixedEventQA(multiplicityTracks2, vz, tracks1); } @@ -1023,15 +1010,15 @@ struct HfTaskFlow { // TODO : FILL NEW PLOTS FOR MCTRUTH ONLY registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); fillTpcTpcChChMixedEventQAmc(multiplicity, vz, tracks1); - /* - if constexpr (std::is_same_v) { - registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); - fillHFMixingQA(multiplicity, vz, tracks1); - } else { - registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); - fillMixingQA(multiplicity, vz, tracks1); - } - */ + + //if constexpr (std::is_same_v) { + // registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); + // fillHFMixingQA(multiplicity, vz, tracks1); + //} else { + // registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); + // fillMixingQA(multiplicity, vz, tracks1); + //} + corrContainer->fillEvent(multiplicity, CorrelationContainer::kCFStepAll); // TO-DO : probably put the step of the correlation container in the template of this function @@ -1144,9 +1131,9 @@ struct HfTaskFlow { { // NEED TO COMMENT THIS - if (!(isCollisionSelected(mcCollision, true))) { - return; - } + //if (!(isCollisionSelected(mcCollision, true))) { + // return; + //} const auto multiplicity = mcTracks.size(); registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicity"), multiplicity); @@ -1240,13 +1227,13 @@ struct HfTaskFlow { return size; }; - /* - auto getTracksSize = [&candidates, this](FilteredCollisionsWSelMult::iterator const& col) { - auto associatedTracks = candidates.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); - auto size = associatedTracks.size(); - return size; - }; - */ + + //auto getTracksSize = [&candidates, this](FilteredCollisionsWSelMult::iterator const& col) { + // auto associatedTracks = candidates.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); + // auto size = associatedTracks.size(); + // return size; + //}; + mixCollisions(collisions, candidates, tracks, getTracksSize, mixedTPCTPCHfCh); } From 32692171b99f19a7823f948142ff7a44f9f38af4 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Fri, 27 Sep 2024 16:53:47 +0000 Subject: [PATCH 18/31] Please consider the following formatting changes --- PWGHF/HFC/Tasks/taskFlow.cxx | 84 ++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 48 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 16f03294b11..7aa513aa1f2 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -101,7 +101,7 @@ struct HfTaskFlow { // Even add McCollisions in the join ? // Kata adds subscribes to it but do not add it in the join - //using FilteredCollisionsWSelMultMC = soa::Filtered>; + // using FilteredCollisionsWSelMultMC = soa::Filtered>; using FilteredCollisionsWSelMultMC = soa::Filtered>; using TracksWDcaSelMC = soa::Filtered>; @@ -110,7 +110,7 @@ struct HfTaskFlow { using aodMcCollisions = soa::Filtered; using aodMcParticles = soa::Filtered; - + using aodTracks = soa::Filtered>; // From Katarina's code, but not sure if I use it @@ -123,10 +123,10 @@ struct HfTaskFlow { // Katarina had this in her code : // Charged track filters - - //Filter trackFilter = (nabs(aod::track::eta) < etaTrackAssocMax) && - // (aod::track::pt > ptTrackAssocMin) && - // requireGlobalTrackWoPtEtaInFilter(); + + // Filter trackFilter = (nabs(aod::track::eta) < etaTrackAssocMax) && + // (aod::track::pt > ptTrackAssocMin) && + // requireGlobalTrackWoPtEtaInFilter(); // configurables for containers ConfigurableAxis axisVertex{"axisVertex", {14, -7, 7}, "vertex axis for histograms"}; @@ -268,7 +268,6 @@ struct HfTaskFlow { registry.add("Data/TpcMft/HadronHadron/SameEvent/hYieldsMFT", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); registry.add("Data/TpcTpc/HadronHadron/SameEvent/hNtracksMFT", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); - // DATA : histograms for TPC-MFT h-h event mixing for TPC tracks registry.add("Data/TpcMft/HadronHadron/MixedEvent/hMultiplicityMixingTPC", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("Data/TpcMft/HadronHadron/MixedEvent/hVtxZMixingTPC", "hVtxZMixing", {HistType::kTH1F, {{100, -10, 10}}}); @@ -327,7 +326,6 @@ struct HfTaskFlow { registry.add("Data/TpcMft/HfHadron/SameEvent/hYieldsMFT", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); registry.add("Data/TpcTpc/HfHadron/SameEvent/hNtracksMFT", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); - // DATA : histograms for TPC-MFT h-h event mixing for candidates registry.add("Data/TpcMft/HfHadron/MixedEvent/hMultiplicityMixingCandidate", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("Data/TpcMft/HfHadron/MixedEvent/hVtxZMixingCandidate", "hVtxZMixing", {HistType::kTH1F, {{100, -10, 10}}}); @@ -588,8 +586,7 @@ struct HfTaskFlow { registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hEtaPhiMFT"), multiplicity, track1.eta(), phi); registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hPtMFT"), track1.pt()); registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hYieldsMFT"), multiplicity, track1.pt(), track1.eta()); - } - else { // if TPC tracks + } else { // if TPC tracks registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hEtaTPC"), track1.eta()); float phi = track1.phi(); o2::math_utils::bringTo02Pi(phi); @@ -603,7 +600,6 @@ struct HfTaskFlow { } else { registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hNtracksTPC"), nTracks); } - } } @@ -623,8 +619,7 @@ struct HfTaskFlow { registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hEtaPhiMFT"), multiplicity, track1.eta(), phi); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPtMFT"), track1.pt()); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hYieldsMFT"), multiplicity, track1.pt(), track1.eta()); - } - else { // if TPC tracks + } else { // if TPC tracks registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hEtaCandidate"), track1.eta()); float phi = track1.phi(); o2::math_utils::bringTo02Pi(phi); @@ -638,7 +633,6 @@ struct HfTaskFlow { } else { registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hNtracksCandidate"), nTracks); } - } } @@ -657,8 +651,7 @@ struct HfTaskFlow { registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hPhiMixingMFT"), track1.phi()); } registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hNtracksMixingMFT"), nTracks); - } - else { // if TPC tracks + } else { // if TPC tracks registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hMultiplicityMixingTPC"), multiplicity); registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hVtxZMixingTPC"), vz); @@ -687,8 +680,7 @@ struct HfTaskFlow { registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hPhiMixingMFT"), track1.phi()); } registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hNtracksMixingMFT"), nTracks); - } - else { // if candidate tracks + } else { // if candidate tracks registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hMultiplicityMixingCandidate"), multiplicity); registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hVtxZMixingCandidate"), vz); @@ -936,7 +928,6 @@ struct HfTaskFlow { auto binningValues = binningWithTracksSize.getBinningValues(collision1, collisions); int bin = binningWithTracksSize.getBin(binningValues); - const auto multiplicityTracks2 = tracks2.size(); // get multiplicity of charged hadrons, which is used for slicing in mixing const auto multiplicityTracks1 = tracks1.size(); // get multiplicity of charged hadrons, which is used for slicing in mixing const auto vz = collision1.posZ(); @@ -944,28 +935,28 @@ struct HfTaskFlow { if constexpr (std::is_same_v) { // If MC registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); fillTpcTpcChChMixedEventQAmc(multiplicityTracks2, vz, tracks1); - - //if constexpr (std::is_same_v) { - // registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); - // fillHFMixingQA(multiplicity, vz, tracks1); - //} else { - // registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); - // fillMixingQA(multiplicity, vz, tracks1); - //} - + + // if constexpr (std::is_same_v) { + // registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); + // fillHFMixingQA(multiplicity, vz, tracks1); + // } else { + // registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); + // fillMixingQA(multiplicity, vz, tracks1); + // } + } else { // If not MC if constexpr (std::is_same_v) { // DATA : If TPC-TPC Hf-h case registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); fillTpcTpcHfChMixedEventQA(multiplicityTracks2, vz, tracks1); } else if constexpr (std::is_same_v) { // DATA : If TPC-MFT h-h case registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hEventCountMixing"), bin); - fillTpcMftChChMixedEventQA(multiplicityTracks1, vz, tracks1); // TPC tracks - fillTpcMftChChMixedEventQA(multiplicityTracks2, vz, tracks2); // MFT tracks + fillTpcMftChChMixedEventQA(multiplicityTracks1, vz, tracks1); // TPC tracks + fillTpcMftChChMixedEventQA(multiplicityTracks2, vz, tracks2); // MFT tracks } else if constexpr (std::is_same_v && std::is_same_v) { // DATA : If TPC-MFT HF-h case registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hEventCountMixing"), bin); fillTpcMftHfChMixedEventQA(multiplicityTracks1, vz, tracks1); // Candidates fillTpcMftHfChMixedEventQA(multiplicityTracks2, vz, tracks2); // MFT tracks - } else { // DATA : If TPC-TPC h-h case + } else { // DATA : If TPC-TPC h-h case registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); fillTpcTpcChChMixedEventQA(multiplicityTracks2, vz, tracks1); } @@ -1010,15 +1001,14 @@ struct HfTaskFlow { // TODO : FILL NEW PLOTS FOR MCTRUTH ONLY registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); fillTpcTpcChChMixedEventQAmc(multiplicity, vz, tracks1); - - //if constexpr (std::is_same_v) { - // registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); - // fillHFMixingQA(multiplicity, vz, tracks1); - //} else { - // registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); - // fillMixingQA(multiplicity, vz, tracks1); - //} - + + // if constexpr (std::is_same_v) { + // registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); + // fillHFMixingQA(multiplicity, vz, tracks1); + // } else { + // registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); + // fillMixingQA(multiplicity, vz, tracks1); + // } corrContainer->fillEvent(multiplicity, CorrelationContainer::kCFStepAll); // TO-DO : probably put the step of the correlation container in the template of this function @@ -1131,7 +1121,7 @@ struct HfTaskFlow { { // NEED TO COMMENT THIS - //if (!(isCollisionSelected(mcCollision, true))) { + // if (!(isCollisionSelected(mcCollision, true))) { // return; //} @@ -1227,13 +1217,11 @@ struct HfTaskFlow { return size; }; - - //auto getTracksSize = [&candidates, this](FilteredCollisionsWSelMult::iterator const& col) { - // auto associatedTracks = candidates.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); - // auto size = associatedTracks.size(); - // return size; - //}; - + // auto getTracksSize = [&candidates, this](FilteredCollisionsWSelMult::iterator const& col) { + // auto associatedTracks = candidates.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); + // auto size = associatedTracks.size(); + // return size; + // }; mixCollisions(collisions, candidates, tracks, getTracksSize, mixedTPCTPCHfCh); } From 6ee35b47f9103fb3bb700bf5543d737c9fa433ee Mon Sep 17 00:00:00 2001 From: AlexianL Date: Thu, 3 Oct 2024 13:19:10 +0200 Subject: [PATCH 19/31] Changing the path of some plots, and adding new plot --- PWGHF/HFC/Tasks/taskFlow.cxx | 152 ++++++++++++++++++----------------- 1 file changed, 79 insertions(+), 73 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 16f03294b11..d325c8841ee 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -225,23 +225,24 @@ struct HfTaskFlow { // DATA : trigger particles (candidates) histograms for TPC-TPC h-h same event auto vbins = (std::vector)binsPt; - registry.add("Data/TpcTpc/HfHadron/hPtCand", "2-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); - registry.add("Data/TpcTpc/HfHadron/hPtProng0", "2-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); - registry.add("Data/TpcTpc/HfHadron/hPtProng1", "2-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); - registry.add("Data/TpcTpc/HfHadron/hMass", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0., 5.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hDecLength", "2-prong candidates;decay length (cm);entries", {HistType::kTH2F, {{200, 0., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hDecLengthXY", "2-prong candidates;decay length xy (cm);entries", {HistType::kTH2F, {{200, 0., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hd0Prong0", "2-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hd0Prong1", "2-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hd0d0", "2-prong candidates;product of DCAxy to prim. vertex (cm^{2});entries", {HistType::kTH2F, {{500, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hCTS", "2-prong candidates;cos #it{#theta}* (D^{0});entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hCt", "2-prong candidates;proper lifetime (D^{0}) * #it{c} (cm);entries", {HistType::kTH2F, {{120, -20., 100.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hCPA", "2-prong candidates;cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hEtaCand", "2-prong candidates;candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hSelectionStatus", "2-prong candidates;selection status;entries", {HistType::kTH2F, {{5, -0.5, 4.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hImpParErr", "2-prong candidates;impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hDecLenErr", "2-prong candidates;decay length error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hDecLenXYErr", "2-prong candidates;decay length xy error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hPtCand", "2-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hPtProng0", "2-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hPtProng1", "2-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hMassVsPt", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0., 5.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hMass", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{100, 0., 10.}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hDecLength", "2-prong candidates;decay length (cm);entries", {HistType::kTH2F, {{200, 0., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hDecLengthXY", "2-prong candidates;decay length xy (cm);entries", {HistType::kTH2F, {{200, 0., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hd0Prong0", "2-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hd0Prong1", "2-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hd0d0", "2-prong candidates;product of DCAxy to prim. vertex (cm^{2});entries", {HistType::kTH2F, {{500, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hCTS", "2-prong candidates;cos #it{#theta}* (D^{0});entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hCt", "2-prong candidates;proper lifetime (D^{0}) * #it{c} (cm);entries", {HistType::kTH2F, {{120, -20., 100.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hCPA", "2-prong candidates;cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hEtaCand", "2-prong candidates;candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hSelectionStatus", "2-prong candidates;selection status;entries", {HistType::kTH2F, {{5, -0.5, 4.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hImpParErr", "2-prong candidates;impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hDecLenErr", "2-prong candidates;decay length error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hDecLenXYErr", "2-prong candidates;decay length xy error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); // DATA : trigger particles (candidates) histograms for TPC-TPC h-h mixed event registry.add("Data/TpcTpc/HfHadron/MixedEvent/hPtHFMixing", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); @@ -300,24 +301,25 @@ struct HfTaskFlow { registry.add("Data/TpcMft/HfHadron/SameEvent/hYieldsCandidate", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); registry.add("Data/TpcTpc/HfHadron/SameEvent/hNtracksCandidate", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); - // DATA : trigger particles (candidates) histograms for TPC-TPC h-h same event - registry.add("Data/TpcMft/HfHadron/hPtCand", "2-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); - registry.add("Data/TpcMft/HfHadron/hPtProng0", "2-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); - registry.add("Data/TpcMft/HfHadron/hPtProng1", "2-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); - registry.add("Data/TpcMft/HfHadron/hMass", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0., 5.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hDecLength", "2-prong candidates;decay length (cm);entries", {HistType::kTH2F, {{200, 0., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hDecLengthXY", "2-prong candidates;decay length xy (cm);entries", {HistType::kTH2F, {{200, 0., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hd0Prong0", "2-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hd0Prong1", "2-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hd0d0", "2-prong candidates;product of DCAxy to prim. vertex (cm^{2});entries", {HistType::kTH2F, {{500, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hCTS", "2-prong candidates;cos #it{#theta}* (D^{0});entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hCt", "2-prong candidates;proper lifetime (D^{0}) * #it{c} (cm);entries", {HistType::kTH2F, {{120, -20., 100.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hCPA", "2-prong candidates;cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hEtaCand", "2-prong candidates;candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hSelectionStatus", "2-prong candidates;selection status;entries", {HistType::kTH2F, {{5, -0.5, 4.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hImpParErr", "2-prong candidates;impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hDecLenErr", "2-prong candidates;decay length error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hDecLenXYErr", "2-prong candidates;decay length xy error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + // DATA : trigger particles (candidates) histograms for TPC-TPC HF-h same event + registry.add("Data/TpcMft/HfHadron/SameEvent/hPtCand", "2-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hPtProng0", "2-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hPtProng1", "2-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hMassVsPt", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0., 5.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hMass", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{100, 0., 10.}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hDecLength", "2-prong candidates;decay length (cm);entries", {HistType::kTH2F, {{200, 0., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hDecLengthXY", "2-prong candidates;decay length xy (cm);entries", {HistType::kTH2F, {{200, 0., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hd0Prong0", "2-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hd0Prong1", "2-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hd0d0", "2-prong candidates;product of DCAxy to prim. vertex (cm^{2});entries", {HistType::kTH2F, {{500, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hCTS", "2-prong candidates;cos #it{#theta}* (D^{0});entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hCt", "2-prong candidates;proper lifetime (D^{0}) * #it{c} (cm);entries", {HistType::kTH2F, {{120, -20., 100.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hCPA", "2-prong candidates;cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hEtaCand", "2-prong candidates;candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hSelectionStatus", "2-prong candidates;selection status;entries", {HistType::kTH2F, {{5, -0.5, 4.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hImpParErr", "2-prong candidates;impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hDecLenErr", "2-prong candidates;decay length error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hDecLenXYErr", "2-prong candidates;decay length xy error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); // DATA : associated particles (MFT tracks) histograms for TPC-MFT h-h same event registry.add("Data/TpcMft/HfHadron/SameEvent/hEtaPhiMFT", "multiplicity vs eta vs phi in MFT", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); @@ -742,29 +744,31 @@ struct HfTaskFlow { } if (candidate.isSelD0() >= selectionFlagD0) { - registry.fill(HIST("Data/TpcTpc/HfHadron/hMass"), hfHelper.invMassD0ToPiK(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hMassVsPt"), hfHelper.invMassD0ToPiK(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hMass"), hfHelper.invMassD0ToPiK(candidate)); } if (candidate.isSelD0bar() >= selectionFlagD0bar) { - registry.fill(HIST("Data/TpcTpc/HfHadron/hMass"), hfHelper.invMassD0barToKPi(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hMassVsPt"), hfHelper.invMassD0barToKPi(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hMass"), hfHelper.invMassD0barToKPi(candidate)); } - registry.fill(HIST("Data/TpcTpc/HfHadron/hPtCand"), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hPtProng0"), candidate.ptProng0()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hPtProng1"), candidate.ptProng1()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hDecLength"), candidate.decayLength(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hDecLengthXY"), candidate.decayLengthXY(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hd0Prong0"), candidate.impactParameter0(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hd0Prong1"), candidate.impactParameter1(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hd0d0"), candidate.impactParameterProduct(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hCTS"), hfHelper.cosThetaStarD0(candidate), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hCt"), hfHelper.ctD0(candidate), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hCPA"), candidate.cpa(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hEtaCand"), candidate.eta(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hSelectionStatus"), candidate.isSelD0() + (candidate.isSelD0bar() * 2), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hImpParErr"), candidate.errorImpactParameter0(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hImpParErr"), candidate.errorImpactParameter1(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hDecLenErr"), candidate.errorDecayLength(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hDecLenXYErr"), candidate.errorDecayLengthXY(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hPtCand"), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hPtProng0"), candidate.ptProng0()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hPtProng1"), candidate.ptProng1()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hDecLength"), candidate.decayLength(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hDecLengthXY"), candidate.decayLengthXY(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hd0Prong0"), candidate.impactParameter0(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hd0Prong1"), candidate.impactParameter1(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hd0d0"), candidate.impactParameterProduct(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hCTS"), hfHelper.cosThetaStarD0(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hCt"), hfHelper.ctD0(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hCPA"), candidate.cpa(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hEtaCand"), candidate.eta(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hSelectionStatus"), candidate.isSelD0() + (candidate.isSelD0bar() * 2), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hImpParErr"), candidate.errorImpactParameter0(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hImpParErr"), candidate.errorImpactParameter1(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hDecLenErr"), candidate.errorDecayLength(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hDecLenXYErr"), candidate.errorDecayLengthXY(), candidate.pt()); } } @@ -779,29 +783,31 @@ struct HfTaskFlow { } if (candidate.isSelD0() >= selectionFlagD0) { - registry.fill(HIST("Data/TpcMft/HfHadron/hMass"), hfHelper.invMassD0ToPiK(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hMassVsPt"), hfHelper.invMassD0ToPiK(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hMass"), hfHelper.invMassD0ToPiK(candidate)); } if (candidate.isSelD0bar() >= selectionFlagD0bar) { - registry.fill(HIST("Data/TpcMft/HfHadron/hMass"), hfHelper.invMassD0barToKPi(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hMassVsPt"), hfHelper.invMassD0barToKPi(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hMass"), hfHelper.invMassD0barToKPi(candidate)); } - registry.fill(HIST("Data/TpcMft/HfHadron/hPtCand"), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hPtProng0"), candidate.ptProng0()); - registry.fill(HIST("Data/TpcMft/HfHadron/hPtProng1"), candidate.ptProng1()); - registry.fill(HIST("Data/TpcMft/HfHadron/hDecLength"), candidate.decayLength(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hDecLengthXY"), candidate.decayLengthXY(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hd0Prong0"), candidate.impactParameter0(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hd0Prong1"), candidate.impactParameter1(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hd0d0"), candidate.impactParameterProduct(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hCTS"), hfHelper.cosThetaStarD0(candidate), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hCt"), hfHelper.ctD0(candidate), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hCPA"), candidate.cpa(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hEtaCand"), candidate.eta(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hSelectionStatus"), candidate.isSelD0() + (candidate.isSelD0bar() * 2), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hImpParErr"), candidate.errorImpactParameter0(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hImpParErr"), candidate.errorImpactParameter1(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hDecLenErr"), candidate.errorDecayLength(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hDecLenXYErr"), candidate.errorDecayLengthXY(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPtCand"), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPtProng0"), candidate.ptProng0()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPtProng1"), candidate.ptProng1()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hDecLength"), candidate.decayLength(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hDecLengthXY"), candidate.decayLengthXY(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hd0Prong0"), candidate.impactParameter0(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hd0Prong1"), candidate.impactParameter1(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hd0d0"), candidate.impactParameterProduct(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hCTS"), hfHelper.cosThetaStarD0(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hCt"), hfHelper.ctD0(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hCPA"), candidate.cpa(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hEtaCand"), candidate.eta(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hSelectionStatus"), candidate.isSelD0() + (candidate.isSelD0bar() * 2), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hImpParErr"), candidate.errorImpactParameter0(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hImpParErr"), candidate.errorImpactParameter1(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hDecLenErr"), candidate.errorDecayLength(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hDecLenXYErr"), candidate.errorDecayLengthXY(), candidate.pt()); } } From f98deb6ae51749c5cd11f72a1af49d8960be23a1 Mon Sep 17 00:00:00 2001 From: AlexianL Date: Thu, 3 Oct 2024 13:41:47 +0200 Subject: [PATCH 20/31] Renaming plots and adding inv mass plot for D0 --- PWGHF/HFC/Tasks/taskFlow.cxx | 198 ++++++++++++++++++----------------- 1 file changed, 102 insertions(+), 96 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 7aa513aa1f2..d3f1a34c448 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -225,23 +225,24 @@ struct HfTaskFlow { // DATA : trigger particles (candidates) histograms for TPC-TPC h-h same event auto vbins = (std::vector)binsPt; - registry.add("Data/TpcTpc/HfHadron/hPtCand", "2-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); - registry.add("Data/TpcTpc/HfHadron/hPtProng0", "2-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); - registry.add("Data/TpcTpc/HfHadron/hPtProng1", "2-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); - registry.add("Data/TpcTpc/HfHadron/hMass", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0., 5.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hDecLength", "2-prong candidates;decay length (cm);entries", {HistType::kTH2F, {{200, 0., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hDecLengthXY", "2-prong candidates;decay length xy (cm);entries", {HistType::kTH2F, {{200, 0., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hd0Prong0", "2-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hd0Prong1", "2-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hd0d0", "2-prong candidates;product of DCAxy to prim. vertex (cm^{2});entries", {HistType::kTH2F, {{500, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hCTS", "2-prong candidates;cos #it{#theta}* (D^{0});entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hCt", "2-prong candidates;proper lifetime (D^{0}) * #it{c} (cm);entries", {HistType::kTH2F, {{120, -20., 100.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hCPA", "2-prong candidates;cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hEtaCand", "2-prong candidates;candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hSelectionStatus", "2-prong candidates;selection status;entries", {HistType::kTH2F, {{5, -0.5, 4.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hImpParErr", "2-prong candidates;impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hDecLenErr", "2-prong candidates;decay length error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/hDecLenXYErr", "2-prong candidates;decay length xy error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hPtCand", "2-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hPtProng0", "2-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hPtProng1", "2-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hMassVsPt", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0., 5.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hMass", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{100, 0., 10.}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hDecLength", "2-prong candidates;decay length (cm);entries", {HistType::kTH2F, {{200, 0., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hDecLengthXY", "2-prong candidates;decay length xy (cm);entries", {HistType::kTH2F, {{200, 0., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hd0Prong0", "2-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hd0Prong1", "2-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hd0d0", "2-prong candidates;product of DCAxy to prim. vertex (cm^{2});entries", {HistType::kTH2F, {{500, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hCTS", "2-prong candidates;cos #it{#theta}* (D^{0});entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hCt", "2-prong candidates;proper lifetime (D^{0}) * #it{c} (cm);entries", {HistType::kTH2F, {{120, -20., 100.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hCPA", "2-prong candidates;cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hEtaCand", "2-prong candidates;candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hSelectionStatus", "2-prong candidates;selection status;entries", {HistType::kTH2F, {{5, -0.5, 4.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hImpParErr", "2-prong candidates;impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hDecLenErr", "2-prong candidates;decay length error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hDecLenXYErr", "2-prong candidates;decay length xy error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); // DATA : trigger particles (candidates) histograms for TPC-TPC h-h mixed event registry.add("Data/TpcTpc/HfHadron/MixedEvent/hPtHFMixing", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); @@ -292,39 +293,40 @@ struct HfTaskFlow { // ========================= // DATA : trigger particles (candidates) histograms for TPC-MFT HF-h same event - registry.add("Data/TpcMft/HfHadron/SameEvent/hEtaPhiCandidate", "multiplicity vs eta vs phi in TPC", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); - registry.add("Data/TpcMft/HfHadron/SameEvent/hEtaCandidate", "etaTPC", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); - registry.add("Data/TpcMft/HfHadron/SameEvent/hPhiCandidate", "phiTPC", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); - registry.add("Data/TpcMft/HfHadron/SameEvent/hPtCandidate", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); - registry.add("Data/TpcMft/HfHadron/SameEvent/hYieldsCandidate", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); - registry.add("Data/TpcTpc/HfHadron/SameEvent/hNtracksCandidate", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/SameEvent/hEtaPhiCandidate", "multiplicity vs eta vs phi in TPC", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/SameEvent/hEtaCandidate", "etaTPC", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/SameEvent/hPhiCandidate", "phiTPC", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/SameEvent/hPtCandidate", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/SameEvent/hYieldsCandidate", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/SameEvent/hNtracksCandidate", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); // DATA : trigger particles (candidates) histograms for TPC-TPC h-h same event - registry.add("Data/TpcMft/HfHadron/hPtCand", "2-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); - registry.add("Data/TpcMft/HfHadron/hPtProng0", "2-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); - registry.add("Data/TpcMft/HfHadron/hPtProng1", "2-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); - registry.add("Data/TpcMft/HfHadron/hMass", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0., 5.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hDecLength", "2-prong candidates;decay length (cm);entries", {HistType::kTH2F, {{200, 0., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hDecLengthXY", "2-prong candidates;decay length xy (cm);entries", {HistType::kTH2F, {{200, 0., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hd0Prong0", "2-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hd0Prong1", "2-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hd0d0", "2-prong candidates;product of DCAxy to prim. vertex (cm^{2});entries", {HistType::kTH2F, {{500, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hCTS", "2-prong candidates;cos #it{#theta}* (D^{0});entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hCt", "2-prong candidates;proper lifetime (D^{0}) * #it{c} (cm);entries", {HistType::kTH2F, {{120, -20., 100.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hCPA", "2-prong candidates;cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hEtaCand", "2-prong candidates;candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hSelectionStatus", "2-prong candidates;selection status;entries", {HistType::kTH2F, {{5, -0.5, 4.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hImpParErr", "2-prong candidates;impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hDecLenErr", "2-prong candidates;decay length error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/hDecLenXYErr", "2-prong candidates;decay length xy error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hPtCand", "2-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hPtProng0", "2-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hPtProng1", "2-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hMassVsPt", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0., 5.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hMass", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{100, 0., 10.}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hDecLength", "2-prong candidates;decay length (cm);entries", {HistType::kTH2F, {{200, 0., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hDecLengthXY", "2-prong candidates;decay length xy (cm);entries", {HistType::kTH2F, {{200, 0., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hd0Prong0", "2-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hd0Prong1", "2-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hd0d0", "2-prong candidates;product of DCAxy to prim. vertex (cm^{2});entries", {HistType::kTH2F, {{500, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hCTS", "2-prong candidates;cos #it{#theta}* (D^{0});entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hCt", "2-prong candidates;proper lifetime (D^{0}) * #it{c} (cm);entries", {HistType::kTH2F, {{120, -20., 100.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hCPA", "2-prong candidates;cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hEtaCand", "2-prong candidates;candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hSelectionStatus", "2-prong candidates;selection status;entries", {HistType::kTH2F, {{5, -0.5, 4.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hImpParErr", "2-prong candidates;impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hDecLenErr", "2-prong candidates;decay length error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hDecLenXYErr", "2-prong candidates;decay length xy error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); // DATA : associated particles (MFT tracks) histograms for TPC-MFT h-h same event - registry.add("Data/TpcMft/HfHadron/SameEvent/hEtaPhiMFT", "multiplicity vs eta vs phi in MFT", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); - registry.add("Data/TpcMft/HfHadron/SameEvent/hEtaMFT", "etaMFT", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); - registry.add("Data/TpcMft/HfHadron/SameEvent/hPhiMFT", "phiMFT", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); - registry.add("Data/TpcMft/HfHadron/SameEvent/hPtMFT", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); - registry.add("Data/TpcMft/HfHadron/SameEvent/hYieldsMFT", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); - registry.add("Data/TpcTpc/HfHadron/SameEvent/hNtracksMFT", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/SameEvent/hEtaPhiMFT", "multiplicity vs eta vs phi in MFT", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/SameEvent/hEtaMFT", "etaMFT", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/SameEvent/hPhiMFT", "phiMFT", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/SameEvent/hPtMFT", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/SameEvent/hYieldsMFT", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/SameEvent/hNtracksMFT", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); // DATA : histograms for TPC-MFT h-h event mixing for candidates registry.add("Data/TpcMft/HfHadron/MixedEvent/hMultiplicityMixingCandidate", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); @@ -612,26 +614,26 @@ struct HfTaskFlow { for (const auto& track1 : tracks) { if constexpr (std::is_same_v) { // if MFT tracks isMFT = true; - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hEtaMFT"), track1.eta()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/SameEvent/hEtaMFT"), track1.eta()); float phi = track1.phi(); o2::math_utils::bringTo02Pi(phi); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPhiMFT"), phi); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hEtaPhiMFT"), multiplicity, track1.eta(), phi); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPtMFT"), track1.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hYieldsMFT"), multiplicity, track1.pt(), track1.eta()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/SameEvent/hPhiMFT"), phi); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/SameEvent/hEtaPhiMFT"), multiplicity, track1.eta(), phi); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/SameEvent/hPtMFT"), track1.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/SameEvent/hYieldsMFT"), multiplicity, track1.pt(), track1.eta()); } else { // if TPC tracks - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hEtaCandidate"), track1.eta()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/SameEvent/hEtaCandidate"), track1.eta()); float phi = track1.phi(); o2::math_utils::bringTo02Pi(phi); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPhiCandidate"), phi); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hEtaPhiCandidate"), multiplicity, track1.eta(), phi); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPtCandidate"), track1.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hYieldsCandidate"), multiplicity, track1.pt(), track1.eta()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/SameEvent/hPhiCandidate"), phi); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/SameEvent/hEtaPhiCandidate"), multiplicity, track1.eta(), phi); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/SameEvent/hPtCandidate"), track1.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/SameEvent/hYieldsCandidate"), multiplicity, track1.pt(), track1.eta()); } if (isMFT) { - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hNtracksMFT"), nTracks); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/SameEvent/hNtracksMFT"), nTracks); } else { - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hNtracksCandidate"), nTracks); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/SameEvent/hNtracksCandidate"), nTracks); } } } @@ -734,29 +736,31 @@ struct HfTaskFlow { } if (candidate.isSelD0() >= selectionFlagD0) { - registry.fill(HIST("Data/TpcTpc/HfHadron/hMass"), hfHelper.invMassD0ToPiK(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hMassVsPt"), hfHelper.invMassD0ToPiK(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hMass"), hfHelper.invMassD0ToPiK(candidate)); } if (candidate.isSelD0bar() >= selectionFlagD0bar) { - registry.fill(HIST("Data/TpcTpc/HfHadron/hMass"), hfHelper.invMassD0barToKPi(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hMassVsPt"), hfHelper.invMassD0barToKPi(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hMass"), hfHelper.invMassD0barToKPi(candidate)); } - registry.fill(HIST("Data/TpcTpc/HfHadron/hPtCand"), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hPtProng0"), candidate.ptProng0()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hPtProng1"), candidate.ptProng1()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hDecLength"), candidate.decayLength(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hDecLengthXY"), candidate.decayLengthXY(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hd0Prong0"), candidate.impactParameter0(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hd0Prong1"), candidate.impactParameter1(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hd0d0"), candidate.impactParameterProduct(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hCTS"), hfHelper.cosThetaStarD0(candidate), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hCt"), hfHelper.ctD0(candidate), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hCPA"), candidate.cpa(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hEtaCand"), candidate.eta(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hSelectionStatus"), candidate.isSelD0() + (candidate.isSelD0bar() * 2), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hImpParErr"), candidate.errorImpactParameter0(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hImpParErr"), candidate.errorImpactParameter1(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hDecLenErr"), candidate.errorDecayLength(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/hDecLenXYErr"), candidate.errorDecayLengthXY(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hPtCand"), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hPtProng0"), candidate.ptProng0()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hPtProng1"), candidate.ptProng1()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hDecLength"), candidate.decayLength(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hDecLengthXY"), candidate.decayLengthXY(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hd0Prong0"), candidate.impactParameter0(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hd0Prong1"), candidate.impactParameter1(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hd0d0"), candidate.impactParameterProduct(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hCTS"), hfHelper.cosThetaStarD0(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hCt"), hfHelper.ctD0(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hCPA"), candidate.cpa(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hEtaCand"), candidate.eta(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hSelectionStatus"), candidate.isSelD0() + (candidate.isSelD0bar() * 2), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hImpParErr"), candidate.errorImpactParameter0(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hImpParErr"), candidate.errorImpactParameter1(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hDecLenErr"), candidate.errorDecayLength(), candidate.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hDecLenXYErr"), candidate.errorDecayLengthXY(), candidate.pt()); } } @@ -771,29 +775,31 @@ struct HfTaskFlow { } if (candidate.isSelD0() >= selectionFlagD0) { - registry.fill(HIST("Data/TpcMft/HfHadron/hMass"), hfHelper.invMassD0ToPiK(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hMassVsPt"), hfHelper.invMassD0ToPiK(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hMass"), hfHelper.invMassD0ToPiK(candidate)); } if (candidate.isSelD0bar() >= selectionFlagD0bar) { - registry.fill(HIST("Data/TpcMft/HfHadron/hMass"), hfHelper.invMassD0barToKPi(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hMassVsPt"), hfHelper.invMassD0barToKPi(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hMass"), hfHelper.invMassD0barToKPi(candidate)); } - registry.fill(HIST("Data/TpcMft/HfHadron/hPtCand"), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hPtProng0"), candidate.ptProng0()); - registry.fill(HIST("Data/TpcMft/HfHadron/hPtProng1"), candidate.ptProng1()); - registry.fill(HIST("Data/TpcMft/HfHadron/hDecLength"), candidate.decayLength(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hDecLengthXY"), candidate.decayLengthXY(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hd0Prong0"), candidate.impactParameter0(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hd0Prong1"), candidate.impactParameter1(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hd0d0"), candidate.impactParameterProduct(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hCTS"), hfHelper.cosThetaStarD0(candidate), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hCt"), hfHelper.ctD0(candidate), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hCPA"), candidate.cpa(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hEtaCand"), candidate.eta(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hSelectionStatus"), candidate.isSelD0() + (candidate.isSelD0bar() * 2), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hImpParErr"), candidate.errorImpactParameter0(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hImpParErr"), candidate.errorImpactParameter1(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hDecLenErr"), candidate.errorDecayLength(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/hDecLenXYErr"), candidate.errorDecayLengthXY(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPtCand"), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPtProng0"), candidate.ptProng0()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPtProng1"), candidate.ptProng1()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hDecLength"), candidate.decayLength(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hDecLengthXY"), candidate.decayLengthXY(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hd0Prong0"), candidate.impactParameter0(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hd0Prong1"), candidate.impactParameter1(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hd0d0"), candidate.impactParameterProduct(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hCTS"), hfHelper.cosThetaStarD0(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hCt"), hfHelper.ctD0(candidate), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hCPA"), candidate.cpa(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hEtaCand"), candidate.eta(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hSelectionStatus"), candidate.isSelD0() + (candidate.isSelD0bar() * 2), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hImpParErr"), candidate.errorImpactParameter0(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hImpParErr"), candidate.errorImpactParameter1(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hDecLenErr"), candidate.errorDecayLength(), candidate.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hDecLenXYErr"), candidate.errorDecayLengthXY(), candidate.pt()); } } From 0e43de81a4b55d8cd8d343eaad4fc75dcd455ed5 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Fri, 4 Oct 2024 09:38:15 +0000 Subject: [PATCH 21/31] Please consider the following formatting changes --- PWGHF/HFC/Tasks/taskFlow.cxx | 53 +++++++++++++++++------------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index bfca3906da2..abbf0987502 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -101,7 +101,7 @@ struct HfTaskFlow { // Even add McCollisions in the join ? // Kata adds subscribes to it but do not add it in the join - //using FilteredCollisionsWSelMultMC = soa::Filtered>; + // using FilteredCollisionsWSelMultMC = soa::Filtered>; using FilteredCollisionsWSelMultMC = soa::Filtered>; using TracksWDcaSelMC = soa::Filtered>; @@ -116,7 +116,7 @@ struct HfTaskFlow { using aodMcCollisions = soa::Filtered; using aodMcParticles = soa::Filtered; - + using aodTracks = soa::Filtered>; // From Katarina's code, but not sure if I use it @@ -947,15 +947,15 @@ struct HfTaskFlow { if constexpr (std::is_same_v) { // If MC registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); fillTpcTpcChChMixedEventQAmc(multiplicityTracks2, vz, tracks1); - - //if constexpr (std::is_same_v) { - // registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); - // fillHFMixingQA(multiplicity, vz, tracks1); - //} else { - // registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); - // fillMixingQA(multiplicity, vz, tracks1); - //} - + + // if constexpr (std::is_same_v) { + // registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); + // fillHFMixingQA(multiplicity, vz, tracks1); + // } else { + // registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); + // fillMixingQA(multiplicity, vz, tracks1); + // } + } else { // If not MC if constexpr (std::is_same_v) { // DATA : If TPC-TPC Hf-h case registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); @@ -1013,15 +1013,14 @@ struct HfTaskFlow { // TODO : FILL NEW PLOTS FOR MCTRUTH ONLY registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); fillTpcTpcChChMixedEventQAmc(multiplicity, vz, tracks1); - - //if constexpr (std::is_same_v) { - // registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); - // fillHFMixingQA(multiplicity, vz, tracks1); - //} else { - // registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); - // fillMixingQA(multiplicity, vz, tracks1); - //} - + + // if constexpr (std::is_same_v) { + // registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); + // fillHFMixingQA(multiplicity, vz, tracks1); + // } else { + // registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); + // fillMixingQA(multiplicity, vz, tracks1); + // } corrContainer->fillEvent(multiplicity, CorrelationContainer::kCFStepAll); // TO-DO : probably put the step of the correlation container in the template of this function @@ -1137,7 +1136,7 @@ struct HfTaskFlow { // if (!(isCollisionSelected(mcCollision, true))) { // return; //} - //if (!(isCollisionSelected(mcCollision, true))) { + // if (!(isCollisionSelected(mcCollision, true))) { // return; //} @@ -1233,13 +1232,11 @@ struct HfTaskFlow { return size; }; - - //auto getTracksSize = [&candidates, this](FilteredCollisionsWSelMult::iterator const& col) { - // auto associatedTracks = candidates.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); - // auto size = associatedTracks.size(); - // return size; - //}; - + // auto getTracksSize = [&candidates, this](FilteredCollisionsWSelMult::iterator const& col) { + // auto associatedTracks = candidates.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); + // auto size = associatedTracks.size(); + // return size; + // }; mixCollisions(collisions, candidates, tracks, getTracksSize, mixedTPCTPCHfCh); } From a2eba57d32fca3fa982a4dce5df46f25626cb4f8 Mon Sep 17 00:00:00 2001 From: AlexianL Date: Mon, 7 Oct 2024 14:51:29 +0200 Subject: [PATCH 22/31] Problems solved : error when merging + have to come back to previous way to remove MC particles with charge equal to 0 which caused segmentation faults in the MC GEN case --- PWGHF/HFC/Tasks/taskFlow.cxx | 60 ++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index abbf0987502..1813d540d53 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -113,12 +113,6 @@ struct HfTaskFlow { using aodTracks = soa::Filtered>; - using aodMcCollisions = soa::Filtered; - - using aodMcParticles = soa::Filtered; - - using aodTracks = soa::Filtered>; - // From Katarina's code, but not sure if I use it Filter mcCollisionFilter = nabs(aod::mccollision::posZ) < zVertexMax; @@ -719,8 +713,16 @@ struct HfTaskFlow { bool isMcParticleSelected(TTrack& track) { // remove MC particles with charge = 0 + // TParticlePDG* pdgparticle = pdg->GetParticle(track.pdgCode()); + // if (pdgparticle->Charge() == 0) { + // return false; + //} + int8_t sign = 0; TParticlePDG* pdgparticle = pdg->GetParticle(track.pdgCode()); - if (pdgparticle->Charge() == 0) { + if (pdgparticle != nullptr) { + sign = (pdgparticle->Charge() > 0) ? 1.0 : ((pdgparticle->Charge() < 0) ? -1.0 : 0.0); + } + if (sign == 0) { return false; } @@ -842,6 +844,7 @@ struct HfTaskFlow { invmass = hfHelper.invMassD0ToPiK(track1); } + // From Katarina's code // in case of MC-generated, do additional selection on MCparticles : charge and isPhysicalPrimary // if (processMc) { @@ -855,9 +858,9 @@ struct HfTaskFlow { // fill single-track distributions if (!fillingHFcontainer) { - target->getTriggerHist()->Fill(CorrelationContainer::kCFStepReconstructed, pt1, multiplicity, posZ, triggerWeight); + target->getTriggerHist()->Fill(step, pt1, multiplicity, posZ, triggerWeight); } else { - target->getTriggerHist()->Fill(CorrelationContainer::kCFStepReconstructed, pt1, multiplicity, posZ, invmass, triggerWeight); + target->getTriggerHist()->Fill(step, pt1, multiplicity, posZ, invmass, triggerWeight); } for (const auto& track2 : tracks2) { @@ -902,12 +905,10 @@ struct HfTaskFlow { if (!fillingHFcontainer) { // fill pair correlations - target->getPairHist()->Fill(CorrelationContainer::kCFStepReconstructed, - eta1 - eta2, pt2, pt1, multiplicity, deltaPhi, posZ, + target->getPairHist()->Fill(step, eta1 - eta2, pt2, pt1, multiplicity, deltaPhi, posZ, triggerWeight * associatedWeight); } else { - target->getPairHist()->Fill(CorrelationContainer::kCFStepReconstructed, - eta1 - eta2, pt2, pt1, multiplicity, deltaPhi, posZ, invmass, + target->getPairHist()->Fill(step, eta1 - eta2, pt2, pt1, multiplicity, deltaPhi, posZ, invmass, triggerWeight * associatedWeight); } } @@ -994,14 +995,14 @@ struct HfTaskFlow { // added this to try to compile when doing mixed event with aodMcParticles and aodMcCollisions (MC truth) // TODO : GET RID OF THE COLLISION SELECTION FOR MC TRUTH - if constexpr (!std::is_same_v) { - if (!(isCollisionSelected(collision1, false))) { - continue; - } - if (!(isCollisionSelected(collision2, false))) { - continue; - } - } + // if constexpr (!std::is_same_v) { + // if (!(isCollisionSelected(collision1, false))) { + // continue; + // } + // if (!(isCollisionSelected(collision2, false))) { + // continue; + // } + //} auto binningValues = binningWithTracksSize.getBinningValues(collision1, collisions); int bin = binningWithTracksSize.getBin(binningValues); @@ -1023,7 +1024,6 @@ struct HfTaskFlow { // } corrContainer->fillEvent(multiplicity, CorrelationContainer::kCFStepAll); - // TO-DO : probably put the step of the correlation container in the template of this function fillCorrelations(corrContainer, tracks1, tracks2, multiplicity, collision1.posZ()); } } @@ -1128,6 +1128,7 @@ struct HfTaskFlow { // MONTE-CARLO : process same event correlations: TPC-TPC h-h case // ===================================== + void processSameTpcTpcChChmcREC(FilteredCollisionsWSelMultMC::iterator const& mcCollision, TracksWDcaSelMC const& mcTracks) { @@ -1136,9 +1137,6 @@ struct HfTaskFlow { // if (!(isCollisionSelected(mcCollision, true))) { // return; //} - // if (!(isCollisionSelected(mcCollision, true))) { - // return; - //} const auto multiplicity = mcTracks.size(); registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicity"), multiplicity); @@ -1157,7 +1155,6 @@ struct HfTaskFlow { // Katarina's version = MC Truth void processSameTpcTpcChChmcGEN(aodMcCollisions::iterator const& mcCollision, - // FilteredCollisionsWSelMultMC const& collisions, aodMcParticles const& mcParticles) { @@ -1192,9 +1189,10 @@ struct HfTaskFlow { // fill correlations for MC collisions that have a reconstructed collision // got rid of the second const auto for multPrimaryCharge0 - multPrimaryCharge0 = fillTpcTpcChChSameEventQAmc(multiplicity, mcParticles); - sameTPCTPCChChMC->fillEvent(multPrimaryCharge0, CorrelationContainer::kCFStepVertex); - fillCorrelations(sameTPCTPCChChMC, mcParticles, mcParticles, multPrimaryCharge0, mcCollision.posZ()); + // This line below for sure induce that some plots are filled two times + //multPrimaryCharge0 = fillTpcTpcChChSameEventQAmc(multiplicity, mcParticles); + //sameTPCTPCChChMC->fillEvent(multPrimaryCharge0, CorrelationContainer::kCFStepVertex); + //fillCorrelations(sameTPCTPCChChMC, mcParticles, mcParticles, multPrimaryCharge0, mcCollision.posZ()); } PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcChChmcGEN, "MONTE-CARLO : Process same-event correlations for TPC-TPC h-h case", true); @@ -1317,6 +1315,8 @@ struct HfTaskFlow { }; mixCollisionsMcTruth(mcCollisions, mcParticles, mcParticles, getTracksSize, mixedTPCTPCChChMC); + + // TO-DO : mixed event for particles that have a reconstructed collision kCFStepVertex } PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcChChmcGEN, "MONTE-CARLO : Process mixed-event correlations for TPC-TPC h-h case", true); }; // End of struct @@ -1324,4 +1324,4 @@ struct HfTaskFlow { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} +} \ No newline at end of file From 7061aa932510ea219c965a7e5d0fe3d842c3e31c Mon Sep 17 00:00:00 2001 From: AlexianL Date: Mon, 7 Oct 2024 15:20:45 +0200 Subject: [PATCH 23/31] add space at the end --- PWGHF/HFC/Tasks/taskFlow.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 1813d540d53..4af1257be4d 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -1324,4 +1324,4 @@ struct HfTaskFlow { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} \ No newline at end of file +} From b000230710e6c78254b8f46817db074d852d0780 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 7 Oct 2024 13:21:16 +0000 Subject: [PATCH 24/31] Please consider the following formatting changes --- PWGHF/HFC/Tasks/taskFlow.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 4af1257be4d..cb64677d74b 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -844,7 +844,6 @@ struct HfTaskFlow { invmass = hfHelper.invMassD0ToPiK(track1); } - // From Katarina's code // in case of MC-generated, do additional selection on MCparticles : charge and isPhysicalPrimary // if (processMc) { @@ -1128,7 +1127,6 @@ struct HfTaskFlow { // MONTE-CARLO : process same event correlations: TPC-TPC h-h case // ===================================== - void processSameTpcTpcChChmcREC(FilteredCollisionsWSelMultMC::iterator const& mcCollision, TracksWDcaSelMC const& mcTracks) { @@ -1190,9 +1188,9 @@ struct HfTaskFlow { // fill correlations for MC collisions that have a reconstructed collision // got rid of the second const auto for multPrimaryCharge0 // This line below for sure induce that some plots are filled two times - //multPrimaryCharge0 = fillTpcTpcChChSameEventQAmc(multiplicity, mcParticles); - //sameTPCTPCChChMC->fillEvent(multPrimaryCharge0, CorrelationContainer::kCFStepVertex); - //fillCorrelations(sameTPCTPCChChMC, mcParticles, mcParticles, multPrimaryCharge0, mcCollision.posZ()); + // multPrimaryCharge0 = fillTpcTpcChChSameEventQAmc(multiplicity, mcParticles); + // sameTPCTPCChChMC->fillEvent(multPrimaryCharge0, CorrelationContainer::kCFStepVertex); + // fillCorrelations(sameTPCTPCChChMC, mcParticles, mcParticles, multPrimaryCharge0, mcCollision.posZ()); } PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcChChmcGEN, "MONTE-CARLO : Process same-event correlations for TPC-TPC h-h case", true); From 3010e1f5547f31a7d7f5a2ba1e5d020ed555309b Mon Sep 17 00:00:00 2001 From: AlexianL Date: Mon, 7 Oct 2024 14:51:29 +0200 Subject: [PATCH 25/31] Problems solved : error when merging + have to come back to previous way to remove MC particles with charge equal to 0 which caused segmentation faults in the MC GEN case --- PWGHF/HFC/Tasks/taskFlow.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index cb64677d74b..fb1984cf253 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -844,6 +844,7 @@ struct HfTaskFlow { invmass = hfHelper.invMassD0ToPiK(track1); } + // From Katarina's code // in case of MC-generated, do additional selection on MCparticles : charge and isPhysicalPrimary // if (processMc) { @@ -1127,6 +1128,7 @@ struct HfTaskFlow { // MONTE-CARLO : process same event correlations: TPC-TPC h-h case // ===================================== + void processSameTpcTpcChChmcREC(FilteredCollisionsWSelMultMC::iterator const& mcCollision, TracksWDcaSelMC const& mcTracks) { From fdb98004f430dd4bf8999a9a24181e5195489e48 Mon Sep 17 00:00:00 2001 From: AlexianL Date: Tue, 8 Oct 2024 10:12:05 +0200 Subject: [PATCH 26/31] Changes in isMcParticleSelected --- PWGHF/HFC/Tasks/taskFlow.cxx | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index fb1984cf253..e0665af0729 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -709,26 +709,21 @@ struct HfTaskFlow { return true; } - template - bool isMcParticleSelected(TTrack& track) + // I am not sure if to template McParticles is useful, I'll address this when doing the MC Gen case of HF-h correlations + template + bool isMcParticleSelected(TMcParticles& mcParticles) { // remove MC particles with charge = 0 - // TParticlePDG* pdgparticle = pdg->GetParticle(track.pdgCode()); - // if (pdgparticle->Charge() == 0) { - // return false; - //} - int8_t sign = 0; - TParticlePDG* pdgparticle = pdg->GetParticle(track.pdgCode()); + TParticlePDG* pdgparticle = pdg->GetParticle(mcParticles.pdgCode()); if (pdgparticle != nullptr) { - sign = (pdgparticle->Charge() > 0) ? 1.0 : ((pdgparticle->Charge() < 0) ? -1.0 : 0.0); - } - if (sign == 0) { - return false; + if (pdgparticle->Charge() == 0) { + return false; + } } // MC particle has to be primary if constexpr (step <= CorrelationContainer::kCFStepAnaTopology) { - return track.isPhysicalPrimary(); + return mcParticles.isPhysicalPrimary(); } return true; } From 06d456ec77c9f15a1a04612e78f13458aa5906b0 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 8 Oct 2024 08:22:03 +0000 Subject: [PATCH 27/31] Please consider the following formatting changes --- PWGHF/HFC/Tasks/taskFlow.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index e0665af0729..b6b43452e05 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -717,7 +717,7 @@ struct HfTaskFlow { TParticlePDG* pdgparticle = pdg->GetParticle(mcParticles.pdgCode()); if (pdgparticle != nullptr) { if (pdgparticle->Charge() == 0) { - return false; + return false; } } @@ -839,7 +839,6 @@ struct HfTaskFlow { invmass = hfHelper.invMassD0ToPiK(track1); } - // From Katarina's code // in case of MC-generated, do additional selection on MCparticles : charge and isPhysicalPrimary // if (processMc) { @@ -1123,7 +1122,6 @@ struct HfTaskFlow { // MONTE-CARLO : process same event correlations: TPC-TPC h-h case // ===================================== - void processSameTpcTpcChChmcREC(FilteredCollisionsWSelMultMC::iterator const& mcCollision, TracksWDcaSelMC const& mcTracks) { From 2a2eceaef91a4b0ca70c13b6b436ec397f8348ff Mon Sep 17 00:00:00 2001 From: AlexianL Date: Mon, 7 Oct 2024 14:51:29 +0200 Subject: [PATCH 28/31] Problems solved : error when merging + have to come back to previous way to remove MC particles with charge equal to 0 which caused segmentation faults in the MC GEN case --- PWGHF/HFC/Tasks/taskFlow.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index b6b43452e05..cc70f894b58 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -839,6 +839,7 @@ struct HfTaskFlow { invmass = hfHelper.invMassD0ToPiK(track1); } + // From Katarina's code // in case of MC-generated, do additional selection on MCparticles : charge and isPhysicalPrimary // if (processMc) { @@ -1122,6 +1123,7 @@ struct HfTaskFlow { // MONTE-CARLO : process same event correlations: TPC-TPC h-h case // ===================================== + void processSameTpcTpcChChmcREC(FilteredCollisionsWSelMultMC::iterator const& mcCollision, TracksWDcaSelMC const& mcTracks) { From dbe5f27d04dd2687682fffbbed728aee7d6c0574 Mon Sep 17 00:00:00 2001 From: AlexianL Date: Tue, 8 Oct 2024 10:12:05 +0200 Subject: [PATCH 29/31] Changes in isMcParticleSelected --- PWGHF/HFC/Tasks/taskFlow.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index cc70f894b58..e0665af0729 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -717,7 +717,7 @@ struct HfTaskFlow { TParticlePDG* pdgparticle = pdg->GetParticle(mcParticles.pdgCode()); if (pdgparticle != nullptr) { if (pdgparticle->Charge() == 0) { - return false; + return false; } } From 556b88fa294e65487b67c513b6c73834106b8e44 Mon Sep 17 00:00:00 2001 From: AlexianL Date: Wed, 9 Oct 2024 17:44:12 +0200 Subject: [PATCH 30/31] addressing comments --- PWGHF/HFC/Tasks/taskFlow.cxx | 179 +++++++++++++++++++---------------- 1 file changed, 97 insertions(+), 82 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index e0665af0729..c46f008cf6e 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -70,48 +70,55 @@ struct HfTaskFlow { SliceCache cache; // ========================= - // DATA : Filters & partitions + // using declarations : DATA // ========================= using FilteredCollisionsWSelMult = soa::Filtered>; - using TracksWDcaSel = soa::Filtered>; using HfCandidatesSel = soa::Filtered>; - - // Collision filters - // FIXME: The filter is applied also on the candidates! Beware! - Filter collisionVtxZFilter = nabs(aod::collision::posZ) < zVertexMax; - - Filter trackFilter = (nabs(aod::track::eta) < etaTrackAssocMax) && - (aod::track::pt > ptTrackAssocMin) && - requireGlobalTrackWoPtEtaInFilter(); - - // HF candidate filter - // TODO: use Partition instead of filter - Filter candidateFilter = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || - aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; - - Preslice dataPerCol = aod::track::collisionId; - // Do I have to adapt this preslice to MC ? How does it work exactly ? - // Preslice mcRecPerCol = aod::track::collisionId; - Preslice mcTruthPerCol = aod::mcparticle::mcCollisionId; + using TracksWDcaSel = soa::Filtered>; // ========================= - // MONTE-CARLO : Filters & partitions + // using declarations : MC // ========================= // Even add McCollisions in the join ? // Kata adds subscribes to it but do not add it in the join // using FilteredCollisionsWSelMultMC = soa::Filtered>; using FilteredCollisionsWSelMultMC = soa::Filtered>; + using FilteredMcCollisions = soa::Filtered; + using FilteredMcParticles = soa::Filtered; using TracksWDcaSelMC = soa::Filtered>; - // using aodCollisions = soa::Filtered>; + // Remnants, need Katarina's info + // using FilteredCollisionsWDcaSelMcLabels = soa::Filtered>; + // using FilteredTracksWDcaSelMcLabels = soa::Filtered>; + + // ========================= + // Filters & partitions : DATA + // ========================= + + // HF candidate filter + // TODO: use Partition instead of filter + Filter candidateFilter = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || + aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; + + // Collision filters + // FIXME: The filter is applied also on the candidates! Beware! + Filter collisionVtxZFilter = nabs(aod::collision::posZ) < zVertexMax; - using aodMcCollisions = soa::Filtered; + Filter trackFilter = (nabs(aod::track::eta) < etaTrackAssocMax) && + (aod::track::pt > ptTrackAssocMin) && + requireGlobalTrackWoPtEtaInFilter(); - using aodMcParticles = soa::Filtered; + // Katarina had this in her code : + // Charged track filters + // Filter trackFilter = (nabs(aod::track::eta) < etaTrackAssocMax) && + // (aod::track::pt > ptTrackAssocMin) && + // requireGlobalTrackWoPtEtaInFilter(); - using aodTracks = soa::Filtered>; + // ========================= + // Filters & partitions : MC + // ========================= // From Katarina's code, but not sure if I use it Filter mcCollisionFilter = nabs(aod::mccollision::posZ) < zVertexMax; @@ -121,12 +128,21 @@ struct HfTaskFlow { (aod::mcparticle::pt > ptTrackAssocMin); //&& //(aod::mcparticle::sign != 0) - // Katarina had this in her code : - // Charged track filters + // ========================= + // Preslice : DATA + // ========================= + + Preslice dataPerCol = aod::track::collisionId; - // Filter trackFilter = (nabs(aod::track::eta) < etaTrackAssocMax) && - // (aod::track::pt > ptTrackAssocMin) && - // requireGlobalTrackWoPtEtaInFilter(); + // ========================= + // Preslice : MC + // ========================= + + Preslice mcTruthPerCol = aod::mcparticle::mcCollisionId; + // Do I have to adapt this preslice to MC ? How does it work exactly ? + // Preslice mcRecPerCol = aod::track::collisionId; + + // configurables for containers ConfigurableAxis axisVertex{"axisVertex", {14, -7, 7}, "vertex axis for histograms"}; @@ -176,7 +192,7 @@ struct HfTaskFlow { labels[1] = "after trigger selection (Run 2)"; labels[2] = "after Physics selection"; - const int maxMixBin = axisMultiplicity->size() * 14; // 14 bins for z-vertex + const int nBinsMix = axisMultiplicity->size() * 14; // 14 bins for z-vertex for (int iBin = 0; iBin < kNBinsEvents; iBin++) { registry.get(HIST("Data/hEventCounter"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); @@ -189,7 +205,7 @@ struct HfTaskFlow { // DATA : event histograms for TPC-TPC h-h same event registry.add("Data/TpcTpc/HadronHadron/SameEvent/hMultiplicity", "hMultiplicity", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("Data/TpcTpc/HadronHadron/SameEvent/hVtxZ", "hVtxZ", {HistType::kTH1F, {{400, -50, 50}}}); - registry.add("Data/TpcTpc/HadronHadron/SameEvent/hEventCountSame", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); + registry.add("Data/TpcTpc/HadronHadron/SameEvent/hEventCountSame", "bin", {HistType::kTH1F, {{nBinsMix + 2, -2.5, -0.5 + nBinsMix, "bin"}}}); // DATA : associated particles histograms for TPC-TPC h-h same event registry.add("Data/TpcTpc/HadronHadron/SameEvent/hPt", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); @@ -203,7 +219,7 @@ struct HfTaskFlow { registry.add("Data/TpcTpc/HadronHadron/SameEvent/hVzEta", "eta vs. Vz", {HistType::kTH2F, {{100, -4, 4, "#eta"}, {20, -10, 10, "Vz"}}}); // DATA : event mixing histograms for TPC-TPC h-h mixed event - registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); + registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing", "bin", {HistType::kTH1F, {{nBinsMix + 2, -2.5, -0.5 + nBinsMix, "bin"}}}); registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hMultiplicityMixing", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hVtxZMixing", "hVtxZMixing", {HistType::kTH1F, {{100, -10, 10}}}); registry.add("Data/TpcTpc/HadronHadron/MixedEvent/hNtracksMixing", "hNtracksMixing", {HistType::kTH1F, {{500, 0, 500}}}); @@ -218,7 +234,7 @@ struct HfTaskFlow { // ========================= // DATA : event histograms for TPC-TPC HF-h same event - registry.add("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); + registry.add("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing", "bin", {HistType::kTH1F, {{nBinsMix + 2, -2.5, -0.5 + nBinsMix, "bin"}}}); registry.add("Data/TpcTpc/HfHadron/MixedEvent/hMultiplicityHFMixing", "hMultiplicityHFMixing", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("Data/TpcTpc/HfHadron/MixedEvent/hVtxZHFMixing", "hVtxZHFMixing", {HistType::kTH1F, {{100, -10, 10}}}); registry.add("Data/TpcTpc/HfHadron/MixedEvent/hNtracksHFMixing", "hNtracksHFMixing", {HistType::kTH1F, {{500, 0, 500}}}); @@ -286,7 +302,7 @@ struct HfTaskFlow { registry.add("Data/TpcMft/HadronHadron/MixedEvent/hNtracksMixingMFT", "hNtracksMixing", {HistType::kTH1F, {{500, 0, 500}}}); // DATA : histograms for TPC-MFT h-h event mixing for events QA - registry.add("Data/TpcMft/HadronHadron/MixedEvent/hEventCountMixing", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); + registry.add("Data/TpcMft/HadronHadron/MixedEvent/hEventCountMixing", "bin", {HistType::kTH1F, {{nBinsMix + 2, -2.5, -0.5 + nBinsMix, "bin"}}}); // ========================= // DATA : histograms for TPC-MFT HF-h case @@ -345,7 +361,7 @@ struct HfTaskFlow { registry.add("Data/TpcMft/HfHadron/MixedEvent/hNtracksMixingMFT", "hNtracksMixing", {HistType::kTH1F, {{500, 0, 500}}}); // DATA : histograms for TPC-MFT h-h event mixing for events QA - registry.add("Data/TpcMft/HfHadron/MixedEvent/hEventCountMixing", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); + registry.add("Data/TpcMft/HfHadron/MixedEvent/hEventCountMixing", "bin", {HistType::kTH1F, {{nBinsMix + 2, -2.5, -0.5 + nBinsMix, "bin"}}}); // ========================= // MC : histograms for TPC-MFT h-h case @@ -366,7 +382,7 @@ struct HfTaskFlow { registry.add("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEtaPhi", "multiplicity vs eta vs phi", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); registry.add("MC/Rec/TpcTpc/HadronHadron/SameEvent/hNtracks", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); // histograms for MC particles in event mixing - registry.add("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); + registry.add("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing", "bin", {HistType::kTH1F, {{nBinsMix + 2, -2.5, -0.5 + nBinsMix, "bin"}}}); registry.add("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hMultiplicityMixing", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hVtxZMixing", "hVtxZMixing", {HistType::kTH1F, {{100, -10, 10}}}); registry.add("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hPtMixing", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); @@ -389,7 +405,7 @@ struct HfTaskFlow { registry.add("MC/Gen/TpcTpc/HadronHadron/SameEvent/hEtaPhi", "multiplicity vs eta vs phi", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); registry.add("MC/Gen/TpcTpc/HadronHadron/SameEvent/hNtracks", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); // histograms for MC particles in event mixing - registry.add("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); + registry.add("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing", "bin", {HistType::kTH1F, {{nBinsMix + 2, -2.5, -0.5 + nBinsMix, "bin"}}}); registry.add("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hMultiplicityMixing", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hVtxZMixing", "hVtxZMixing", {HistType::kTH1F, {{100, -10, 10}}}); registry.add("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hPtMixing", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); @@ -455,7 +471,7 @@ struct HfTaskFlow { // ---- DATA : TPC-TPC h-h Same Event QA ---- template - void fillTpcTpcChChSameEventQA(float multiplicity, TTracks const& tracks) + void fillTpcTpcChChSameEventQa(float multiplicity, TTracks const& tracks) { int nTracks = tracks.size(); for (const auto& track1 : tracks) { @@ -471,14 +487,13 @@ struct HfTaskFlow { // ---- MC : TPC-TPC h-h Same Event QA ---- // Changed quickly void for int type + added the return for a test template - int fillTpcTpcChChSameEventQAmc(float multiplicity, TTracks const& tracks) + int fillTpcTpcChChSameEventQaMc(float multiplicity, TTracks const& tracks) { int nTracks = tracks.size(); for (const auto& track1 : tracks) { - // TO-DO : DEBUG THIS // in case of MC-generated, do additional selection on MCparticles : charge and isPhysicalPrimary - if constexpr (std::is_same_v) { + if constexpr (std::is_same_v) { if (!isMcParticleSelected(track1)) { continue; } @@ -511,7 +526,7 @@ struct HfTaskFlow { // ---- DATA : TPC-TPC h-h Mixed Event QA ---- template - void fillTpcTpcChChMixedEventQA(float multiplicity, float vz, TTracks const& tracks) + void fillTpcTpcChChMixedEventQa(float multiplicity, float vz, TTracks const& tracks) { registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hMultiplicityMixing"), multiplicity); registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hVtxZMixing"), vz); @@ -527,7 +542,7 @@ struct HfTaskFlow { // ---- MC : TPC-TPC h-h Mixed Event QA ---- template - void fillTpcTpcChChMixedEventQAmc(float multiplicity, float vz, TTracks const& tracks) + void fillTpcTpcChChMixedEventQaMc(float multiplicity, float vz, TTracks const& tracks) { if constexpr (std::is_same_v) { // if MC Rec registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hMultiplicityMixing"), multiplicity); @@ -558,7 +573,7 @@ struct HfTaskFlow { // ---- DATA : TPC-TPC HF-h Mixed Event QA ---- template - void fillTpcTpcHfChMixedEventQA(float multiplicity, float vz, TTracks const& tracks) + void fillTpcTpcHfChMixedEventQa(float multiplicity, float vz, TTracks const& tracks) { registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hMultiplicityHFMixing"), multiplicity); registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hVtxZHFMixing"), vz); @@ -574,7 +589,7 @@ struct HfTaskFlow { // ---- DATA : TPC-MFT h-h Same Event QA ---- template - void fillTpcMftChChSameEventQA(float multiplicity, TTracks const& tracks) + void fillTpcMftChChSameEventQa(float multiplicity, TTracks const& tracks) { int nTracks = tracks.size(); bool isMFT = false; @@ -607,7 +622,7 @@ struct HfTaskFlow { // ---- DATA : TPC-MFT HF-h Same Event QA ---- template - void fillTpcMftHfChSameEventQA(float multiplicity, TTracks const& tracks) + void fillTpcMftHfChSameEventQa(float multiplicity, TTracks const& tracks) { int nTracks = tracks.size(); bool isMFT = false; @@ -640,7 +655,7 @@ struct HfTaskFlow { // ---- DATA : TPC-MFT h-h Mixed Event QA ---- template - void fillTpcMftChChMixedEventQA(float multiplicity, float vz, TTracks const& tracks) + void fillTpcMftChChMixedEventQa(float multiplicity, float vz, TTracks const& tracks) { if constexpr (std::is_same_v) { // if MFT tracks registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hMultiplicityMixingMFT"), multiplicity); @@ -669,7 +684,7 @@ struct HfTaskFlow { // ---- DATA : TPC-MFT h-h Mixed Event QA ---- template - void fillTpcMftHfChMixedEventQA(float multiplicity, float vz, TTracks const& tracks) + void fillTpcMftHfChMixedEventQa(float multiplicity, float vz, TTracks const& tracks) { if constexpr (std::is_same_v) { // if MFT tracks registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hMultiplicityMixingMFT"), multiplicity); @@ -731,7 +746,7 @@ struct HfTaskFlow { // ---- DATA : TPC-TPC HF-h Same Event (Candidates) QA ---- // TODO: Note: we do not need all these plots since they are in D0 and Lc task -> remove it after we are sure this works template - void fillTpcTpcCandidateQA(TTracks const& candidates) + void fillTpcTpcCandidateQa(TTracks const& candidates) { for (const auto& candidate : candidates) { if (!isAcceptedCandidate(candidate)) { @@ -770,7 +785,7 @@ struct HfTaskFlow { // ---- DATA : TPC-MFT HF-h Same Event (Candidates) QA ---- // TODO: Note: we do not need all these plots since they are in D0 and Lc task -> remove it after we are sure this works template - void fillTpcMftCandidateQA(TTracks const& candidates) + void fillTpcMftCandidateQa(TTracks const& candidates) { for (const auto& candidate : candidates) { if (!isAcceptedCandidate(candidate)) { @@ -843,8 +858,8 @@ struct HfTaskFlow { // From Katarina's code // in case of MC-generated, do additional selection on MCparticles : charge and isPhysicalPrimary // if (processMc) { - // NOTE : this version with aodMcParticles is only for Katarina's way of doing MC - if constexpr (std::is_same_v || std::is_same_v) { + // NOTE : this version with FilteredMcParticles is only for Katarina's way of doing MC + if constexpr (std::is_same_v || std::is_same_v) { if (!isMcParticleSelected(track1)) { continue; } @@ -878,7 +893,7 @@ struct HfTaskFlow { // in case of MC-generated, do additional selection on MCparticles : charge and isPhysicalPrimary // if (processMc) { - if constexpr (std::is_same_v || std::is_same_v) { + if constexpr (std::is_same_v || std::is_same_v) { if (!isMcParticleSelected(track2)) { continue; } @@ -924,7 +939,7 @@ struct HfTaskFlow { for (const auto& [collision1, tracks1, collision2, tracks2] : pair) { - if constexpr (!std::is_same_v) { + if constexpr (!std::is_same_v) { if (!(isCollisionSelected(collision1, false))) { continue; } @@ -942,7 +957,7 @@ struct HfTaskFlow { if constexpr (std::is_same_v) { // If MC registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); - fillTpcTpcChChMixedEventQAmc(multiplicityTracks2, vz, tracks1); + fillTpcTpcChChMixedEventQaMc(multiplicityTracks2, vz, tracks1); // if constexpr (std::is_same_v) { // registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); @@ -955,18 +970,18 @@ struct HfTaskFlow { } else { // If not MC if constexpr (std::is_same_v) { // DATA : If TPC-TPC Hf-h case registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); - fillTpcTpcHfChMixedEventQA(multiplicityTracks2, vz, tracks1); + fillTpcTpcHfChMixedEventQa(multiplicityTracks2, vz, tracks1); } else if constexpr (std::is_same_v) { // DATA : If TPC-MFT h-h case registry.fill(HIST("Data/TpcMft/HadronHadron/MixedEvent/hEventCountMixing"), bin); - fillTpcMftChChMixedEventQA(multiplicityTracks1, vz, tracks1); // TPC tracks - fillTpcMftChChMixedEventQA(multiplicityTracks2, vz, tracks2); // MFT tracks + fillTpcMftChChMixedEventQa(multiplicityTracks1, vz, tracks1); // TPC tracks + fillTpcMftChChMixedEventQa(multiplicityTracks2, vz, tracks2); // MFT tracks } else if constexpr (std::is_same_v && std::is_same_v) { // DATA : If TPC-MFT HF-h case registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hEventCountMixing"), bin); - fillTpcMftHfChMixedEventQA(multiplicityTracks1, vz, tracks1); // Candidates - fillTpcMftHfChMixedEventQA(multiplicityTracks2, vz, tracks2); // MFT tracks + fillTpcMftHfChMixedEventQa(multiplicityTracks1, vz, tracks1); // Candidates + fillTpcMftHfChMixedEventQa(multiplicityTracks2, vz, tracks2); // MFT tracks } else { // DATA : If TPC-TPC h-h case registry.fill(HIST("Data/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); - fillTpcTpcChChMixedEventQA(multiplicityTracks2, vz, tracks1); + fillTpcTpcChChMixedEventQa(multiplicityTracks2, vz, tracks1); } } @@ -988,9 +1003,9 @@ struct HfTaskFlow { for (const auto& [collision1, tracks1, collision2, tracks2] : pair) { - // added this to try to compile when doing mixed event with aodMcParticles and aodMcCollisions (MC truth) + // added this to try to compile when doing mixed event with FilteredMcParticles and FilteredMcCollisions (MC truth) // TODO : GET RID OF THE COLLISION SELECTION FOR MC TRUTH - // if constexpr (!std::is_same_v) { + // if constexpr (!std::is_same_v) { // if (!(isCollisionSelected(collision1, false))) { // continue; // } @@ -1008,7 +1023,7 @@ struct HfTaskFlow { // TO BE DONE : ADD ONE MORE IF CONDITION TO FILL THE MC CASE // TODO : FILL NEW PLOTS FOR MCTRUTH ONLY registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); - fillTpcTpcChChMixedEventQAmc(multiplicity, vz, tracks1); + fillTpcTpcChChMixedEventQaMc(multiplicity, vz, tracks1); // if constexpr (std::is_same_v) { // registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); @@ -1049,7 +1064,7 @@ struct HfTaskFlow { sameTPCTPCChCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); - fillTpcTpcChChSameEventQA(multiplicity, tracks); + fillTpcTpcChChSameEventQa(multiplicity, tracks); // TO-DO : add if condition for when we will implant corrected correlations (kCFStepReconstructed -> kCFStepCorrected) fillCorrelations(sameTPCTPCChCh, tracks, tracks, multiplicity, collision.posZ()); } @@ -1070,7 +1085,7 @@ struct HfTaskFlow { sameTPCTPCHfCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); - fillTpcTpcCandidateQA(candidates); + fillTpcTpcCandidateQa(candidates); fillCorrelations(sameTPCTPCHfCh, candidates, tracks, multiplicity, collision.posZ()); } PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcHfCh, "DATA : Process same-event correlations for TPC-TPC HF-h case", true); @@ -1091,8 +1106,8 @@ struct HfTaskFlow { const auto multiplicityMFT = mftTracks.size(); sameTPCMFTChCh->fillEvent(multiplicityTPC, CorrelationContainer::kCFStepReconstructed); - fillTpcMftChChSameEventQA(multiplicityTPC, tracks); - fillTpcMftChChSameEventQA(multiplicityMFT, mftTracks); + fillTpcMftChChSameEventQa(multiplicityTPC, tracks); + fillTpcMftChChSameEventQa(multiplicityMFT, mftTracks); fillCorrelations(sameTPCMFTChCh, tracks, mftTracks, multiplicityTPC, collision.posZ()); } PROCESS_SWITCH(HfTaskFlow, processSameTpcMftChCh, "DATA : Process same-event correlations for TPC-MFT h-h case", true); @@ -1113,8 +1128,8 @@ struct HfTaskFlow { const auto multiplicityMFT = mftTracks.size(); sameTPCMFTHfCh->fillEvent(multiplicityCandidates, CorrelationContainer::kCFStepReconstructed); - fillTpcMftCandidateQA(candidates); - fillTpcMftHfChSameEventQA(multiplicityMFT, mftTracks); + fillTpcMftCandidateQa(candidates); + fillTpcMftHfChSameEventQa(multiplicityMFT, mftTracks); fillCorrelations(sameTPCMFTHfCh, candidates, mftTracks, multiplicityCandidates, collision.posZ()); } PROCESS_SWITCH(HfTaskFlow, processSameTpcMftHfCh, "DATA : Process same-event correlations for TPC-MFT HF-h case", true); @@ -1143,14 +1158,14 @@ struct HfTaskFlow { sameTPCTPCChChMC->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); - fillTpcTpcChChSameEventQAmc(multiplicity, mcTracks); + fillTpcTpcChChSameEventQaMc(multiplicity, mcTracks); fillCorrelations(sameTPCTPCChChMC, mcTracks, mcTracks, multiplicity, mcCollision.posZ()); } PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcChChmcREC, "MONTE-CARLO : Process same-event correlations for TPC-TPC h-h case", true); // Katarina's version = MC Truth - void processSameTpcTpcChChmcGEN(aodMcCollisions::iterator const& mcCollision, - aodMcParticles const& mcParticles) + void processSameTpcTpcChChmcGEN(FilteredMcCollisions::iterator const& mcCollision, + FilteredMcParticles const& mcParticles) { // if (!(isCollisionSelected(mcCollision, true))) { @@ -1173,7 +1188,7 @@ struct HfTaskFlow { // fill correlations for all MC collisions // In Katka's code, the first time doing this does not fill the histograms, right now will be filled two times.. - auto multPrimaryCharge0 = fillTpcTpcChChSameEventQAmc(multiplicity, mcParticles); + auto multPrimaryCharge0 = fillTpcTpcChChSameEventQaMc(multiplicity, mcParticles); sameTPCTPCChChMC->fillEvent(multPrimaryCharge0, CorrelationContainer::kCFStepAll); fillCorrelations(sameTPCTPCChChMC, mcParticles, mcParticles, multPrimaryCharge0, mcCollision.posZ()); @@ -1182,12 +1197,12 @@ struct HfTaskFlow { // int bin = baseBinning.getBin(std::make_tuple(mcCollision.posZ(), multiplicity)); // registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hEventCountSame"), bin); - // fill correlations for MC collisions that have a reconstructed collision + // TO-DO : fill correlation container for MC collisions that have a reconstructed collision // got rid of the second const auto for multPrimaryCharge0 // This line below for sure induce that some plots are filled two times - // multPrimaryCharge0 = fillTpcTpcChChSameEventQAmc(multiplicity, mcParticles); - // sameTPCTPCChChMC->fillEvent(multPrimaryCharge0, CorrelationContainer::kCFStepVertex); - // fillCorrelations(sameTPCTPCChChMC, mcParticles, mcParticles, multPrimaryCharge0, mcCollision.posZ()); + //multPrimaryCharge0 = fillTpcTpcChChSameEventQaMc(multiplicity, mcParticles); + //sameTPCTPCChChMC->fillEvent(multPrimaryCharge0, CorrelationContainer::kCFStepVertex); + //fillCorrelations(sameTPCTPCChChMC, mcParticles, mcParticles, multPrimaryCharge0, mcCollision.posZ()); } PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcChChmcGEN, "MONTE-CARLO : Process same-event correlations for TPC-TPC h-h case", true); @@ -1296,14 +1311,14 @@ struct HfTaskFlow { PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcChChmcREC, "MONTE-CARLO : Process mixed-event correlations for TPC-TPC h-h case", true); // MC gen - void processMixedTpcTpcChChmcGEN(aodMcCollisions const& mcCollisions, - aodMcParticles const& mcParticles, + void processMixedTpcTpcChChmcGEN(FilteredMcCollisions const& mcCollisions, + FilteredMcParticles const& mcParticles, FilteredCollisionsWSelMultMC const& collisions) { // use normal index instead of globalIndex for MixedEvent ?? // we want to group collisions based on charged-track multiplicity - auto getTracksSize = [&mcParticles, this](aodMcCollisions::iterator const& mcCol) { + auto getTracksSize = [&mcParticles, this](FilteredMcCollisions::iterator const& mcCol) { auto associatedTracks = mcParticles.sliceByCached(o2::aod::mcparticle::mcCollisionId, mcCol.globalIndex(), this->cache); // it's cached, so slicing/grouping happens only once auto size = associatedTracks.size(); return size; From 65425d8463c424a9fad41cc4c3561f8207b7cdc4 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 9 Oct 2024 16:06:44 +0000 Subject: [PATCH 31/31] Please consider the following formatting changes --- PWGHF/HFC/Tasks/taskFlow.cxx | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index c46f008cf6e..5fcdb7a7878 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -70,7 +70,7 @@ struct HfTaskFlow { SliceCache cache; // ========================= - // using declarations : DATA + // using declarations : DATA // ========================= using FilteredCollisionsWSelMult = soa::Filtered>; @@ -89,14 +89,14 @@ struct HfTaskFlow { using FilteredMcParticles = soa::Filtered; using TracksWDcaSelMC = soa::Filtered>; - // Remnants, need Katarina's info + // Remnants, need Katarina's info // using FilteredCollisionsWDcaSelMcLabels = soa::Filtered>; // using FilteredTracksWDcaSelMcLabels = soa::Filtered>; // ========================= - // Filters & partitions : DATA + // Filters & partitions : DATA // ========================= - + // HF candidate filter // TODO: use Partition instead of filter Filter candidateFilter = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || @@ -131,7 +131,7 @@ struct HfTaskFlow { // ========================= // Preslice : DATA // ========================= - + Preslice dataPerCol = aod::track::collisionId; // ========================= @@ -142,8 +142,6 @@ struct HfTaskFlow { // Do I have to adapt this preslice to MC ? How does it work exactly ? // Preslice mcRecPerCol = aod::track::collisionId; - - // configurables for containers ConfigurableAxis axisVertex{"axisVertex", {14, -7, 7}, "vertex axis for histograms"}; ConfigurableAxis axisDeltaPhi{"axisDeltaPhi", {72, -PIHalf, PIHalf * 3}, "delta phi axis for histograms"}; @@ -732,7 +730,7 @@ struct HfTaskFlow { TParticlePDG* pdgparticle = pdg->GetParticle(mcParticles.pdgCode()); if (pdgparticle != nullptr) { if (pdgparticle->Charge() == 0) { - return false; + return false; } } @@ -854,7 +852,6 @@ struct HfTaskFlow { invmass = hfHelper.invMassD0ToPiK(track1); } - // From Katarina's code // in case of MC-generated, do additional selection on MCparticles : charge and isPhysicalPrimary // if (processMc) { @@ -1138,7 +1135,6 @@ struct HfTaskFlow { // MONTE-CARLO : process same event correlations: TPC-TPC h-h case // ===================================== - void processSameTpcTpcChChmcREC(FilteredCollisionsWSelMultMC::iterator const& mcCollision, TracksWDcaSelMC const& mcTracks) { @@ -1200,9 +1196,9 @@ struct HfTaskFlow { // TO-DO : fill correlation container for MC collisions that have a reconstructed collision // got rid of the second const auto for multPrimaryCharge0 // This line below for sure induce that some plots are filled two times - //multPrimaryCharge0 = fillTpcTpcChChSameEventQaMc(multiplicity, mcParticles); - //sameTPCTPCChChMC->fillEvent(multPrimaryCharge0, CorrelationContainer::kCFStepVertex); - //fillCorrelations(sameTPCTPCChChMC, mcParticles, mcParticles, multPrimaryCharge0, mcCollision.posZ()); + // multPrimaryCharge0 = fillTpcTpcChChSameEventQaMc(multiplicity, mcParticles); + // sameTPCTPCChChMC->fillEvent(multPrimaryCharge0, CorrelationContainer::kCFStepVertex); + // fillCorrelations(sameTPCTPCChChMC, mcParticles, mcParticles, multPrimaryCharge0, mcCollision.posZ()); } PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcChChmcGEN, "MONTE-CARLO : Process same-event correlations for TPC-TPC h-h case", true);