Skip to content

Commit eab96a3

Browse files
committed
Add track QA histograms and fix naming bug
1 parent bdcb675 commit eab96a3

1 file changed

Lines changed: 61 additions & 12 deletions

File tree

PWGHF/HFL/Tasks/taskSingleElectron.cxx

Lines changed: 61 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,15 @@ struct HfTaskSingleElectron {
8282
Configurable<float> ptTrackMin{"ptTrackMin", 0.5, "min pt cut"};
8383
Configurable<float> etaTrackMax{"etaTrackMax", 0.8, "eta cut"};
8484
Configurable<int> nCrossedRowTpcMin{"nCrossedRowTpcMin", 70, "min # of TPC n cluster crossed rows"};
85-
Configurable<float> nClsFoundOverFindableTpcMin{"nClsFoundOverFindableTpcMin", 0.8, "min # of TPC found/findable clusters"};
85+
Configurable<float> nCrossedRowsOverFindableClsTpcMin{"nCrossedRowsOverFindableClsTpcMin", 0.8, "min ratio of TPC crossed rows over findable clusters"};
8686
Configurable<float> chi2PerNClTpcMax{"chi2PerNClTpcMax", 4., "max # of tpc chi2 per clusters"};
8787
Configurable<int> clsIbItsMin{"clsIbItsMin", 3, "min # of its clusters in IB"};
8888
Configurable<float> chi2PerNClItsMax{"chi2PerNClItsMax", 6., "min # of its chi2 per clusters"};
8989
Configurable<float> dcaxyMax{"dcaxyMax", 1., "max of track dca in xy"};
9090
Configurable<float> dcazMax{"dcazMax", 2., "max of track dca in z"};
91+
Configurable<int> nClsTpcMin{"nClsTpcMin", 0, "min # of found TPC clusters"};
92+
Configurable<int> nClsItsMin{"nClsItsMin", 0, "min # of total ITS clusters"};
93+
Configurable<bool> requireItsTpcRefit{"requireItsTpcRefit", true, "require ITS and TPC refit"};
9194
Configurable<float> nSigmaTofMax{"nSigmaTofMax", 3., "max of tof nsigma"};
9295
Configurable<float> nSigmaTpcMin{"nSigmaTpcMin", -1., "min of tpc nsigma"};
9396
Configurable<float> nSigmaTpcMax{"nSigmaTpcMax", 3., "max of tpc nsigma"};
@@ -104,7 +107,7 @@ struct HfTaskSingleElectron {
104107
// using declarations
105108
using MyCollisions = soa::Join<aod::Collisions, aod::EvSels>;
106109
using TracksEl = soa::Join<aod::Tracks, aod::TrackSelection, aod::TrackSelectionExtension, aod::TracksExtra, aod::TracksDCA, aod::pidTOFFullEl, aod::pidTPCFullEl>;
107-
using McTracksEl = soa::Join<aod::Tracks, aod::TrackExtra, aod::TracksDCA, aod::pidTOFFullEl, aod::pidTPCFullEl, aod::McTrackLabels>;
110+
using McTracksEl = soa::Join<aod::Tracks, aod::TrackSelection, aod::TrackSelectionExtension, aod::TrackExtra, aod::TracksDCA, aod::pidTOFFullEl, aod::pidTPCFullEl, aod::McTrackLabels>;
108111

109112
// Filter
110113
Filter collZFilter = nabs(aod::collision::posZ) < posZMax;
@@ -137,13 +140,28 @@ struct HfTaskSingleElectron {
137140

138141
// QA plots for trigger track selection
139142
histos.add("hNClsTpcTrack", "hNClsTpcTrack", kTH1D, {{200, 0, 200}});
140-
histos.add("hNClsFoundFindableTpcTrack", "", kTH1D, {{10, 0, 1}});
143+
histos.add("hCrossedRowsOverFindableTpcTrack", "", kTH1D, {{200, 0, 2}});
141144
histos.add("hChi2TpcTrack", "", kTH1D, {{100, 0, 10}});
142145
histos.add("hIbClsItsTrack", "", kTH1D, {{10, 0, 10}});
143146
histos.add("hChi2ItsTrack", "", kTH1D, {{50, 0, 50}});
144147
histos.add("hDcaXYTrack", "", kTH1D, {{600, -3, 3}});
145148
histos.add("hDcaZTrack", "", kTH1D, {{600, -3, 3}});
146149

150+
// QA of track-selection variables before any track cut, differential in pT (binning follows DPG qaEventTrack)
151+
histos.add("hPtEtaPreCut", "before track selection;#it{p}_{T} (GeV/#it{c});#eta", kTH2D, {{axisPtEl}, {40, -1., 1.}});
152+
histos.add("hPtCrossedRowsTpcPreCut", "before track selection;#it{p}_{T} (GeV/#it{c});TPC crossed rows", kTH2D, {{axisPtEl}, {165, -0.5, 164.5}});
153+
histos.add("hPtCrossedRowsOverFindableTpcPreCut", "before track selection;#it{p}_{T} (GeV/#it{c});TPC crossed rows / findable clusters", kTH2D, {{axisPtEl}, {200, 0., 2.}});
154+
histos.add("hPtNClsFoundTpcPreCut", "before track selection;#it{p}_{T} (GeV/#it{c});TPC found clusters", kTH2D, {{axisPtEl}, {165, -0.5, 164.5}});
155+
histos.add("hPtNClsFindableTpcPreCut", "before track selection;#it{p}_{T} (GeV/#it{c});TPC findable clusters", kTH2D, {{axisPtEl}, {165, -0.5, 164.5}});
156+
histos.add("hPtFoundOverFindableTpcPreCut", "before track selection;#it{p}_{T} (GeV/#it{c});TPC found / findable clusters", kTH2D, {{axisPtEl}, {200, 0., 2.}});
157+
histos.add("hPtFracSharedClsTpcPreCut", "before track selection;#it{p}_{T} (GeV/#it{c});fraction of shared TPC clusters", kTH2D, {{axisPtEl}, {100, 0., 1.}});
158+
histos.add("hPtChi2TpcPreCut", "before track selection;#it{p}_{T} (GeV/#it{c});#chi^{2} / cluster TPC", kTH2D, {{axisPtEl}, {100, 0., 10.}});
159+
histos.add("hPtNClsItsPreCut", "before track selection;#it{p}_{T} (GeV/#it{c});# clusters ITS", kTH2D, {{axisPtEl}, {8, -0.5, 7.5}});
160+
histos.add("hPtIbClsItsPreCut", "before track selection;#it{p}_{T} (GeV/#it{c});# clusters ITS inner barrel", kTH2D, {{axisPtEl}, {4, -0.5, 3.5}});
161+
histos.add("hPtChi2ItsPreCut", "before track selection;#it{p}_{T} (GeV/#it{c});#chi^{2} / cluster ITS", kTH2D, {{axisPtEl}, {100, 0., 40.}});
162+
histos.add("hPtDcaXYPreCut", "before track selection;#it{p}_{T} (GeV/#it{c});DCA_{xy} (cm)", kTH2D, {{axisPtEl}, {600, -3., 3.}});
163+
histos.add("hPtDcaZPreCut", "before track selection;#it{p}_{T} (GeV/#it{c});DCA_{z} (cm)", kTH2D, {{axisPtEl}, {600, -3., 3.}});
164+
147165
// pid
148166
histos.add("hTofNSigPt", "", kTH2D, {{axisPtEl}, {axisNsig}});
149167
histos.add("hTofNSigPtQA", "", kTH2D, {{axisPtEl}, {axisNsig}});
@@ -168,6 +186,25 @@ struct HfTaskSingleElectron {
168186
histos.add("hPdgCo", "", kTH1D, {{10001, -0.5, 10000.5}});
169187
}
170188

189+
template <typename TrackType>
190+
void fillTrackQaPreCut(const TrackType& track)
191+
{
192+
double const pt = track.pt();
193+
histos.fill(HIST("hPtEtaPreCut"), pt, track.eta());
194+
histos.fill(HIST("hPtCrossedRowsTpcPreCut"), pt, track.tpcNClsCrossedRows());
195+
histos.fill(HIST("hPtCrossedRowsOverFindableTpcPreCut"), pt, track.tpcCrossedRowsOverFindableCls());
196+
histos.fill(HIST("hPtNClsFoundTpcPreCut"), pt, track.tpcNClsFound());
197+
histos.fill(HIST("hPtNClsFindableTpcPreCut"), pt, track.tpcNClsFindable());
198+
histos.fill(HIST("hPtFoundOverFindableTpcPreCut"), pt, track.tpcFoundOverFindableCls());
199+
histos.fill(HIST("hPtFracSharedClsTpcPreCut"), pt, track.tpcFractionSharedCls());
200+
histos.fill(HIST("hPtChi2TpcPreCut"), pt, track.tpcChi2NCl());
201+
histos.fill(HIST("hPtNClsItsPreCut"), pt, track.itsNCls());
202+
histos.fill(HIST("hPtIbClsItsPreCut"), pt, track.itsNClsInnerBarrel());
203+
histos.fill(HIST("hPtChi2ItsPreCut"), pt, track.itsChi2NCl());
204+
histos.fill(HIST("hPtDcaXYPreCut"), pt, track.dcaXY());
205+
histos.fill(HIST("hPtDcaZPreCut"), pt, track.dcaZ());
206+
}
207+
171208
template <typename TrackType>
172209
bool trackSel(const TrackType& track)
173210
{
@@ -182,22 +219,34 @@ struct HfTaskSingleElectron {
182219
return false;
183220
}
184221

185-
if (track.tpcCrossedRowsOverFindableCls() < nClsFoundOverFindableTpcMin) {
222+
if (track.tpcCrossedRowsOverFindableCls() < nCrossedRowsOverFindableClsTpcMin) {
223+
return false;
224+
}
225+
226+
if (track.tpcNClsFound() < nClsTpcMin) {
186227
return false;
187228
}
188229

189230
if (track.tpcChi2NCl() > chi2PerNClTpcMax) {
190231
return false;
191232
}
192233

193-
if (!(track.itsNClsInnerBarrel() == clsIbItsMin)) {
234+
if (track.itsNClsInnerBarrel() < clsIbItsMin) { // inner barrel has 3 layers: default 3 is equivalent to the previous == requirement
235+
return false;
236+
}
237+
238+
if (track.itsNCls() < nClsItsMin) {
194239
return false;
195240
}
196241

197242
if (track.itsChi2NCl() > chi2PerNClItsMax) {
198243
return false;
199244
}
200245

246+
if (requireItsTpcRefit && !(track.passedITSRefit() && track.passedTPCRefit())) {
247+
return false;
248+
}
249+
201250
if (std::abs(track.dcaXY()) > dcaxyMax) {
202251
return false;
203252
}
@@ -436,19 +485,17 @@ struct HfTaskSingleElectron {
436485

437486
for (const auto& track : tracks) {
438487

439-
if (!trackSel(track)) {
440-
continue;
441-
}
488+
fillTrackQaPreCut(track);
442489

443-
if (!(track.passedITSRefit() && track.passedTPCRefit())) {
490+
if (!trackSel(track)) {
444491
continue;
445492
}
446493

447494
histos.fill(HIST("hEtaTrack"), track.eta());
448495
histos.fill(HIST("hPtTrack"), track.pt());
449496

450497
histos.fill(HIST("hNClsTpcTrack"), track.tpcNClsCrossedRows());
451-
histos.fill(HIST("hNClsFoundFindableTpcTrack"), track.tpcCrossedRowsOverFindableCls());
498+
histos.fill(HIST("hCrossedRowsOverFindableTpcTrack"), track.tpcCrossedRowsOverFindableCls());
452499
histos.fill(HIST("hChi2TpcTrack"), track.tpcChi2NCl());
453500
histos.fill(HIST("hIbClsItsTrack"), track.itsNClsInnerBarrel());
454501
histos.fill(HIST("hChi2ItsTrack"), track.itsChi2NCl());
@@ -501,6 +548,8 @@ struct HfTaskSingleElectron {
501548

502549
for (const auto& track : tracks) {
503550

551+
fillTrackQaPreCut(track);
552+
504553
if (!trackSel(track)) {
505554
continue;
506555
}
@@ -509,7 +558,7 @@ struct HfTaskSingleElectron {
509558
histos.fill(HIST("hPtTrack"), track.pt());
510559

511560
histos.fill(HIST("hNClsTpcTrack"), track.tpcNClsCrossedRows());
512-
histos.fill(HIST("hNClsFoundFindableTpcTrack"), track.tpcCrossedRowsOverFindableCls());
561+
histos.fill(HIST("hCrossedRowsOverFindableTpcTrack"), track.tpcCrossedRowsOverFindableCls());
513562
histos.fill(HIST("hChi2TpcTrack"), track.tpcChi2NCl());
514563
histos.fill(HIST("hIbClsItsTrack"), track.itsNClsInnerBarrel());
515564
histos.fill(HIST("hDcaXYTrack"), track.dcaXY());
@@ -559,7 +608,7 @@ struct HfTaskSingleElectron {
559608
histos.fill(HIST("hDcaTrack"), track.pt(), track.dcaXY());
560609
}
561610
}
562-
PROCESS_SWITCH(HfTaskSingleElectron, processMc, "For real data", false);
611+
PROCESS_SWITCH(HfTaskSingleElectron, processMc, "For MC simulations", false);
563612
};
564613

565614
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)