Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DPG/AOT-Tracks: add possibility to force track to match or not TRD. #7631

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions DPG/Tasks/AOTTrack/qaEventTrack.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ struct qaEventTrack {
// options to check the track variables only for PV contributors
Configurable<bool> checkOnlyPVContributor{"checkOnlyPVContributor", false, "check the track variables only for primary vertex contributors"};

// options to force or not the presence of TRD (debug)
struct : ConfigurableGroup {
Configurable<bool> activateChecksTRD{"activateChecksTRD", false, "Activate the checks wityh TRD - force the track to have or not have TRD"};
Configurable<bool> forceTRD{"forceTRD", false, "Force the track to have TRD"};
Configurable<bool> forceNotTRD{"forceNotTRD", false, "Force the track not to have TRD"};
} checksTRD;

// configurable binning of histograms
ConfigurableAxis binsPt{"binsPt", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 2.0, 5.0, 10.0, 20.0, 50.0}, ""};
ConfigurableAxis binsInvPt{"binsInvPt", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 2.0, 5.0, 10.0, 20.0, 50.0}, ""};
Expand Down Expand Up @@ -152,6 +159,13 @@ struct qaEventTrack {
return;
}

if (checksTRD.activateChecksTRD) {
std::array<bool, 2> casesTRD = {checksTRD.forceTRD, checksTRD.forceNotTRD};
if (std::accumulate(casesTRD.begin(), casesTRD.end(), 0) != 1) {
LOGP(fatal, "One and only one case between forceTRD and forceNotTRD can be true at a time. Fix it!");
}
}

//
// Next section setups overwrite of configurableAxis if overwriteAxisRangeForPbPb is used.
//
Expand Down Expand Up @@ -1498,6 +1512,17 @@ void qaEventTrack::fillRecoHistogramsGroupedTracks(const C& collision, const T&
if (!isSelectedTrack<IS_MC>(track)) {
continue;
}
// TRD checks (debug)
if (checksTRD.activateChecksTRD) {
if (checksTRD.forceTRD && !track.hasTRD()) {
/// We want only tracks that match TRD, but the current one does not match it. Let's skip it.
continue;
}
if (checksTRD.forceNotTRD && track.hasTRD()) {
/// We want only tracks that do not match TRD, but the current one matches it. Let's skip it.
continue;
}
}
// fill kinematic variables
histos.fill(HIST("Tracks/Kine/pt"), track.pt());
if (track.sign() > 0) {
Expand Down
Loading