Skip to content

Commit bc86495

Browse files
committed
U
1 parent c6aee7d commit bc86495

File tree

1 file changed

+56
-20
lines changed

1 file changed

+56
-20
lines changed

DPG/Tasks/AOTTrack/PID/qaPIDTPCSignal.cxx

Lines changed: 56 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,15 @@ struct tpcPidQaSignal {
3838
Configurable<int> trdSelection{"trdSelection", 0, "Flag for the TRD selection: -1 no TRD, 0 no selection, 1 TRD"};
3939
Configurable<float> fractionOfEvents{"fractionOfEvents", 0.1f, "Downsampling factor for the events for derived data"};
4040
Configurable<float> minP{"minP", 0.01, "Minimum momentum in range"};
41+
Configurable<float> maxEta{"maxEta", 0.8, "Maximum eta in range"};
42+
Configurable<float> maxITSChi2{"maxITSChi2", 36, "Maximum chi2 in range"};
43+
Configurable<float> maxTPCChi2{"maxTPCChi2", 4, "Maximum chi2 in range"};
4144
Configurable<float> maxP{"maxP", 20, "Maximum momentum in range"};
45+
Configurable<int> minITSCls{"minITSCls", 6, "Minimum number of ITS clusters"};
46+
Configurable<int> pidInTracking{"pidInTracking", -1, "PID in tracking"};
47+
Configurable<int> minTPCCls{"minTPCCls", 0, "Minimum number of TPC clusters"};
48+
Configurable<int> minTPCClsFindable{"minTPCClsFindable", 0, "Minimum number of TPC findable clusters"};
49+
Configurable<float> minCrossedRowsOverFindableCls{"minCrossedRowsOverFindableCls", 0.8f, "Minimum number of TPC found/findable clusters"};
4250
ConfigurableAxis dEdxBins{"dEdxBins", {5000, 0.f, 5000.f}, "Binning in dE/dx"};
4351
Configurable<float> minTPCNcls{"minTPCNcls", 0.f, "Minimum number or TPC Clusters for tracks"};
4452
Configurable<float> minNClsCrossedRows{"minNClsCrossedRows", 70.f, "Minimum number or TPC crossed rows for tracks"};
@@ -63,6 +71,25 @@ struct tpcPidQaSignal {
6371
h->GetXaxis()->SetBinLabel(2, "Passed ev. sel.");
6472
h->GetXaxis()->SetBinLabel(3, "Passed vtx Z");
6573

74+
// Event properties
75+
h = histos.add<TH1>("trksel", "", kTH1D, {{10, 0.5, 10.5, "Trk. Sel."}});
76+
h->GetXaxis()->SetBinLabel(1, "Tracks read");
77+
h->GetXaxis()->SetBinLabel(2, Form("Has > %i ITS clusters", minITSCls.value));
78+
h->GetXaxis()->SetBinLabel(3, Form("Has > %f TPC clusters findable", minTPCClsFindable.value));
79+
h->GetXaxis()->SetBinLabel(4, Form("Has > %f TPC clusters found", minTPCNcls.value));
80+
h->GetXaxis()->SetBinLabel(5, Form("Has > %f Found/Findable Ratio", minCrossedRowsOverFindableCls.value));
81+
h->GetXaxis()->SetBinLabel(6, Form("Has > %f Xrows", minNClsCrossedRows.value));
82+
h->GetXaxis()->SetBinLabel(7, "All PID in trk");
83+
if (pidInTracking == -1) {
84+
h->GetXaxis()->SetBinLabel(7, Form("PID in trk %i", pidInTracking.value));
85+
}
86+
h->GetXaxis()->SetBinLabel(8, "no TRD sel.");
87+
if (trdSelection == -1) {
88+
h->GetXaxis()->SetBinLabel(8, "has no TRD");
89+
} else if (trdSelection == 1) {
90+
h->GetXaxis()->SetBinLabel(8, "has TRD");
91+
}
92+
6693
histos.add("event/vertexz", "", kTH1D, {vtxZAxis});
6794
hdedx = histos.add<TH3>("event/tpcsignal", "", kTH3D, {pAxis, dedxAxis, chargeAxis});
6895
LOG(info) << "QA PID TPC histograms:";
@@ -72,43 +99,54 @@ struct tpcPidQaSignal {
7299
template <typename T>
73100
bool isTrackSelected(const T& track)
74101
{
75-
if (t.itsNCls() < 6) {
102+
histos.fill(HIST("trksel"), 1);
103+
if (track.itsNCls() < minITSCls) {
76104
return false;
77105
}
78-
if (t.tpcNClsFindable() <= 0) {
106+
histos.fill(HIST("trksel"), 2);
107+
if (track.tpcNClsFindable() <= minTPCClsFindable) {
79108
return false;
80109
}
81-
if (t.tpcNClsFound() < minTPCNcls) {
110+
histos.fill(HIST("trksel"), 3);
111+
if (track.tpcNClsFound() < minTPCNcls) {
82112
return false;
83113
}
84-
if (t.tpcCrossedRowsOverFindableCls() < 0.8f) {
114+
histos.fill(HIST("trksel"), 4);
115+
if (track.tpcCrossedRowsOverFindableCls() < minCrossedRowsOverFindableCls) {
85116
return false;
86117
}
87-
if (t.tpcNClsCrossedRows() < minNClsCrossedRows) {
118+
histos.fill(HIST("trksel"), 5);
119+
if (track.tpcNClsCrossedRows() < minNClsCrossedRows) {
88120
return false;
89121
}
122+
histos.fill(HIST("trksel"), 6);
123+
if (pidInTracking != -1 && track.pidForTracking() != pidInTracking) {
124+
return false;
125+
}
126+
histos.fill(HIST("trksel"), 7);
90127
switch (trdSelection) {
91128
case 0:
92129
break;
93130
case -1:
94-
if (t.hasTRD()) {
131+
if (track.hasTRD()) {
95132
return false;
96133
}
97134
break;
98135
case 1:
99-
if (!t.hasTRD()) {
136+
if (!track.hasTRD()) {
100137
return false;
101138
}
102139
break;
103140
default:
104141
LOG(fatal) << "Invalid TRD selection";
105142
}
143+
histos.fill(HIST("trksel"), 8);
106144
return true;
107145
}
108146

109-
Filter trackFilterEta = (nabs(aod::track::eta) < 0.8f);
110-
Filter trackFilterITS = (aod::track::itsChi2NCl < 36.f);
111-
Filter trackFilterTPC = ((aod::track::tpcChi2NCl < 4.f));
147+
Filter trackFilterEta = (nabs(aod::track::eta) < maxEta);
148+
Filter trackFilterITS = (aod::track::itsChi2NCl < maxITSChi2);
149+
Filter trackFilterTPC = ((aod::track::tpcChi2NCl < maxTPCChi2));
112150
using TrackCandidates = soa::Join<aod::TracksIU, aod::TracksExtra>;
113151
void processEvSel(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision,
114152
soa::Filtered<TrackCandidates> const& tracks,
@@ -166,23 +204,21 @@ struct tpcPidQaSignal {
166204
}
167205
PROCESS_SWITCH(tpcPidQaSignal, processEvSel, "Process with event selection", false);
168206

169-
void processNoEvSel(aod::Collision const& collision,
170-
soa::Filtered<TrackCandidates> const& tracks)
207+
void processNoEvSel(soa::Filtered<TrackCandidates> const& tracks, aod::Collisions const& collisions)
171208
{
172209
if (fractionOfEvents < 1.f && (static_cast<float>(rand_r(&randomSeed)) / static_cast<float>(RAND_MAX)) > fractionOfEvents) { // Skip events that are not sampled
173210
return;
174211
}
175212

176-
histos.fill(HIST("event/evsel"), 1);
177-
histos.fill(HIST("event/evsel"), 2);
178-
179-
if (abs(collision.posZ()) > 10.f) {
180-
return;
181-
}
182-
histos.fill(HIST("event/evsel"), 3);
183-
histos.fill(HIST("event/vertexz"), collision.posZ());
213+
histos.fill(HIST("event/evsel"), 1, collisions.size());
184214

185215
for (const auto& t : tracks) {
216+
if (!t.has_collision()) {
217+
continue;
218+
}
219+
if (abs(t.collision().posZ()) > 10.f) {
220+
continue;
221+
}
186222
if (!isTrackSelected(t)) {
187223
continue;
188224
}

0 commit comments

Comments
 (0)