Skip to content

Commit c6a8a6d

Browse files
rashiguptrashi234
andauthored
[PWGHF] Implementation of MassLike/MassUnlike Columns and Move TPC–TOF PID Cuts to electronSelectionWithTPCEmcal.cxx (#14045)
Co-authored-by: rashi.gupta@cern.ch <rashi.gupta@cern.ch>
1 parent 09e34c7 commit c6a8a6d

File tree

3 files changed

+45
-42
lines changed

3 files changed

+45
-42
lines changed

PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx

Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,6 @@ struct HfCorrelatorHfeHadrons {
133133
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}}});
134134
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}}});
135135
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}}});
136-
registry.add("hTpcTofNSigmaVsPt", " TPC and TOF nSigma info vs pt; n#sigma; n#sigma;#it{pt} (GeV/#it{c});", {HistType::kTH3F, {{axisNSigma}, {axisNSigma}, {axisPt}}});
137-
138-
// After electron selection Information
139-
registry.add("hTofNSigmaVsPt", " TOF nSigma info vs pt; n#sigma;#it{pt} (GeV/#it{c});", {HistType::kTH2F, {{axisNSigma}, {axisPt}}});
140-
registry.add("hTpcNSigmaVsPt", " TPC nSigma info vs pt; n#sigma;#it{pt} (GeV/#it{c});", {HistType::kTH2F, {{axisNSigma}, {axisPt}}});
141136

