Skip to content

Commit 3952c9b

Browse files
authored
[DPG] Add contributor cuts (#8594)
1 parent 727ac32 commit 3952c9b

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ struct tofPidQa {
137137
Configurable<bool> splitSignalPerCharge{"splitSignalPerCharge", true, "Split the signal per charge (reduces memory footprint if off)"};
138138
Configurable<bool> enableVsMomentumHistograms{"enableVsMomentumHistograms", false, "Enables plots vs momentum instead of just pT (reduces memory footprint if off)"};
139139
Configurable<bool> requireGoodMatchTracks{"requireGoodMatchTracks", false, "Require good match tracks"};
140+
Configurable<float> pvContributorsMin{"pvContributorsMin", -10, "Minimum pvContributors"};
141+
Configurable<float> pvContributorsMax{"pvContributorsMax", 10000, "Maximum pvContributors"};
140142

141143
template <o2::track::PID::ID id>
142144
void initPerParticle(const AxisSpec& pAxis,
@@ -282,6 +284,8 @@ struct tofPidQa {
282284
h->GetXaxis()->SetBinLabel(1, "Events read");
283285
h->GetXaxis()->SetBinLabel(2, "Passed ev. sel.");
284286
h->GetXaxis()->SetBinLabel(3, "Passed vtx Z");
287+
h->GetXaxis()->SetBinLabel(4, Form("Passed pvContributorsMin %f", pvContributorsMin.value));
288+
h->GetXaxis()->SetBinLabel(5, Form("Passed pvContributorsMax %f", pvContributorsMax.value));
285289

286290
h = histos.add<TH1>("event/trackselection", "", kTH1D, {{10, 0.5, 10.5, "Selection passed"}});
287291
h->GetXaxis()->SetBinLabel(1, "Tracks read");
@@ -375,11 +379,30 @@ struct tofPidQa {
375379
}
376380
}
377381
}
378-
if (abs(collision.posZ()) > 10.f) {
382+
if (std::abs(collision.posZ()) > 10.f) {
379383
return false;
380384
}
385+
// Count the number of contributors
386+
int pvContributors = 0;
387+
for (const auto& trk : tracks) {
388+
if (trk.isPVContributor()) {
389+
pvContributors++;
390+
}
391+
}
392+
if (pvContributors < pvContributorsMin) {
393+
return false;
394+
}
395+
if constexpr (fillHistograms) {
396+
histos.fill(HIST("event/evsel"), 4);
397+
}
398+
if (pvContributors > pvContributorsMax) {
399+
return false;
400+
}
401+
if constexpr (fillHistograms) {
402+
histos.fill(HIST("event/evsel"), 5);
403+
}
381404
if constexpr (fillHistograms) {
382-
histos.fill(HIST("event/evsel"), 3);
405+
histos.fill(HIST("event/evsel"), 6);
383406
histos.fill(HIST("event/vertexz"), collision.posZ());
384407

385408
histos.fill(HIST("event/evtime/colltime"), collision.collisionTime() * 1000.f);
@@ -505,7 +528,7 @@ struct tofPidQa {
505528
}
506529

507530
if (applyRapidityCut) {
508-
if (abs(t.rapidity(PID::getMass(id))) > 0.5) {
531+
if (std::abs(t.rapidity(PID::getMass(id))) > 0.5) {
509532
continue;
510533
}
511534
}

0 commit comments

Comments
 (0)