Skip to content

Commit 3d6781a

Browse files
rashigupthkoley
andauthored
PWGHF/HFL: Add 2DHistogram in electronselection table and correct electron trackid in HFelectron correlationtask (#7751)
Co-authored-by: Hirak Koley <hirak.koley@gmail.com> Co-authored-by: Hirak Koley <hirak.kumar.koley@cern.ch>
1 parent 28e04f2 commit 3d6781a

2 files changed

Lines changed: 105 additions & 35 deletions

File tree

PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,19 @@ struct HfCorrelatorHfeHadrons {
124124
ptElectron = eTrack.ptTrack();
125125
phiElectron = eTrack.phiTrack();
126126
etaElectron = eTrack.etaTrack();
127+
127128
double deltaPhi = -999;
128129
double deltaEta = -999;
129130
double ptHadron = -999;
130131
double etaHadron = -999;
131132
double phiHadron = -999;
133+
132134
if (!eTrack.isEmcal())
133135
continue;
134136

135137
registry.fill(HIST("hptElectron"), ptElectron);
136138
for (const auto& hTrack : tracks) {
137-
138-
if (hTrack.globalIndex() == eTrack.globalIndex())
139+
if (hTrack.globalIndex() == eTrack.trackId())
139140
continue;
140141
// Apply Hadron cut
141142
if (!selAssoHadron(hTrack))

PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx

Lines changed: 102 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,39 @@ using namespace o2::framework;
4040
using namespace o2::framework::expressions;
4141
using namespace o2::soa;
4242

43+
const int etaAxisBins = 100;
44+
const float trackEtaAxisMin = -1.5;
45+
const float trackEtaAxisMax = 1.5;
46+
const int phiAxisBins = 100;
47+
const float trackPhiAxisMin = 0.;
48+
const float trackPhiAxisMax = o2::constants::math::TwoPI;
49+
const int passEMCalBins = 3;
50+
const int passEMCalAxisMin = 0.;
51+
const int passEMCalAxisMax = 3;
52+
const int eopAxisBins = 60;
53+
const float eopAxisMin = 0.;
54+
const float eopAxisMax = 3.0;
55+
const int pAxisBins = 500;
56+
const float pAxisMin = 0.;
57+
const float pAxisMax = 50.0;
58+
const int m02AxisBins = 100;
59+
const float m02AxisMin = 0.;
60+
const float m02AxisMax = 2.0;
61+
const int m20AxisBins = 100;
62+
const float m20AxisMin = 0.;
63+
const float m20AxisMax = 2.0;
64+
const int nSigmaAxisBins = 300;
65+
const float nSigmaAxisMin = -15.;
66+
const float nSigmaAxisMax = 15.;
67+
const int dEdxAxisBins = 480;
68+
const float dEdxAxisMin = 0.;
69+
const float dEdxAxisMax = 160.;
4370
struct HfElectronSelectionWithTpcEmcal {
4471

4572
Produces<aod::HfSelEl> electronSel;
4673
// Configurables
4774
// EMCal Cluster information
75+
4876
Configurable<bool> fillEmcClusterInfo{"fillEmcClusterInfo", true, "Fill histograms with EMCal cluster info before and after track match"};
4977

5078
// Event Selection
@@ -113,34 +141,55 @@ struct HfElectronSelectionWithTpcEmcal {
113141
Filter CollisionFilter = nabs(aod::collision::posZ) < zPvPosMax && aod::collision::numContrib > (uint16_t)1;
114142
PresliceUnsorted<o2::aod::EMCALMatchedTracks> perClusterMatchedTracks = o2::aod::emcalmatchedtrack::trackId;
115143

116-
HistogramConfigSpec hEmcClusterInfoSpec{HistType::kTHnSparseD, {{300, 0.0, 30.0}, {100, -0.9, 0.9}, {200, 0, 6.3}, {50, 0, 50}, {1800, -900, 900}}};
117-
HistogramConfigSpec hDeltaPhiDeltaEtaEmcClusterTrackSpecEnergy{HistType::kTHnSparseD, {{400, -0.2, 0.2}, {400, -0.2, 0.2}, {600, -300, 300}, {300, 0.0, 30.0}}};
118-
HistogramConfigSpec hPIDSpec{HistType::kTHnSparseD, {{60, 0, 3}, {500, 0.0, 50.0}, {500, 0., 50.}, {300, -15, 15}, {300, 0.0, 30.0}, {400, 0, 2}, {400, 0, 2}}};
119-
HistogramConfigSpec hTrackAllInfoSpec{HistType::kTHnSparseD, {{480, 0, 160}, {300, -15, 15}, {500, 0., 50.}, {500, 0., 50.}, {100, -1.5, 1.5}, {100, 0, 7}, {3, 0, 3}}};
120-
HistogramConfigSpec hTrackInfoSpec{HistType::kTHnSparseD, {{60, 0, 3}, {480, 0, 160}, {300, -15, 15}, {500, 0., 50.}, {500, 0., 50.}, {100, -1.5, 1.5}, {100, 0, 7}}};
144+
HistogramConfigSpec hEmcClusterEnergySpec{HistType::kTH1F, {{300, 0.0, 30.0}}};
145+
HistogramConfigSpec hEmcClusterEtaPhiSpec{HistType::kTH2F, {{100, -0.9, 0.9}, {200, 0, 6.3}}};
146+
HistogramConfigSpec hEmcClusterEnergyCellSpec{HistType::kTH2F, {{400, 0.0, 30.0}, {50, 0, 50}}};
147+
HistogramConfigSpec hEmcClusterEnergyTimeSpec{HistType::kTH2F, {{300, 0.0, 30.0}, {1800, -900, 900}}};
148+
149+
HistogramConfigSpec hDeltaPhiDeltaEtaEmcClusterTrackSpecEnergy{HistType::kTH3F, {{400, -0.2, 0.2}, {400, -0.2, 0.2}, {600, -300, 300}}};
150+
HistogramConfigSpec hAfterMatchEoPSigamSpec{HistType::kTHnSparseD, {{eopAxisBins, eopAxisMin, eopAxisMax}, {pAxisBins, pAxisMin, pAxisMax}, {nSigmaAxisBins, nSigmaAxisMin, nSigmaAxisMax}, {m02AxisBins, m02AxisMin, m02AxisMax}, {m20AxisBins, m20AxisMin, m20AxisMax}}};
151+
152+
HistogramConfigSpec hTrackEnergyLossSpec{HistType::kTH3F, {{dEdxAxisBins, dEdxAxisMin, dEdxAxisMax}, {pAxisBins, pAxisMin, pAxisMax}, {passEMCalBins, passEMCalAxisMin, passEMCalAxisMax}}};
153+
154+
HistogramConfigSpec hTracknSigmaSpec{HistType::kTH3F, {{nSigmaAxisBins, nSigmaAxisMin, nSigmaAxisMax}, {pAxisBins, pAxisMin, pAxisMax}, {passEMCalBins, passEMCalAxisMin, passEMCalAxisMax}}};
121155

122156
HistogramRegistry registry{
123157
"registry",
124158
{{"hNevents", "No of events", {HistType::kTH1F, {{3, 1, 4}}}},
125159
{"hZvertex", "z vertex", {HistType::kTH1F, {{100, -100, 100}}}},
126-
{"hTrackInformation", "Sparse TPC info; dE/dx;n#sigma;#it{p} (GeV#it{/c});#it{p}_{T} (GeV#it{/c});#eta;#varphi;passEMcal;", hTrackAllInfoSpec},
127-
{"hEmcClusterInformationBefore", "EMCal Cluster Info before match; Energy (GeV);#eta;#varphi", hEmcClusterInfoSpec},
128-
{"hEmcClusterInformationAfter", "EMCal Cluster Info after match; Energy (GeV);#eta;#varphi", hEmcClusterInfoSpec},
129-
{"hPIDafterMatch", "PID Info after match; E/P; dE/dx;n#sigma;#it{p} (GeV#it{/c});#it{p}_{T} (GeV#it{/c});#eta;#varphi;", hTrackInfoSpec},
130-
{"hEPRatioafterPID", "E/P Ratio after PID Cuts apply only trackwodca filter", {HistType::kTH2F, {{60, 0, 3}, {100, 0, 10}}}},
131-
{"hPIDafterPIDcuts", "PID Info after PID cuts; E/P; #it{p} (GeV#it{/c});#it{p}_{T} (GeV#it{/c});n_{#sigma}^{e};GeV;M02;M20", hPIDSpec},
132-
{"hEmcClsTrkEtaPhiDiffTimeEnergy", "EmcClsTrkEtaPhiDiffTimeEnergy;#Delta#eta;#Delta#varphi;Sec; Energy (GeV)", hDeltaPhiDeltaEtaEmcClusterTrackSpecEnergy}}};
133-
134-
void init(InitContext&)
160+
{"hEmcClusterM02", "m02", {HistType::kTH1F, {{m02AxisBins, m02AxisMin, m02AxisMax}}}},
161+
{"hEmcClusterM20", "m20", {HistType::kTH1F, {{m20AxisBins, m20AxisMin, m20AxisMax}}}},
162+
{"hTrackEtaPhi", "TPC EtaPhi Info; #eta;#varphi;passEMcal;", {HistType::kTH3F, {{etaAxisBins, trackEtaAxisMin, trackEtaAxisMax}, {phiAxisBins, trackPhiAxisMin, trackPhiAxisMax}, {passEMCalBins, passEMCalAxisMin, passEMCalAxisMax}}}},
163+
{"hTrackEnergyLossVsP", " TPC Energy loss info vs P; dE/dx;#it{p} (GeV#it{/c});passEMcal;", hTrackEnergyLossSpec},
164+
{"hTrackEnergyLossVsPt", " TPC Energy loss info vs Pt; dE/dx;#it{p}_{T} (GeV#it{/c});passEMcal;", hTrackEnergyLossSpec},
165+
{"hTracknSigmaVsP", " TPC nSigma info vs P; n#sigma;#it{p} (GeV#it{/c});passEMcal;", hTracknSigmaSpec},
166+
{"hTracknSigmaVsPt", " TPC nSigma info vs Pt; n#sigma;#it{p}_{T} (GeV#it{/c});passEMcal;", hTracknSigmaSpec},
167+
{"hEmcClusterEnergy", "EMCal Cluster Info before match Energy; Energy (GeV)", hEmcClusterEnergySpec},
168+
{"hEmcClusterEtaPhi", "EMCal Cluster Info before match Eta and Phi; #eta;#varphi;", hEmcClusterEtaPhiSpec},
169+
{"hEmcClusterEnergyCell", "EMCal Cluster Info before match Energy vs nCells; Energy (GeV);ncell;", hEmcClusterEnergyCellSpec},
170+
{"hEmcClusterEnergyTime", "EMCal Cluster Info before match Energy vs time; Energy (GeV); sec;", hEmcClusterEnergyTimeSpec},
171+
{"hEmcClusterAfterMatchEnergy", "EMCal Cluster Info After match Energy; Energy (GeV)", hEmcClusterEnergySpec},
172+
{"hEmcClusterAfterMatchEtaPhi", "EMCal Cluster Info After match Eta and Phi; #eta;#varphi;", hEmcClusterEtaPhiSpec},
173+
{"hEmcClusterAfterMatchEnergyCells", "EMCal Cluster Info After match Energy vs nCells; Energy (GeV);ncell;", hEmcClusterEnergyCellSpec},
174+
{"hEmcClusterAfterMatchEnergyTime", "EMCal Cluster Info After match Energy vs time; Energy (GeV); sec;", hEmcClusterEnergyTimeSpec},
175+
176+
{"hAfterMatchSigmaVsEoP", "PID Info after match EoP vs Sigma ; E/P;#it{p}_{T} (GeV#it{/c});n#sigma; m02; m20;", hAfterMatchEoPSigamSpec},
177+
{"hAfterMatchEoPVsP", "PID Info after match EoP vs P; E/P;#it{p} (GeV#it{/c});", {HistType::kTH2F, {{eopAxisBins, eopAxisMin, eopAxisMax}, {pAxisBins, pAxisMin, pAxisMax}}}},
178+
{"hAfterMatchSigmaVsP", "PID Info after match Sigma vs Momentum ; n#sigma; #it{p} (GeV#it{/c}; ", {HistType::kTH2F, {{nSigmaAxisBins, nSigmaAxisMin, nSigmaAxisMax}, {pAxisBins, pAxisMin, pAxisMax}}}},
179+
{"hAfterMatchEtaPhi", "PID Info after match Eta vs Phi ; #eta; #varphi; ", {HistType::kTH2F, {{etaAxisBins, trackEtaAxisMin, trackEtaAxisMax}, {phiAxisBins, trackPhiAxisMin, trackPhiAxisMax}}}},
180+
{"hAfterMatchEnergyLossVsP", "PID Info after match Energy loss info vs P ; dE/dx;#it{p} (GeV#it{/c});; ", {HistType::kTH2F, {{dEdxAxisBins, dEdxAxisMin, dEdxAxisMax}, {pAxisBins, pAxisMin, pAxisMax}}}},
181+
{"hAfterMatchEnergyLossVsPt", "PID Info after match Energy loss info vs Pt ;dE/dx;#it{p}_{T} (GeV#it{/c}); ", {HistType::kTH2F, {{dEdxAxisBins, dEdxAxisMin, dEdxAxisMax}, {pAxisBins, pAxisMin, pAxisMax}}}},
182+
183+
{"hAfterPIDEtaPhi", "PID Info after PID Cuts Eta vs Phi ; #eta; #varphi; ", {HistType::kTH2F, {{etaAxisBins, trackEtaAxisMin, trackEtaAxisMax}, {phiAxisBins, trackPhiAxisMin, trackPhiAxisMax}}}},
184+
{"hEPRatioAfterPID", "E/P Ratio after PID Cuts apply only trackwodca filter", {HistType::kTH2F, {{pAxisBins, pAxisMin, pAxisMax}, {300, 0, 30}}}},
185+
{"hPIDAfterPIDCuts", "PID Info after PID cuts; E/P;#it{p}_{T} (GeV#it{/c});n#sigma;m02; m20;", hAfterMatchEoPSigamSpec},
186+
{"hEmcClsTrkEtaPhiDiffTimeEnergy", "EmcClsTrkEtaPhiDiffTimeEnergy;#Delta#eta;#Delta#varphi;Sec;", hDeltaPhiDeltaEtaEmcClusterTrackSpecEnergy}}};
187+
188+
void init(o2::framework::InitContext&)
135189
{
136-
registry.get<THnSparse>(HIST("hTrackInformation"))->Sumw2();
137-
registry.get<THnSparse>(HIST("hEmcClusterInformationBefore"))->Sumw2();
138-
registry.get<THnSparse>(HIST("hEmcClusterInformationAfter"))->Sumw2();
139-
registry.get<THnSparse>(HIST("hPIDafterMatch"))->Sumw2();
140-
registry.get<THnSparse>(HIST("hPIDafterPIDcuts"))->Sumw2();
141-
registry.get<THnSparse>(HIST("hEmcClsTrkEtaPhiDiffTimeEnergy"))->Sumw2();
190+
registry.get<THnSparse>(HIST("hAfterMatchSigmaVsEoP"))->Sumw2();
191+
registry.get<THnSparse>(HIST("hPIDAfterPIDCuts"))->Sumw2();
142192
}
143-
144193
// Track Selection Cut
145194
template <typename T>
146195
bool selTracks(T const& track)
@@ -178,7 +227,12 @@ struct HfElectronSelectionWithTpcEmcal {
178227
///////////////////////////////
179228
if (fillEmcClusterInfo) {
180229
for (const auto& emcClusterBefore : emcClusters) {
181-
registry.fill(HIST("hEmcClusterInformationBefore"), emcClusterBefore.energy(), emcClusterBefore.eta(), emcClusterBefore.phi(), emcClusterBefore.nCells(), emcClusterBefore.time());
230+
registry.fill(HIST("hEmcClusterEnergy"), emcClusterBefore.energy()); // track etaphi infor after filter bit
231+
registry.fill(HIST("hEmcClusterEtaPhi"), emcClusterBefore.eta(), emcClusterBefore.phi()); // track etaphi infor after filter bit
232+
registry.fill(HIST("hEmcClusterEnergyCell"), emcClusterBefore.energy(), emcClusterBefore.nCells()); // track etaphi infor after filter bit
233+
registry.fill(HIST("hEmcClusterEnergyTime"), emcClusterBefore.energy(), emcClusterBefore.time()); // track etaphi infor after filter bit
234+
registry.fill(HIST("hEmcClusterM02"), emcClusterBefore.m02());
235+
registry.fill(HIST("hEmcClusterM20"), emcClusterBefore.m20());
182236
}
183237
}
184238
int passEMCal;
@@ -189,17 +243,16 @@ struct HfElectronSelectionWithTpcEmcal {
189243
float dcaxyTrack = -999;
190244
float dcazTrack = -999;
191245
float tpcNsigmaTrack = -999;
192-
246+
int electronId = -999;
193247
for (const auto& track : tracks) {
194-
195248
phiTrack = track.phi();
196249
etaTrack = track.eta();
197250
pTrack = track.p();
198251
ptTrack = track.pt();
199252
dcaxyTrack = track.dcaXY();
200253
dcazTrack = track.dcaZ();
201254
tpcNsigmaTrack = track.tpcNSigmaEl();
202-
255+
electronId = track.globalIndex();
203256
// Apply Track Selection
204257
if (!selTracks(track)) {
205258
continue;
@@ -211,7 +264,11 @@ struct HfElectronSelectionWithTpcEmcal {
211264
if ((phiTrack > phiTrackDCalMin && phiTrack < phiTrackDCalMax) && ((etaTrack > etaTrackDCalPositiveMin && etaTrack < etaTrackDCalPositiveMax) || (etaTrack > etaTrackDCalNegativeMin && etaTrack < etaTrackDCalNegativeMax)))
212265
passEMCal = 2; // Dcal acceptance passed
213266

214-
registry.fill(HIST("hTrackInformation"), track.tpcSignal(), tpcNsigmaTrack, pTrack, ptTrack, etaTrack, phiTrack, passEMCal); // track infor after filter bit
267+
registry.fill(HIST("hTrackEtaPhi"), etaTrack, phiTrack, passEMCal); // track etaphi infor after filter bit
268+
registry.fill(HIST("hTrackEnergyLossVsP"), track.tpcSignal(), pTrack, passEMCal); // track etaphi infor after filter bit
269+
registry.fill(HIST("hTrackEnergyLossVsPt"), track.tpcSignal(), ptTrack, passEMCal); // track etaphi infor after filter bit
270+
registry.fill(HIST("hTracknSigmaVsP"), tpcNsigmaTrack, pTrack, passEMCal); // track etaphi infor after filter bit
271+
registry.fill(HIST("hTracknSigmaVsPt"), tpcNsigmaTrack, ptTrack, passEMCal); // track etaphi infor after filter bit
215272

216273
auto tracksofcluster = matchedTracks.sliceBy(perClusterMatchedTracks, track.globalIndex());
217274
float phiMatchTrack = -999;
@@ -273,12 +330,22 @@ struct HfElectronSelectionWithTpcEmcal {
273330
}
274331
}
275332

276-
registry.fill(HIST("hEmcClsTrkEtaPhiDiffTimeEnergy"), deltaEtaMatch, deltaPhiMatch, timeEmcCluster, eMatchEmcCluster);
333+
registry.fill(HIST("hEmcClsTrkEtaPhiDiffTimeEnergy"), deltaEtaMatch, deltaPhiMatch, timeEmcCluster);
277334

278335
if (fillEmcClusterInfo)
279-
registry.fill(HIST("hEmcClusterInformationAfter"), eMatchEmcCluster, etaMatchEmcCluster, phiMatchEmcCluster, cellEmcCluster, timeEmcCluster);
336+
registry.fill(HIST("hEmcClusterAfterMatchEnergy"), emcCluster.energy()); // track etaphi infor after filter bit
337+
registry.fill(HIST("hEmcClusterAfterMatchEtaPhi"), emcCluster.eta(), emcCluster.phi()); // track etaphi infor after filter bit
338+
registry.fill(HIST("hEmcClusterAfterMatchEnergyCells"), emcCluster.energy(), emcCluster.nCells()); // track etaphi infor after filter bit
339+
registry.fill(HIST("hEmcClusterAfterMatchEnergyTime"), emcCluster.energy(), emcCluster.time()); // track etaphi infor after filter bit
340+
280341
eop = eMatchEmcCluster / pMatchTrack;
281-
registry.fill(HIST("hPIDafterMatch"), eop, matchTrack.tpcSignal(), tpcNsigmaMatchTrack, pMatchTrack, ptMatchTrack, etaMatchTrack, phiMatchTrack);
342+
343+
registry.fill(HIST("hAfterMatchSigmaVsEoP"), eop, ptMatchTrack, tpcNsigmaMatchTrack, m02MatchEmcCluster, m20MatchEmcCluster);
344+
registry.fill(HIST("hAfterMatchEoPVsP"), eop, pMatchTrack);
345+
registry.fill(HIST("hAfterMatchSigmaVsP"), tpcNsigmaMatchTrack, pMatchTrack);
346+
registry.fill(HIST("hAfterMatchEtaPhi"), etaMatchTrack, phiMatchTrack);
347+
registry.fill(HIST("hAfterMatchEnergyLossVsP"), matchTrack.tpcSignal(), pMatchTrack);
348+
registry.fill(HIST("hAfterMatchEnergyLossVsPt"), matchTrack.tpcSignal(), ptMatchTrack);
282349

283350
// Apply Electron Identification cuts
284351
if constexpr (!isMc) {
@@ -291,22 +358,24 @@ struct HfElectronSelectionWithTpcEmcal {
291358
}
292359
}
293360

294-
registry.fill(HIST("hEPRatioafterPID"), eop, ptMatchTrack);
361+
registry.fill(HIST("hPIDAfterPIDCuts"), eop, ptMatchTrack, tpcNsigmaMatchTrack, m02MatchEmcCluster, m20MatchEmcCluster);
362+
registry.fill(HIST("hEPRatioAfterPID"), pMatchTrack, eMatchEmcCluster);
363+
registry.fill(HIST("hAfterPIDEtaPhi"), etaMatchTrack, phiMatchTrack);
295364
if (eop < eopElectronMin || eop > eopElectronMax) {
296365
continue;
297366
}
298-
registry.fill(HIST("hPIDafterPIDcuts"), eop, pMatchTrack, ptMatchTrack, tpcNsigmaMatchTrack, eMatchEmcCluster, m02MatchEmcCluster, m20MatchEmcCluster);
299367

300368
isEMcal = true;
301-
electronSel(matchTrack.collisionId(), matchTrack.globalIndex(), etaMatchTrack, phiMatchTrack, ptMatchTrack, pMatchTrack, trackRapidity, matchTrack.dcaXY(), matchTrack.dcaZ(), matchTrack.tpcNSigmaEl(), matchTrack.tofNSigmaEl(),
369+
std::cout << " electron id in selection" << electronId << std::endl;
370+
electronSel(matchTrack.collisionId(), electronId, etaMatchTrack, phiMatchTrack, ptMatchTrack, pMatchTrack, trackRapidity, matchTrack.dcaXY(), matchTrack.dcaZ(), matchTrack.tpcNSigmaEl(), matchTrack.tofNSigmaEl(),
302371
eMatchEmcCluster, etaMatchEmcCluster, phiMatchEmcCluster, m02MatchEmcCluster, m20MatchEmcCluster, cellEmcCluster, timeEmcCluster, deltaEtaMatch, deltaPhiMatch, isEMcal);
303372
}
304373

305374
/// Electron information without Emcal and use TPC and TOF
306375
if (isEMcal) {
307376
continue;
308377
}
309-
electronSel(track.collisionId(), track.globalIndex(), etaTrack, phiTrack, ptTrack, pTrack, trackRapidity, dcaxyTrack, dcazTrack, track.tpcNSigmaEl(), track.tofNSigmaEl(),
378+
electronSel(track.collisionId(), electronId, etaTrack, phiTrack, ptTrack, pTrack, trackRapidity, dcaxyTrack, dcazTrack, track.tpcNSigmaEl(), track.tofNSigmaEl(),
310379
eMatchEmcCluster, etaMatchEmcCluster, phiMatchEmcCluster, m02MatchEmcCluster, m20MatchEmcCluster, cellEmcCluster, timeEmcCluster, deltaEtaMatch, deltaPhiMatch, isEMcal);
311380
}
312381
}

0 commit comments

Comments
 (0)