142137
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}}});
143138
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}}});
@@ -231,17 +226,7 @@ struct HfCorrelatorHfeHadrons {
231226
if (eTrack.isEmcal() && requireEmcal) {
232227
acceptElectron = true;
233228
} else if (!eTrack.isEmcal() && !requireEmcal) {
234-
235-
registry.fill(HIST("hTpcTofNSigmaVsPt"), eTrack.tofNSigmaElTrack(), eTrack.tpcNSigmaElTrack(), eTrack.ptTrack());
236-
237-
// After electron selection Information
238-
if (std::abs(eTrack.tofNSigmaElTrack()) < tofNSigmaEl && eTrack.tpcNSigmaElTrack() > tpcNsigmaElectronMin &&
239-
eTrack.tpcNSigmaElTrack() < tpcNsigmaElectronMax) {
240-
241-
registry.fill(HIST("hTofNSigmaVsPt"), eTrack.tofNSigmaElTrack(), eTrack.ptTrack());
242-
registry.fill(HIST("hTpcNSigmaVsPt"), eTrack.tpcNSigmaElTrack(), eTrack.ptTrack());
243-
acceptElectron = true;
244-
}
229+
acceptElectron = true;
245230
}
246231

247232
if (!acceptElectron) {
@@ -251,31 +236,33 @@ struct HfCorrelatorHfeHadrons {
251236
registry.fill(HIST("hptElectron"), ptElectron);
252237
int nElectronLS = 0;
253238
int nElectronUS = 0;
254-
float massLike = 0;
255-
float massUnLike = 0;
256-
if (eTrack.nElPairLS() > 0) {
257-
for (int i = 0; i < eTrack.nElPairLS(); ++i) {
258-
massLike = eTrack.invariantMassEE();
239+
240+
auto spanLS = eTrack.lSMassEE();
241+
auto spanUS = eTrack.uLSMassEE();
242+
243+
if (!spanLS.empty()) {
244+
for (size_t i = 0; i < spanLS.size(); ++i) {
245+
float massLike = spanLS[i]; // <-- access i-th element
259246

260247
registry.fill(HIST("hLSElectronBin"), poolBin);
261248
registry.fill(HIST("hLikeMass"), massLike);
249+
registry.fill(HIST("hLikeSignPt"), eTrack.ptTrack());
262250

263251
if (massLike <= invMassEEMax) {
264252
++nElectronLS;
265-
registry.fill(HIST("hLikeSignPt"), eTrack.ptTrack());
266253
}
267254
}
268255
}
269-
if (eTrack.nElPairUS() > 0) {
270-
for (int i = 0; i < eTrack.nElPairUS(); ++i) {
271-
massUnLike = eTrack.invariantMassEE();
256+
if (!spanUS.empty()) {
257+
for (size_t i = 0; i < spanUS.size(); ++i) {
258+
float massUnLike = spanUS[i]; // <-- access i-th element
272259

273260
registry.fill(HIST("hULSElectronBin"), poolBin);
274261
registry.fill(HIST("hUnLikeMass"), massUnLike);
262+
registry.fill(HIST("hUnLikeSignPt"), eTrack.ptTrack());
275263

276264
if (massUnLike <= invMassEEMax) {
277265
++nElectronUS;
278-
registry.fill(HIST("hLikeSignPt"), eTrack.ptTrack());
279266
}
280267
}
281268
}
@@ -309,18 +296,15 @@ struct HfCorrelatorHfeHadrons {
309296
int nElHadUSCorr = 0;
310297
if (eTrack.nElPairLS() > 0) {
311298
for (int i = 0; i < eTrack.nElPairLS(); ++i) {
312-
if (eTrack.invariantMassEE() <= invMassEEMax) {
313-
++nElHadLSCorr;
314-
registry.fill(HIST("hLSEHCorrel"), ptElectron, ptHadron, deltaPhi, deltaEta);
315-
}
299+
++nElHadLSCorr;
300+
registry.fill(HIST("hLSEHCorrel"), ptElectron, ptHadron, deltaPhi, deltaEta);
316301
}
317302
}
318303
if (eTrack.nElPairUS() > 0) {
319304
for (int i = 0; i < eTrack.nElPairUS(); ++i) {
320-
if (eTrack.invariantMassEE() <= invMassEEMax) {
321-
registry.fill(HIST("hULSEHCorrel"), ptElectron, ptHadron, deltaPhi, deltaEta);
322-
++nElHadUSCorr;
323-
}
305+
306+
registry.fill(HIST("hULSEHCorrel"), ptElectron, ptHadron, deltaPhi, deltaEta);
307+
++nElHadUSCorr;
324308
}
325309
}
326310
entryElectronHadronPair(deltaPhi, deltaEta, ptElectron, ptHadron, poolBin, nElHadLSCorr, nElHadUSCorr);

PWGHF/HFL/DataModel/ElectronSelectionTable.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <Framework/AnalysisDataModel.h>
2323

2424
#include <cstdint>
25+
#include <vector>
2526

2627
namespace o2::aod
2728
{
@@ -85,7 +86,8 @@ DECLARE_SOA_COLUMN(PhiTrack, phiTrack, float); //! azimuth of th
8586
DECLARE_SOA_COLUMN(PtTrack, ptTrack, float); //! transverse momentum of the electron track
8687
DECLARE_SOA_COLUMN(TpcNSigmaElTrack, tpcNSigmaElTrack, float); //! tpcNSigma of the electron track(TPC PID)
8788
DECLARE_SOA_COLUMN(TofNSigmaElTrack, tofNSigmaElTrack, float); //! tofNSigma of the electron track(TOF PID)
88-
DECLARE_SOA_COLUMN(InvariantMassEE, invariantMassEE, float); //! invariant mass of the non-Hfelectron
89+
DECLARE_SOA_COLUMN(LSMassEE, lSMassEE, std::vector<float>); //! mass of the Like sign electron pair
90+
DECLARE_SOA_COLUMN(ULSMassEE, uLSMassEE, std::vector<float>); //! mass of UnLike sign electron pair
8991
DECLARE_SOA_COLUMN(NElPairLS, nElPairLS, int); //! Number of Like sign electron pair
9092
DECLARE_SOA_COLUMN(NElPairUS, nElPairUS, int); //! Number of UnLike sign electron pair
9193
DECLARE_SOA_COLUMN(IsEmcal, isEmcal, bool); //! electron information
@@ -99,7 +101,8 @@ DECLARE_SOA_TABLE(HfCorrSelEl, "AOD", "HfCORRSELEL", //! Electron Informations
99101
hf_corr_sel_electron::PtTrack,
100102
hf_corr_sel_electron::TpcNSigmaElTrack,
101103
hf_corr_sel_electron::TofNSigmaElTrack,
102-
hf_corr_sel_electron::InvariantMassEE,
104+
hf_corr_sel_electron::LSMassEE,
105+
hf_corr_sel_electron::ULSMassEE,
103106
hf_corr_sel_electron::NElPairLS,
104107
hf_corr_sel_electron::NElPairUS,
105108
hf_corr_sel_electron::IsEmcal);

PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#include <array>
4747
#include <cmath>
4848
#include <cstdint>
49+
#include <vector>
4950

5051
using namespace o2;
5152
using namespace o2::constants::physics;
@@ -123,6 +124,7 @@ struct HfElectronSelectionWithTpcEmcal {
123124
Configurable<float> m20EmcClusterElectronMin{"m20EmcClusterElectronMin", 0.0f, "min Electron EMCal Cluster M20"};
124125
Configurable<float> tpcNsigmaElectronMin{"tpcNsigmaElectronMin", -0.5f, "min Electron TPCnsigma"};
125126
Configurable<float> tpcNsigmaElectronMax{"tpcNsigmaElectronMax", 3.0f, "max Electron TPCnsigma"};
127+
Configurable<float> tofNSigmaEl{"tofNSigmaEl", 3.0, "Sigma cut for electrons not in EMCal"};
126128
Configurable<int> pdgCodeCharmMin{"pdgCodeCharmMin", 400, "Min Charm Hadron PdgCode"};
127129
Configurable<int> pdgCodeCharmMax{"pdgCodeCharmMax", 600, "Max Charm Hadron PdgCode"};
128130
Configurable<int> pdgCodeBeautyMin{"pdgCodeBeautyMin", 4000, "Min beauty Hadron PdgCode"};
@@ -224,6 +226,8 @@ struct HfElectronSelectionWithTpcEmcal {
224226

225227
registry.add("hPIDAfterPIDCuts", "PID Info after PID cuts; E/P;#it{p}_{T} (GeV#it{/c});n#sigma;m02; m20;", {HistType::kTHnSparseF, {{axisEoP}, {axisPt}, {axisnSigma}, {axisM02}, {axisM20}}});
226228
registry.add("hEmcClsTrkEtaPhiDiffTime", "EmcClsTrkEtaPhiDiffTime;#Delta#eta;#Delta#varphi;Sec;", {HistType::kTH3F, {{axisDeltaEta}, {axisDeltaPhi}, {axisEmcClsTime}}});
229+
registry.add("hTofNSigmaVsPt", " TOF nSigma vs pt; n#sigma;#it{pt} (GeV/#it{c});", {HistType::kTH2F, {{axisnSigma}, {axisPt}}});
230+
registry.add("hTpcNSigmaVsPt", " TPC nSigma vs pt; n#sigma;#it{pt} (GeV/#it{c});", {HistType::kTH2F, {{axisnSigma}, {axisPt}}});
227231
}
228232
// Track Selection Cut
229233
template <typename T>
@@ -292,12 +296,11 @@ struct HfElectronSelectionWithTpcEmcal {
292296
{
293297
int nElPairsLS = 0;
294298
int nElPairsUS = 0;
295-
bool isLSElectron = false;
296-
bool isULSElectron = false;
297299
float invMassElectron = 0.;
298300
float massLike = 0;
299301
float massUnLike = 0;
300-
302+
std::vector<float> vecLSMass;
303+
std::vector<float> vecULSMass;
301304
for (const auto& pTrack : tracks) {
302305
if (pTrack.globalIndex() == electron.globalIndex()) {
303306
continue;
@@ -339,10 +342,12 @@ struct HfElectronSelectionWithTpcEmcal {
339342
}
340343

341344
invMassElectron = RecoDecay::m(std::array{pTrack.pVector(), electron.pVector()}, std::array{MassElectron, MassElectron});
342-
345+
bool isLSElectron = false;
346+
bool isULSElectron = false;
343347
// for like charge
344348
if (pTrack.sign() == electron.sign()) {
345349
massLike = invMassElectron;
350+
vecLSMass.push_back(massLike);
346351
isLSElectron = true;
347352
if (isEMcal) {
348353
registry.fill(HIST("hLikeMass"), massLike);
@@ -351,6 +356,7 @@ struct HfElectronSelectionWithTpcEmcal {
351356
// for unlike charge
352357
if (pTrack.sign() != electron.sign()) {
353358
massUnLike = invMassElectron;
359+
vecULSMass.push_back(massUnLike);
354360
isULSElectron = true;
355361
if (isEMcal) {
356362
registry.fill(HIST("hUnLikeMass"), massUnLike);
@@ -375,7 +381,8 @@ struct HfElectronSelectionWithTpcEmcal {
375381
}
376382
}
377383
// Pass multiplicities and other required parameters for this electron
378-
hfElectronSelection(electron.collisionId(), electron.globalIndex(), electron.eta(), electron.phi(), electron.pt(), electron.tpcNSigmaEl(), electron.tofNSigmaEl(), invMassElectron, nElPairsLS, nElPairsUS, isEMcal);
384+
// Pass multiplicities and other required parameters for this electron
385+
hfElectronSelection(electron.collisionId(), electron.globalIndex(), electron.eta(), electron.phi(), electron.pt(), electron.tpcNSigmaEl(), electron.tofNSigmaEl(), vecLSMass, vecULSMass, nElPairsLS, nElPairsUS, isEMcal);
379386
}
380387
// Electron Identification
381388
template <bool IsMc, typename TracksType, typename EmcClusterType, typename MatchType, typename CollisionType, typename ParticleType>
@@ -525,13 +532,22 @@ struct HfElectronSelectionWithTpcEmcal {
525532

526533
nonHfe(matchTrack, tracks, true);
527534

528-
electronSel(track.collisionId(), matchTrack.globalIndex(), etaMatchTrack, phiMatchTrack, ptMatchTrack, pMatchTrack, trackRapidity, matchTrack.dcaXY(), matchTrack.dcaZ(), matchTrack.tpcNSigmaEl(), matchTrack.tofNSigmaEl(),
535+
///////////////// NonHf electron Selection without Emcal ////////////////////////
536+
electronSel(track.collisionId(), track.globalIndex(), etaTrack, phiTrack, ptTrack, pTrack, trackRapidity, dcaxyTrack, dcazTrack, track.tpcNSigmaEl(), track.tofNSigmaEl(),
529537
eMatchEmcCluster, etaMatchEmcCluster, phiMatchEmcCluster, m02MatchEmcCluster, m20MatchEmcCluster, cellEmcCluster, timeEmcCluster, deltaEtaMatch, deltaPhiMatch, isEMcal);
530538
}
531539
/// Electron information without Emcal and use TPC and TOF
532540
if (isEMcal) {
533541
continue;
534542
}
543+
if (std::abs(track.tofNSigmaEl()) > tofNSigmaEl)
544+
continue;
545+
registry.fill(HIST("hTofNSigmaVsPt"), track.tofNSigmaEl(), track.pt());
546+
registry.fill(HIST("hTpcNSigmaVsPt"), track.tpcNSigmaEl(), track.pt());
547+
548+
if ((track.tpcNSigmaEl() < tpcNsigmaElectronMin || track.tpcNSigmaEl() > tpcNsigmaElectronMax))
549+
continue;
550+
535551
nonHfe(track, tracks, false);
536552
///////////////// NonHf electron Selection without Emcal ////////////////////////
537553
electronSel(track.collisionId(), track.globalIndex(), etaTrack, phiTrack, ptTrack, pTrack, trackRapidity, dcaxyTrack, dcazTrack, track.tpcNSigmaEl(), track.tofNSigmaEl(),

0 commit comments

Comments
 (0)