From 703714cdcb45d16df995b3d3fbebfaccadfa8b29 Mon Sep 17 00:00:00 2001 From: Seul I Jeong Date: Tue, 3 Feb 2026 11:48:58 +0900 Subject: [PATCH 1/7] added dcaHadron Histogram --- PWGHF/HFL/Tasks/taskSingleElectron.cxx | 169 +++++++++++++++---------- 1 file changed, 104 insertions(+), 65 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskSingleElectron.cxx b/PWGHF/HFL/Tasks/taskSingleElectron.cxx index 6c4d1f76833..e1c9ae06fb8 100644 --- a/PWGHF/HFL/Tasks/taskSingleElectron.cxx +++ b/PWGHF/HFL/Tasks/taskSingleElectron.cxx @@ -1,6 +1,6 @@ // Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright +// holders. All rights not expressly granted are reserved. // // This software is distributed under the terms of the GNU General Public // License v3 (GPL Version 3), copied verbatim in the file "COPYING". @@ -12,6 +12,7 @@ /// \file taskSingleElectron.cxx /// \brief task for electrons from heavy-flavour hadron decays /// \author Jonghan Park (Jeonbuk National University) +/// \author Seul I Jeong (Pusan National University) #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTOF.h" @@ -41,11 +42,7 @@ using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; -enum PdgCode { - kEta = 221, - kOmega = 223, - kEtaPrime = 331 -}; +enum PdgCode { kEta = 221, kOmega = 223, kEtaPrime = 331 }; enum SourceType { NotElec = 0, // not electron @@ -88,27 +85,44 @@ struct HfTaskSingleElectron { Configurable ptTrackMax{"ptTrackMax", 10., "max pt cut"}; Configurable ptTrackMin{"ptTrackMin", 0.5, "min pt cut"}; Configurable etaTrackMax{"etaTrackMax", 0.8, "eta cut"}; - Configurable tpcNCrossedRowMin{"tpcNCrossedRowMin", 70, "max of TPC n cluster crossed rows"}; - Configurable tpcNClsFoundOverFindableMin{"tpcNClsFoundOverFindableMin", 0.8, "min # of TPC found/findable clusters"}; - Configurable tpcChi2perNClMax{"tpcChi2perNClMax", 4., "min # of tpc chi2 per clusters"}; - Configurable itsIBClsMin{"itsIBClsMin", 3, "min # of its clusters in IB"}; - Configurable itsChi2perNClMax{"itsChi2perNClMax", 6., "min # of tpc chi2 per clusters"}; + Configurable tpcNCrossedRowMin{"tpcNCrossedRowMin", 70, + "max of TPC n cluster crossed rows"}; + Configurable tpcNClsFoundOverFindableMin{ + "tpcNClsFoundOverFindableMin", 0.8, + "min # of TPC found/findable clusters"}; + Configurable tpcChi2perNClMax{"tpcChi2perNClMax", 4., + "min # of tpc chi2 per clusters"}; + Configurable itsIBClsMin{"itsIBClsMin", 3, + "min # of its clusters in IB"}; + Configurable itsChi2perNClMax{"itsChi2perNClMax", 6., + "min # of tpc chi2 per clusters"}; Configurable dcaxyMax{"dcaxyMax", 1., "max of track dca in xy"}; Configurable dcazMax{"dcazMax", 2., "max of track dca in z"}; Configurable tofNSigmaMax{"tofNSigmaMax", 3., "max of tof nsigma"}; Configurable tpcNSigmaMin{"tpcNSigmaMin", -1., "min of tpc nsigma"}; Configurable tpcNSigmaMax{"tpcNSigmaMax", 3., "max of tpc nsigma"}; - Configurable nBinsP{"nBinsP", 1500, "number of bins of particle momentum"}; + Configurable nBinsP{"nBinsP", 1500, + "number of bins of particle momentum"}; Configurable nBinsPt{"nBinsPt", 100, "N bins in pT histo"}; + Configurable tpcNSigmaHadronMax{"tpcNSigmaHadronMax", -3, + "max of tpc hadron nsigma"}; + Configurable tpcNSigmaHadronMin{"tpcNSigmaHadronMin", -5, + "min of tpc hadron nsigma"}; + // SliceCache SliceCache cache; // using declarations using MyCollisions = soa::Join; - using TracksEl = soa::Join; - using McTracksEl = soa::Join; + using TracksEl = + soa::Join; + using McTracksEl = + soa::Join; // Filter Filter collZFilter = nabs(aod::collision::posZ) < posZMax; @@ -116,13 +130,18 @@ struct HfTaskSingleElectron { // Partition // ConfigurableAxis - ConfigurableAxis axisPtEl{"axisPtEl", {VARIABLE_WIDTH, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.75f, 2.0f, 2.25f, 2.5f, 2.75f, 3.f, 3.5f, 4.0f, 5.0f, 6.0f, 8.0f, 10.0f}, "electron pt bins"}; + ConfigurableAxis axisPtEl{ + "axisPtEl", + {VARIABLE_WIDTH, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, 1.1f, + 1.2f, 1.3f, 1.4f, 1.5f, 1.75f, 2.0f, 2.25f, 2.5f, + 2.75f, 3.f, 3.5f, 4.0f, 5.0f, 6.0f, 8.0f, 10.0f}, + "electron pt bins"}; // Histogram registry - HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry histos{ + "histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - void init(InitContext const&) - { + void init(InitContext const &) { // AxisSpec const AxisSpec axisEvt{4, 0., 4., "nEvents"}; const AxisSpec axisNCont{100, 0., 100., "nCont"}; @@ -137,7 +156,10 @@ struct HfTaskSingleElectron { histos.add("nEvents", "Number of events", kTH1D, {{1, 0., 1.}}); histos.add("VtxZ", "VtxZ; cm; entries", kTH1D, {axisPosZ}); histos.add("etaTrack", "etaTrack; #eta; entries", kTH1D, {axisEta}); - histos.add("ptTrack", "#it{p}_{T} distribution of selected tracks; #it{p}_{T} (GeV/#it{c}); entries", kTH1D, {axisPt}); + histos.add("ptTrack", + "#it{p}_{T} distribution of selected tracks; #it{p}_{T} " + "(GeV/#it{c}); entries", + kTH1D, {axisPt}); // QA plots for trigger track selection histos.add("tpcNClsTrack", "tpcNClsTrack", kTH1D, {{200, 0, 200}}); @@ -163,6 +185,7 @@ struct HfTaskSingleElectron { histos.add("dcaCharm", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); histos.add("dcaDalitz", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); histos.add("dcaConv", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); + histos.add("dcaHadron", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); // QA plots for MC histos.add("hPdgC", "", kTH1D, {{10001, -0.5, 10000.5}}); @@ -171,9 +194,7 @@ struct HfTaskSingleElectron { histos.add("hPdgCo", "", kTH1D, {{10001, -0.5, 10000.5}}); } - template - bool trackSel(const TrackType& track) - { + template bool trackSel(const TrackType &track) { if ((track.pt() > ptTrackMax) || (track.pt() < ptTrackMin)) { return false; } @@ -213,8 +234,7 @@ struct HfTaskSingleElectron { } template - int getElecSource(const TrackType& track, double& mpt, int& mpdg) - { + int getElecSource(const TrackType &track, double &mpt, int &mpdg) { auto mcpart = track.mcParticle(); if (std::abs(mcpart.pdgCode()) != kElectron) { return NotElec; @@ -227,30 +247,34 @@ struct HfTaskSingleElectron { int grmotherPt = -999; int ggrmotherPt = -999.; // mother, grand mother, grand grand mother pt - auto partMother = mcpart.template mothers_as(); // first mother particle of electron - auto partMotherCopy = partMother; // copy of the first mother - auto mctrack = partMother; // will change all the time + auto partMother = + mcpart.template mothers_as(); // first mother particle + // of electron + auto partMotherCopy = partMother; // copy of the first mother + auto mctrack = partMother; // will change all the time motherPt = partMother.front().pt(); // first mother pt motherPdg = std::abs(partMother.front().pdgCode()); // first mother pdg - mpt = motherPt; // copy of first mother pt - mpdg = motherPdg; // copy of first mother pdg + mpt = motherPt; // copy of first mother pt + mpdg = motherPdg; // copy of first mother pdg // check if electron from charm hadrons - if ((static_cast(motherPdg / 100.) % 10) == kCharm || (static_cast(motherPdg / 1000.) % 10) == kCharm) { + if ((static_cast(motherPdg / 100.) % 10) == kCharm || + (static_cast(motherPdg / 1000.) % 10) == kCharm) { // iterate until B hadron is found as an ancestor while (partMother.size()) { mctrack = partMother.front().template mothers_as(); if (mctrack.size()) { - auto const& grmothersIdsVec = mctrack.front().mothersIds(); + auto const &grmothersIdsVec = mctrack.front().mothersIds(); if (grmothersIdsVec.empty()) { return DirectCharm; } grmotherPt = mctrack.front().pt(); grmotherPdg = std::abs(mctrack.front().pdgCode()); - if ((static_cast(grmotherPdg / 100.) % 10) == kBottom || (static_cast(grmotherPdg / 1000.) % 10) == kBottom) { + if ((static_cast(grmotherPdg / 100.) % 10) == kBottom || + (static_cast(grmotherPdg / 1000.) % 10) == kBottom) { mpt = grmotherPt; mpdg = grmotherPdg; return BeautyCharm; @@ -258,12 +282,15 @@ struct HfTaskSingleElectron { } partMother = mctrack; } - } else if ((static_cast(motherPdg / 100.) % 10) == kBottom || (static_cast(motherPdg / 1000.) % 10) == kBottom) { // check if electron from beauty hadrons + } else if ((static_cast(motherPdg / 100.) % 10) == kBottom || + (static_cast(motherPdg / 1000.) % 10) == + kBottom) { // check if electron from beauty hadrons return DirectBeauty; - } else if (motherPdg == kGamma) { // check if electron from photon conversion + } else if (motherPdg == + kGamma) { // check if electron from photon conversion mctrack = partMother.front().template mothers_as(); if (mctrack.size()) { - auto const& grmothersIdsVec = mctrack.front().mothersIds(); + auto const &grmothersIdsVec = mctrack.front().mothersIds(); if (grmothersIdsVec.empty()) { return DirectGamma; } @@ -274,7 +301,7 @@ struct HfTaskSingleElectron { partMother = mctrack; mctrack = partMother.front().template mothers_as(); if (mctrack.size()) { - auto const& ggrmothersIdsVec = mctrack.front().mothersIds(); + auto const &ggrmothersIdsVec = mctrack.front().mothersIds(); if (ggrmothersIdsVec.empty()) { if (grmotherPdg == kPi0) { return GammaPi0; @@ -351,17 +378,17 @@ struct HfTaskSingleElectron { } else { // check if electron from Dalitz decays mctrack = partMother.front().template mothers_as(); if (mctrack.size()) { - auto const& grmothersIdsVec = mctrack.front().mothersIds(); + auto const &grmothersIdsVec = mctrack.front().mothersIds(); if (grmothersIdsVec.empty()) { static const std::map pdgToSource = { - {kPi0, Pi0}, - {PdgCode::kEta, Eta}, - {PdgCode::kOmega, Omega}, - {kPhi, Phi}, - {PdgCode::kEtaPrime, EtaPrime}, - {kRho770_0, Rho0}, - {kKPlus, Ke3}, - {kK0Long, K0l}}; + {kPi0, Pi0}, + {PdgCode::kEta, Eta}, + {PdgCode::kOmega, Omega}, + {kPhi, Phi}, + {PdgCode::kEtaPrime, EtaPrime}, + {kRho770_0, Rho0}, + {kKPlus, Ke3}, + {kK0Long, K0l}}; auto it = pdgToSource.find(motherPdg); if (it != pdgToSource.end()) { @@ -421,9 +448,8 @@ struct HfTaskSingleElectron { return Else; } - void processData(soa::Filtered::iterator const& collision, - TracksEl const& tracks) - { + void processData(soa::Filtered::iterator const &collision, + TracksEl const &tracks) { float const flagAnalysedEvt = 0.5; if (!collision.sel8()) { @@ -437,7 +463,7 @@ struct HfTaskSingleElectron { histos.fill(HIST("VtxZ"), collision.posZ()); histos.fill(HIST("nEvents"), flagAnalysedEvt); - for (const auto& track : tracks) { + for (const auto &track : tracks) { if (!trackSel(track)) { continue; @@ -451,7 +477,8 @@ struct HfTaskSingleElectron { histos.fill(HIST("ptTrack"), track.pt()); histos.fill(HIST("tpcNClsTrack"), track.tpcNClsCrossedRows()); - histos.fill(HIST("tpcFoundFindableTrack"), track.tpcCrossedRowsOverFindableCls()); + histos.fill(HIST("tpcFoundFindableTrack"), + track.tpcCrossedRowsOverFindableCls()); histos.fill(HIST("tpcChi2Track"), track.tpcChi2NCl()); histos.fill(HIST("itsIBClsTrack"), track.itsNClsInnerBarrel()); histos.fill(HIST("itsChi2Track"), track.itsChi2NCl()); @@ -467,11 +494,20 @@ struct HfTaskSingleElectron { } histos.fill(HIST("tofNSigPtQA"), track.pt(), track.tofNSigmaEl()); histos.fill(HIST("tpcNSigPAfterTofCut"), track.p(), track.tpcNSigmaEl()); - histos.fill(HIST("tpcNSigPtAfterTofCut"), track.pt(), track.tpcNSigmaEl()); + histos.fill(HIST("tpcNSigPtAfterTofCut"), track.pt(), + track.tpcNSigmaEl()); - if (track.tpcNSigmaEl() < tpcNSigmaMin || track.tpcNSigmaEl() > tpcNSigmaMax) { + if (track.tpcNSigmaEl() < tpcNSigmaMin || + track.tpcNSigmaEl() > tpcNSigmaMax) { continue; } + + if (track.tpcNSigmaEl() < tpcNSigmaHadronMax && + track.tpcNSigmaEl() > tpcNSigmaHadronMin) { + + histos.fill(HIST("dcaHadron"), track.pt(), track.dcaXY()); + } + histos.fill(HIST("tpcNSigPtQA"), track.pt(), track.tpcNSigmaEl()); histos.fill(HIST("dcaTrack"), track.pt(), track.dcaXY()); @@ -479,10 +515,8 @@ struct HfTaskSingleElectron { } PROCESS_SWITCH(HfTaskSingleElectron, processData, "For real data", true); - void processMc(soa::Filtered::iterator const& collision, - McTracksEl const& tracks, - aod::McParticles const&) - { + void processMc(soa::Filtered::iterator const &collision, + McTracksEl const &tracks, aod::McParticles const &) { float const flagAnalysedEvt = 0.5; if (!collision.sel8()) { @@ -496,7 +530,7 @@ struct HfTaskSingleElectron { histos.fill(HIST("VtxZ"), collision.posZ()); histos.fill(HIST("nEvents"), flagAnalysedEvt); - for (const auto& track : tracks) { + for (const auto &track : tracks) { if (!trackSel(track)) { continue; @@ -506,7 +540,8 @@ struct HfTaskSingleElectron { histos.fill(HIST("ptTrack"), track.pt()); histos.fill(HIST("tpcNClsTrack"), track.tpcNClsCrossedRows()); - histos.fill(HIST("tpcFoundFindableTrack"), track.tpcCrossedRowsOverFindableCls()); + histos.fill(HIST("tpcFoundFindableTrack"), + track.tpcCrossedRowsOverFindableCls()); histos.fill(HIST("tpcChi2Track"), track.tpcChi2NCl()); histos.fill(HIST("itsIBClsTrack"), track.itsNClsInnerBarrel()); histos.fill(HIST("dcaXYTrack"), track.dcaXY()); @@ -539,13 +574,19 @@ struct HfTaskSingleElectron { histos.fill(HIST("dcaDalitz"), track.pt(), track.dcaXY()); } + if (track.tpcNSigmaEl() < tpcNSigmaHadronMax && + track.tpcNSigmaEl() > tpcNSigmaHadronMin) + histos.fill(HIST("dcaHadron"), track.pt(), track.dcaXY()); + if (std::abs(track.tofNSigmaEl()) > tofNSigmaMax) { continue; } histos.fill(HIST("tofNSigPtQA"), track.pt(), track.tofNSigmaEl()); - histos.fill(HIST("tpcNSigPtAfterTofCut"), track.pt(), track.tpcNSigmaEl()); + histos.fill(HIST("tpcNSigPtAfterTofCut"), track.pt(), + track.tpcNSigmaEl()); - if (track.tpcNSigmaEl() < tpcNSigmaMin || track.tpcNSigmaEl() > tpcNSigmaMax) { + if (track.tpcNSigmaEl() < tpcNSigmaMin || + track.tpcNSigmaEl() > tpcNSigmaMax) { continue; } histos.fill(HIST("tpcNSigPtQA"), track.pt(), track.tpcNSigmaEl()); @@ -556,8 +597,6 @@ struct HfTaskSingleElectron { PROCESS_SWITCH(HfTaskSingleElectron, processMc, "For real data", false); }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; +WorkflowSpec defineDataProcessing(ConfigContext const &cfgc) { + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From 8cc76055a999c7f970a1b91917c12eb2edb011af Mon Sep 17 00:00:00 2001 From: Seul I Jeong Date: Tue, 3 Feb 2026 13:51:01 +0900 Subject: [PATCH 2/7] modified copyright issue --- PWGHF/HFL/Tasks/taskSingleElectron.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskSingleElectron.cxx b/PWGHF/HFL/Tasks/taskSingleElectron.cxx index e1c9ae06fb8..161e5fb9a7b 100644 --- a/PWGHF/HFL/Tasks/taskSingleElectron.cxx +++ b/PWGHF/HFL/Tasks/taskSingleElectron.cxx @@ -11,8 +11,7 @@ /// /// \file taskSingleElectron.cxx /// \brief task for electrons from heavy-flavour hadron decays -/// \author Jonghan Park (Jeonbuk National University) -/// \author Seul I Jeong (Pusan National University) +/// \author Jonghan Park (Jeonbuk National University), Seul I Jeong (Pusan National University) #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTOF.h" From ce1d0e804750f24fbed6e020259aa56ab2b91369 Mon Sep 17 00:00:00 2001 From: Seul I Jeong Date: Tue, 3 Feb 2026 14:07:11 +0900 Subject: [PATCH 3/7] modified copyright policy --- PWGHF/HFL/Tasks/taskSingleElectron.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskSingleElectron.cxx b/PWGHF/HFL/Tasks/taskSingleElectron.cxx index 161e5fb9a7b..94ceb06d75a 100644 --- a/PWGHF/HFL/Tasks/taskSingleElectron.cxx +++ b/PWGHF/HFL/Tasks/taskSingleElectron.cxx @@ -1,6 +1,6 @@ // Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright -// holders. All rights not expressly granted are reserved. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. // // This software is distributed under the terms of the GNU General Public // License v3 (GPL Version 3), copied verbatim in the file "COPYING". From 3c57bfa3b494d6fea313d50367ae807628b58926 Mon Sep 17 00:00:00 2001 From: Seul I Jeong Date: Tue, 3 Feb 2026 15:26:49 +0900 Subject: [PATCH 4/7] Added Histrogram(dcaHadron) --- PWGHF/HFL/Tasks/taskSingleElectron.cxx | 194 +++++++++++-------------- 1 file changed, 85 insertions(+), 109 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskSingleElectron.cxx b/PWGHF/HFL/Tasks/taskSingleElectron.cxx index 94ceb06d75a..f4968f5c337 100644 --- a/PWGHF/HFL/Tasks/taskSingleElectron.cxx +++ b/PWGHF/HFL/Tasks/taskSingleElectron.cxx @@ -41,7 +41,6 @@ using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; -enum PdgCode { kEta = 221, kOmega = 223, kEtaPrime = 331 }; enum SourceType { NotElec = 0, // not electron @@ -84,44 +83,30 @@ struct HfTaskSingleElectron { Configurable ptTrackMax{"ptTrackMax", 10., "max pt cut"}; Configurable ptTrackMin{"ptTrackMin", 0.5, "min pt cut"}; Configurable etaTrackMax{"etaTrackMax", 0.8, "eta cut"}; - Configurable tpcNCrossedRowMin{"tpcNCrossedRowMin", 70, - "max of TPC n cluster crossed rows"}; - Configurable tpcNClsFoundOverFindableMin{ - "tpcNClsFoundOverFindableMin", 0.8, - "min # of TPC found/findable clusters"}; - Configurable tpcChi2perNClMax{"tpcChi2perNClMax", 4., - "min # of tpc chi2 per clusters"}; - Configurable itsIBClsMin{"itsIBClsMin", 3, - "min # of its clusters in IB"}; - Configurable itsChi2perNClMax{"itsChi2perNClMax", 6., - "min # of tpc chi2 per clusters"}; + Configurable tpcNCrossedRowMin{"tpcNCrossedRowMin", 70, "max of TPC n cluster crossed rows"}; + Configurable tpcNClsFoundOverFindableMin{"tpcNClsFoundOverFindableMin", 0.8, "min # of TPC found/findable clusters"}; + Configurable tpcChi2perNClMax{"tpcChi2perNClMax", 4., "min # of tpc chi2 per clusters"}; + Configurable itsIBClsMin{"itsIBClsMin", 3, "min # of its clusters in IB"}; + Configurable itsChi2perNClMax{"itsChi2perNClMax", 6., "min # of tpc chi2 per clusters"}; Configurable dcaxyMax{"dcaxyMax", 1., "max of track dca in xy"}; Configurable dcazMax{"dcazMax", 2., "max of track dca in z"}; Configurable tofNSigmaMax{"tofNSigmaMax", 3., "max of tof nsigma"}; Configurable tpcNSigmaMin{"tpcNSigmaMin", -1., "min of tpc nsigma"}; Configurable tpcNSigmaMax{"tpcNSigmaMax", 3., "max of tpc nsigma"}; - Configurable nBinsP{"nBinsP", 1500, - "number of bins of particle momentum"}; + Configurable nBinsP{"nBinsP", 1500, "number of bins of particle momentum"}; Configurable nBinsPt{"nBinsPt", 100, "N bins in pT histo"}; - Configurable tpcNSigmaHadronMax{"tpcNSigmaHadronMax", -3, - "max of tpc hadron nsigma"}; - Configurable tpcNSigmaHadronMin{"tpcNSigmaHadronMin", -5, - "min of tpc hadron nsigma"}; + Configurable tpcNSigmaHadronMax{"tpcNSigmaHadronMax", -3, "max of tpc hadron nsigma"}; + Configurable tpcNSigmaHadronMin{"tpcNSigmaHadronMin" , -5, "min of tpc hadron nsigma"}; // SliceCache SliceCache cache; // using declarations using MyCollisions = soa::Join; - using TracksEl = - soa::Join; - using McTracksEl = - soa::Join; + using TracksEl = soa::Join; + using McTracksEl = soa::Join; // Filter Filter collZFilter = nabs(aod::collision::posZ) < posZMax; @@ -129,18 +114,13 @@ struct HfTaskSingleElectron { // Partition // ConfigurableAxis - ConfigurableAxis axisPtEl{ - "axisPtEl", - {VARIABLE_WIDTH, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, 1.1f, - 1.2f, 1.3f, 1.4f, 1.5f, 1.75f, 2.0f, 2.25f, 2.5f, - 2.75f, 3.f, 3.5f, 4.0f, 5.0f, 6.0f, 8.0f, 10.0f}, - "electron pt bins"}; + ConfigurableAxis axisPtEl{"axisPtEl", {VARIABLE_WIDTH, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.75f, 2.0f, 2.25f, 2.5f, 2.75f, 3.f, 3.5f, 4.0f, 5.0f, 6.0f, 8.0f, 10.0f}, "electron pt bins"}; // Histogram registry - HistogramRegistry histos{ - "histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry histos{"histos"}; - void init(InitContext const &) { + void init(InitContext const&) + { // AxisSpec const AxisSpec axisEvt{4, 0., 4., "nEvents"}; const AxisSpec axisNCont{100, 0., 100., "nCont"}; @@ -155,10 +135,7 @@ struct HfTaskSingleElectron { histos.add("nEvents", "Number of events", kTH1D, {{1, 0., 1.}}); histos.add("VtxZ", "VtxZ; cm; entries", kTH1D, {axisPosZ}); histos.add("etaTrack", "etaTrack; #eta; entries", kTH1D, {axisEta}); - histos.add("ptTrack", - "#it{p}_{T} distribution of selected tracks; #it{p}_{T} " - "(GeV/#it{c}); entries", - kTH1D, {axisPt}); + histos.add("ptTrack", "#it{p}_{T} distribution of selected tracks; #it{p}_{T} (GeV/#it{c}); entries", kTH1D, {axisPt}); // QA plots for trigger track selection histos.add("tpcNClsTrack", "tpcNClsTrack", kTH1D, {{200, 0, 200}}); @@ -184,7 +161,7 @@ struct HfTaskSingleElectron { histos.add("dcaCharm", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); histos.add("dcaDalitz", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); histos.add("dcaConv", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); - histos.add("dcaHadron", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); + histos.add("dcaHadron", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); // QA plots for MC histos.add("hPdgC", "", kTH1D, {{10001, -0.5, 10000.5}}); @@ -193,7 +170,9 @@ struct HfTaskSingleElectron { histos.add("hPdgCo", "", kTH1D, {{10001, -0.5, 10000.5}}); } - template bool trackSel(const TrackType &track) { + template + bool trackSel(const TrackType& track) + { if ((track.pt() > ptTrackMax) || (track.pt() < ptTrackMin)) { return false; } @@ -233,7 +212,8 @@ struct HfTaskSingleElectron { } template - int getElecSource(const TrackType &track, double &mpt, int &mpdg) { + int getElecSource(const TrackType& track, double& mpt, int& mpdg) + { auto mcpart = track.mcParticle(); if (std::abs(mcpart.pdgCode()) != kElectron) { return NotElec; @@ -246,34 +226,30 @@ struct HfTaskSingleElectron { int grmotherPt = -999; int ggrmotherPt = -999.; // mother, grand mother, grand grand mother pt - auto partMother = - mcpart.template mothers_as(); // first mother particle - // of electron - auto partMotherCopy = partMother; // copy of the first mother - auto mctrack = partMother; // will change all the time + auto partMother = mcpart.template mothers_as(); // first mother particle of electron + auto partMotherCopy = partMother; // copy of the first mother + auto mctrack = partMother; // will change all the time motherPt = partMother.front().pt(); // first mother pt motherPdg = std::abs(partMother.front().pdgCode()); // first mother pdg - mpt = motherPt; // copy of first mother pt - mpdg = motherPdg; // copy of first mother pdg + mpt = motherPt; // copy of first mother pt + mpdg = motherPdg; // copy of first mother pdg // check if electron from charm hadrons - if ((static_cast(motherPdg / 100.) % 10) == kCharm || - (static_cast(motherPdg / 1000.) % 10) == kCharm) { + if ((static_cast(motherPdg / 100.) % 10) == kCharm || (static_cast(motherPdg / 1000.) % 10) == kCharm) { // iterate until B hadron is found as an ancestor while (partMother.size()) { mctrack = partMother.front().template mothers_as(); if (mctrack.size()) { - auto const &grmothersIdsVec = mctrack.front().mothersIds(); + auto const& grmothersIdsVec = mctrack.front().mothersIds(); if (grmothersIdsVec.empty()) { return DirectCharm; } grmotherPt = mctrack.front().pt(); grmotherPdg = std::abs(mctrack.front().pdgCode()); - if ((static_cast(grmotherPdg / 100.) % 10) == kBottom || - (static_cast(grmotherPdg / 1000.) % 10) == kBottom) { + if ((static_cast(grmotherPdg / 100.) % 10) == kBottom || (static_cast(grmotherPdg / 1000.) % 10) == kBottom) { mpt = grmotherPt; mpdg = grmotherPdg; return BeautyCharm; @@ -281,15 +257,12 @@ struct HfTaskSingleElectron { } partMother = mctrack; } - } else if ((static_cast(motherPdg / 100.) % 10) == kBottom || - (static_cast(motherPdg / 1000.) % 10) == - kBottom) { // check if electron from beauty hadrons + } else if ((static_cast(motherPdg / 100.) % 10) == kBottom || (static_cast(motherPdg / 1000.) % 10) == kBottom) { // check if electron from beauty hadrons return DirectBeauty; - } else if (motherPdg == - kGamma) { // check if electron from photon conversion + } else if (motherPdg == kGamma) { // check if electron from photon conversion mctrack = partMother.front().template mothers_as(); if (mctrack.size()) { - auto const &grmothersIdsVec = mctrack.front().mothersIds(); + auto const& grmothersIdsVec = mctrack.front().mothersIds(); if (grmothersIdsVec.empty()) { return DirectGamma; } @@ -300,21 +273,21 @@ struct HfTaskSingleElectron { partMother = mctrack; mctrack = partMother.front().template mothers_as(); if (mctrack.size()) { - auto const &ggrmothersIdsVec = mctrack.front().mothersIds(); + auto const& ggrmothersIdsVec = mctrack.front().mothersIds(); if (ggrmothersIdsVec.empty()) { if (grmotherPdg == kPi0) { return GammaPi0; } - if (grmotherPdg == PdgCode::kEta) { + if (grmotherPdg == Pdg::kEta) { return GammaEta; } - if (grmotherPdg == PdgCode::kOmega) { + if (grmotherPdg == Pdg::kOmega) { return GammaOmega; } - if (grmotherPdg == kPhi) { + if (grmotherPdg == Pdg::kPhi) { return GammaPhi; } - if (grmotherPdg == PdgCode::kEtaPrime) { + if (grmotherPdg == Pdg::kEtaPrime) { return GammaEtaPrime; } if (grmotherPdg == kRho770_0) { @@ -346,22 +319,22 @@ struct HfTaskSingleElectron { mpt = grmotherPt; return GammaPi0; } - if (grmotherPdg == PdgCode::kEta) { + if (grmotherPdg == Pdg::kEta) { mpdg = grmotherPdg; mpt = grmotherPt; return GammaEta; } - if (grmotherPdg == PdgCode::kOmega) { + if (grmotherPdg == Pdg::kOmega) { mpdg = grmotherPdg; mpt = grmotherPt; return GammaOmega; } - if (grmotherPdg == kPhi) { + if (grmotherPdg == Pdg::kPhi) { mpdg = grmotherPdg; mpt = grmotherPt; return GammaPhi; } - if (grmotherPdg == PdgCode::kEtaPrime) { + if (grmotherPdg == Pdg::kEtaPrime) { mpdg = grmotherPdg; mpt = grmotherPt; return GammaEtaPrime; @@ -377,17 +350,17 @@ struct HfTaskSingleElectron { } else { // check if electron from Dalitz decays mctrack = partMother.front().template mothers_as(); if (mctrack.size()) { - auto const &grmothersIdsVec = mctrack.front().mothersIds(); + auto const& grmothersIdsVec = mctrack.front().mothersIds(); if (grmothersIdsVec.empty()) { static const std::map pdgToSource = { - {kPi0, Pi0}, - {PdgCode::kEta, Eta}, - {PdgCode::kOmega, Omega}, - {kPhi, Phi}, - {PdgCode::kEtaPrime, EtaPrime}, - {kRho770_0, Rho0}, - {kKPlus, Ke3}, - {kK0Long, K0l}}; + {kPi0, Pi0}, + {Pdg::kEta, Eta}, + {Pdg::kOmega, Omega}, + {Pdg::kPhi, Phi}, + {Pdg::kEtaPrime, EtaPrime}, + {kRho770_0, Rho0}, + {kKPlus, Ke3}, + {kK0Long, K0l}}; auto it = pdgToSource.find(motherPdg); if (it != pdgToSource.end()) { @@ -419,16 +392,16 @@ struct HfTaskSingleElectron { mpdg = motherPdg; return Pi0; } - if (motherPdg == PdgCode::kEta) { + if (motherPdg == Pdg::kEta) { return Eta; } - if (motherPdg == PdgCode::kOmega) { + if (motherPdg == Pdg::kOmega) { return Omega; } - if (motherPdg == kPhi) { + if (motherPdg == Pdg::kPhi) { return Phi; } - if (motherPdg == PdgCode::kEtaPrime) { + if (motherPdg == Pdg::kEtaPrime) { return EtaPrime; } if (motherPdg == kRho770_0) { @@ -447,8 +420,9 @@ struct HfTaskSingleElectron { return Else; } - void processData(soa::Filtered::iterator const &collision, - TracksEl const &tracks) { + void processData(soa::Filtered::iterator const& collision, + TracksEl const& tracks) + { float const flagAnalysedEvt = 0.5; if (!collision.sel8()) { @@ -462,7 +436,7 @@ struct HfTaskSingleElectron { histos.fill(HIST("VtxZ"), collision.posZ()); histos.fill(HIST("nEvents"), flagAnalysedEvt); - for (const auto &track : tracks) { + for (const auto& track : tracks) { if (!trackSel(track)) { continue; @@ -476,8 +450,7 @@ struct HfTaskSingleElectron { histos.fill(HIST("ptTrack"), track.pt()); histos.fill(HIST("tpcNClsTrack"), track.tpcNClsCrossedRows()); - histos.fill(HIST("tpcFoundFindableTrack"), - track.tpcCrossedRowsOverFindableCls()); + histos.fill(HIST("tpcFoundFindableTrack"), track.tpcCrossedRowsOverFindableCls()); histos.fill(HIST("tpcChi2Track"), track.tpcChi2NCl()); histos.fill(HIST("itsIBClsTrack"), track.itsNClsInnerBarrel()); histos.fill(HIST("itsChi2Track"), track.itsChi2NCl()); @@ -493,19 +466,18 @@ struct HfTaskSingleElectron { } histos.fill(HIST("tofNSigPtQA"), track.pt(), track.tofNSigmaEl()); histos.fill(HIST("tpcNSigPAfterTofCut"), track.p(), track.tpcNSigmaEl()); - histos.fill(HIST("tpcNSigPtAfterTofCut"), track.pt(), - track.tpcNSigmaEl()); + histos.fill(HIST("tpcNSigPtAfterTofCut"), track.pt(), track.tpcNSigmaEl()); - if (track.tpcNSigmaEl() < tpcNSigmaMin || - track.tpcNSigmaEl() > tpcNSigmaMax) { + if (track.tpcNSigmaEl() < tpcNSigmaMin || track.tpcNSigmaEl() > tpcNSigmaMax) { continue; } + + + if (track.tpcNSigmaEl() < tpcNSigmaHadronMax && track.tpcNSigmaEl() > tpcNSigmaHadronMin){ + + histos.fill(HIST("dcaHadron"), track.pt(), track.dcaXY()); - if (track.tpcNSigmaEl() < tpcNSigmaHadronMax && - track.tpcNSigmaEl() > tpcNSigmaHadronMin) { - - histos.fill(HIST("dcaHadron"), track.pt(), track.dcaXY()); - } + } histos.fill(HIST("tpcNSigPtQA"), track.pt(), track.tpcNSigmaEl()); @@ -514,8 +486,10 @@ struct HfTaskSingleElectron { } PROCESS_SWITCH(HfTaskSingleElectron, processData, "For real data", true); - void processMc(soa::Filtered::iterator const &collision, - McTracksEl const &tracks, aod::McParticles const &) { + void processMc(soa::Filtered::iterator const& collision, + McTracksEl const& tracks, + aod::McParticles const&) + { float const flagAnalysedEvt = 0.5; if (!collision.sel8()) { @@ -529,7 +503,7 @@ struct HfTaskSingleElectron { histos.fill(HIST("VtxZ"), collision.posZ()); histos.fill(HIST("nEvents"), flagAnalysedEvt); - for (const auto &track : tracks) { + for (const auto& track : tracks) { if (!trackSel(track)) { continue; @@ -539,8 +513,7 @@ struct HfTaskSingleElectron { histos.fill(HIST("ptTrack"), track.pt()); histos.fill(HIST("tpcNClsTrack"), track.tpcNClsCrossedRows()); - histos.fill(HIST("tpcFoundFindableTrack"), - track.tpcCrossedRowsOverFindableCls()); + histos.fill(HIST("tpcFoundFindableTrack"), track.tpcCrossedRowsOverFindableCls()); histos.fill(HIST("tpcChi2Track"), track.tpcChi2NCl()); histos.fill(HIST("itsIBClsTrack"), track.itsNClsInnerBarrel()); histos.fill(HIST("dcaXYTrack"), track.dcaXY()); @@ -573,29 +546,32 @@ struct HfTaskSingleElectron { histos.fill(HIST("dcaDalitz"), track.pt(), track.dcaXY()); } - if (track.tpcNSigmaEl() < tpcNSigmaHadronMax && - track.tpcNSigmaEl() > tpcNSigmaHadronMin) - histos.fill(HIST("dcaHadron"), track.pt(), track.dcaXY()); + + if (track.tpcNSigmaEl() < tpcNSigmaHadronMax && track.tpcNSigmaEl() > tpcNSigmaHadronMin) + histos.fill(HIST("dcaHadron"), track.pt(), track.dcaXY()); + if (std::abs(track.tofNSigmaEl()) > tofNSigmaMax) { continue; } histos.fill(HIST("tofNSigPtQA"), track.pt(), track.tofNSigmaEl()); - histos.fill(HIST("tpcNSigPtAfterTofCut"), track.pt(), - track.tpcNSigmaEl()); + histos.fill(HIST("tpcNSigPtAfterTofCut"), track.pt(), track.tpcNSigmaEl()); - if (track.tpcNSigmaEl() < tpcNSigmaMin || - track.tpcNSigmaEl() > tpcNSigmaMax) { + if (track.tpcNSigmaEl() < tpcNSigmaMin || track.tpcNSigmaEl() > tpcNSigmaMax) { continue; } histos.fill(HIST("tpcNSigPtQA"), track.pt(), track.tpcNSigmaEl()); histos.fill(HIST("dcaTrack"), track.pt(), track.dcaXY()); + + } } PROCESS_SWITCH(HfTaskSingleElectron, processMc, "For real data", false); }; -WorkflowSpec defineDataProcessing(ConfigContext const &cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; } From f7743f7da8a2f5ba7abe549cac0d5b4df7de983b Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 3 Feb 2026 06:47:43 +0000 Subject: [PATCH 5/7] Please consider the following formatting changes --- PWGHF/HFL/Tasks/taskSingleElectron.cxx | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskSingleElectron.cxx b/PWGHF/HFL/Tasks/taskSingleElectron.cxx index f4968f5c337..51aa6a948d1 100644 --- a/PWGHF/HFL/Tasks/taskSingleElectron.cxx +++ b/PWGHF/HFL/Tasks/taskSingleElectron.cxx @@ -41,7 +41,6 @@ using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; - enum SourceType { NotElec = 0, // not electron DirectCharm = 1, // electrons from prompt charm hadrons @@ -98,7 +97,7 @@ struct HfTaskSingleElectron { Configurable nBinsPt{"nBinsPt", 100, "N bins in pT histo"}; Configurable tpcNSigmaHadronMax{"tpcNSigmaHadronMax", -3, "max of tpc hadron nsigma"}; - Configurable tpcNSigmaHadronMin{"tpcNSigmaHadronMin" , -5, "min of tpc hadron nsigma"}; + Configurable tpcNSigmaHadronMin{"tpcNSigmaHadronMin", -5, "min of tpc hadron nsigma"}; // SliceCache SliceCache cache; @@ -120,7 +119,7 @@ struct HfTaskSingleElectron { HistogramRegistry histos{"histos"}; void init(InitContext const&) - { + { // AxisSpec const AxisSpec axisEvt{4, 0., 4., "nEvents"}; const AxisSpec axisNCont{100, 0., 100., "nCont"}; @@ -161,7 +160,7 @@ struct HfTaskSingleElectron { histos.add("dcaCharm", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); histos.add("dcaDalitz", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); histos.add("dcaConv", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); - histos.add("dcaHadron", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); + histos.add("dcaHadron", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); // QA plots for MC histos.add("hPdgC", "", kTH1D, {{10001, -0.5, 10000.5}}); @@ -471,13 +470,11 @@ struct HfTaskSingleElectron { if (track.tpcNSigmaEl() < tpcNSigmaMin || track.tpcNSigmaEl() > tpcNSigmaMax) { continue; } - - - if (track.tpcNSigmaEl() < tpcNSigmaHadronMax && track.tpcNSigmaEl() > tpcNSigmaHadronMin){ - - histos.fill(HIST("dcaHadron"), track.pt(), track.dcaXY()); - } + if (track.tpcNSigmaEl() < tpcNSigmaHadronMax && track.tpcNSigmaEl() > tpcNSigmaHadronMin) { + + histos.fill(HIST("dcaHadron"), track.pt(), track.dcaXY()); + } histos.fill(HIST("tpcNSigPtQA"), track.pt(), track.tpcNSigmaEl()); @@ -546,10 +543,8 @@ struct HfTaskSingleElectron { histos.fill(HIST("dcaDalitz"), track.pt(), track.dcaXY()); } - - if (track.tpcNSigmaEl() < tpcNSigmaHadronMax && track.tpcNSigmaEl() > tpcNSigmaHadronMin) - histos.fill(HIST("dcaHadron"), track.pt(), track.dcaXY()); - + if (track.tpcNSigmaEl() < tpcNSigmaHadronMax && track.tpcNSigmaEl() > tpcNSigmaHadronMin) + histos.fill(HIST("dcaHadron"), track.pt(), track.dcaXY()); if (std::abs(track.tofNSigmaEl()) > tofNSigmaMax) { continue; @@ -563,8 +558,6 @@ struct HfTaskSingleElectron { histos.fill(HIST("tpcNSigPtQA"), track.pt(), track.tpcNSigmaEl()); histos.fill(HIST("dcaTrack"), track.pt(), track.dcaXY()); - - } } PROCESS_SWITCH(HfTaskSingleElectron, processMc, "For real data", false); From 419fd5e5a605f407dd8e8828ca2e9c0b140943ba Mon Sep 17 00:00:00 2001 From: Seul I Jeong Date: Wed, 4 Feb 2026 12:47:36 +0900 Subject: [PATCH 6/7] Changed Histogram name and Configurable name --- PWGHF/HFL/Tasks/taskSingleElectron.cxx | 185 +++++++++++++------------ 1 file changed, 96 insertions(+), 89 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskSingleElectron.cxx b/PWGHF/HFL/Tasks/taskSingleElectron.cxx index 51aa6a948d1..66156706173 100644 --- a/PWGHF/HFL/Tasks/taskSingleElectron.cxx +++ b/PWGHF/HFL/Tasks/taskSingleElectron.cxx @@ -41,6 +41,7 @@ using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; + enum SourceType { NotElec = 0, // not electron DirectCharm = 1, // electrons from prompt charm hadrons @@ -82,22 +83,22 @@ struct HfTaskSingleElectron { Configurable ptTrackMax{"ptTrackMax", 10., "max pt cut"}; Configurable ptTrackMin{"ptTrackMin", 0.5, "min pt cut"}; Configurable etaTrackMax{"etaTrackMax", 0.8, "eta cut"}; - Configurable tpcNCrossedRowMin{"tpcNCrossedRowMin", 70, "max of TPC n cluster crossed rows"}; - Configurable tpcNClsFoundOverFindableMin{"tpcNClsFoundOverFindableMin", 0.8, "min # of TPC found/findable clusters"}; - Configurable tpcChi2perNClMax{"tpcChi2perNClMax", 4., "min # of tpc chi2 per clusters"}; - Configurable itsIBClsMin{"itsIBClsMin", 3, "min # of its clusters in IB"}; - Configurable itsChi2perNClMax{"itsChi2perNClMax", 6., "min # of tpc chi2 per clusters"}; + Configurable nCrossedRowTPCMin{"nCrossedRowTPCMin", 70, "max of TPC n cluster crossed rows"}; + Configurable nClsFoundOverFindableTpcMin{"nClsFoundOverFindableTpcMin", 0.8, "min # of TPC found/findable clusters"}; + Configurable Chi2pernClTpcMax{"Chi2pernClTpcMax", 4., "min # of tpc chi2 per clusters"}; + Configurable ClsIBItsMin{"ClsIBItsMin", 3, "min # of its clusters in IB"}; + Configurable Chi2pernClItsMax{"Chi2pernClItsMax", 6., "min # of tpc chi2 per clusters"}; Configurable dcaxyMax{"dcaxyMax", 1., "max of track dca in xy"}; Configurable dcazMax{"dcazMax", 2., "max of track dca in z"}; - Configurable tofNSigmaMax{"tofNSigmaMax", 3., "max of tof nsigma"}; - Configurable tpcNSigmaMin{"tpcNSigmaMin", -1., "min of tpc nsigma"}; - Configurable tpcNSigmaMax{"tpcNSigmaMax", 3., "max of tpc nsigma"}; + Configurable nSigmaTofMax{"nSigmaTofMax", 3., "max of tof nsigma"}; + Configurable nSigmaTpcMin{"nSigmaTpcMin", -1., "min of tpc nsigma"}; + Configurable nSigmaTPCMax{"nSigmaTPCMax", 3., "max of tpc nsigma"}; Configurable nBinsP{"nBinsP", 1500, "number of bins of particle momentum"}; Configurable nBinsPt{"nBinsPt", 100, "N bins in pT histo"}; - Configurable tpcNSigmaHadronMax{"tpcNSigmaHadronMax", -3, "max of tpc hadron nsigma"}; - Configurable tpcNSigmaHadronMin{"tpcNSigmaHadronMin", -5, "min of tpc hadron nsigma"}; + Configurable nSigmaTpcHadronMax{"nSigmaTpcHadronMax", -3, "max of tpc hadron nsigma"}; + Configurable nSigmaTpcHadronMin{"nSigmaTpcHadronMin" , -5, "min of tpc hadron nsigma"}; // SliceCache SliceCache cache; @@ -119,7 +120,7 @@ struct HfTaskSingleElectron { HistogramRegistry histos{"histos"}; void init(InitContext const&) - { + { // AxisSpec const AxisSpec axisEvt{4, 0., 4., "nEvents"}; const AxisSpec axisNCont{100, 0., 100., "nCont"}; @@ -131,36 +132,36 @@ struct HfTaskSingleElectron { const AxisSpec axisTrackIp{4000, -0.2, 0.2, "dca"}; // create histograms - histos.add("nEvents", "Number of events", kTH1D, {{1, 0., 1.}}); - histos.add("VtxZ", "VtxZ; cm; entries", kTH1D, {axisPosZ}); - histos.add("etaTrack", "etaTrack; #eta; entries", kTH1D, {axisEta}); - histos.add("ptTrack", "#it{p}_{T} distribution of selected tracks; #it{p}_{T} (GeV/#it{c}); entries", kTH1D, {axisPt}); + histos.add("hNEvents", "Number of events", kTH1D, {{1, 0., 1.}}); + histos.add("hVtxZ", "hVtxZ; cm; entries", kTH1D, {axisPosZ}); + histos.add("hEtaTrack", "hEtaTrack; #eta; entries", kTH1D, {axisEta}); + histos.add("hPtTrack", "#it{p}_{T} distribution of selected tracks; #it{p}_{T} (GeV/#it{c}); entries", kTH1D, {axisPt}); // QA plots for trigger track selection - histos.add("tpcNClsTrack", "tpcNClsTrack", kTH1D, {{200, 0, 200}}); - histos.add("tpcFoundFindableTrack", "", kTH1D, {{10, 0, 1}}); - histos.add("tpcChi2Track", "", kTH1D, {{100, 0, 10}}); - histos.add("itsIBClsTrack", "", kTH1D, {{10, 0, 10}}); - histos.add("itsChi2Track", "", kTH1D, {{50, 0, 50}}); - histos.add("dcaXYTrack", "", kTH1D, {{600, -3, 3}}); - histos.add("dcaZTrack", "", kTH1D, {{600, -3, 3}}); + histos.add("hNClsTpcTrack", "hNClsTpcTrack", kTH1D, {{200, 0, 200}}); + histos.add("hNClsFoundFindableTpcTrack", "", kTH1D, {{10, 0, 1}}); + histos.add("hChi2TpcTrack", "", kTH1D, {{100, 0, 10}}); + histos.add("hibClsItsTrack", "", kTH1D, {{10, 0, 10}}); + histos.add("hChi2ItsTrack", "", kTH1D, {{50, 0, 50}}); + histos.add("hDcaXYTrack", "", kTH1D, {{600, -3, 3}}); + histos.add("hDcaZTrack", "", kTH1D, {{600, -3, 3}}); // pid - histos.add("tofNSigPt", "", kTH2D, {{axisPtEl}, {axisNsig}}); - histos.add("tofNSigPtQA", "", kTH2D, {{axisPtEl}, {axisNsig}}); - histos.add("tpcNSigP", "", kTH2D, {{axisP}, {axisNsig}}); - histos.add("tpcNSigPt", "", kTH2D, {{axisPtEl}, {axisNsig}}); - histos.add("tpcNSigPAfterTofCut", "", kTH2D, {{axisP}, {axisNsig}}); - histos.add("tpcNSigPtAfterTofCut", "", kTH2D, {{axisPtEl}, {axisNsig}}); - histos.add("tpcNSigPtQA", "", kTH2D, {{axisPtEl}, {axisNsig}}); + histos.add("hTofNSigPt", "", kTH2D, {{axisPtEl}, {axisNsig}}); + histos.add("hTofNSigPtQA", "", kTH2D, {{axisPtEl}, {axisNsig}}); + histos.add("hTPCNSigP", "", kTH2D, {{axisP}, {axisNsig}}); + histos.add("hTPCNSigPt", "", kTH2D, {{axisPtEl}, {axisNsig}}); + histos.add("hTPCNSigPAfterTofCut", "", kTH2D, {{axisP}, {axisNsig}}); + histos.add("hTPCNSigPtAfterTofCut", "", kTH2D, {{axisPtEl}, {axisNsig}}); + histos.add("hTPCNSigPtQA", "", kTH2D, {{axisPtEl}, {axisNsig}}); // track impact parameter - histos.add("dcaTrack", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); - histos.add("dcaBeauty", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); - histos.add("dcaCharm", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); - histos.add("dcaDalitz", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); - histos.add("dcaConv", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); - histos.add("dcaHadron", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); + histos.add("hDcaTrack", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); + histos.add("hDcaBeauty", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); + histos.add("hDcaChram", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); + histos.add("hDcaDalitz", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); + histos.add("hDcaConv", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); + histos.add("hDcaHadron", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); // QA plots for MC histos.add("hPdgC", "", kTH1D, {{10001, -0.5, 10000.5}}); @@ -179,23 +180,23 @@ struct HfTaskSingleElectron { return false; } - if (track.tpcNClsCrossedRows() < tpcNCrossedRowMin) { + if (track.tpcNClsCrossedRows() < nCrossedRowTPCMin) { return false; } - if (track.tpcCrossedRowsOverFindableCls() < tpcNClsFoundOverFindableMin) { + if (track.tpcCrossedRowsOverFindableCls() < nClsFoundOverFindableTpcMin) { return false; } - if (track.tpcChi2NCl() > tpcChi2perNClMax) { + if (track.tpcChi2NCl() > Chi2pernClTpcMax) { return false; } - if (!(track.itsNClsInnerBarrel() == itsIBClsMin)) { + if (!(track.itsNClsInnerBarrel() == ClsIBItsMin)) { return false; } - if (track.itsChi2NCl() > itsChi2perNClMax) { + if (track.itsChi2NCl() > Chi2pernClItsMax) { return false; } @@ -432,8 +433,8 @@ struct HfTaskSingleElectron { return; } - histos.fill(HIST("VtxZ"), collision.posZ()); - histos.fill(HIST("nEvents"), flagAnalysedEvt); + histos.fill(HIST("hVtxZ"), collision.posZ()); + histos.fill(HIST("hNEvents"), flagAnalysedEvt); for (const auto& track : tracks) { @@ -445,40 +446,42 @@ struct HfTaskSingleElectron { continue; } - histos.fill(HIST("etaTrack"), track.eta()); - histos.fill(HIST("ptTrack"), track.pt()); + histos.fill(HIST("hEtaTrack"), track.eta()); + histos.fill(HIST("hPtTrack"), track.pt()); - histos.fill(HIST("tpcNClsTrack"), track.tpcNClsCrossedRows()); - histos.fill(HIST("tpcFoundFindableTrack"), track.tpcCrossedRowsOverFindableCls()); - histos.fill(HIST("tpcChi2Track"), track.tpcChi2NCl()); - histos.fill(HIST("itsIBClsTrack"), track.itsNClsInnerBarrel()); - histos.fill(HIST("itsChi2Track"), track.itsChi2NCl()); - histos.fill(HIST("dcaXYTrack"), track.dcaXY()); - histos.fill(HIST("dcaZTrack"), track.dcaZ()); + histos.fill(HIST("hNClsTpcTrack"), track.tpcNClsCrossedRows()); + histos.fill(HIST("hNClsFoundFindableTpcTrack"), track.tpcCrossedRowsOverFindableCls()); + histos.fill(HIST("hChi2TpcTrack"), track.tpcChi2NCl()); + histos.fill(HIST("hibClsItsTrack"), track.itsNClsInnerBarrel()); + histos.fill(HIST("hChi2ItsTrack"), track.itsChi2NCl()); + histos.fill(HIST("hDcaXYTrack"), track.dcaXY()); + histos.fill(HIST("hDcaZTrack"), track.dcaZ()); - histos.fill(HIST("tofNSigPt"), track.pt(), track.tofNSigmaEl()); - histos.fill(HIST("tpcNSigP"), track.p(), track.tpcNSigmaEl()); - histos.fill(HIST("tpcNSigPt"), track.pt(), track.tpcNSigmaEl()); + histos.fill(HIST("hTofNSigPt"), track.pt(), track.tofNSigmaEl()); + histos.fill(HIST("hTPCNSigP"), track.p(), track.tpcNSigmaEl()); + histos.fill(HIST("hTPCNSigPt"), track.pt(), track.tpcNSigmaEl()); - if (std::abs(track.tofNSigmaEl()) > tofNSigmaMax) { + if (std::abs(track.tofNSigmaEl()) > nSigmaTofMax) { continue; } - histos.fill(HIST("tofNSigPtQA"), track.pt(), track.tofNSigmaEl()); - histos.fill(HIST("tpcNSigPAfterTofCut"), track.p(), track.tpcNSigmaEl()); - histos.fill(HIST("tpcNSigPtAfterTofCut"), track.pt(), track.tpcNSigmaEl()); + histos.fill(HIST("hTofNSigPtQA"), track.pt(), track.tofNSigmaEl()); + histos.fill(HIST("hTPCNSigPAfterTofCut"), track.p(), track.tpcNSigmaEl()); + histos.fill(HIST("hTPCNSigPtAfterTofCut"), track.pt(), track.tpcNSigmaEl()); - if (track.tpcNSigmaEl() < tpcNSigmaMin || track.tpcNSigmaEl() > tpcNSigmaMax) { + if (track.tpcNSigmaEl() < nSigmaTpcMin || track.tpcNSigmaEl() > nSigmaTPCMax) { continue; } + + + if (track.tpcNSigmaEl() < nSigmaTpcHadronMax && track.tpcNSigmaEl() > nSigmaTpcHadronMin){ + + histos.fill(HIST("hDcaHadron"), track.pt(), track.dcaXY()); - if (track.tpcNSigmaEl() < tpcNSigmaHadronMax && track.tpcNSigmaEl() > tpcNSigmaHadronMin) { - - histos.fill(HIST("dcaHadron"), track.pt(), track.dcaXY()); - } + } - histos.fill(HIST("tpcNSigPtQA"), track.pt(), track.tpcNSigmaEl()); + histos.fill(HIST("hTPCNSigPtQA"), track.pt(), track.tpcNSigmaEl()); - histos.fill(HIST("dcaTrack"), track.pt(), track.dcaXY()); + histos.fill(HIST("hDcaTrack"), track.pt(), track.dcaXY()); } } PROCESS_SWITCH(HfTaskSingleElectron, processData, "For real data", true); @@ -497,8 +500,8 @@ struct HfTaskSingleElectron { return; } - histos.fill(HIST("VtxZ"), collision.posZ()); - histos.fill(HIST("nEvents"), flagAnalysedEvt); + histos.fill(HIST("hVtxZ"), collision.posZ()); + histos.fill(HIST("hNEvents"), flagAnalysedEvt); for (const auto& track : tracks) { @@ -506,18 +509,18 @@ struct HfTaskSingleElectron { continue; } - histos.fill(HIST("etaTrack"), track.eta()); - histos.fill(HIST("ptTrack"), track.pt()); + histos.fill(HIST("hEtaTrack"), track.eta()); + histos.fill(HIST("hPtTrack"), track.pt()); - histos.fill(HIST("tpcNClsTrack"), track.tpcNClsCrossedRows()); - histos.fill(HIST("tpcFoundFindableTrack"), track.tpcCrossedRowsOverFindableCls()); - histos.fill(HIST("tpcChi2Track"), track.tpcChi2NCl()); - histos.fill(HIST("itsIBClsTrack"), track.itsNClsInnerBarrel()); - histos.fill(HIST("dcaXYTrack"), track.dcaXY()); - histos.fill(HIST("dcaZTrack"), track.dcaZ()); + histos.fill(HIST("hNClsTpcTrack"), track.tpcNClsCrossedRows()); + histos.fill(HIST("hNClsFoundFindableTpcTrack"), track.tpcCrossedRowsOverFindableCls()); + histos.fill(HIST("hChi2TpcTrack"), track.tpcChi2NCl()); + histos.fill(HIST("hibClsItsTrack"), track.itsNClsInnerBarrel()); + histos.fill(HIST("hDcaXYTrack"), track.dcaXY()); + histos.fill(HIST("hDcaZTrack"), track.dcaZ()); - histos.fill(HIST("tofNSigPt"), track.pt(), track.tofNSigmaEl()); - histos.fill(HIST("tpcNSigPt"), track.pt(), track.tpcNSigmaEl()); + histos.fill(HIST("hTofNSigPt"), track.pt(), track.tofNSigmaEl()); + histos.fill(HIST("hTPCNSigPt"), track.pt(), track.tpcNSigmaEl()); int mpdg; // electron source pdg code double mpt; // electron source pt @@ -525,39 +528,43 @@ struct HfTaskSingleElectron { if (source == DirectBeauty || source == BeautyCharm) { histos.fill(HIST("hPdgB"), mpdg); - histos.fill(HIST("dcaBeauty"), track.pt(), track.dcaXY()); + histos.fill(HIST("hDcaBeauty"), track.pt(), track.dcaXY()); } if (source == DirectCharm) { histos.fill(HIST("hPdgC"), mpdg); - histos.fill(HIST("dcaCharm"), track.pt(), track.dcaXY()); + histos.fill(HIST("hDcaChram"), track.pt(), track.dcaXY()); } if (source >= GammaPi0 && source <= GammaSigma) { histos.fill(HIST("hPdgCo"), mpdg); - histos.fill(HIST("dcaConv"), track.pt(), track.dcaXY()); + histos.fill(HIST("hDcaConv"), track.pt(), track.dcaXY()); } if (source >= Pi0 && source <= Sigma) { histos.fill(HIST("hPdgDa"), mpdg); - histos.fill(HIST("dcaDalitz"), track.pt(), track.dcaXY()); + histos.fill(HIST("hDcaDalitz"), track.pt(), track.dcaXY()); } - if (track.tpcNSigmaEl() < tpcNSigmaHadronMax && track.tpcNSigmaEl() > tpcNSigmaHadronMin) - histos.fill(HIST("dcaHadron"), track.pt(), track.dcaXY()); - if (std::abs(track.tofNSigmaEl()) > tofNSigmaMax) { + if (track.tpcNSigmaEl() < nSigmaTpcHadronMax && track.tpcNSigmaEl() > nSigmaTpcHadronMin) + histos.fill(HIST("hDcaHadron"), track.pt(), track.dcaXY()); + + + if (std::abs(track.tofNSigmaEl()) > nSigmaTofMax) { continue; } - histos.fill(HIST("tofNSigPtQA"), track.pt(), track.tofNSigmaEl()); - histos.fill(HIST("tpcNSigPtAfterTofCut"), track.pt(), track.tpcNSigmaEl()); + histos.fill(HIST("hTofNSigPtQA"), track.pt(), track.tofNSigmaEl()); + histos.fill(HIST("hTPCNSigPtAfterTofCut"), track.pt(), track.tpcNSigmaEl()); - if (track.tpcNSigmaEl() < tpcNSigmaMin || track.tpcNSigmaEl() > tpcNSigmaMax) { + if (track.tpcNSigmaEl() < nSigmaTpcMin || track.tpcNSigmaEl() > nSigmaTPCMax) { continue; } - histos.fill(HIST("tpcNSigPtQA"), track.pt(), track.tpcNSigmaEl()); + histos.fill(HIST("hTPCNSigPtQA"), track.pt(), track.tpcNSigmaEl()); + + histos.fill(HIST("hDcaTrack"), track.pt(), track.dcaXY()); + - histos.fill(HIST("dcaTrack"), track.pt(), track.dcaXY()); } } PROCESS_SWITCH(HfTaskSingleElectron, processMc, "For real data", false); From baf7b557dc18dd5187503903d09fe4da2df305b8 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 4 Feb 2026 03:48:24 +0000 Subject: [PATCH 7/7] Please consider the following formatting changes --- PWGHF/HFL/Tasks/taskSingleElectron.cxx | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskSingleElectron.cxx b/PWGHF/HFL/Tasks/taskSingleElectron.cxx index 66156706173..0d1b2a83b08 100644 --- a/PWGHF/HFL/Tasks/taskSingleElectron.cxx +++ b/PWGHF/HFL/Tasks/taskSingleElectron.cxx @@ -41,7 +41,6 @@ using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; - enum SourceType { NotElec = 0, // not electron DirectCharm = 1, // electrons from prompt charm hadrons @@ -98,7 +97,7 @@ struct HfTaskSingleElectron { Configurable nBinsPt{"nBinsPt", 100, "N bins in pT histo"}; Configurable nSigmaTpcHadronMax{"nSigmaTpcHadronMax", -3, "max of tpc hadron nsigma"}; - Configurable nSigmaTpcHadronMin{"nSigmaTpcHadronMin" , -5, "min of tpc hadron nsigma"}; + Configurable nSigmaTpcHadronMin{"nSigmaTpcHadronMin", -5, "min of tpc hadron nsigma"}; // SliceCache SliceCache cache; @@ -120,7 +119,7 @@ struct HfTaskSingleElectron { HistogramRegistry histos{"histos"}; void init(InitContext const&) - { + { // AxisSpec const AxisSpec axisEvt{4, 0., 4., "nEvents"}; const AxisSpec axisNCont{100, 0., 100., "nCont"}; @@ -161,7 +160,7 @@ struct HfTaskSingleElectron { histos.add("hDcaChram", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); histos.add("hDcaDalitz", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); histos.add("hDcaConv", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); - histos.add("hDcaHadron", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); + histos.add("hDcaHadron", "", kTH2D, {{axisPtEl}, {axisTrackIp}}); // QA plots for MC histos.add("hPdgC", "", kTH1D, {{10001, -0.5, 10000.5}}); @@ -471,13 +470,11 @@ struct HfTaskSingleElectron { if (track.tpcNSigmaEl() < nSigmaTpcMin || track.tpcNSigmaEl() > nSigmaTPCMax) { continue; } - - - if (track.tpcNSigmaEl() < nSigmaTpcHadronMax && track.tpcNSigmaEl() > nSigmaTpcHadronMin){ - - histos.fill(HIST("hDcaHadron"), track.pt(), track.dcaXY()); - } + if (track.tpcNSigmaEl() < nSigmaTpcHadronMax && track.tpcNSigmaEl() > nSigmaTpcHadronMin) { + + histos.fill(HIST("hDcaHadron"), track.pt(), track.dcaXY()); + } histos.fill(HIST("hTPCNSigPtQA"), track.pt(), track.tpcNSigmaEl()); @@ -546,10 +543,8 @@ struct HfTaskSingleElectron { histos.fill(HIST("hDcaDalitz"), track.pt(), track.dcaXY()); } - - if (track.tpcNSigmaEl() < nSigmaTpcHadronMax && track.tpcNSigmaEl() > nSigmaTpcHadronMin) - histos.fill(HIST("hDcaHadron"), track.pt(), track.dcaXY()); - + if (track.tpcNSigmaEl() < nSigmaTpcHadronMax && track.tpcNSigmaEl() > nSigmaTpcHadronMin) + histos.fill(HIST("hDcaHadron"), track.pt(), track.dcaXY()); if (std::abs(track.tofNSigmaEl()) > nSigmaTofMax) { continue; @@ -563,8 +558,6 @@ struct HfTaskSingleElectron { histos.fill(HIST("hTPCNSigPtQA"), track.pt(), track.tpcNSigmaEl()); histos.fill(HIST("hDcaTrack"), track.pt(), track.dcaXY()); - - } } PROCESS_SWITCH(HfTaskSingleElectron, processMc, "For real data", false);