From 0558894b94f4bba5de72f71242107295ee6a2f43 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sat, 2 Aug 2025 09:47:24 +0530 Subject: [PATCH 01/52] Add DeltaEta and Deltaphi from Emcal correction table Add DeltaEta and Deltaphi from Emcal correction table --- PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index 94bad334ce4..7dac8c0a83d 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -468,8 +468,8 @@ struct HfElectronSelectionWithTpcEmcal { timeEmcCluster = emcCluster.time(); cellEmcCluster = emcCluster.nCells(); - deltaPhiMatch = matchTrack.trackPhiEmcal() - phiMatchEmcCluster; - deltaEtaMatch = matchTrack.trackEtaEmcal() - etaMatchEmcCluster; + deltaPhiMatch = ematchTrack.deltaPhi(); + deltaEtaMatch = ematchTrack.deltaEta(); // Track and EMCal cluster Matching if (std::abs(timeEmcCluster) > timeEmcClusterMax) { From ae540ffc6a4ac15db789b91506fe2a59ac86569d Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sat, 2 Aug 2025 09:48:43 +0530 Subject: [PATCH 02/52] remove some condition on Hadron table for event mix remove some condition on Hadron table --- PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index 30989581962..3467ec6e566 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -152,12 +152,17 @@ struct HfCorrelatorHfeHadrons { int gCollisionId = collision.globalIndex(); int64_t timeStamp = bc.timestamp(); + // Add hadron Table For Mix Event Electron Hadron correlation + for (const auto& hTrack : tracks) { + registry.fill(HIST("hTracksBin"), poolBin); + entryHadron(hTrack.phi(), hTrack.eta(), hTrack.pt(), poolBin, gCollisionId, timeStamp); + } + // Construct Deta Phi between electrons and hadrons double ptElectron = -999; double phiElectron = -999; double etaElectron = -999; - int nElectron = 0; for (const auto& eTrack : electron) { ptElectron = eTrack.ptTrack(); @@ -209,10 +214,7 @@ struct HfCorrelatorHfeHadrons { if (ptCondition && (ptElectron < ptHadron)) { continue; } - if (nElectron == 0) { - registry.fill(HIST("hTracksBin"), poolBin); - entryHadron(phiHadron, etaHadron, ptHadron, poolBin, gCollisionId, timeStamp); - } + deltaPhi = RecoDecay::constrainAngle(phiElectron - phiHadron, -o2::constants::math::PIHalf); deltaEta = etaElectron - etaHadron; registry.fill(HIST("hInclusiveEHCorrel"), ptElectron, ptHadron, deltaPhi, deltaEta); @@ -236,8 +238,7 @@ struct HfCorrelatorHfeHadrons { entryElectronHadronPair(deltaPhi, deltaEta, ptElectron, ptHadron, poolBin, nElHadLSCorr, nElHadUSCorr); } // end Hadron Track loop - nElectron++; - } // end Electron loop + } // end Electron loop } // mix event electron-hadron correlation From d76d2a67039f08b95fd9617e603acbbc86096022 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sat, 2 Aug 2025 09:58:47 +0530 Subject: [PATCH 03/52] Update correlatorHfeHadrons.cxx From 0789651a66e9e4a2117f3d89fcf9f68b4c63fac2 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sat, 2 Aug 2025 10:03:52 +0530 Subject: [PATCH 04/52] Update correlatorHfeHadrons.cxx --- PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index 3467ec6e566..3469c1fad69 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -238,7 +238,8 @@ struct HfCorrelatorHfeHadrons { entryElectronHadronPair(deltaPhi, deltaEta, ptElectron, ptHadron, poolBin, nElHadLSCorr, nElHadUSCorr); } // end Hadron Track loop - } // end Electron loop + + } // end Electron loop } // mix event electron-hadron correlation From 046b5bc283619fcb94077616688622a78a330803 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Wed, 13 Aug 2025 09:53:54 +0530 Subject: [PATCH 05/52] Addsome cut in Hadron Table --- PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index 3469c1fad69..a83b62f6e21 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -154,6 +154,9 @@ struct HfCorrelatorHfeHadrons { // Add hadron Table For Mix Event Electron Hadron correlation for (const auto& hTrack : tracks) { + if (!selAssoHadron(hTrack)) { + continue; + } registry.fill(HIST("hTracksBin"), poolBin); entryHadron(hTrack.phi(), hTrack.eta(), hTrack.pt(), poolBin, gCollisionId, timeStamp); } @@ -238,8 +241,7 @@ struct HfCorrelatorHfeHadrons { entryElectronHadronPair(deltaPhi, deltaEta, ptElectron, ptHadron, poolBin, nElHadLSCorr, nElHadUSCorr); } // end Hadron Track loop - - } // end Electron loop + } // end Electron loop } // mix event electron-hadron correlation From d1bf746dd9152ebe1a8fd2f8abad157fef957916 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Wed, 13 Aug 2025 10:00:08 +0530 Subject: [PATCH 06/52] Update correlatorHfeHadrons.cxx From 8b339d18b0cead505259c2fcb9ffb6e5172be9b3 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Wed, 13 Aug 2025 10:03:38 +0530 Subject: [PATCH 07/52] Update correlatorHfeHadrons.cxx --- PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index a83b62f6e21..0a824c1e9b5 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -241,7 +241,8 @@ struct HfCorrelatorHfeHadrons { entryElectronHadronPair(deltaPhi, deltaEta, ptElectron, ptHadron, poolBin, nElHadLSCorr, nElHadUSCorr); } // end Hadron Track loop - } // end Electron loop + + } // end Electron loop } // mix event electron-hadron correlation From 87f93217ead2743d3a6be396e1e7421731596da2 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Wed, 13 Aug 2025 10:08:12 +0530 Subject: [PATCH 08/52] Update correlatorHfeHadrons.cxx --- PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index df2fe0168c1..0a824c1e9b5 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -157,7 +157,6 @@ struct HfCorrelatorHfeHadrons { if (!selAssoHadron(hTrack)) { continue; } - registry.fill(HIST("hTracksBin"), poolBin); entryHadron(hTrack.phi(), hTrack.eta(), hTrack.pt(), poolBin, gCollisionId, timeStamp); } @@ -472,4 +471,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ adaptAnalysisTask(cfgc)}; -} \ No newline at end of file +} From 2bebe35305dbbc0918a46e5a5cad57246ca7c940 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Thu, 11 Sep 2025 14:34:33 +0530 Subject: [PATCH 09/52] add Mc gen for non hf --- .../electronSelectionWithTpcEmcal.cxx | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index 7dac8c0a83d..d54bfcdeb8f 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -550,12 +550,9 @@ struct HfElectronSelectionWithTpcEmcal { void processMcGen(McGenTableCollision const& mcCollision, aod::McParticles const& mcParticles) { - ///// electron identification bool isNonHfe = false; for (const auto& particleMc : mcParticles) { - if (!particleMc.isPhysicalPrimary()) - continue; if (!mcGensel(particleMc)) { continue; } @@ -580,30 +577,41 @@ struct HfElectronSelectionWithTpcEmcal { //================= eta->e ====================================== if (std::abs(mother.pdgCode()) == kEta) { - isEmbEta = true; + if (mother.isPhysicalPrimary()) { + isEmbEta = true; + } } //================= eta->pi0->e ====================================== if (std::abs(mother.pdgCode()) == kPi0) { - isEmbPi0 = true; // pi0 -> e + if (mother.isPhysicalPrimary()) { + isEmbPi0 = true; // pi0 -> e + } if (std::abs(gmother.pdgCode()) == kEta) { - isEmbEta = true; // eta->pi0-> e + if (gmother.isPhysicalPrimary()) { + isEmbEta = true; // eta->pi0-> e + } } } /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ if (std::abs(mother.pdgCode()) == kGamma) { if (std::abs(gmother.pdgCode()) == kEta) { - isEmbEta = true; // eta->gamma-> e + if (gmother.isPhysicalPrimary()) { + isEmbEta = true; // eta->gamma-> e + } } if (std::abs(gmother.pdgCode()) == kPi0) { - isEmbPi0 = true; // pi0-> gamma-> e + if (gmother.isPhysicalPrimary()) { + isEmbPi0 = true; // pi0-> gamma-> e + } if (std::abs(ggmother.pdgCode()) == kEta) { - - isEmbEta = true; // eta->pi0->gamma-> e + if (ggmother.isPhysicalPrimary()) { + isEmbEta = true; // eta->pi0->gamma-> e + } } } } @@ -629,7 +637,6 @@ struct HfElectronSelectionWithTpcEmcal { PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processMcGen, "Process MC Gen mode", false); }; - WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; From 67283a1e0259f5432a21d7b87a0e051312a187fa Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Thu, 11 Sep 2025 14:35:40 +0530 Subject: [PATCH 10/52] Add mc gen for hadron --- .../TableProducer/correlatorHfeHadrons.cxx | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index 0a824c1e9b5..fdd2e1c60e1 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -108,7 +108,10 @@ struct HfCorrelatorHfeHadrons { registry.add("hULSEHCorrel", "Sparse for Delta phi and Delta eta UnLike sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hMCgenNonHfEHCorrel", "Sparse for Delta phi and Delta eta for McGen Non Hf Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hMCgenInclusiveEHCorrl", "Sparse for Delta phi and Delta eta for McGen Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); - registry.add("hptElectron", "hptElectron", {HistType::kTH1D, {axisPt}}); + registry.add("hptElectron", "hptElectronMcGen", {HistType::kTH1D, {axisPt}}); + registry.add("hptHadron", "hptHadron", {HistType::kTH1D, {axisPt}}); + registry.add("hMCgenptHadron", "hMCgenptHadron", {HistType::kTH1D, {axisPt}}); + registry.add("hMCgenptHadronprimary", "hMCgenptHadronprimary", {HistType::kTH1D, {axisPt}}); registry.add("hMixEventInclusiveEHCorrl", "Sparse for mix event Delta phi and Delta eta Inclusive Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hMixEventLSEHCorrel", "Sparse for mix event Delta phi and Delta eta Like sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); @@ -158,6 +161,7 @@ struct HfCorrelatorHfeHadrons { continue; } registry.fill(HIST("hTracksBin"), poolBin); + registry.fill(HIST("hptHadron"), hTrack.pt()); entryHadron(hTrack.phi(), hTrack.eta(), hTrack.pt(), poolBin, gCollisionId, timeStamp); } @@ -313,7 +317,7 @@ struct HfCorrelatorHfeHadrons { fillCorrelation(collision, electron, tracks, bc); } - PROCESS_SWITCH(HfCorrelatorHfeHadrons, processData, "Process for Data", true); + PROCESS_SWITCH(HfCorrelatorHfeHadrons, processData, "Process for Data", false); // ======= Process starts for McRec, Same event ============ @@ -332,9 +336,25 @@ struct HfCorrelatorHfeHadrons { BinningTypeMcGen corrBinningMcGen{{zBins, multBinsMcGen}, true}; int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), mcCollision.multMCFT0A())); + for (const auto& particleMc : mcParticles) { + if (particleMc.eta() < etaTrackMin || particleMc.eta() > etaTrackMax) { + continue; + } + if (particleMc.pt() < ptTrackMin) { + continue; + } + + registry.fill(HIST("hMCgenptHadron"), particleMc.pt()); + if (particleMc.isPhysicalPrimary()) { + + registry.fill(HIST("hMCgenptHadronprimary"), particleMc.pt()); + } + } + double ptElectron = 0; double phiElectron = 0; double etaElectron = 0; + for (const auto& electronMc : electron) { double ptHadron = 0; double phiHadron = 0; @@ -382,7 +402,7 @@ struct HfCorrelatorHfeHadrons { } } } - PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcGen, "Process MC Gen mode", false); + PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcGen, "Process MC Gen mode", true); // ====================== Implement Event mixing on Data =============================== // ====================== Implement Event mixing on Data =================================== @@ -465,7 +485,7 @@ struct HfCorrelatorHfeHadrons { } } } - PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcGenMixedEvent, "Process Mixed Event MC Gen mode", false); + PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcGenMixedEvent, "Process Mixed Event MC Gen mode", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From 61183616a5a43d9396a561e0266adba6f705c0b0 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Thu, 11 Sep 2025 15:04:20 +0530 Subject: [PATCH 11/52] Update correlatorHfeHadrons.cxx --- PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index fdd2e1c60e1..a264151a4b4 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -108,7 +108,7 @@ struct HfCorrelatorHfeHadrons { registry.add("hULSEHCorrel", "Sparse for Delta phi and Delta eta UnLike sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hMCgenNonHfEHCorrel", "Sparse for Delta phi and Delta eta for McGen Non Hf Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hMCgenInclusiveEHCorrl", "Sparse for Delta phi and Delta eta for McGen Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); - registry.add("hptElectron", "hptElectronMcGen", {HistType::kTH1D, {axisPt}}); + registry.add("hptElectron", "hptElectron", {HistType::kTH1D, {axisPt}}); registry.add("hptHadron", "hptHadron", {HistType::kTH1D, {axisPt}}); registry.add("hMCgenptHadron", "hMCgenptHadron", {HistType::kTH1D, {axisPt}}); registry.add("hMCgenptHadronprimary", "hMCgenptHadronprimary", {HistType::kTH1D, {axisPt}}); From b05e432bfb921c189586f069b74bae9f08cedf22 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Thu, 11 Sep 2025 17:15:15 +0530 Subject: [PATCH 12/52] Update correlatorHfeHadrons.cxx --- .../TableProducer/correlatorHfeHadrons.cxx | 26 +++---------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index a264151a4b4..0a824c1e9b5 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -109,9 +109,6 @@ struct HfCorrelatorHfeHadrons { registry.add("hMCgenNonHfEHCorrel", "Sparse for Delta phi and Delta eta for McGen Non Hf Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hMCgenInclusiveEHCorrl", "Sparse for Delta phi and Delta eta for McGen Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hptElectron", "hptElectron", {HistType::kTH1D, {axisPt}}); - registry.add("hptHadron", "hptHadron", {HistType::kTH1D, {axisPt}}); - registry.add("hMCgenptHadron", "hMCgenptHadron", {HistType::kTH1D, {axisPt}}); - registry.add("hMCgenptHadronprimary", "hMCgenptHadronprimary", {HistType::kTH1D, {axisPt}}); registry.add("hMixEventInclusiveEHCorrl", "Sparse for mix event Delta phi and Delta eta Inclusive Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hMixEventLSEHCorrel", "Sparse for mix event Delta phi and Delta eta Like sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); @@ -161,7 +158,6 @@ struct HfCorrelatorHfeHadrons { continue; } registry.fill(HIST("hTracksBin"), poolBin); - registry.fill(HIST("hptHadron"), hTrack.pt()); entryHadron(hTrack.phi(), hTrack.eta(), hTrack.pt(), poolBin, gCollisionId, timeStamp); } @@ -317,7 +313,7 @@ struct HfCorrelatorHfeHadrons { fillCorrelation(collision, electron, tracks, bc); } - PROCESS_SWITCH(HfCorrelatorHfeHadrons, processData, "Process for Data", false); + PROCESS_SWITCH(HfCorrelatorHfeHadrons, processData, "Process for Data", true); // ======= Process starts for McRec, Same event ============ @@ -336,25 +332,9 @@ struct HfCorrelatorHfeHadrons { BinningTypeMcGen corrBinningMcGen{{zBins, multBinsMcGen}, true}; int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), mcCollision.multMCFT0A())); - for (const auto& particleMc : mcParticles) { - if (particleMc.eta() < etaTrackMin || particleMc.eta() > etaTrackMax) { - continue; - } - if (particleMc.pt() < ptTrackMin) { - continue; - } - - registry.fill(HIST("hMCgenptHadron"), particleMc.pt()); - if (particleMc.isPhysicalPrimary()) { - - registry.fill(HIST("hMCgenptHadronprimary"), particleMc.pt()); - } - } - double ptElectron = 0; double phiElectron = 0; double etaElectron = 0; - for (const auto& electronMc : electron) { double ptHadron = 0; double phiHadron = 0; @@ -402,7 +382,7 @@ struct HfCorrelatorHfeHadrons { } } } - PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcGen, "Process MC Gen mode", true); + PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcGen, "Process MC Gen mode", false); // ====================== Implement Event mixing on Data =============================== // ====================== Implement Event mixing on Data =================================== @@ -485,7 +465,7 @@ struct HfCorrelatorHfeHadrons { } } } - PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcGenMixedEvent, "Process Mixed Event MC Gen mode", true); + PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcGenMixedEvent, "Process Mixed Event MC Gen mode", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From a1ce8eed59d24fb00cbc2cc8781724fb24fa6e5e Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Thu, 11 Sep 2025 17:30:08 +0530 Subject: [PATCH 13/52] Update electronSelectionWithTpcEmcal.cxx --- .../electronSelectionWithTpcEmcal.cxx | 29 +++++++------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index d54bfcdeb8f..7dac8c0a83d 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -550,9 +550,12 @@ struct HfElectronSelectionWithTpcEmcal { void processMcGen(McGenTableCollision const& mcCollision, aod::McParticles const& mcParticles) { + ///// electron identification bool isNonHfe = false; for (const auto& particleMc : mcParticles) { + if (!particleMc.isPhysicalPrimary()) + continue; if (!mcGensel(particleMc)) { continue; } @@ -577,41 +580,30 @@ struct HfElectronSelectionWithTpcEmcal { //================= eta->e ====================================== if (std::abs(mother.pdgCode()) == kEta) { - if (mother.isPhysicalPrimary()) { - isEmbEta = true; - } + isEmbEta = true; } //================= eta->pi0->e ====================================== if (std::abs(mother.pdgCode()) == kPi0) { - if (mother.isPhysicalPrimary()) { - isEmbPi0 = true; // pi0 -> e - } + isEmbPi0 = true; // pi0 -> e if (std::abs(gmother.pdgCode()) == kEta) { - if (gmother.isPhysicalPrimary()) { - isEmbEta = true; // eta->pi0-> e - } + isEmbEta = true; // eta->pi0-> e } } /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ if (std::abs(mother.pdgCode()) == kGamma) { if (std::abs(gmother.pdgCode()) == kEta) { - if (gmother.isPhysicalPrimary()) { - isEmbEta = true; // eta->gamma-> e - } + isEmbEta = true; // eta->gamma-> e } if (std::abs(gmother.pdgCode()) == kPi0) { - if (gmother.isPhysicalPrimary()) { - isEmbPi0 = true; // pi0-> gamma-> e - } + isEmbPi0 = true; // pi0-> gamma-> e if (std::abs(ggmother.pdgCode()) == kEta) { - if (ggmother.isPhysicalPrimary()) { - isEmbEta = true; // eta->pi0->gamma-> e - } + + isEmbEta = true; // eta->pi0->gamma-> e } } } @@ -637,6 +629,7 @@ struct HfElectronSelectionWithTpcEmcal { PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processMcGen, "Process MC Gen mode", false); }; + WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; From 5bc5cd5aa0bc752bba7f0221a289204a7e37fd2f Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Fri, 12 Sep 2025 13:49:33 +0530 Subject: [PATCH 14/52] Update electronSelectionWithTpcEmcal.cxx --- .../electronSelectionWithTpcEmcal.cxx | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index 7dac8c0a83d..8444b0190dc 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -535,7 +535,7 @@ struct HfElectronSelectionWithTpcEmcal { { fillElectronTrack(collision, tracks, emcClusters, matchedTracks, 0); } - PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processData, "process Data info only", true); + PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processData, "process Data info only", false); /// Electron selection - for MC reco-level analysis void processMcRec(McTableCollision const& mcCollision, McTableTracks const& mcTracks, @@ -550,12 +550,9 @@ struct HfElectronSelectionWithTpcEmcal { void processMcGen(McGenTableCollision const& mcCollision, aod::McParticles const& mcParticles) { - ///// electron identification bool isNonHfe = false; for (const auto& particleMc : mcParticles) { - if (!particleMc.isPhysicalPrimary()) - continue; if (!mcGensel(particleMc)) { continue; } @@ -580,30 +577,41 @@ struct HfElectronSelectionWithTpcEmcal { //================= eta->e ====================================== if (std::abs(mother.pdgCode()) == kEta) { - isEmbEta = true; + if (mother.isPhysicalPrimary()) { + isEmbEta = true; + } } //================= eta->pi0->e ====================================== if (std::abs(mother.pdgCode()) == kPi0) { - isEmbPi0 = true; // pi0 -> e + if (mother.isPhysicalPrimary()) { + isEmbPi0 = true; // pi0 -> e + } if (std::abs(gmother.pdgCode()) == kEta) { - isEmbEta = true; // eta->pi0-> e + if (gmother.isPhysicalPrimary()) { + isEmbEta = true; // eta->pi0-> e + } } } /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ if (std::abs(mother.pdgCode()) == kGamma) { if (std::abs(gmother.pdgCode()) == kEta) { - isEmbEta = true; // eta->gamma-> e + if (gmother.isPhysicalPrimary()) { + isEmbEta = true; // eta->gamma-> e + } } if (std::abs(gmother.pdgCode()) == kPi0) { - isEmbPi0 = true; // pi0-> gamma-> e + if (gmother.isPhysicalPrimary()) { + isEmbPi0 = true; // pi0-> gamma-> e + } if (std::abs(ggmother.pdgCode()) == kEta) { - - isEmbEta = true; // eta->pi0->gamma-> e + if (ggmother.isPhysicalPrimary()) { + isEmbEta = true; // eta->pi0->gamma-> e + } } } } @@ -627,9 +635,8 @@ struct HfElectronSelectionWithTpcEmcal { } } - PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processMcGen, "Process MC Gen mode", false); + PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processMcGen, "Process MC Gen mode", true); }; - WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; From ca7b9fac44f95a8033cd6076602d8157e8e5a177 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Fri, 12 Sep 2025 13:50:12 +0530 Subject: [PATCH 15/52] Update correlatorHfeHadrons.cxx From bbd31023b4919a6564552562984453b202e1e187 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Fri, 12 Sep 2025 16:37:56 +0530 Subject: [PATCH 16/52] add Mc gen for non hf From c1c1c417056c4511cbe7826939a5577b6351179a Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Fri, 12 Sep 2025 18:05:01 +0530 Subject: [PATCH 17/52] Update correlatorHfeHadrons.cxx From 37b3c19f4aa29cf6a53bb15bf87ac185d276bca8 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Mon, 15 Sep 2025 09:58:41 +0530 Subject: [PATCH 18/52] add Mc gen for non hf --- .../electronSelectionWithTpcEmcal.cxx | 128 ++++++++++-------- 1 file changed, 74 insertions(+), 54 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index 8444b0190dc..9efa205e062 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -562,74 +562,94 @@ struct HfElectronSelectionWithTpcEmcal { bool isEmbEta = false; bool isEmbPi0 = false; - if (particleMc.has_mothers()) { - // Check first mother - auto const& mother = particleMc.mothers_first_as(); - - if (std::abs(mother.pdgCode()) == kEta || std::abs(mother.pdgCode()) == kPi0 || std::abs(mother.pdgCode()) == kGamma) { - registry.fill(HIST("hMcgenAllNonHfeElectron"), particleMc.pt()); - if (mother.has_mothers()) { - auto const& gmother = mother.mothers_first_as(); - if (gmother.has_mothers()) { - auto const& ggmother = gmother.mothers_first_as(); - - // cases to consider: eta->e, eta->pi0->e, eta->gamma->e, eta->pi0->gamma->e, pi0->e, pi0->gamma->e - - //================= eta->e ====================================== - if (std::abs(mother.pdgCode()) == kEta) { - if (mother.isPhysicalPrimary()) { - isEmbEta = true; - } - } - //================= eta->pi0->e ====================================== + // Check first mother + auto const& mother = particleMc.mothers_first_as(); + + if (std::abs(mother.pdgCode()) == kEta || std::abs(mother.pdgCode()) == kPi0 || std::abs(mother.pdgCode()) == kGamma) { + registry.fill(HIST("hMcgenAllNonHfeElectron"), particleMc.pt()); + auto const& gmother = mother.mothers_first_as(); + auto const& ggmother = gmother.mothers_first_as(); + auto const& gggmother = ggmother.mothers_first_as(); + + // cases to consider: eta->e, eta->pi0->e, eta->gamma->e, eta->pi0->gamma->e, pi0->e, pi0->gamma->e + + //================= eta->e ====================================== + if (std::abs(mother.pdgCode()) == kEta) { + if (mother.isPhysicalPrimary()) { + if ((std::abs(gmother.pdgCode()) >= 400 && std::abs(gmother.pdgCode()) < 600) || + (std::abs(gmother.pdgCode()) >= 4000 && std::abs(gmother.pdgCode()) < 6000)) { + continue; + } + isEmbEta = true; + } + } + //================= eta->pi0->e ====================================== - if (std::abs(mother.pdgCode()) == kPi0) { - if (mother.isPhysicalPrimary()) { - isEmbPi0 = true; // pi0 -> e - } + if (std::abs(mother.pdgCode()) == kPi0) { + if (mother.isPhysicalPrimary()) { + if ((std::abs(gmother.pdgCode()) >= 400 && std::abs(gmother.pdgCode()) < 600) || + (std::abs(gmother.pdgCode()) >= 4000 && std::abs(gmother.pdgCode()) < 6000)) { + continue; + } + isEmbPi0 = true; // pi0 -> e + } - if (std::abs(gmother.pdgCode()) == kEta) { - if (gmother.isPhysicalPrimary()) { - isEmbEta = true; // eta->pi0-> e - } - } + if (std::abs(gmother.pdgCode()) == kEta) { + if (gmother.isPhysicalPrimary()) { + if ((std::abs(ggmother.pdgCode()) >= 400 && std::abs(ggmother.pdgCode()) < 600) || + (std::abs(ggmother.pdgCode()) >= 4000 && std::abs(ggmother.pdgCode()) < 6000)) { + continue; } + isEmbEta = true; // eta->pi0-> e + } + } + } - /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ - if (std::abs(mother.pdgCode()) == kGamma) { - if (std::abs(gmother.pdgCode()) == kEta) { - if (gmother.isPhysicalPrimary()) { - isEmbEta = true; // eta->gamma-> e - } - } + /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ + if (std::abs(mother.pdgCode()) == kGamma) { + if (std::abs(gmother.pdgCode()) == kEta) { + if (gmother.isPhysicalPrimary()) { + if ((std::abs(ggmother.pdgCode()) >= 400 && std::abs(ggmother.pdgCode()) < 600) || + (std::abs(ggmother.pdgCode()) >= 4000 && std::abs(ggmother.pdgCode()) < 6000)) { + continue; + } + isEmbEta = true; // eta->gamma-> e + } + } - if (std::abs(gmother.pdgCode()) == kPi0) { - if (gmother.isPhysicalPrimary()) { - isEmbPi0 = true; // pi0-> gamma-> e - } + if (std::abs(gmother.pdgCode()) == kPi0) { + if (gmother.isPhysicalPrimary()) { + if ((std::abs(ggmother.pdgCode()) >= 400 && std::abs(ggmother.pdgCode()) < 600) || + (std::abs(ggmother.pdgCode()) >= 4000 && std::abs(ggmother.pdgCode()) < 6000)) { + continue; + } + isEmbPi0 = true; // pi0-> gamma-> e + } - if (std::abs(ggmother.pdgCode()) == kEta) { - if (ggmother.isPhysicalPrimary()) { - isEmbEta = true; // eta->pi0->gamma-> e - } - } + if (std::abs(ggmother.pdgCode()) == kEta) { + if (ggmother.isPhysicalPrimary()) { + if ((std::abs(gggmother.pdgCode()) >= 400 && std::abs(gggmother.pdgCode()) < 600) || + (std::abs(gggmother.pdgCode()) >= 4000 && std::abs(gggmother.pdgCode()) < 6000)) { + continue; } + isEmbEta = true; // eta->pi0->gamma-> e } } } } - } - if (isEmbPi0 || isEmbEta) { - registry.fill(HIST("hMcgenNonHfeElectron"), particleMc.pt()); - isNonHfe = true; - if (isEmbPi0) { + if (isEmbPi0 || isEmbEta) { + registry.fill(HIST("hMcgenNonHfeElectron"), particleMc.pt()); + isNonHfe = true; + if (isEmbPi0) { - registry.fill(HIST("hPi0eEmbTrkPt"), particleMc.pt()); - } - if (isEmbEta) { - registry.fill(HIST("hEtaeEmbTrkPt"), particleMc.pt()); + registry.fill(HIST("hPi0eEmbTrkPt"), particleMc.pt()); + } + if (isEmbEta) { + registry.fill(HIST("hEtaeEmbTrkPt"), particleMc.pt()); + } } } + hfGenElectronSel(mcCollision.globalIndex(), particleMc.globalIndex(), particleMc.eta(), particleMc.phi(), particleMc.pt(), isNonHfe); } } From b513806786a5515fa6efebec3959e27496507cc4 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Mon, 15 Sep 2025 10:10:01 +0530 Subject: [PATCH 19/52] Add mc gen for hadron --- .../TableProducer/correlatorHfeHadrons.cxx | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index 0a824c1e9b5..b445436f6f4 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -48,7 +48,7 @@ using namespace o2::aod::hf_sel_electron; std::vector zBins{VARIABLE_WIDTH, -10.0, -2.5, 2.5, 10.0}; std::vector multBins{VARIABLE_WIDTH, 0., 200., 500.0, 5000.}; std::vector multBinsMcGen{VARIABLE_WIDTH, 0., 20., 50.0, 500.}; // In MCGen multiplicity is defined by counting primaries -using BinningType = ColumnBinningPolicy>; +using BinningType = ColumnBinningPolicy>; BinningType corrBinning{{zBins, multBins}, true}; using BinningTypeMcGen = ColumnBinningPolicy; @@ -109,6 +109,9 @@ struct HfCorrelatorHfeHadrons { registry.add("hMCgenNonHfEHCorrel", "Sparse for Delta phi and Delta eta for McGen Non Hf Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hMCgenInclusiveEHCorrl", "Sparse for Delta phi and Delta eta for McGen Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hptElectron", "hptElectron", {HistType::kTH1D, {axisPt}}); + registry.add("hptHadron", "hptHadron", {HistType::kTH1D, {axisPt}}); + registry.add("hMCgenptHadron", "hMCgenptHadron", {HistType::kTH1D, {axisPt}}); + registry.add("hMCgenptHadronprimary", "hMCgenptHadronprimary", {HistType::kTH1D, {axisPt}}); registry.add("hMixEventInclusiveEHCorrl", "Sparse for mix event Delta phi and Delta eta Inclusive Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hMixEventLSEHCorrel", "Sparse for mix event Delta phi and Delta eta Like sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); @@ -147,7 +150,7 @@ struct HfCorrelatorHfeHadrons { { if (!(isRun3 ? collision.sel8() : (collision.sel7() && collision.alias_bit(kINT7)))) return; - int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFV0M())); + int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); auto bc = collision.template bc_as(); int gCollisionId = collision.globalIndex(); int64_t timeStamp = bc.timestamp(); @@ -158,6 +161,7 @@ struct HfCorrelatorHfeHadrons { continue; } registry.fill(HIST("hTracksBin"), poolBin); + registry.fill(HIST("hptHadron"), hTrack.pt()); entryHadron(hTrack.phi(), hTrack.eta(), hTrack.pt(), poolBin, gCollisionId, timeStamp); } @@ -260,7 +264,7 @@ struct HfCorrelatorHfeHadrons { double ptHadronMix = -999; double etaHadronMix = -999; double phiHadronMix = -999; - int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFV0M())); + int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M())); for (const auto& [t1, t2] : combinations(CombinationsFullIndexPolicy(tracks1, tracks2))) { if (!t1.isEmcal()) { continue; @@ -313,7 +317,7 @@ struct HfCorrelatorHfeHadrons { fillCorrelation(collision, electron, tracks, bc); } - PROCESS_SWITCH(HfCorrelatorHfeHadrons, processData, "Process for Data", true); + PROCESS_SWITCH(HfCorrelatorHfeHadrons, processData, "Process for Data", false); // ======= Process starts for McRec, Same event ============ @@ -332,9 +336,25 @@ struct HfCorrelatorHfeHadrons { BinningTypeMcGen corrBinningMcGen{{zBins, multBinsMcGen}, true}; int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), mcCollision.multMCFT0A())); + for (const auto& particleMc : mcParticles) { + if (particleMc.eta() < etaTrackMin || particleMc.eta() > etaTrackMax) { + continue; + } + if (particleMc.pt() < ptTrackMin) { + continue; + } + + registry.fill(HIST("hMCgenptHadron"), particleMc.pt()); + if (particleMc.isPhysicalPrimary()) { + + registry.fill(HIST("hMCgenptHadronprimary"), particleMc.pt()); + } + } + double ptElectron = 0; double phiElectron = 0; double etaElectron = 0; + for (const auto& electronMc : electron) { double ptHadron = 0; double phiHadron = 0; @@ -382,7 +402,7 @@ struct HfCorrelatorHfeHadrons { } } } - PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcGen, "Process MC Gen mode", false); + PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcGen, "Process MC Gen mode", true); // ====================== Implement Event mixing on Data =============================== // ====================== Implement Event mixing on Data =================================== @@ -465,7 +485,7 @@ struct HfCorrelatorHfeHadrons { } } } - PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcGenMixedEvent, "Process Mixed Event MC Gen mode", false); + PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcGenMixedEvent, "Process Mixed Event MC Gen mode", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From 50247599d4663abbc8fa98eaf7caa1189c9c63d0 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Mon, 15 Sep 2025 11:16:38 +0530 Subject: [PATCH 20/52] Update electronSelectionWithTpcEmcal.cxx --- .../electronSelectionWithTpcEmcal.cxx | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index 9efa205e062..179de729c23 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -118,6 +118,10 @@ struct HfElectronSelectionWithTpcEmcal { Configurable m20EmcClusterElectronMin{"m20EmcClusterElectronMin", 0.0f, "min Electron EMCal Cluster M20"}; Configurable tpcNsigmaElectronMin{"tpcNsigmaElectronMin", -0.5f, "min Electron TPCnsigma"}; Configurable tpcNsigmaElectronMax{"tpcNsigmaElectronMax", 3.0f, "max Electron TPCnsigma"}; + Configurable charmMinID{"charmMinID", 400.0, "Min Charm Hadron ID"}; + Configurable charmMaxID{"charmMaxID", 600.0, "Max Charm Hadron ID"}; + Configurable beautyMinID{"beautyMinID", 4000.0, "Min beauty Hadron ID"}; + Configurable beautyMaxID{"beautyMaxID", 6000.0, "Max beauty Hadron ID"}; using TableCollisions = o2::soa::Filtered>; using TableCollision = TableCollisions::iterator; @@ -576,8 +580,8 @@ struct HfElectronSelectionWithTpcEmcal { //================= eta->e ====================================== if (std::abs(mother.pdgCode()) == kEta) { if (mother.isPhysicalPrimary()) { - if ((std::abs(gmother.pdgCode()) >= 400 && std::abs(gmother.pdgCode()) < 600) || - (std::abs(gmother.pdgCode()) >= 4000 && std::abs(gmother.pdgCode()) < 6000)) { + if ((std::abs(gmother.pdgCode()) >= charmMinID && std::abs(gmother.pdgCode()) < charmMaxID) || + (std::abs(gmother.pdgCode()) >= beautyMinID && std::abs(gmother.pdgCode()) < beautyMaxID)) { continue; } isEmbEta = true; @@ -587,8 +591,8 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(mother.pdgCode()) == kPi0) { if (mother.isPhysicalPrimary()) { - if ((std::abs(gmother.pdgCode()) >= 400 && std::abs(gmother.pdgCode()) < 600) || - (std::abs(gmother.pdgCode()) >= 4000 && std::abs(gmother.pdgCode()) < 6000)) { + if ((std::abs(gmother.pdgCode()) >= charmMinID && std::abs(gmother.pdgCode()) < charmMaxID) || + (std::abs(gmother.pdgCode()) >= beautyMinID && std::abs(gmother.pdgCode()) < beautyMaxID)) { continue; } isEmbPi0 = true; // pi0 -> e @@ -596,8 +600,8 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(gmother.pdgCode()) == kEta) { if (gmother.isPhysicalPrimary()) { - if ((std::abs(ggmother.pdgCode()) >= 400 && std::abs(ggmother.pdgCode()) < 600) || - (std::abs(ggmother.pdgCode()) >= 4000 && std::abs(ggmother.pdgCode()) < 6000)) { + if ((std::abs(ggmother.pdgCode()) >= charmMinID && std::abs(ggmother.pdgCode()) < charmMaxID) || + (std::abs(ggmother.pdgCode()) >= beautyMinID && std::abs(ggmother.pdgCode()) < beautyMaxID)) { continue; } isEmbEta = true; // eta->pi0-> e @@ -609,8 +613,8 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(mother.pdgCode()) == kGamma) { if (std::abs(gmother.pdgCode()) == kEta) { if (gmother.isPhysicalPrimary()) { - if ((std::abs(ggmother.pdgCode()) >= 400 && std::abs(ggmother.pdgCode()) < 600) || - (std::abs(ggmother.pdgCode()) >= 4000 && std::abs(ggmother.pdgCode()) < 6000)) { + if ((std::abs(ggmother.pdgCode()) >= charmMinID && std::abs(ggmother.pdgCode()) < charmMaxID) || + (std::abs(ggmother.pdgCode()) >= beautyMinID && std::abs(ggmother.pdgCode()) < beautyMaxID)) { continue; } isEmbEta = true; // eta->gamma-> e @@ -619,8 +623,8 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(gmother.pdgCode()) == kPi0) { if (gmother.isPhysicalPrimary()) { - if ((std::abs(ggmother.pdgCode()) >= 400 && std::abs(ggmother.pdgCode()) < 600) || - (std::abs(ggmother.pdgCode()) >= 4000 && std::abs(ggmother.pdgCode()) < 6000)) { + if ((std::abs(ggmother.pdgCode()) >= charmMinID && std::abs(ggmother.pdgCode()) < charmMaxID) || + (std::abs(ggmother.pdgCode()) >= beautyMinID && std::abs(ggmother.pdgCode()) < beautyMaxID)) { continue; } isEmbPi0 = true; // pi0-> gamma-> e @@ -628,8 +632,8 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(ggmother.pdgCode()) == kEta) { if (ggmother.isPhysicalPrimary()) { - if ((std::abs(gggmother.pdgCode()) >= 400 && std::abs(gggmother.pdgCode()) < 600) || - (std::abs(gggmother.pdgCode()) >= 4000 && std::abs(gggmother.pdgCode()) < 6000)) { + if ((std::abs(gggmother.pdgCode()) >= charmMinID && std::abs(gggmother.pdgCode()) < charmMaxID) || + (std::abs(gggmother.pdgCode()) >= beautyMinID && std::abs(gggmother.pdgCode()) < beautyMaxID)) { continue; } isEmbEta = true; // eta->pi0->gamma-> e From b9593e92ffa98807d763c58c08605ecdf5075b03 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Mon, 15 Sep 2025 17:18:53 +0530 Subject: [PATCH 21/52] Add Tof information Correlation without Emcal Added TOF information to the correlation without requiring EMCAL. In addition, a downscale factor has been implemented in order to reduce memory usage during the analysis. --- .../TableProducer/correlatorHfeHadrons.cxx | 81 +++++++++++++++---- 1 file changed, 66 insertions(+), 15 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index b445436f6f4..4e1cb50760d 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -36,6 +36,8 @@ #include #include +#include + #include #include @@ -45,6 +47,7 @@ using namespace o2::framework::expressions; using namespace o2::soa; using namespace o2::aod::hf_sel_electron; +TRandom3* rnd = new TRandom3(0); std::vector zBins{VARIABLE_WIDTH, -10.0, -2.5, 2.5, 10.0}; std::vector multBins{VARIABLE_WIDTH, 0., 200., 500.0, 5000.}; std::vector multBinsMcGen{VARIABLE_WIDTH, 0., 20., 50.0, 500.}; // In MCGen multiplicity is defined by counting primaries @@ -69,10 +72,18 @@ struct HfCorrelatorHfeHadrons { Configurable etaTrackMin{"etaTrackMin", -0.8f, "Eta range for associated hadron tracks"}; Configurable dcaXYTrackMax{"dcaXYTrackMax", 0.5f, "DCA XY cut"}; Configurable dcaZTrackMax{"dcaZTrackMax", 1.0f, "DCA Z cut"}; + Configurable requireEmcal{"requireEmcal", true, "Require electron to be in EMCal"}; + + // Sigma cut for non-EMCal electrons + Configurable tofNSigmaEl{"tofNSigmaEl", 3.0, "Sigma cut for electrons not in EMCal"}; + Configurable tpcNsigmaElectronMin{"tpcNsigmaElectronMin", -0.5f, "min Electron TPCnsigma"}; + Configurable tpcNsigmaElectronMax{"tpcNsigmaElectronMax", 3.0f, "max Electron TPCnsigma"}; // Electron hadron correlation condition Configurable ptCondition{"ptCondition", true, "Electron pT should be greater than associate particle pT"}; + Configurable eventFractionToAnalyze{"eventFractionToAnalyze", -1, "Fraction of events to analyze (use only for ME offline on very large samples)"}; + SliceCache cache; using TableCollisions = o2::soa::Filtered>; using TableCollision = TableCollisions::iterator; @@ -87,25 +98,33 @@ struct HfCorrelatorHfeHadrons { Preslice perCol = aod::track::collisionId; Preslice perCollision = aod::hf_sel_electron::collisionId; + ConfigurableAxis binsPosZ{"binsPosZ", {100, -10., 10.}, "primary vertex z coordinate"}; ConfigurableAxis binsDeltaEta{"binsDeltaEta", {30, -1.8, 1.8}, "#it{#Delta#eta}"}; ConfigurableAxis binsDeltaPhi{"binsDeltaPhi", {32, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}, "#it{#Delta#varphi}"}; ConfigurableAxis binsPt{"binsPt", {50, 0.0, 50}, "#it{p_{T}}(GeV/#it{c})"}; ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"}; - + ConfigurableAxis binsnSigma{"binsnSigma", {30, -15., 15.}, "#it{#sigma_{TPC}}"}; HistogramRegistry registry{ "registry", {}}; void init(InitContext&) { + AxisSpec axisPosZ = {binsPosZ, "Pos Z"}; AxisSpec axisDeltaEta = {binsDeltaEta, "#Delta #eta = #eta_{Electron}- #eta_{Hadron}"}; AxisSpec axisDeltaPhi = {binsDeltaPhi, "#Delta #varphi = #varphi_{Electron}- #varphi_{Hadron}"}; AxisSpec axisPt = {binsPt, "#it{p_{T}}(GeV/#it{c})"}; AxisSpec axisPoolBin = {binsPoolBin, "PoolBin"}; + AxisSpec axisnSigma = {binsnSigma, "it{#sigma_{TPC}}"}; + registry.add("hZvertex", "z vertex", {HistType::kTH1D, {axisPosZ}}); + registry.add("hNevents", "No of events", {HistType::kTH1D, {{3, 1, 4}}}); registry.add("hInclusiveEHCorrel", "Sparse for Delta phi and Delta eta Inclusive Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hLSEHCorrel", "Sparse for Delta phi and Delta eta Like sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hULSEHCorrel", "Sparse for Delta phi and Delta eta UnLike sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); + registry.add("hTofnSigmaVsP", " Tof nSigma info vs P; n#sigma;#it{p} (GeV#it{/c});passEMcal;", {HistType::kTH2F, {{axisnSigma}, {axisPt}}}); + registry.add("hTpcnSigmaVsP", " TPC nSigma info vs P; n#sigma;#it{p} (GeV#it{/c});passEMcal;", {HistType::kTH2F, {{axisnSigma}, {axisPt}}}); + registry.add("hMCgenNonHfEHCorrel", "Sparse for Delta phi and Delta eta for McGen Non Hf Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hMCgenInclusiveEHCorrl", "Sparse for Delta phi and Delta eta for McGen Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hptElectron", "hptElectron", {HistType::kTH1D, {axisPt}}); @@ -155,14 +174,25 @@ struct HfCorrelatorHfeHadrons { int gCollisionId = collision.globalIndex(); int64_t timeStamp = bc.timestamp(); + bool skipEventTableFilling = false; + if (eventFractionToAnalyze > 0) { + if (rnd->Uniform(0, 1) > eventFractionToAnalyze) { + skipEventTableFilling = true; + } + } + + registry.fill(HIST("hNevents"), 1); // Add hadron Table For Mix Event Electron Hadron correlation - for (const auto& hTrack : tracks) { - if (!selAssoHadron(hTrack)) { - continue; + if (!skipEventTableFilling) { + registry.fill(HIST("hZvertex"), collision.posZ()); + for (const auto& hTrack : tracks) { + if (!selAssoHadron(hTrack)) { + continue; + } + registry.fill(HIST("hTracksBin"), poolBin); + registry.fill(HIST("hptHadron"), hTrack.pt()); + entryHadron(hTrack.phi(), hTrack.eta(), hTrack.pt(), poolBin, gCollisionId, timeStamp); } - registry.fill(HIST("hTracksBin"), poolBin); - registry.fill(HIST("hptHadron"), hTrack.pt()); - entryHadron(hTrack.phi(), hTrack.eta(), hTrack.pt(), poolBin, gCollisionId, timeStamp); } // Construct Deta Phi between electrons and hadrons @@ -175,16 +205,35 @@ struct HfCorrelatorHfeHadrons { ptElectron = eTrack.ptTrack(); phiElectron = eTrack.phiTrack(); etaElectron = eTrack.etaTrack(); + bool acceptElectron = false; double deltaPhi = -999; double deltaEta = -999; double ptHadron = -999; double etaHadron = -999; double phiHadron = -999; - - if (!eTrack.isEmcal()) { - continue; + if (eTrack.isEmcal()) { + // EMCal electron + if (requireEmcal) { + acceptElectron = true; + } + } else { + // Non-EMCal electron + if (!requireEmcal) { + // Apply sigma cut + if (std::abs(eTrack.tofNSigmaElTrack()) < tofNSigmaEl) { + if (eTrack.tpcNSigmaElTrack() > tpcNsigmaElectronMin && eTrack.tpcNSigmaElTrack() < tpcNsigmaElectronMax) { + registry.fill(HIST("hTofnSigmaVsP"), eTrack.tofNSigmaElTrack(), eTrack.ptTrack()); + registry.fill(HIST("hTpcnSigmaVsP"), eTrack.tpcNSigmaElTrack(), eTrack.ptTrack()); + acceptElectron = true; + } + } + } } + + if (!acceptElectron) + continue; // skip electron if not passing criteria + registry.fill(HIST("hptElectron"), ptElectron); int nElectronLS = 0; int nElectronUS = 0; @@ -203,8 +252,10 @@ struct HfCorrelatorHfeHadrons { } } - registry.fill(HIST("hElectronBin"), poolBin); - entryElectron(phiElectron, etaElectron, ptElectron, nElectronLS, nElectronUS, poolBin, gCollisionId, timeStamp); + if (!skipEventTableFilling) { + registry.fill(HIST("hElectronBin"), poolBin); + entryElectron(phiElectron, etaElectron, ptElectron, nElectronLS, nElectronUS, poolBin, gCollisionId, timeStamp); + } for (const auto& hTrack : tracks) { // Apply Hadron cut @@ -317,7 +368,7 @@ struct HfCorrelatorHfeHadrons { fillCorrelation(collision, electron, tracks, bc); } - PROCESS_SWITCH(HfCorrelatorHfeHadrons, processData, "Process for Data", false); + PROCESS_SWITCH(HfCorrelatorHfeHadrons, processData, "Process for Data", true); // ======= Process starts for McRec, Same event ============ @@ -402,7 +453,7 @@ struct HfCorrelatorHfeHadrons { } } } - PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcGen, "Process MC Gen mode", true); + PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcGen, "Process MC Gen mode", false); // ====================== Implement Event mixing on Data =============================== // ====================== Implement Event mixing on Data =================================== @@ -485,7 +536,7 @@ struct HfCorrelatorHfeHadrons { } } } - PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcGenMixedEvent, "Process Mixed Event MC Gen mode", true); + PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcGenMixedEvent, "Process Mixed Event MC Gen mode", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From dbdb07ab74cea7ec350f71df8fdbe03db0f1f7c2 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Mon, 15 Sep 2025 17:22:30 +0530 Subject: [PATCH 22/52] Update electronSelectionWithTpcEmcal.cxx --- .../electronSelectionWithTpcEmcal.cxx | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index 179de729c23..919f6682b15 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -118,10 +118,10 @@ struct HfElectronSelectionWithTpcEmcal { Configurable m20EmcClusterElectronMin{"m20EmcClusterElectronMin", 0.0f, "min Electron EMCal Cluster M20"}; Configurable tpcNsigmaElectronMin{"tpcNsigmaElectronMin", -0.5f, "min Electron TPCnsigma"}; Configurable tpcNsigmaElectronMax{"tpcNsigmaElectronMax", 3.0f, "max Electron TPCnsigma"}; - Configurable charmMinID{"charmMinID", 400.0, "Min Charm Hadron ID"}; - Configurable charmMaxID{"charmMaxID", 600.0, "Max Charm Hadron ID"}; - Configurable beautyMinID{"beautyMinID", 4000.0, "Min beauty Hadron ID"}; - Configurable beautyMaxID{"beautyMaxID", 6000.0, "Max beauty Hadron ID"}; + Configurable charmMinPdgCode{"charmMinPdgCode", 400.0, "Min Charm Hadron PdgCode"}; + Configurable charmMaxPdgCode{"charmMaxPdgCode", 600.0, "Max Charm Hadron PdgCode"}; + Configurable beautyMinPdgCode{"beautyMinPdgCode", 4000.0, "Min beauty Hadron PdgCode"}; + Configurable beautyMaxPdgCode{"beautyMaxPdgCode", 6000.0, "Max beauty Hadron PdgCode"}; using TableCollisions = o2::soa::Filtered>; using TableCollision = TableCollisions::iterator; @@ -539,7 +539,7 @@ struct HfElectronSelectionWithTpcEmcal { { fillElectronTrack(collision, tracks, emcClusters, matchedTracks, 0); } - PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processData, "process Data info only", false); + PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processData, "process Data info only", true); /// Electron selection - for MC reco-level analysis void processMcRec(McTableCollision const& mcCollision, McTableTracks const& mcTracks, @@ -580,8 +580,8 @@ struct HfElectronSelectionWithTpcEmcal { //================= eta->e ====================================== if (std::abs(mother.pdgCode()) == kEta) { if (mother.isPhysicalPrimary()) { - if ((std::abs(gmother.pdgCode()) >= charmMinID && std::abs(gmother.pdgCode()) < charmMaxID) || - (std::abs(gmother.pdgCode()) >= beautyMinID && std::abs(gmother.pdgCode()) < beautyMaxID)) { + if ((std::abs(gmother.pdgCode()) >= charmMinPdgCode && std::abs(gmother.pdgCode()) < charmMaxPdgCode) || + (std::abs(gmother.pdgCode()) >= beautyMinPdgCode && std::abs(gmother.pdgCode()) < beautyMaxPdgCode)) { continue; } isEmbEta = true; @@ -591,8 +591,8 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(mother.pdgCode()) == kPi0) { if (mother.isPhysicalPrimary()) { - if ((std::abs(gmother.pdgCode()) >= charmMinID && std::abs(gmother.pdgCode()) < charmMaxID) || - (std::abs(gmother.pdgCode()) >= beautyMinID && std::abs(gmother.pdgCode()) < beautyMaxID)) { + if ((std::abs(gmother.pdgCode()) >= charmMinPdgCode && std::abs(gmother.pdgCode()) < charmMaxPdgCode) || + (std::abs(gmother.pdgCode()) >= beautyMinPdgCode && std::abs(gmother.pdgCode()) < beautyMaxPdgCode)) { continue; } isEmbPi0 = true; // pi0 -> e @@ -600,8 +600,8 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(gmother.pdgCode()) == kEta) { if (gmother.isPhysicalPrimary()) { - if ((std::abs(ggmother.pdgCode()) >= charmMinID && std::abs(ggmother.pdgCode()) < charmMaxID) || - (std::abs(ggmother.pdgCode()) >= beautyMinID && std::abs(ggmother.pdgCode()) < beautyMaxID)) { + if ((std::abs(ggmother.pdgCode()) >= charmMinPdgCode && std::abs(ggmother.pdgCode()) < charmMaxPdgCode) || + (std::abs(ggmother.pdgCode()) >= beautyMinPdgCode && std::abs(ggmother.pdgCode()) < beautyMaxPdgCode)) { continue; } isEmbEta = true; // eta->pi0-> e @@ -613,8 +613,8 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(mother.pdgCode()) == kGamma) { if (std::abs(gmother.pdgCode()) == kEta) { if (gmother.isPhysicalPrimary()) { - if ((std::abs(ggmother.pdgCode()) >= charmMinID && std::abs(ggmother.pdgCode()) < charmMaxID) || - (std::abs(ggmother.pdgCode()) >= beautyMinID && std::abs(ggmother.pdgCode()) < beautyMaxID)) { + if ((std::abs(ggmother.pdgCode()) >= charmMinPdgCode && std::abs(ggmother.pdgCode()) < charmMaxPdgCode) || + (std::abs(ggmother.pdgCode()) >= beautyMinPdgCode && std::abs(ggmother.pdgCode()) < beautyMaxPdgCode)) { continue; } isEmbEta = true; // eta->gamma-> e @@ -623,8 +623,8 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(gmother.pdgCode()) == kPi0) { if (gmother.isPhysicalPrimary()) { - if ((std::abs(ggmother.pdgCode()) >= charmMinID && std::abs(ggmother.pdgCode()) < charmMaxID) || - (std::abs(ggmother.pdgCode()) >= beautyMinID && std::abs(ggmother.pdgCode()) < beautyMaxID)) { + if ((std::abs(ggmother.pdgCode()) >= charmMinPdgCode && std::abs(ggmother.pdgCode()) < charmMaxPdgCode) || + (std::abs(ggmother.pdgCode()) >= beautyMinPdgCode && std::abs(ggmother.pdgCode()) < beautyMaxPdgCode)) { continue; } isEmbPi0 = true; // pi0-> gamma-> e @@ -632,8 +632,8 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(ggmother.pdgCode()) == kEta) { if (ggmother.isPhysicalPrimary()) { - if ((std::abs(gggmother.pdgCode()) >= charmMinID && std::abs(gggmother.pdgCode()) < charmMaxID) || - (std::abs(gggmother.pdgCode()) >= beautyMinID && std::abs(gggmother.pdgCode()) < beautyMaxID)) { + if ((std::abs(gggmother.pdgCode()) >= charmMinPdgCode && std::abs(gggmother.pdgCode()) < charmMaxPdgCode) || + (std::abs(gggmother.pdgCode()) >= beautyMinPdgCode && std::abs(gggmother.pdgCode()) < beautyMaxPdgCode)) { continue; } isEmbEta = true; // eta->pi0->gamma-> e @@ -659,7 +659,7 @@ struct HfElectronSelectionWithTpcEmcal { } } - PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processMcGen, "Process MC Gen mode", true); + PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processMcGen, "Process MC Gen mode", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From 693d31429e1e166f2368cd41bdafbff1feb52a1c Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Mon, 15 Sep 2025 17:33:36 +0530 Subject: [PATCH 23/52] Update correlatorHfeHadrons.cxx --- PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index 0e551d12f45..4e1cb50760d 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -183,7 +183,6 @@ struct HfCorrelatorHfeHadrons { registry.fill(HIST("hNevents"), 1); // Add hadron Table For Mix Event Electron Hadron correlation - if (!skipEventTableFilling) { registry.fill(HIST("hZvertex"), collision.posZ()); for (const auto& hTrack : tracks) { @@ -194,14 +193,6 @@ struct HfCorrelatorHfeHadrons { registry.fill(HIST("hptHadron"), hTrack.pt()); entryHadron(hTrack.phi(), hTrack.eta(), hTrack.pt(), poolBin, gCollisionId, timeStamp); } - - for (const auto& hTrack : tracks) { - if (!selAssoHadron(hTrack)) { - continue; - } - registry.fill(HIST("hTracksBin"), poolBin); - entryHadron(hTrack.phi(), hTrack.eta(), hTrack.pt(), poolBin, gCollisionId, timeStamp); - } // Construct Deta Phi between electrons and hadrons From 9ea1b127de6ca049c1fe3e93a7f25a31f93565a2 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Mon, 15 Sep 2025 18:31:18 +0530 Subject: [PATCH 24/52] Update electronSelectionWithTpcEmcal.cxx --- .../electronSelectionWithTpcEmcal.cxx | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index 919f6682b15..7edfc393c8f 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -118,10 +118,10 @@ struct HfElectronSelectionWithTpcEmcal { Configurable m20EmcClusterElectronMin{"m20EmcClusterElectronMin", 0.0f, "min Electron EMCal Cluster M20"}; Configurable tpcNsigmaElectronMin{"tpcNsigmaElectronMin", -0.5f, "min Electron TPCnsigma"}; Configurable tpcNsigmaElectronMax{"tpcNsigmaElectronMax", 3.0f, "max Electron TPCnsigma"}; - Configurable charmMinPdgCode{"charmMinPdgCode", 400.0, "Min Charm Hadron PdgCode"}; - Configurable charmMaxPdgCode{"charmMaxPdgCode", 600.0, "Max Charm Hadron PdgCode"}; - Configurable beautyMinPdgCode{"beautyMinPdgCode", 4000.0, "Min beauty Hadron PdgCode"}; - Configurable beautyMaxPdgCode{"beautyMaxPdgCode", 6000.0, "Max beauty Hadron PdgCode"}; + Configurable pdgCodeCharmMin{"pdgCodeCharmMin", 400, "Min Charm Hadron PdgCode"}; + Configurable pdgCodeCharmMax{"pdgCodeCharmMax", 600, "Max Charm Hadron PdgCode"}; + Configurable pdgCodeBeautyMin{"pdgCodeBeautyMin", 4000, "Min beauty Hadron PdgCode"}; + Configurable pdgCodeBeautyMax{"pdgCodeBeautyMax", 6000, "Max beauty Hadron PdgCode"}; using TableCollisions = o2::soa::Filtered>; using TableCollision = TableCollisions::iterator; @@ -580,8 +580,8 @@ struct HfElectronSelectionWithTpcEmcal { //================= eta->e ====================================== if (std::abs(mother.pdgCode()) == kEta) { if (mother.isPhysicalPrimary()) { - if ((std::abs(gmother.pdgCode()) >= charmMinPdgCode && std::abs(gmother.pdgCode()) < charmMaxPdgCode) || - (std::abs(gmother.pdgCode()) >= beautyMinPdgCode && std::abs(gmother.pdgCode()) < beautyMaxPdgCode)) { + if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { continue; } isEmbEta = true; @@ -591,8 +591,8 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(mother.pdgCode()) == kPi0) { if (mother.isPhysicalPrimary()) { - if ((std::abs(gmother.pdgCode()) >= charmMinPdgCode && std::abs(gmother.pdgCode()) < charmMaxPdgCode) || - (std::abs(gmother.pdgCode()) >= beautyMinPdgCode && std::abs(gmother.pdgCode()) < beautyMaxPdgCode)) { + if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { continue; } isEmbPi0 = true; // pi0 -> e @@ -600,8 +600,8 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(gmother.pdgCode()) == kEta) { if (gmother.isPhysicalPrimary()) { - if ((std::abs(ggmother.pdgCode()) >= charmMinPdgCode && std::abs(ggmother.pdgCode()) < charmMaxPdgCode) || - (std::abs(ggmother.pdgCode()) >= beautyMinPdgCode && std::abs(ggmother.pdgCode()) < beautyMaxPdgCode)) { + if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { continue; } isEmbEta = true; // eta->pi0-> e @@ -613,8 +613,8 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(mother.pdgCode()) == kGamma) { if (std::abs(gmother.pdgCode()) == kEta) { if (gmother.isPhysicalPrimary()) { - if ((std::abs(ggmother.pdgCode()) >= charmMinPdgCode && std::abs(ggmother.pdgCode()) < charmMaxPdgCode) || - (std::abs(ggmother.pdgCode()) >= beautyMinPdgCode && std::abs(ggmother.pdgCode()) < beautyMaxPdgCode)) { + if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { continue; } isEmbEta = true; // eta->gamma-> e @@ -623,8 +623,8 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(gmother.pdgCode()) == kPi0) { if (gmother.isPhysicalPrimary()) { - if ((std::abs(ggmother.pdgCode()) >= charmMinPdgCode && std::abs(ggmother.pdgCode()) < charmMaxPdgCode) || - (std::abs(ggmother.pdgCode()) >= beautyMinPdgCode && std::abs(ggmother.pdgCode()) < beautyMaxPdgCode)) { + if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { continue; } isEmbPi0 = true; // pi0-> gamma-> e @@ -632,8 +632,8 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(ggmother.pdgCode()) == kEta) { if (ggmother.isPhysicalPrimary()) { - if ((std::abs(gggmother.pdgCode()) >= charmMinPdgCode && std::abs(gggmother.pdgCode()) < charmMaxPdgCode) || - (std::abs(gggmother.pdgCode()) >= beautyMinPdgCode && std::abs(gggmother.pdgCode()) < beautyMaxPdgCode)) { + if ((std::abs(gggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gggmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(gggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gggmother.pdgCode()) < pdgCodeBeautyMax)) { continue; } isEmbEta = true; // eta->pi0->gamma-> e From 7e8e23e52529d2f222188d0e9dcc177c047bd0ed Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Tue, 16 Sep 2025 14:39:10 +0530 Subject: [PATCH 25/52] TRandom3: stack object instead of global --- PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index 4e1cb50760d..f546cb78bf8 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -47,7 +47,6 @@ using namespace o2::framework::expressions; using namespace o2::soa; using namespace o2::aod::hf_sel_electron; -TRandom3* rnd = new TRandom3(0); std::vector zBins{VARIABLE_WIDTH, -10.0, -2.5, 2.5, 10.0}; std::vector multBins{VARIABLE_WIDTH, 0., 200., 500.0, 5000.}; std::vector multBinsMcGen{VARIABLE_WIDTH, 0., 20., 50.0, 500.}; // In MCGen multiplicity is defined by counting primaries @@ -84,6 +83,8 @@ struct HfCorrelatorHfeHadrons { Configurable eventFractionToAnalyze{"eventFractionToAnalyze", -1, "Fraction of events to analyze (use only for ME offline on very large samples)"}; + TRandom3 rnd{0}; + SliceCache cache; using TableCollisions = o2::soa::Filtered>; using TableCollision = TableCollisions::iterator; @@ -176,7 +177,7 @@ struct HfCorrelatorHfeHadrons { bool skipEventTableFilling = false; if (eventFractionToAnalyze > 0) { - if (rnd->Uniform(0, 1) > eventFractionToAnalyze) { + if (rnd.Uniform(0, 1) > eventFractionToAnalyze) { skipEventTableFilling = true; } } From 3749947dd2116d3e21f2a6d725f5932055f0dc9d Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Tue, 16 Sep 2025 15:46:15 +0530 Subject: [PATCH 26/52] Rename binsnSigma to binsNSigma to follow camelCase convention --- PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index f546cb78bf8..5d3e61ea80b 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -104,7 +104,8 @@ struct HfCorrelatorHfeHadrons { ConfigurableAxis binsDeltaPhi{"binsDeltaPhi", {32, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}, "#it{#Delta#varphi}"}; ConfigurableAxis binsPt{"binsPt", {50, 0.0, 50}, "#it{p_{T}}(GeV/#it{c})"}; ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"}; - ConfigurableAxis binsnSigma{"binsnSigma", {30, -15., 15.}, "#it{#sigma_{TPC}}"}; + ConfigurableAxis binsNSigma{"binsNSigma", {30, -15., 15.}, "#it{#sigma_{TPC}}"}; + HistogramRegistry registry{ "registry", {}}; @@ -116,15 +117,15 @@ struct HfCorrelatorHfeHadrons { AxisSpec axisDeltaPhi = {binsDeltaPhi, "#Delta #varphi = #varphi_{Electron}- #varphi_{Hadron}"}; AxisSpec axisPt = {binsPt, "#it{p_{T}}(GeV/#it{c})"}; AxisSpec axisPoolBin = {binsPoolBin, "PoolBin"}; - AxisSpec axisnSigma = {binsnSigma, "it{#sigma_{TPC}}"}; + AxisSpec axisNSigma = {binsNSigma, "it{#sigma_{TPC}}"}; registry.add("hZvertex", "z vertex", {HistType::kTH1D, {axisPosZ}}); registry.add("hNevents", "No of events", {HistType::kTH1D, {{3, 1, 4}}}); registry.add("hInclusiveEHCorrel", "Sparse for Delta phi and Delta eta Inclusive Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hLSEHCorrel", "Sparse for Delta phi and Delta eta Like sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hULSEHCorrel", "Sparse for Delta phi and Delta eta UnLike sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); - registry.add("hTofnSigmaVsP", " Tof nSigma info vs P; n#sigma;#it{p} (GeV#it{/c});passEMcal;", {HistType::kTH2F, {{axisnSigma}, {axisPt}}}); - registry.add("hTpcnSigmaVsP", " TPC nSigma info vs P; n#sigma;#it{p} (GeV#it{/c});passEMcal;", {HistType::kTH2F, {{axisnSigma}, {axisPt}}}); + registry.add("hTofnSigmaVsP", " Tof nSigma info vs P; n#sigma;#it{p} (GeV#it{/c});passEMcal;", {HistType::kTH2F, {{axisNSigma}, {axisPt}}}); + registry.add("hTpcnSigmaVsP", " TPC nSigma info vs P; n#sigma;#it{p} (GeV#it{/c});passEMcal;", {HistType::kTH2F, {{axisNSigma}, {axisPt}}}); registry.add("hMCgenNonHfEHCorrel", "Sparse for Delta phi and Delta eta for McGen Non Hf Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hMCgenInclusiveEHCorrl", "Sparse for Delta phi and Delta eta for McGen Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); From 7e4da8ef73d825f8758274fee33c6fe2077cb033 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Thu, 18 Sep 2025 09:01:25 +0530 Subject: [PATCH 27/52] remove build error From 3a0e9f1c0176624d4904dbe1421df60d48c2aeb4 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Thu, 18 Sep 2025 21:24:53 +0530 Subject: [PATCH 28/52] use brace and reduce if condition --- .../TableProducer/correlatorHfeHadrons.cxx | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index 5d3e61ea80b..8b3b8186e8a 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -214,27 +214,23 @@ struct HfCorrelatorHfeHadrons { double ptHadron = -999; double etaHadron = -999; double phiHadron = -999; - if (eTrack.isEmcal()) { - // EMCal electron - if (requireEmcal) { + // EMCal electron + if (eTrack.isEmcal() && requireEmcal) { + acceptElectron = true; + } else if (!eTrack.isEmcal() && !requireEmcal) { + + // Apply sigma cut + if (std::abs(eTrack.tofNSigmaElTrack()) < tofNSigmaEl && eTrack.tpcNSigmaElTrack() > tpcNsigmaElectronMin && + eTrack.tpcNSigmaElTrack() < tpcNsigmaElectronMax) { + registry.fill(HIST("hTofnSigmaVsP"), eTrack.tofNSigmaElTrack(), eTrack.ptTrack()); + registry.fill(HIST("hTpcnSigmaVsP"), eTrack.tpcNSigmaElTrack(), eTrack.ptTrack()); acceptElectron = true; } - } else { - // Non-EMCal electron - if (!requireEmcal) { - // Apply sigma cut - if (std::abs(eTrack.tofNSigmaElTrack()) < tofNSigmaEl) { - if (eTrack.tpcNSigmaElTrack() > tpcNsigmaElectronMin && eTrack.tpcNSigmaElTrack() < tpcNsigmaElectronMax) { - registry.fill(HIST("hTofnSigmaVsP"), eTrack.tofNSigmaElTrack(), eTrack.ptTrack()); - registry.fill(HIST("hTpcnSigmaVsP"), eTrack.tpcNSigmaElTrack(), eTrack.ptTrack()); - acceptElectron = true; - } - } - } } - if (!acceptElectron) + if (!acceptElectron) { continue; // skip electron if not passing criteria + } registry.fill(HIST("hptElectron"), ptElectron); int nElectronLS = 0; From 53dde2b61aa9799323e47b5038fedc8171935cfc Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sat, 27 Sep 2025 17:06:47 +0530 Subject: [PATCH 29/52] properly define gmother in MC Gen --- .../electronSelectionWithTpcEmcal.cxx | 139 ++++++++++-------- 1 file changed, 75 insertions(+), 64 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index 7edfc393c8f..dc621e9e7f4 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -539,7 +539,7 @@ struct HfElectronSelectionWithTpcEmcal { { fillElectronTrack(collision, tracks, emcClusters, matchedTracks, 0); } - PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processData, "process Data info only", true); + PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processData, "process Data info only", false); /// Electron selection - for MC reco-level analysis void processMcRec(McTableCollision const& mcCollision, McTableTracks const& mcTracks, @@ -567,89 +567,99 @@ struct HfElectronSelectionWithTpcEmcal { bool isEmbPi0 = false; // Check first mother - auto const& mother = particleMc.mothers_first_as(); - - if (std::abs(mother.pdgCode()) == kEta || std::abs(mother.pdgCode()) == kPi0 || std::abs(mother.pdgCode()) == kGamma) { - registry.fill(HIST("hMcgenAllNonHfeElectron"), particleMc.pt()); - auto const& gmother = mother.mothers_first_as(); - auto const& ggmother = gmother.mothers_first_as(); - auto const& gggmother = ggmother.mothers_first_as(); - - // cases to consider: eta->e, eta->pi0->e, eta->gamma->e, eta->pi0->gamma->e, pi0->e, pi0->gamma->e - - //================= eta->e ====================================== - if (std::abs(mother.pdgCode()) == kEta) { - if (mother.isPhysicalPrimary()) { - if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbEta = true; - } - } - //================= eta->pi0->e ====================================== + if (particleMc.has_mothers()) { + auto const& mother = particleMc.mothers_first_as(); - if (std::abs(mother.pdgCode()) == kPi0) { - if (mother.isPhysicalPrimary()) { - if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbPi0 = true; // pi0 -> e - } + if (std::abs(mother.pdgCode()) == kEta || std::abs(mother.pdgCode()) == kPi0 || std::abs(mother.pdgCode()) == kGamma) { + + registry.fill(HIST("hMcgenAllNonHfeElectron"), particleMc.pt()); + + auto const& gmother = mother.mothers_first_as(); + // cases to consider: eta->e, eta->pi0->e, eta->gamma->e, eta->pi0->gamma->e, pi0->e, pi0->gamma->e - if (std::abs(gmother.pdgCode()) == kEta) { - if (gmother.isPhysicalPrimary()) { - if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { + //================= eta->e ====================================== + if (std::abs(mother.pdgCode()) == kEta) { + + if (mother.isPhysicalPrimary()) { + if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { continue; } - isEmbEta = true; // eta->pi0-> e + isEmbEta = true; } } - } - /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ - if (std::abs(mother.pdgCode()) == kGamma) { - if (std::abs(gmother.pdgCode()) == kEta) { - if (gmother.isPhysicalPrimary()) { - if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { + //================= eta->pi0->e ====================================== + + if (std::abs(mother.pdgCode()) == kPi0) { + if (mother.isPhysicalPrimary()) { + if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { continue; } - isEmbEta = true; // eta->gamma-> e + isEmbPi0 = true; // pi0 -> e + } + if (std::abs(gmother.pdgCode()) == kEta) { + if (gmother.isPhysicalPrimary() || gmother.has_mothers()) { + auto const& ggmother = gmother.mothers_first_as(); + if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbEta = true; // eta->pi0-> e + } } } - if (std::abs(gmother.pdgCode()) == kPi0) { - if (gmother.isPhysicalPrimary()) { - if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; + /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ + if (std::abs(mother.pdgCode()) == kGamma) { + + if (std::abs(gmother.pdgCode()) == kEta) { + if (gmother.isPhysicalPrimary() || gmother.has_mothers()) { + auto const& ggmother = gmother.mothers_first_as(); + if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbEta = true; // eta->gamma-> e } - isEmbPi0 = true; // pi0-> gamma-> e } - if (std::abs(ggmother.pdgCode()) == kEta) { - if (ggmother.isPhysicalPrimary()) { - if ((std::abs(gggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gggmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gggmother.pdgCode()) < pdgCodeBeautyMax)) { + if (std::abs(gmother.pdgCode()) == kPi0) { + if (gmother.isPhysicalPrimary() || gmother.has_mothers()) { + auto const& ggmother = gmother.mothers_first_as(); + if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { continue; } - isEmbEta = true; // eta->pi0->gamma-> e + isEmbPi0 = true; // pi0-> gamma-> e + } + if (gmother.has_mothers()) { + auto const& ggmother = gmother.mothers_first_as(); + if (std::abs(ggmother.pdgCode()) == kEta) { + if (ggmother.isPhysicalPrimary() || ggmother.has_mothers()) { + auto const& gggmother = ggmother.mothers_first_as(); + if ((std::abs(gggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gggmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(gggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gggmother.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbEta = true; // eta->pi0->gamma-> e + } + } } } } - } - if (isEmbPi0 || isEmbEta) { - registry.fill(HIST("hMcgenNonHfeElectron"), particleMc.pt()); - isNonHfe = true; - if (isEmbPi0) { - registry.fill(HIST("hPi0eEmbTrkPt"), particleMc.pt()); - } - if (isEmbEta) { - registry.fill(HIST("hEtaeEmbTrkPt"), particleMc.pt()); + if (isEmbPi0 || isEmbEta) { + registry.fill(HIST("hMcgenNonHfeElectron"), particleMc.pt()); + isNonHfe = true; + if (isEmbPi0) { + + registry.fill(HIST("hPi0eEmbTrkPt"), particleMc.pt()); + } + if (isEmbEta) { + registry.fill(HIST("hEtaeEmbTrkPt"), particleMc.pt()); + } } } } @@ -659,8 +669,9 @@ struct HfElectronSelectionWithTpcEmcal { } } - PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processMcGen, "Process MC Gen mode", false); + PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processMcGen, "Process MC Gen mode", true); }; + WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; From 152de4b714234f085e9cd0b470b51053ece2ad14 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sat, 27 Sep 2025 17:18:49 +0530 Subject: [PATCH 30/52] remove error --- PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index dc621e9e7f4..e890bbe72d7 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -539,7 +539,7 @@ struct HfElectronSelectionWithTpcEmcal { { fillElectronTrack(collision, tracks, emcClusters, matchedTracks, 0); } - PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processData, "process Data info only", false); + PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processData, "process Data info only", true); /// Electron selection - for MC reco-level analysis void processMcRec(McTableCollision const& mcCollision, McTableTracks const& mcTracks, @@ -624,7 +624,6 @@ struct HfElectronSelectionWithTpcEmcal { isEmbEta = true; // eta->gamma-> e } } - if (std::abs(gmother.pdgCode()) == kPi0) { if (gmother.isPhysicalPrimary() || gmother.has_mothers()) { auto const& ggmother = gmother.mothers_first_as(); @@ -649,7 +648,6 @@ struct HfElectronSelectionWithTpcEmcal { } } } - if (isEmbPi0 || isEmbEta) { registry.fill(HIST("hMcgenNonHfeElectron"), particleMc.pt()); isNonHfe = true; @@ -663,13 +661,11 @@ struct HfElectronSelectionWithTpcEmcal { } } } - hfGenElectronSel(mcCollision.globalIndex(), particleMc.globalIndex(), particleMc.eta(), particleMc.phi(), particleMc.pt(), isNonHfe); } } } - - PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processMcGen, "Process MC Gen mode", true); + PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processMcGen, "Process MC Gen mode", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 69b14b4ffd2c7f411ac3963339832d0536ff73b1 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sat, 27 Sep 2025 17:24:34 +0530 Subject: [PATCH 31/52] remove clang error --- .../electronSelectionWithTpcEmcal.cxx | 89 +------------------ 1 file changed, 2 insertions(+), 87 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index 96c09ee3cb1..e890bbe72d7 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -567,7 +567,6 @@ struct HfElectronSelectionWithTpcEmcal { bool isEmbPi0 = false; // Check first mother - if (particleMc.has_mothers()) { auto const& mother = particleMc.mothers_first_as(); @@ -645,82 +644,10 @@ struct HfElectronSelectionWithTpcEmcal { } isEmbEta = true; // eta->pi0->gamma-> e } - - auto const& mother = particleMc.mothers_first_as(); - - if (std::abs(mother.pdgCode()) == kEta || std::abs(mother.pdgCode()) == kPi0 || std::abs(mother.pdgCode()) == kGamma) { - registry.fill(HIST("hMcgenAllNonHfeElectron"), particleMc.pt()); - auto const& gmother = mother.mothers_first_as(); - auto const& ggmother = gmother.mothers_first_as(); - auto const& gggmother = ggmother.mothers_first_as(); - - // cases to consider: eta->e, eta->pi0->e, eta->gamma->e, eta->pi0->gamma->e, pi0->e, pi0->gamma->e - - //================= eta->e ====================================== - if (std::abs(mother.pdgCode()) == kEta) { - if (mother.isPhysicalPrimary()) { - if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbEta = true; - } - } - //================= eta->pi0->e ====================================== - - if (std::abs(mother.pdgCode()) == kPi0) { - if (mother.isPhysicalPrimary()) { - if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbPi0 = true; // pi0 -> e - } - - if (std::abs(gmother.pdgCode()) == kEta) { - if (gmother.isPhysicalPrimary()) { - if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbEta = true; // eta->pi0-> e - } - } - } - - /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ - if (std::abs(mother.pdgCode()) == kGamma) { - if (std::abs(gmother.pdgCode()) == kEta) { - if (gmother.isPhysicalPrimary()) { - if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbEta = true; // eta->gamma-> e - } - } - - if (std::abs(gmother.pdgCode()) == kPi0) { - if (gmother.isPhysicalPrimary()) { - if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbPi0 = true; // pi0-> gamma-> e - } - - if (std::abs(ggmother.pdgCode()) == kEta) { - if (ggmother.isPhysicalPrimary()) { - if ((std::abs(gggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gggmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gggmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbEta = true; // eta->pi0->gamma-> e } } } - if (isEmbPi0 || isEmbEta) { registry.fill(HIST("hMcgenNonHfeElectron"), particleMc.pt()); isNonHfe = true; @@ -731,29 +658,17 @@ struct HfElectronSelectionWithTpcEmcal { if (isEmbEta) { registry.fill(HIST("hEtaeEmbTrkPt"), particleMc.pt()); } - - } - if (isEmbPi0 || isEmbEta) { - registry.fill(HIST("hMcgenNonHfeElectron"), particleMc.pt()); - isNonHfe = true; - if (isEmbPi0) { - - registry.fill(HIST("hPi0eEmbTrkPt"), particleMc.pt()); - } - if (isEmbEta) { - registry.fill(HIST("hEtaeEmbTrkPt"), particleMc.pt()); - } } } - hfGenElectronSel(mcCollision.globalIndex(), particleMc.globalIndex(), particleMc.eta(), particleMc.phi(), particleMc.pt(), isNonHfe); } } } PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processMcGen, "Process MC Gen mode", false); }; + WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} \ No newline at end of file +} From 3353dbde80a49473a11727a5ea5aa2ac1adfada9 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 5 Oct 2025 19:22:40 +0530 Subject: [PATCH 32/52] add BCsWithTimestamps table in MC reconstruction dd BCsWithTimestamps table in MC reconstruction --- PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index 8b3b8186e8a..8bcc7e6ba57 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -372,9 +372,9 @@ struct HfCorrelatorHfeHadrons { void processMcRec(McTableCollision const& mcCollision, aod::HfCorrSelEl const& mcElectron, - McTableTracks const& mcTracks) + McTableTracks const& mcTracks, aod::BCsWithTimestamps const& bc) { - fillCorrelation(mcCollision, mcElectron, mcTracks, 0); + fillCorrelation(mcCollision, mcElectron, mcTracks, bc); } PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcRec, "Process MC Reco mode", false); From 7645784885cc5c3b64ac2fd23333cc559e2f9ee1 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 5 Oct 2025 19:50:53 +0530 Subject: [PATCH 33/52] Adjust processMcRec arguments to follow O2 guideline --- PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index 8bcc7e6ba57..9b99c06fd53 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -361,7 +361,8 @@ struct HfCorrelatorHfeHadrons { void processData(TableCollision const& collision, aod::HfCorrSelEl const& electron, - TableTracks const& tracks, aod::BCsWithTimestamps const& bc) + TableTracks const& tracks, + aod::BCsWithTimestamps const& bc) { fillCorrelation(collision, electron, tracks, bc); } @@ -372,7 +373,8 @@ struct HfCorrelatorHfeHadrons { void processMcRec(McTableCollision const& mcCollision, aod::HfCorrSelEl const& mcElectron, - McTableTracks const& mcTracks, aod::BCsWithTimestamps const& bc) + McTableTracks const& mcTracks, + aod::BCsWithTimestamps const& bc) { fillCorrelation(mcCollision, mcElectron, mcTracks, bc); } From 0b9db5c9f073ccf948493b2eed1cf1077cef99cd Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 12 Oct 2025 11:41:30 +0530 Subject: [PATCH 34/52] Add non Hfe Invariant mass on table --- .../electronSelectionWithTpcEmcal.cxx | 59 ++++++++++--------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index e890bbe72d7..2345998b640 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -53,7 +53,7 @@ using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; -const int kEta = 221; +const int kEtaLocal = 221; struct HfElectronSelectionWithTpcEmcal { @@ -71,7 +71,7 @@ struct HfElectronSelectionWithTpcEmcal { KFParticle kfNonHfe; Configurable fillEmcClusterInfo{"fillEmcClusterInfo", true, "Fill histograms with EMCal cluster info before and after track match"}; Configurable fillTrackInfo{"fillTrackInfo", true, "Fill histograms with Track Information info before track match"}; - + Configurable emcalRegion{"emcalAcceptance", 0, "Select EMCal region for filling histograms"}; // Event Selection Configurable zPvPosMax{"zPvPosMax", 10., "Maximum z of the primary vertex (cm)"}; Configurable isRun3{"isRun3", true, "Data is from Run3 or Run2"}; @@ -138,7 +138,7 @@ struct HfElectronSelectionWithTpcEmcal { PresliceUnsorted perClusterMatchedTracks = o2::aod::emcalmatchedtrack::trackId; // configurable axis - + Configurable skipNoEmcClusters{"skipNoEmcClusters", false, "Skip events with no EMCal clusters"}; ConfigurableAxis binsPosZ{"binsPosZ", {100, -10., 10.}, "primary vertex z coordinate"}; ConfigurableAxis binsEta{"binsEta", {100, -2.0, 2.}, "#it{#eta}"}; ConfigurableAxis binsPhi{"binsPhi", {32, 0.0, o2::constants::math::TwoPI}, "#it{#varphi}"}; @@ -163,7 +163,7 @@ struct HfElectronSelectionWithTpcEmcal { void init(o2::framework::InitContext&) { - AxisSpec axisPosZ = {binsPosZ, "Pos Z"}; + AxisSpec const axisPosZ = {binsPosZ, "Pos Z"}; AxisSpec axisMass = {binsMass, "Mass (GeV/#it{c}^{2}); entries"}; AxisSpec axisPt = {binsPt, "#it{p_{T}}(GeV/#it{c})"}; AxisSpec axisEta = {binsEta, "#it{#eta}"}; @@ -181,6 +181,7 @@ struct HfElectronSelectionWithTpcEmcal { AxisSpec axisDeltaPhi = {binsDeltaPhi, "#Delta #varphi = #varphi_{trk}- #varphi_{cluster}"}; registry.add("hZvertex", "z vertex", {HistType::kTH1D, {axisPosZ}}); + registry.add("hNeventsAfterPassEmcal", "No of events pass the Emcal", {HistType::kTH1D, {{3, 1, 4}}}); registry.add("hNevents", "No of events", {HistType::kTH1D, {{3, 1, 4}}}); registry.add("hLikeMass", "Like mass", {HistType::kTH1D, {{axisMass}}}); registry.add("hUnLikeMass", "unLike mass", {HistType::kTH1D, {{axisMass}}}); @@ -315,16 +316,16 @@ struct HfElectronSelectionWithTpcEmcal { pdgE2 = kPositron; } - KFPTrack kfpTrack = createKFPTrackFromTrack(electron); - KFPTrack kfpAssociatedTrack = createKFPTrackFromTrack(pTrack); - KFParticle kfTrack(kfpTrack, pdgE1); - KFParticle kfAssociatedTrack(kfpAssociatedTrack, pdgE2); + KFPTrack const kfpTrack = createKFPTrackFromTrack(electron); + KFPTrack const kfpAssociatedTrack = createKFPTrackFromTrack(pTrack); + KFParticle const kfTrack(kfpTrack, pdgE1); + KFParticle const kfAssociatedTrack(kfpAssociatedTrack, pdgE2); const KFParticle* electronPairs[2] = {&kfTrack, &kfAssociatedTrack}; kfNonHfe.SetConstructMethod(2); kfNonHfe.Construct(electronPairs, 2); - int ndf = kfNonHfe.GetNDF(); - double chi2recg = kfNonHfe.GetChi2() / ndf; + int const ndf = kfNonHfe.GetNDF(); + double const chi2recg = kfNonHfe.GetChi2() / ndf; if (ndf < 1.0) { continue; } @@ -370,23 +371,24 @@ struct HfElectronSelectionWithTpcEmcal { } } // Pass multiplicities and other required parameters for this electron - hfElectronSelection(electron.collisionId(), electron.globalIndex(), electron.eta(), electron.phi(), electron.pt(), electron.tpcNSigmaEl(), electron.tofNSigmaEl(), nElPairsLS, nElPairsUS, isEMcal); + hfElectronSelection(electron.collisionId(), electron.globalIndex(), electron.eta(), electron.phi(), electron.pt(), electron.tpcNSigmaEl(), electron.tofNSigmaEl(), invMassElectron, nElPairsLS, nElPairsUS, isEMcal); } // Electron Identification - template + template void fillElectronTrack(CollisionType const& collision, TracksType const& tracks, EmcClusterType const& emcClusters, MatchType const& matchedTracks, ParticleType const& /*particlemc*/) { - if (!(isRun3 ? collision.sel8() : (collision.sel7() && collision.alias_bit(kINT7)))) + if (!(isRun3 ? collision.sel8() : (collision.sel7() && collision.alias_bit(kINT7)))) { return; - - registry.fill(HIST("hNevents"), 1); + } + int region = emcalRegion; + registry.fill(HIST("hNevents"), region); // skip events with no clusters - if (emcClusters.size() == 0) { + if (emcClusters.size() == 0 && skipNoEmcClusters) { return; } registry.fill(HIST("hZvertex"), collision.posZ()); - + registry.fill(HIST("hNeventsAfterPassEmcal"), region); ///////////////////////////////// // EMCal cluster info before match /// /////////////////////////////// @@ -421,10 +423,12 @@ struct HfElectronSelectionWithTpcEmcal { if (!selTracks(track)) { continue; } - if ((phiTrack > phiTrackEMCalMin && phiTrack < phiTrackEMCalMax) && (etaTrack > etaTrackMin && etaTrack < etaTrackMax)) + if ((phiTrack > phiTrackEMCalMin && phiTrack < phiTrackEMCalMax) && (etaTrack > etaTrackMin && etaTrack < etaTrackMax)) { passEMCal = EMCalAcceptance; // EMcal acceptance passed - if ((phiTrack > phiTrackDCalMin && phiTrack < phiTrackDCalMax) && ((etaTrack > etaTrackDCalPositiveMin && etaTrack < etaTrackDCalPositiveMax) || (etaTrack > etaTrackDCalNegativeMin && etaTrack < etaTrackDCalNegativeMax))) + } + if ((phiTrack > phiTrackDCalMin && phiTrack < phiTrackDCalMax) && ((etaTrack > etaTrackDCalPositiveMin && etaTrack < etaTrackDCalPositiveMax) || (etaTrack > etaTrackDCalNegativeMin && etaTrack < etaTrackDCalNegativeMax))) { passEMCal = DCalAcceptance; // Dcal acceptance passed + } if (fillTrackInfo) { registry.fill(HIST("hTrackEtaPhi"), etaTrack, phiTrack, passEMCal); // track etaphi infor after filter bit @@ -449,7 +453,7 @@ struct HfElectronSelectionWithTpcEmcal { float deltaPhiMatch = -999.; float deltaEtaMatch = -999.; float eop = -999; - bool isEMcal = false; + bool const isEMcal = false; float trackRapidity = track.rapidity(MassElectron); @@ -539,7 +543,7 @@ struct HfElectronSelectionWithTpcEmcal { { fillElectronTrack(collision, tracks, emcClusters, matchedTracks, 0); } - PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processData, "process Data info only", true); + PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processData, "process Data info only", false); /// Electron selection - for MC reco-level analysis void processMcRec(McTableCollision const& mcCollision, McTableTracks const& mcTracks, @@ -549,7 +553,7 @@ struct HfElectronSelectionWithTpcEmcal { { fillElectronTrack(mcCollision, mcTracks, mcEmcClusters, matchedTracks, mcParticles); } - PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processMcRec, "Process MC Reco mode", false); + PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processMcRec, "Process MC Reco mode", true); void processMcGen(McGenTableCollision const& mcCollision, aod::McParticles const& mcParticles) { @@ -570,15 +574,14 @@ struct HfElectronSelectionWithTpcEmcal { if (particleMc.has_mothers()) { auto const& mother = particleMc.mothers_first_as(); - if (std::abs(mother.pdgCode()) == kEta || std::abs(mother.pdgCode()) == kPi0 || std::abs(mother.pdgCode()) == kGamma) { - + if (std::abs(mother.pdgCode()) == kEtaLocal || std::abs(mother.pdgCode()) == kPi0 || std::abs(mother.pdgCode()) == kGamma) { registry.fill(HIST("hMcgenAllNonHfeElectron"), particleMc.pt()); auto const& gmother = mother.mothers_first_as(); // cases to consider: eta->e, eta->pi0->e, eta->gamma->e, eta->pi0->gamma->e, pi0->e, pi0->gamma->e //================= eta->e ====================================== - if (std::abs(mother.pdgCode()) == kEta) { + if (std::abs(mother.pdgCode()) == kEtaLocal) { if (mother.isPhysicalPrimary()) { if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || @@ -599,7 +602,7 @@ struct HfElectronSelectionWithTpcEmcal { } isEmbPi0 = true; // pi0 -> e } - if (std::abs(gmother.pdgCode()) == kEta) { + if (std::abs(gmother.pdgCode()) == kEtaLocal) { if (gmother.isPhysicalPrimary() || gmother.has_mothers()) { auto const& ggmother = gmother.mothers_first_as(); if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || @@ -614,7 +617,7 @@ struct HfElectronSelectionWithTpcEmcal { /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ if (std::abs(mother.pdgCode()) == kGamma) { - if (std::abs(gmother.pdgCode()) == kEta) { + if (std::abs(gmother.pdgCode()) == kEtaLocal) { if (gmother.isPhysicalPrimary() || gmother.has_mothers()) { auto const& ggmother = gmother.mothers_first_as(); if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || @@ -635,7 +638,7 @@ struct HfElectronSelectionWithTpcEmcal { } if (gmother.has_mothers()) { auto const& ggmother = gmother.mothers_first_as(); - if (std::abs(ggmother.pdgCode()) == kEta) { + if (std::abs(ggmother.pdgCode()) == kEtaLocal) { if (ggmother.isPhysicalPrimary() || ggmother.has_mothers()) { auto const& gggmother = ggmother.mothers_first_as(); if ((std::abs(gggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gggmother.pdgCode()) < pdgCodeCharmMax) || From 67914ee81abebd5ef071bcf8c96ea3028d557ff9 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 12 Oct 2025 11:42:33 +0530 Subject: [PATCH 35/52] Add invariant mass column --- PWGHF/HFL/DataModel/ElectronSelectionTable.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGHF/HFL/DataModel/ElectronSelectionTable.h b/PWGHF/HFL/DataModel/ElectronSelectionTable.h index cae859d08f1..a53aa631a6b 100644 --- a/PWGHF/HFL/DataModel/ElectronSelectionTable.h +++ b/PWGHF/HFL/DataModel/ElectronSelectionTable.h @@ -85,6 +85,7 @@ DECLARE_SOA_COLUMN(PhiTrack, phiTrack, float); //! azimuth of th DECLARE_SOA_COLUMN(PtTrack, ptTrack, float); //! transverse momentum of the electron track DECLARE_SOA_COLUMN(TpcNSigmaElTrack, tpcNSigmaElTrack, float); //! tpcNSigma of the electron track(TPC PID) DECLARE_SOA_COLUMN(TofNSigmaElTrack, tofNSigmaElTrack, float); //! tofNSigma of the electron track(TOF PID) +DECLARE_SOA_COLUMN(InvariantMass, invariantMass, bool); //! invariant mass of the non-Hfelectron DECLARE_SOA_COLUMN(NElPairLS, nElPairLS, int); //! Number of Like sign electron pair DECLARE_SOA_COLUMN(NElPairUS, nElPairUS, int); //! Number of UnLike sign electron pair DECLARE_SOA_COLUMN(IsEmcal, isEmcal, bool); //! electron information @@ -98,6 +99,7 @@ DECLARE_SOA_TABLE(HfCorrSelEl, "AOD", "HfCORRSELEL", //! Electron Informations hf_corr_sel_electron::PtTrack, hf_corr_sel_electron::TpcNSigmaElTrack, hf_corr_sel_electron::TofNSigmaElTrack, + hf_corr_sel_electron::InvariantMass, hf_corr_sel_electron::NElPairLS, hf_corr_sel_electron::NElPairUS, hf_corr_sel_electron::IsEmcal); From 989856bcc74f1249415fc5b9785ee971b159c94f Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 12 Oct 2025 11:47:06 +0530 Subject: [PATCH 36/52] Add invariant mass condion to find the electron with TPC and TOF --- .../TableProducer/correlatorHfeHadrons.cxx | 44 ++++++++++++++----- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index 9b99c06fd53..3da997dac10 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -65,6 +65,7 @@ struct HfCorrelatorHfeHadrons { Configurable isRun3{"isRun3", true, "Data is from Run3 or Run2"}; Configurable numberEventsMixed{"numberEventsMixed", 5, "number of events mixed in ME process"}; + Configurable invariantMassEl{"invariantMassEl", 0.14f, "max Invariant Mass for Photonic electron"}; // Associated Hadron selection Configurable ptTrackMin{"ptTrackMin", 0.1f, "Transverse momentum range for associated hadron tracks"}; Configurable etaTrackMax{"etaTrackMax", 0.8f, "Eta range for associated hadron tracks"}; @@ -105,6 +106,7 @@ struct HfCorrelatorHfeHadrons { ConfigurableAxis binsPt{"binsPt", {50, 0.0, 50}, "#it{p_{T}}(GeV/#it{c})"}; ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"}; ConfigurableAxis binsNSigma{"binsNSigma", {30, -15., 15.}, "#it{#sigma_{TPC}}"}; + ConfigurableAxis binsMass{"binsMass", {100, 0.0, 2.0}, "Mass (GeV/#it{c}^{2}); entries"}; HistogramRegistry registry{ "registry", @@ -116,11 +118,17 @@ struct HfCorrelatorHfeHadrons { AxisSpec axisDeltaEta = {binsDeltaEta, "#Delta #eta = #eta_{Electron}- #eta_{Hadron}"}; AxisSpec axisDeltaPhi = {binsDeltaPhi, "#Delta #varphi = #varphi_{Electron}- #varphi_{Hadron}"}; AxisSpec axisPt = {binsPt, "#it{p_{T}}(GeV/#it{c})"}; + AxisSpec axisMass = {binsMass, "Mass (GeV/#it{c}^{2}); entries"}; AxisSpec axisPoolBin = {binsPoolBin, "PoolBin"}; AxisSpec axisNSigma = {binsNSigma, "it{#sigma_{TPC}}"}; registry.add("hZvertex", "z vertex", {HistType::kTH1D, {axisPosZ}}); registry.add("hNevents", "No of events", {HistType::kTH1D, {{3, 1, 4}}}); + registry.add("hLikeMass", "Like mass", {HistType::kTH1D, {{axisMass}}}); + registry.add("hUnLikeMass", "unLike mass", {HistType::kTH1D, {{axisMass}}}); + registry.add("hLikeSignPt", "Like sign Momentum ", {HistType::kTH1D, {{axisPt}}}); + registry.add("hUnLikeSignPt", "UnLike sign Momentum", {HistType::kTH1D, {{axisPt}}}); + registry.add("hInclusiveEHCorrel", "Sparse for Delta phi and Delta eta Inclusive Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hLSEHCorrel", "Sparse for Delta phi and Delta eta Like sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hULSEHCorrel", "Sparse for Delta phi and Delta eta UnLike sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); @@ -235,18 +243,32 @@ struct HfCorrelatorHfeHadrons { registry.fill(HIST("hptElectron"), ptElectron); int nElectronLS = 0; int nElectronUS = 0; + float massLike = 0; + float massUnLike = 0; if (eTrack.nElPairLS() > 0) { for (int i = 0; i < eTrack.nElPairLS(); ++i) { + massLike = eTrack.invariantMass(); - ++nElectronLS; registry.fill(HIST("hLSElectronBin"), poolBin); + registry.fill(HIST("hLikeMass"), massLike); + + if (massLike <= invariantMassEl) { + ++nElectronLS; + registry.fill(HIST("hLikeSignPt"), eTrack.ptTrack()); + } } } if (eTrack.nElPairUS() > 0) { for (int i = 0; i < eTrack.nElPairUS(); ++i) { + massUnLike = eTrack.invariantMass(); - ++nElectronUS; registry.fill(HIST("hULSElectronBin"), poolBin); + registry.fill(HIST("hUnLikeMass"), massUnLike); + + if (massUnLike <= invariantMassEl) { + ++nElectronUS; + registry.fill(HIST("hLikeSignPt"), eTrack.ptTrack()); + } } } @@ -279,16 +301,18 @@ struct HfCorrelatorHfeHadrons { int nElHadUSCorr = 0; if (eTrack.nElPairLS() > 0) { for (int i = 0; i < eTrack.nElPairLS(); ++i) { - - ++nElHadLSCorr; - registry.fill(HIST("hLSEHCorrel"), ptElectron, ptHadron, deltaPhi, deltaEta); + if (eTrack.invariantMass() <= invariantMassEl) { + ++nElHadLSCorr; + registry.fill(HIST("hLSEHCorrel"), ptElectron, ptHadron, deltaPhi, deltaEta); + } } } if (eTrack.nElPairUS() > 0) { for (int i = 0; i < eTrack.nElPairUS(); ++i) { - - registry.fill(HIST("hULSEHCorrel"), ptElectron, ptHadron, deltaPhi, deltaEta); - ++nElHadUSCorr; + if (eTrack.invariantMass() <= invariantMassEl) { + registry.fill(HIST("hULSEHCorrel"), ptElectron, ptHadron, deltaPhi, deltaEta); + ++nElHadUSCorr; + } } } entryElectronHadronPair(deltaPhi, deltaEta, ptElectron, ptHadron, poolBin, nElHadLSCorr, nElHadUSCorr); @@ -367,7 +391,7 @@ struct HfCorrelatorHfeHadrons { fillCorrelation(collision, electron, tracks, bc); } - PROCESS_SWITCH(HfCorrelatorHfeHadrons, processData, "Process for Data", true); + PROCESS_SWITCH(HfCorrelatorHfeHadrons, processData, "Process for Data", false); // ======= Process starts for McRec, Same event ============ @@ -379,7 +403,7 @@ struct HfCorrelatorHfeHadrons { fillCorrelation(mcCollision, mcElectron, mcTracks, bc); } - PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcRec, "Process MC Reco mode", false); + PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcRec, "Process MC Reco mode", true); void processMcGen(McGenTableCollision const& mcCollision, aod::McParticles const& mcParticles, aod::HfMcGenSelEl const& electron) { From 6b1d442d07172f3562aae0f94e09d6ea7ed2f5dc Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 12 Oct 2025 12:12:18 +0530 Subject: [PATCH 37/52] Add mass invariant condirtion --- .../TableProducer/correlatorHfeHadrons.cxx | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index 3da997dac10..f6bc76fb40c 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -47,11 +47,12 @@ using namespace o2::framework::expressions; using namespace o2::soa; using namespace o2::aod::hf_sel_electron; -std::vector zBins{VARIABLE_WIDTH, -10.0, -2.5, 2.5, 10.0}; -std::vector multBins{VARIABLE_WIDTH, 0., 200., 500.0, 5000.}; -std::vector multBinsMcGen{VARIABLE_WIDTH, 0., 20., 50.0, 500.}; // In MCGen multiplicity is defined by counting primaries +const std::vector zBins{VARIABLE_WIDTH, -10.0, -2.5, 2.5, 10.0}; +const std::vector multBins{VARIABLE_WIDTH, 0., 200., 500.0, 5000.}; +const std::vector multBinsMcGen{VARIABLE_WIDTH, 0., 20., 50.0, 500.}; // In MCGen multiplicity is defined by counting primaries using BinningType = ColumnBinningPolicy>; -BinningType corrBinning{{zBins, multBins}, true}; +const BinningType corrBinning{{zBins, multBins}, true}; + using BinningTypeMcGen = ColumnBinningPolicy; struct HfCorrelatorHfeHadrons { @@ -114,12 +115,13 @@ struct HfCorrelatorHfeHadrons { void init(InitContext&) { - AxisSpec axisPosZ = {binsPosZ, "Pos Z"}; + AxisSpec const axisPosZ = {binsPosZ, "Pos Z"}; AxisSpec axisDeltaEta = {binsDeltaEta, "#Delta #eta = #eta_{Electron}- #eta_{Hadron}"}; AxisSpec axisDeltaPhi = {binsDeltaPhi, "#Delta #varphi = #varphi_{Electron}- #varphi_{Hadron}"}; AxisSpec axisPt = {binsPt, "#it{p_{T}}(GeV/#it{c})"}; AxisSpec axisMass = {binsMass, "Mass (GeV/#it{c}^{2}); entries"}; - AxisSpec axisPoolBin = {binsPoolBin, "PoolBin"}; + + AxisSpec const axisPoolBin = {binsPoolBin, "PoolBin"}; AxisSpec axisNSigma = {binsNSigma, "it{#sigma_{TPC}}"}; registry.add("hZvertex", "z vertex", {HistType::kTH1D, {axisPosZ}}); @@ -128,7 +130,6 @@ struct HfCorrelatorHfeHadrons { registry.add("hUnLikeMass", "unLike mass", {HistType::kTH1D, {{axisMass}}}); registry.add("hLikeSignPt", "Like sign Momentum ", {HistType::kTH1D, {{axisPt}}}); registry.add("hUnLikeSignPt", "UnLike sign Momentum", {HistType::kTH1D, {{axisPt}}}); - registry.add("hInclusiveEHCorrel", "Sparse for Delta phi and Delta eta Inclusive Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hLSEHCorrel", "Sparse for Delta phi and Delta eta Like sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hULSEHCorrel", "Sparse for Delta phi and Delta eta UnLike sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); @@ -177,8 +178,9 @@ struct HfCorrelatorHfeHadrons { template void fillCorrelation(CollisionType const& collision, ElectronType const& electron, TracksType const& tracks, BcType const&) { - if (!(isRun3 ? collision.sel8() : (collision.sel7() && collision.alias_bit(kINT7)))) + if (!(isRun3 ? collision.sel8() : (collision.sel7() && collision.alias_bit(kINT7)))) { return; + } int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); auto bc = collision.template bc_as(); int gCollisionId = collision.globalIndex(); @@ -327,8 +329,9 @@ struct HfCorrelatorHfeHadrons { template void fillMixCorrelation(CollisionType1 const&, CollisionType2 const& c2, ElectronType const& tracks1, TracksType const& tracks2) { - if (!(isRun3 ? c2.sel8() : (c2.sel7() && c2.alias_bit(kINT7)))) + if (!(isRun3 ? c2.sel8() : (c2.sel7() && c2.alias_bit(kINT7)))) { return; + } double ptElectronMix = -999; double phiElectronMix = -999; double etaElectronMix = -999; @@ -408,7 +411,7 @@ struct HfCorrelatorHfeHadrons { void processMcGen(McGenTableCollision const& mcCollision, aod::McParticles const& mcParticles, aod::HfMcGenSelEl const& electron) { - BinningTypeMcGen corrBinningMcGen{{zBins, multBinsMcGen}, true}; + BinningTypeMcGen const corrBinningMcGen{{zBins, multBinsMcGen}, true}; int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), mcCollision.multMCFT0A())); for (const auto& particleMc : mcParticles) { @@ -485,7 +488,7 @@ struct HfCorrelatorHfeHadrons { void processDataMixedEvent(TableCollisions const& collision, aod::HfCorrSelEl const& electron, TableTracks const& tracks) { auto tracksTuple = std::make_tuple(electron, tracks); - Pair pair{corrBinning, numberEventsMixed, -1, collision, tracksTuple, &cache}; + Pair const pair{corrBinning, numberEventsMixed, -1, collision, tracksTuple, &cache}; // loop over the rows of the new table for (const auto& [c1, tracks1, c2, tracks2] : pair) { @@ -500,7 +503,7 @@ struct HfCorrelatorHfeHadrons { void processMcRecMixedEvent(McTableCollisions const& mccollision, aod::HfCorrSelEl const& electron, McTableTracks const& mcTracks) { auto tracksTuple = std::make_tuple(electron, mcTracks); - Pair pairMcRec{corrBinning, numberEventsMixed, -1, mccollision, tracksTuple, &cache}; + Pair const pairMcRec{corrBinning, numberEventsMixed, -1, mccollision, tracksTuple, &cache}; // loop over the rows of the new table for (const auto& [c1, tracks1, c2, tracks2] : pairMcRec) { @@ -509,13 +512,14 @@ struct HfCorrelatorHfeHadrons { } } PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcRecMixedEvent, "Process Mixed Event MC Reco mode", false); + void processMcGenMixedEvent(McGenTableCollisions const& mcCollision, aod::HfMcGenSelEl const& electrons, aod::McParticles const& mcParticles) { - BinningTypeMcGen corrBinningMcGen{{zBins, multBinsMcGen}, true}; + BinningTypeMcGen const corrBinningMcGen{{zBins, multBinsMcGen}, true}; auto tracksTuple = std::make_tuple(electrons, mcParticles); - Pair pairMcGen{corrBinningMcGen, 5, -1, mcCollision, tracksTuple, &cache}; + Pair const pairMcGen{corrBinningMcGen, 5, -1, mcCollision, tracksTuple, &cache}; // loop over the rows of the new table double ptElectronMix = -999; @@ -562,6 +566,7 @@ struct HfCorrelatorHfeHadrons { } PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcGenMixedEvent, "Process Mixed Event MC Gen mode", false); }; + WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ From 821588bb2adce3c1c4920fc5c671daba9d32e4b0 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 12 Oct 2025 12:20:58 +0530 Subject: [PATCH 38/52] remove O2 linter error --- .../HFL/TableProducer/electronSelectionWithTpcEmcal.cxx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index d8ae498cbff..d24580d0db8 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -71,7 +71,7 @@ struct HfElectronSelectionWithTpcEmcal { KFParticle kfNonHfe; Configurable fillEmcClusterInfo{"fillEmcClusterInfo", true, "Fill histograms with EMCal cluster info before and after track match"}; Configurable fillTrackInfo{"fillTrackInfo", true, "Fill histograms with Track Information info before track match"}; - Configurable emcalRegion{"emcalAcceptance", 0, "Select EMCal region for filling histograms"}; + Configurable emcalRegion{"emcalRegion", 0, "Select EMCal region for filling histograms"}; // Event Selection Configurable zPvPosMax{"zPvPosMax", 10., "Maximum z of the primary vertex (cm)"}; Configurable isRun3{"isRun3", true, "Data is from Run3 or Run2"}; @@ -380,11 +380,8 @@ struct HfElectronSelectionWithTpcEmcal { if (!(isRun3 ? collision.sel8() : (collision.sel7() && collision.alias_bit(kINT7)))) { return; } - int region = emcalRegion; - registry.fill(HIST("hNevents"), region) - - registry.fill(HIST("hNevents"), 1); + registry.fill(HIST("hNevents"), region); // skip events with no clusters if (emcClusters.size() == 0 && skipNoEmcClusters) { @@ -580,11 +577,9 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(mother.pdgCode()) == kEtaLocal || std::abs(mother.pdgCode()) == kPi0 || std::abs(mother.pdgCode()) == kGamma) { registry.fill(HIST("hMcgenAllNonHfeElectron"), particleMc.pt()); - auto const& gmother = mother.mothers_first_as(); // cases to consider: eta->e, eta->pi0->e, eta->gamma->e, eta->pi0->gamma->e, pi0->e, pi0->gamma->e - //================= eta->e ====================================== if (std::abs(mother.pdgCode()) == kEtaLocal) { From 8a43ff45aadfe528347829fd7aa37351925e56bb Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 12 Oct 2025 12:27:51 +0530 Subject: [PATCH 39/52] remove clang error From 5d48835fca4b5d748a9f835cfa79404c601bea55 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 12 Oct 2025 12:28:37 +0530 Subject: [PATCH 40/52] remove O2 inter erro --- PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index d24580d0db8..9b6a05f9bfd 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -72,6 +72,7 @@ struct HfElectronSelectionWithTpcEmcal { Configurable fillEmcClusterInfo{"fillEmcClusterInfo", true, "Fill histograms with EMCal cluster info before and after track match"}; Configurable fillTrackInfo{"fillTrackInfo", true, "Fill histograms with Track Information info before track match"}; Configurable emcalRegion{"emcalRegion", 0, "Select EMCal region for filling histograms"}; + Configurable skipNoEmcClusters{"skipNoEmcClusters", false, "Skip events with no EMCal clusters"}; // Event Selection Configurable zPvPosMax{"zPvPosMax", 10., "Maximum z of the primary vertex (cm)"}; Configurable isRun3{"isRun3", true, "Data is from Run3 or Run2"}; @@ -138,7 +139,6 @@ struct HfElectronSelectionWithTpcEmcal { PresliceUnsorted perClusterMatchedTracks = o2::aod::emcalmatchedtrack::trackId; // configurable axis - Configurable skipNoEmcClusters{"skipNoEmcClusters", false, "Skip events with no EMCal clusters"}; ConfigurableAxis binsPosZ{"binsPosZ", {100, -10., 10.}, "primary vertex z coordinate"}; ConfigurableAxis binsEta{"binsEta", {100, -2.0, 2.}, "#it{#eta}"}; ConfigurableAxis binsPhi{"binsPhi", {32, 0.0, o2::constants::math::TwoPI}, "#it{#varphi}"}; From fdb7010a9d293a885fbbf1a3579c461c7ffaffb6 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 19 Oct 2025 11:42:37 +0530 Subject: [PATCH 41/52] correct invariant mass column --- PWGHF/HFL/DataModel/ElectronSelectionTable.h | 24 ++++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/PWGHF/HFL/DataModel/ElectronSelectionTable.h b/PWGHF/HFL/DataModel/ElectronSelectionTable.h index a53aa631a6b..95f2daac276 100644 --- a/PWGHF/HFL/DataModel/ElectronSelectionTable.h +++ b/PWGHF/HFL/DataModel/ElectronSelectionTable.h @@ -78,17 +78,17 @@ DECLARE_SOA_TABLE(HfSelEl, "AOD", "HFSELEL", //! Electron Informations // definition of columns and tables for HfcorrElectron Selection namespace hf_corr_sel_electron { -DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! collisioniD of the electron track -DECLARE_SOA_INDEX_COLUMN(Track, track); //! trackid of of the electron track -DECLARE_SOA_COLUMN(EtaTrack, etaTrack, float); //! pseudorapidity of the electron track -DECLARE_SOA_COLUMN(PhiTrack, phiTrack, float); //! azimuth of the electron track -DECLARE_SOA_COLUMN(PtTrack, ptTrack, float); //! transverse momentum of the electron track -DECLARE_SOA_COLUMN(TpcNSigmaElTrack, tpcNSigmaElTrack, float); //! tpcNSigma of the electron track(TPC PID) -DECLARE_SOA_COLUMN(TofNSigmaElTrack, tofNSigmaElTrack, float); //! tofNSigma of the electron track(TOF PID) -DECLARE_SOA_COLUMN(InvariantMass, invariantMass, bool); //! invariant mass of the non-Hfelectron -DECLARE_SOA_COLUMN(NElPairLS, nElPairLS, int); //! Number of Like sign electron pair -DECLARE_SOA_COLUMN(NElPairUS, nElPairUS, int); //! Number of UnLike sign electron pair -DECLARE_SOA_COLUMN(IsEmcal, isEmcal, bool); //! electron information +DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! collisioniD of the electron track +DECLARE_SOA_INDEX_COLUMN(Track, track); //! trackid of of the electron track +DECLARE_SOA_COLUMN(EtaTrack, etaTrack, float); //! pseudorapidity of the electron track +DECLARE_SOA_COLUMN(PhiTrack, phiTrack, float); //! azimuth of the electron track +DECLARE_SOA_COLUMN(PtTrack, ptTrack, float); //! transverse momentum of the electron track +DECLARE_SOA_COLUMN(TpcNSigmaElTrack, tpcNSigmaElTrack, float); //! tpcNSigma of the electron track(TPC PID) +DECLARE_SOA_COLUMN(TofNSigmaElTrack, tofNSigmaElTrack, float); //! tofNSigma of the electron track(TOF PID) +DECLARE_SOA_COLUMN(InvariantMassNonHfe, invariantMassNonHfe, float); //! invariant mass of the non-Hfelectron +DECLARE_SOA_COLUMN(NElPairLS, nElPairLS, int); //! Number of Like sign electron pair +DECLARE_SOA_COLUMN(NElPairUS, nElPairUS, int); //! Number of UnLike sign electron pair +DECLARE_SOA_COLUMN(IsEmcal, isEmcal, bool); //! electron information } // namespace hf_corr_sel_electron DECLARE_SOA_TABLE(HfCorrSelEl, "AOD", "HfCORRSELEL", //! Electron Informations @@ -99,7 +99,7 @@ DECLARE_SOA_TABLE(HfCorrSelEl, "AOD", "HfCORRSELEL", //! Electron Informations hf_corr_sel_electron::PtTrack, hf_corr_sel_electron::TpcNSigmaElTrack, hf_corr_sel_electron::TofNSigmaElTrack, - hf_corr_sel_electron::InvariantMass, + hf_corr_sel_electron::InvariantMassNonHfe, hf_corr_sel_electron::NElPairLS, hf_corr_sel_electron::NElPairUS, hf_corr_sel_electron::IsEmcal); From 1521439b70e03564dc7c8b177d35913dfdb1b73f Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 19 Oct 2025 11:49:25 +0530 Subject: [PATCH 42/52] data Pocessing on by default --- .../TableProducer/electronSelectionWithTpcEmcal.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index 9b6a05f9bfd..1aa4197e4ea 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -380,15 +380,15 @@ struct HfElectronSelectionWithTpcEmcal { if (!(isRun3 ? collision.sel8() : (collision.sel7() && collision.alias_bit(kINT7)))) { return; } - int region = emcalRegion; - registry.fill(HIST("hNevents"), region); + + registry.fill(HIST("hNevents"), static_cast(emcalRegion)); // skip events with no clusters if (emcClusters.size() == 0 && skipNoEmcClusters) { return; } registry.fill(HIST("hZvertex"), collision.posZ()); - registry.fill(HIST("hNeventsAfterPassEmcal"), region); + registry.fill(HIST("hNeventsAfterPassEmcal"), static_cast(emcalRegion)); ///////////////////////////////// // EMCal cluster info before match /// /////////////////////////////// @@ -543,7 +543,7 @@ struct HfElectronSelectionWithTpcEmcal { { fillElectronTrack(collision, tracks, emcClusters, matchedTracks, 0); } - PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processData, "process Data info only", false); + PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processData, "process Data info only", true); /// Electron selection - for MC reco-level analysis void processMcRec(McTableCollision const& mcCollision, McTableTracks const& mcTracks, @@ -553,7 +553,7 @@ struct HfElectronSelectionWithTpcEmcal { { fillElectronTrack(mcCollision, mcTracks, mcEmcClusters, matchedTracks, mcParticles); } - PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processMcRec, "Process MC Reco mode", true); + PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processMcRec, "Process MC Reco mode", false); void processMcGen(McGenTableCollision const& mcCollision, aod::McParticles const& mcParticles) { From 9a0ef3545141772d3497165d4bf433ee4d154fe3 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 19 Oct 2025 11:54:53 +0530 Subject: [PATCH 43/52] correct invariant mass name --- PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index f6bc76fb40c..3ffc3fb5c40 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -66,7 +66,7 @@ struct HfCorrelatorHfeHadrons { Configurable isRun3{"isRun3", true, "Data is from Run3 or Run2"}; Configurable numberEventsMixed{"numberEventsMixed", 5, "number of events mixed in ME process"}; - Configurable invariantMassEl{"invariantMassEl", 0.14f, "max Invariant Mass for Photonic electron"}; + Configurable invariantMassNonHfe{"invariantMassNonHfe", 0.14f, "max Invariant Mass for Photonic electron"}; // Associated Hadron selection Configurable ptTrackMin{"ptTrackMin", 0.1f, "Transverse momentum range for associated hadron tracks"}; Configurable etaTrackMax{"etaTrackMax", 0.8f, "Eta range for associated hadron tracks"}; @@ -254,7 +254,7 @@ struct HfCorrelatorHfeHadrons { registry.fill(HIST("hLSElectronBin"), poolBin); registry.fill(HIST("hLikeMass"), massLike); - if (massLike <= invariantMassEl) { + if (massLike <= invariantMassNonHfe) { ++nElectronLS; registry.fill(HIST("hLikeSignPt"), eTrack.ptTrack()); } @@ -267,7 +267,7 @@ struct HfCorrelatorHfeHadrons { registry.fill(HIST("hULSElectronBin"), poolBin); registry.fill(HIST("hUnLikeMass"), massUnLike); - if (massUnLike <= invariantMassEl) { + if (massUnLike <= invariantMassNonHfe) { ++nElectronUS; registry.fill(HIST("hLikeSignPt"), eTrack.ptTrack()); } @@ -394,7 +394,7 @@ struct HfCorrelatorHfeHadrons { fillCorrelation(collision, electron, tracks, bc); } - PROCESS_SWITCH(HfCorrelatorHfeHadrons, processData, "Process for Data", false); + PROCESS_SWITCH(HfCorrelatorHfeHadrons, processData, "Process for Data", true); // ======= Process starts for McRec, Same event ============ @@ -406,7 +406,7 @@ struct HfCorrelatorHfeHadrons { fillCorrelation(mcCollision, mcElectron, mcTracks, bc); } - PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcRec, "Process MC Reco mode", true); + PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcRec, "Process MC Reco mode", false); void processMcGen(McGenTableCollision const& mcCollision, aod::McParticles const& mcParticles, aod::HfMcGenSelEl const& electron) { From e4ea74a6d051afa25677fc191c9187a68ffae47f Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 19 Oct 2025 11:57:57 +0530 Subject: [PATCH 44/52] correcct mass name --- PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index 3ffc3fb5c40..28c76749271 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -303,7 +303,7 @@ struct HfCorrelatorHfeHadrons { int nElHadUSCorr = 0; if (eTrack.nElPairLS() > 0) { for (int i = 0; i < eTrack.nElPairLS(); ++i) { - if (eTrack.invariantMass() <= invariantMassEl) { + if (eTrack.invariantMass() <= invariantMassNonHfe) { ++nElHadLSCorr; registry.fill(HIST("hLSEHCorrel"), ptElectron, ptHadron, deltaPhi, deltaEta); } @@ -311,7 +311,7 @@ struct HfCorrelatorHfeHadrons { } if (eTrack.nElPairUS() > 0) { for (int i = 0; i < eTrack.nElPairUS(); ++i) { - if (eTrack.invariantMass() <= invariantMassEl) { + if (eTrack.invariantMass() <= invariantMassNonHfe) { registry.fill(HIST("hULSEHCorrel"), ptElectron, ptHadron, deltaPhi, deltaEta); ++nElHadUSCorr; } From 0ea47ce90b4e98c9663353abffa4ca908bce03fb Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Tue, 21 Oct 2025 22:46:52 +0530 Subject: [PATCH 45/52] update mass name --- PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index 28c76749271..3c89dc779a3 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -249,7 +249,7 @@ struct HfCorrelatorHfeHadrons { float massUnLike = 0; if (eTrack.nElPairLS() > 0) { for (int i = 0; i < eTrack.nElPairLS(); ++i) { - massLike = eTrack.invariantMass(); + massLike = eTrack.invariantMassEE(); registry.fill(HIST("hLSElectronBin"), poolBin); registry.fill(HIST("hLikeMass"), massLike); @@ -262,7 +262,7 @@ struct HfCorrelatorHfeHadrons { } if (eTrack.nElPairUS() > 0) { for (int i = 0; i < eTrack.nElPairUS(); ++i) { - massUnLike = eTrack.invariantMass(); + massUnLike = eTrack.invariantMassEE(); registry.fill(HIST("hULSElectronBin"), poolBin); registry.fill(HIST("hUnLikeMass"), massUnLike); @@ -303,7 +303,7 @@ struct HfCorrelatorHfeHadrons { int nElHadUSCorr = 0; if (eTrack.nElPairLS() > 0) { for (int i = 0; i < eTrack.nElPairLS(); ++i) { - if (eTrack.invariantMass() <= invariantMassNonHfe) { + if (eTrack.invariantMassEE() <= invariantMassNonHfe) { ++nElHadLSCorr; registry.fill(HIST("hLSEHCorrel"), ptElectron, ptHadron, deltaPhi, deltaEta); } @@ -311,7 +311,7 @@ struct HfCorrelatorHfeHadrons { } if (eTrack.nElPairUS() > 0) { for (int i = 0; i < eTrack.nElPairUS(); ++i) { - if (eTrack.invariantMass() <= invariantMassNonHfe) { + if (eTrack.invariantMassEE() <= invariantMassNonHfe) { registry.fill(HIST("hULSEHCorrel"), ptElectron, ptHadron, deltaPhi, deltaEta); ++nElHadUSCorr; } @@ -387,11 +387,11 @@ struct HfCorrelatorHfeHadrons { // ======= Process starts for Data, Same event ============ void processData(TableCollision const& collision, - aod::HfCorrSelEl const& electron, + aod::HfCorrSelEl const& electrons, TableTracks const& tracks, aod::BCsWithTimestamps const& bc) { - fillCorrelation(collision, electron, tracks, bc); + fillCorrelation(collision, electrons, tracks, bc); } PROCESS_SWITCH(HfCorrelatorHfeHadrons, processData, "Process for Data", true); @@ -399,11 +399,11 @@ struct HfCorrelatorHfeHadrons { // ======= Process starts for McRec, Same event ============ void processMcRec(McTableCollision const& mcCollision, - aod::HfCorrSelEl const& mcElectron, + aod::HfCorrSelEl const& mcElectrons, McTableTracks const& mcTracks, aod::BCsWithTimestamps const& bc) { - fillCorrelation(mcCollision, mcElectron, mcTracks, bc); + fillCorrelation(mcCollision, mcElectrons, mcTracks, bc); } PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcRec, "Process MC Reco mode", false); From d2238c4a0bc46148dd284dccb0c8a70c8254d09a Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Tue, 21 Oct 2025 22:48:40 +0530 Subject: [PATCH 46/52] remove casting --- PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index 1aa4197e4ea..52029c4e7c6 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -381,7 +381,7 @@ struct HfElectronSelectionWithTpcEmcal { return; } - registry.fill(HIST("hNevents"), static_cast(emcalRegion)); + registry.fill(HIST("hNevents"), emcalRegion.value); // skip events with no clusters if (emcClusters.size() == 0 && skipNoEmcClusters) { From a551de2695f3fa9872e131ffd1c79982ed4a7de5 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Tue, 21 Oct 2025 22:49:30 +0530 Subject: [PATCH 47/52] update mass name --- PWGHF/HFL/DataModel/ElectronSelectionTable.h | 24 ++++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/PWGHF/HFL/DataModel/ElectronSelectionTable.h b/PWGHF/HFL/DataModel/ElectronSelectionTable.h index 95f2daac276..5566f5ca6ff 100644 --- a/PWGHF/HFL/DataModel/ElectronSelectionTable.h +++ b/PWGHF/HFL/DataModel/ElectronSelectionTable.h @@ -78,17 +78,17 @@ DECLARE_SOA_TABLE(HfSelEl, "AOD", "HFSELEL", //! Electron Informations // definition of columns and tables for HfcorrElectron Selection namespace hf_corr_sel_electron { -DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! collisioniD of the electron track -DECLARE_SOA_INDEX_COLUMN(Track, track); //! trackid of of the electron track -DECLARE_SOA_COLUMN(EtaTrack, etaTrack, float); //! pseudorapidity of the electron track -DECLARE_SOA_COLUMN(PhiTrack, phiTrack, float); //! azimuth of the electron track -DECLARE_SOA_COLUMN(PtTrack, ptTrack, float); //! transverse momentum of the electron track -DECLARE_SOA_COLUMN(TpcNSigmaElTrack, tpcNSigmaElTrack, float); //! tpcNSigma of the electron track(TPC PID) -DECLARE_SOA_COLUMN(TofNSigmaElTrack, tofNSigmaElTrack, float); //! tofNSigma of the electron track(TOF PID) -DECLARE_SOA_COLUMN(InvariantMassNonHfe, invariantMassNonHfe, float); //! invariant mass of the non-Hfelectron -DECLARE_SOA_COLUMN(NElPairLS, nElPairLS, int); //! Number of Like sign electron pair -DECLARE_SOA_COLUMN(NElPairUS, nElPairUS, int); //! Number of UnLike sign electron pair -DECLARE_SOA_COLUMN(IsEmcal, isEmcal, bool); //! electron information +DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! collisioniD of the electron track +DECLARE_SOA_INDEX_COLUMN(Track, track); //! trackid of of the electron track +DECLARE_SOA_COLUMN(EtaTrack, etaTrack, float); //! pseudorapidity of the electron track +DECLARE_SOA_COLUMN(PhiTrack, phiTrack, float); //! azimuth of the electron track +DECLARE_SOA_COLUMN(PtTrack, ptTrack, float); //! transverse momentum of the electron track +DECLARE_SOA_COLUMN(TpcNSigmaElTrack, tpcNSigmaElTrack, float); //! tpcNSigma of the electron track(TPC PID) +DECLARE_SOA_COLUMN(TofNSigmaElTrack, tofNSigmaElTrack, float); //! tofNSigma of the electron track(TOF PID) +DECLARE_SOA_COLUMN(InvariantMassEE, invariantMassEE, float); //! invariant mass of the non-Hfelectron +DECLARE_SOA_COLUMN(NElPairLS, nElPairLS, int); //! Number of Like sign electron pair +DECLARE_SOA_COLUMN(NElPairUS, nElPairUS, int); //! Number of UnLike sign electron pair +DECLARE_SOA_COLUMN(IsEmcal, isEmcal, bool); //! electron information } // namespace hf_corr_sel_electron DECLARE_SOA_TABLE(HfCorrSelEl, "AOD", "HfCORRSELEL", //! Electron Informations @@ -99,7 +99,7 @@ DECLARE_SOA_TABLE(HfCorrSelEl, "AOD", "HfCORRSELEL", //! Electron Informations hf_corr_sel_electron::PtTrack, hf_corr_sel_electron::TpcNSigmaElTrack, hf_corr_sel_electron::TofNSigmaElTrack, - hf_corr_sel_electron::InvariantMassNonHfe, + hf_corr_sel_electron::InvariantMassEE, hf_corr_sel_electron::NElPairLS, hf_corr_sel_electron::NElPairUS, hf_corr_sel_electron::IsEmcal); From efe2811d96199ee250ee29da42dc9ef22e80071c Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Tue, 21 Oct 2025 23:24:31 +0530 Subject: [PATCH 48/52] Add a refrence to emcal region --- PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index 52029c4e7c6..b09ef8213de 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -61,6 +61,7 @@ struct HfElectronSelectionWithTpcEmcal { Produces hfElectronSelection; Produces hfGenElectronSel; + // select the emcal or dcal acceptance enum EMCalRegion { NoAcceptance = 0, EMCalAcceptance = 1, @@ -71,8 +72,11 @@ struct HfElectronSelectionWithTpcEmcal { KFParticle kfNonHfe; Configurable fillEmcClusterInfo{"fillEmcClusterInfo", true, "Fill histograms with EMCal cluster info before and after track match"}; Configurable fillTrackInfo{"fillTrackInfo", true, "Fill histograms with Track Information info before track match"}; - Configurable emcalRegion{"emcalRegion", 0, "Select EMCal region for filling histograms"}; Configurable skipNoEmcClusters{"skipNoEmcClusters", false, "Skip events with no EMCal clusters"}; + + // select the emcal or dcal acceptance + Configurable emcalRegion{"emcalRegion", 0, "Select EMCal region for filling histograms"}; + // Event Selection Configurable zPvPosMax{"zPvPosMax", 10., "Maximum z of the primary vertex (cm)"}; Configurable isRun3{"isRun3", true, "Data is from Run3 or Run2"}; From 8306c17749a61570af495d11503133c3cbb538f9 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Tue, 21 Oct 2025 23:25:33 +0530 Subject: [PATCH 49/52] update mass name --- PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index 3c89dc779a3..f94a4e4e0b3 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -66,7 +66,7 @@ struct HfCorrelatorHfeHadrons { Configurable isRun3{"isRun3", true, "Data is from Run3 or Run2"}; Configurable numberEventsMixed{"numberEventsMixed", 5, "number of events mixed in ME process"}; - Configurable invariantMassNonHfe{"invariantMassNonHfe", 0.14f, "max Invariant Mass for Photonic electron"}; + Configurable invMassEEMax{"invMassEEMax", 0.14f, "max Invariant Mass for Photonic electron"}; // Associated Hadron selection Configurable ptTrackMin{"ptTrackMin", 0.1f, "Transverse momentum range for associated hadron tracks"}; Configurable etaTrackMax{"etaTrackMax", 0.8f, "Eta range for associated hadron tracks"}; @@ -254,7 +254,7 @@ struct HfCorrelatorHfeHadrons { registry.fill(HIST("hLSElectronBin"), poolBin); registry.fill(HIST("hLikeMass"), massLike); - if (massLike <= invariantMassNonHfe) { + if (massLike <= invMassEEMax) { ++nElectronLS; registry.fill(HIST("hLikeSignPt"), eTrack.ptTrack()); } @@ -267,7 +267,7 @@ struct HfCorrelatorHfeHadrons { registry.fill(HIST("hULSElectronBin"), poolBin); registry.fill(HIST("hUnLikeMass"), massUnLike); - if (massUnLike <= invariantMassNonHfe) { + if (massUnLike <= invMassEEMax) { ++nElectronUS; registry.fill(HIST("hLikeSignPt"), eTrack.ptTrack()); } @@ -303,7 +303,7 @@ struct HfCorrelatorHfeHadrons { int nElHadUSCorr = 0; if (eTrack.nElPairLS() > 0) { for (int i = 0; i < eTrack.nElPairLS(); ++i) { - if (eTrack.invariantMassEE() <= invariantMassNonHfe) { + if (eTrack.invariantMassEE() <= invMassEEMax) { ++nElHadLSCorr; registry.fill(HIST("hLSEHCorrel"), ptElectron, ptHadron, deltaPhi, deltaEta); } @@ -311,7 +311,7 @@ struct HfCorrelatorHfeHadrons { } if (eTrack.nElPairUS() > 0) { for (int i = 0; i < eTrack.nElPairUS(); ++i) { - if (eTrack.invariantMassEE() <= invariantMassNonHfe) { + if (eTrack.invariantMassEE() <= invMassEEMax) { registry.fill(HIST("hULSEHCorrel"), ptElectron, ptHadron, deltaPhi, deltaEta); ++nElHadUSCorr; } From abbaf7649503c3f0c9be25210c90f1c1b274ad8d Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Mon, 27 Oct 2025 10:00:45 +0530 Subject: [PATCH 50/52] Correct Emcal ref in configurable --- PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index b09ef8213de..952883b3eac 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -75,7 +75,7 @@ struct HfElectronSelectionWithTpcEmcal { Configurable skipNoEmcClusters{"skipNoEmcClusters", false, "Skip events with no EMCal clusters"}; // select the emcal or dcal acceptance - Configurable emcalRegion{"emcalRegion", 0, "Select EMCal region for filling histograms"}; + Configurable emcalRegion{"emcalRegion", 0, "Select EMCal region for filling histograms (see EMCalRegion enum)"}; // Event Selection Configurable zPvPosMax{"zPvPosMax", 10., "Maximum z of the primary vertex (cm)"}; From 4e230c164d1dd51cf76303a73c2e979774404469 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Mon, 27 Oct 2025 10:03:28 +0530 Subject: [PATCH 51/52] Fix singular/plural usage in variable naming --- PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index f94a4e4e0b3..40e3278bc07 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -176,7 +176,7 @@ struct HfCorrelatorHfeHadrons { // Electron-hadron Correlation template - void fillCorrelation(CollisionType const& collision, ElectronType const& electron, TracksType const& tracks, BcType const&) + void fillCorrelation(CollisionType const& collision, ElectronType const& electrons, TracksType const& tracks, BcType const&) { if (!(isRun3 ? collision.sel8() : (collision.sel7() && collision.alias_bit(kINT7)))) { return; @@ -213,7 +213,7 @@ struct HfCorrelatorHfeHadrons { double phiElectron = -999; double etaElectron = -999; - for (const auto& eTrack : electron) { + for (const auto& eTrack : electrons) { ptElectron = eTrack.ptTrack(); phiElectron = eTrack.phiTrack(); etaElectron = eTrack.etaTrack(); @@ -389,9 +389,9 @@ struct HfCorrelatorHfeHadrons { void processData(TableCollision const& collision, aod::HfCorrSelEl const& electrons, TableTracks const& tracks, - aod::BCsWithTimestamps const& bc) + aod::BCsWithTimestamps const& bcs) { - fillCorrelation(collision, electrons, tracks, bc); + fillCorrelation(collision, electrons, tracks, bcs); } PROCESS_SWITCH(HfCorrelatorHfeHadrons, processData, "Process for Data", true); @@ -401,14 +401,14 @@ struct HfCorrelatorHfeHadrons { void processMcRec(McTableCollision const& mcCollision, aod::HfCorrSelEl const& mcElectrons, McTableTracks const& mcTracks, - aod::BCsWithTimestamps const& bc) + aod::BCsWithTimestamps const& bcs) { - fillCorrelation(mcCollision, mcElectrons, mcTracks, bc); + fillCorrelation(mcCollision, mcElectrons, mcTracks, bcs); } PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcRec, "Process MC Reco mode", false); - void processMcGen(McGenTableCollision const& mcCollision, aod::McParticles const& mcParticles, aod::HfMcGenSelEl const& electron) + void processMcGen(McGenTableCollision const& mcCollision, aod::McParticles const& mcParticles, aod::HfMcGenSelEl const& electrons) { BinningTypeMcGen const corrBinningMcGen{{zBins, multBinsMcGen}, true}; @@ -433,7 +433,7 @@ struct HfCorrelatorHfeHadrons { double phiElectron = 0; double etaElectron = 0; - for (const auto& electronMc : electron) { + for (const auto& electronMc : electrons) { double ptHadron = 0; double phiHadron = 0; double etaHadron = 0; From f871be33fe51ad9707312e5de5639841ba8ae1cc Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Fri, 31 Oct 2025 12:47:35 +0530 Subject: [PATCH 52/52] use BCType instead of aod::BCsWithTimestamps use BCType instead of aod::BCsWithTimestamps --- PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index 40e3278bc07..eb5beb0ca55 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -182,7 +182,7 @@ struct HfCorrelatorHfeHadrons { return; } int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); - auto bc = collision.template bc_as(); + auto bc = collision.template bc_as(); int gCollisionId = collision.globalIndex(); int64_t timeStamp = bc.timestamp();