Skip to content

Commit d62fd16

Browse files
authored
[PWGHF] Add MC species templates for eID in taskSingleElectron (#17920)
1 parent 50f944a commit d62fd16

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

PWGHF/HFL/Tasks/taskSingleElectron.cxx

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,18 @@ struct HfTaskSingleElectron {
171171
histos.add("hTpcNSigPtAfterTofCut", "", kTH2D, {{axisPtEl}, {axisNsig}});
172172
histos.add("hTpcNSigPtQA", "", kTH2D, {{axisPtEl}, {axisNsig}});
173173

174+
// TPC nSigma(e) vs pT per MC truth species (electron, pion, kaon, proton, other), after the track selection and after the TOF electron selection
175+
histos.add("hTpcNSigPtRecElectron", "MC truth e^{#pm} after track selection;#it{p}_{T} (GeV/#it{c});n#sigma_{e}^{TPC}", kTH2D, {{axisPtEl}, {axisNsig}});
176+
histos.add("hTpcNSigPtRecPion", "MC truth #pi^{#pm} after track selection;#it{p}_{T} (GeV/#it{c});n#sigma_{e}^{TPC}", kTH2D, {{axisPtEl}, {axisNsig}});
177+
histos.add("hTpcNSigPtRecKaon", "MC truth K^{#pm} after track selection;#it{p}_{T} (GeV/#it{c});n#sigma_{e}^{TPC}", kTH2D, {{axisPtEl}, {axisNsig}});
178+
histos.add("hTpcNSigPtRecProton", "MC truth p after track selection;#it{p}_{T} (GeV/#it{c});n#sigma_{e}^{TPC}", kTH2D, {{axisPtEl}, {axisNsig}});
179+
histos.add("hTpcNSigPtRecOther", "MC truth other after track selection;#it{p}_{T} (GeV/#it{c});n#sigma_{e}^{TPC}", kTH2D, {{axisPtEl}, {axisNsig}});
180+
histos.add("hTpcNSigPtAfterTofCutRecElectron", "MC truth e^{#pm} after TOF selection;#it{p}_{T} (GeV/#it{c});n#sigma_{e}^{TPC}", kTH2D, {{axisPtEl}, {axisNsig}});
181+
histos.add("hTpcNSigPtAfterTofCutRecPion", "MC truth #pi^{#pm} after TOF selection;#it{p}_{T} (GeV/#it{c});n#sigma_{e}^{TPC}", kTH2D, {{axisPtEl}, {axisNsig}});
182+
histos.add("hTpcNSigPtAfterTofCutRecKaon", "MC truth K^{#pm} after TOF selection;#it{p}_{T} (GeV/#it{c});n#sigma_{e}^{TPC}", kTH2D, {{axisPtEl}, {axisNsig}});
183+
histos.add("hTpcNSigPtAfterTofCutRecProton", "MC truth p after TOF selection;#it{p}_{T} (GeV/#it{c});n#sigma_{e}^{TPC}", kTH2D, {{axisPtEl}, {axisNsig}});
184+
histos.add("hTpcNSigPtAfterTofCutRecOther", "MC truth other after TOF selection;#it{p}_{T} (GeV/#it{c});n#sigma_{e}^{TPC}", kTH2D, {{axisPtEl}, {axisNsig}});
185+
174186
// track impact parameter
175187
histos.add("hDcaTrack", "", kTH2D, {{axisPtEl}, {axisTrackIp}});
176188
histos.add("hDcaBeauty", "", kTH2D, {{axisPtEl}, {axisTrackIp}});
@@ -205,6 +217,42 @@ struct HfTaskSingleElectron {
205217
histos.fill(HIST("hPtDcaZPreCut"), pt, track.dcaZ());
206218
}
207219

220+
template <typename TrackType>
221+
void fillTpcNSigPtRec(const TrackType& track, bool afterTofCut)
222+
{
223+
if (!track.has_mcParticle()) {
224+
return;
225+
}
226+
double const pt = track.pt();
227+
double const nSigmaEl = track.tpcNSigmaEl();
228+
int const absPdg = std::abs(track.mcParticle().pdgCode());
229+
if (!afterTofCut) {
230+
if (absPdg == kElectron) {
231+
histos.fill(HIST("hTpcNSigPtRecElectron"), pt, nSigmaEl);
232+
} else if (absPdg == kPiPlus) {
233+
histos.fill(HIST("hTpcNSigPtRecPion"), pt, nSigmaEl);
234+
} else if (absPdg == kKPlus) {
235+
histos.fill(HIST("hTpcNSigPtRecKaon"), pt, nSigmaEl);
236+
} else if (absPdg == kProton) {
237+
histos.fill(HIST("hTpcNSigPtRecProton"), pt, nSigmaEl);
238+
} else {
239+
histos.fill(HIST("hTpcNSigPtRecOther"), pt, nSigmaEl);
240+
}
241+
return;
242+
}
243+
if (absPdg == kElectron) {
244+
histos.fill(HIST("hTpcNSigPtAfterTofCutRecElectron"), pt, nSigmaEl);
245+
} else if (absPdg == kPiPlus) {
246+
histos.fill(HIST("hTpcNSigPtAfterTofCutRecPion"), pt, nSigmaEl);
247+
} else if (absPdg == kKPlus) {
248+
histos.fill(HIST("hTpcNSigPtAfterTofCutRecKaon"), pt, nSigmaEl);
249+
} else if (absPdg == kProton) {
250+
histos.fill(HIST("hTpcNSigPtAfterTofCutRecProton"), pt, nSigmaEl);
251+
} else {
252+
histos.fill(HIST("hTpcNSigPtAfterTofCutRecOther"), pt, nSigmaEl);
253+
}
254+
}
255+
208256
template <typename TrackType>
209257
bool trackSel(const TrackType& track)
210258
{
@@ -566,6 +614,7 @@ struct HfTaskSingleElectron {
566614

567615
histos.fill(HIST("hTofNSigPt"), track.pt(), track.tofNSigmaEl());
568616
histos.fill(HIST("hTpcNSigPt"), track.pt(), track.tpcNSigmaEl());
617+
fillTpcNSigPtRec(track, false);
569618

570619
int mpdg{}; // electron source pdg code
571620
double mpt{}; // electron source pt
@@ -599,6 +648,7 @@ struct HfTaskSingleElectron {
599648
}
600649
histos.fill(HIST("hTofNSigPtQA"), track.pt(), track.tofNSigmaEl());
601650
histos.fill(HIST("hTpcNSigPtAfterTofCut"), track.pt(), track.tpcNSigmaEl());
651+
fillTpcNSigPtRec(track, true);
602652

603653
if (track.tpcNSigmaEl() < nSigmaTpcMin || track.tpcNSigmaEl() > nSigmaTpcMax) {
604654
continue;

0 commit comments

Comments
 (0)