Skip to content
97 changes: 73 additions & 24 deletions DPG/Tasks/AOTTrack/qaMatchEff.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
Configurable<bool> isCentralityRequired{"isCentralityRequired", false, "Boolean to switch the centrality selection on/off."};
Configurable<bool> isRejectNearByEvent{"isRejectNearByEvent", false, "Boolean to switch the rejection of near by events on/off."};
Configurable<bool> isEnableOccupancyCut{"isEnableOccupancyCut", false, "Boolean to switch the occupancy cut on/off."};
Configurable<bool> disableITSROFCut{"disableITSROFCut", false, "Disable ITS ROC cut for event selection"};
struct : ConfigurableGroup {
Configurable<float> centralityMinCut{"centralityMinCut", 0.0f, "Minimum centrality"};
Configurable<float> centralityMaxCut{"centralityMaxCut", 100.0f, "Maximum centrality"};
Expand Down Expand Up @@ -1412,7 +1413,7 @@
return true;
}
/// Function applying the TPC selections
template <typename T>

Check failure on line 1416 in DPG/Tasks/AOTTrack/qaMatchEff.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
bool isTrackSelectedTPCCuts(T& track)
{
if (!isUseTrackSelections && !isUseAnalysisTrackSelections)
Expand Down Expand Up @@ -1566,7 +1567,7 @@
if constexpr (!IS_MC) {
tpcNSigmaPion = track.tpcNSigmaPi();
tpcNSigmaKaon = track.tpcNSigmaKa();
tpcNSigmaProton = track.tpcNSigmaPr();

Check failure on line 1570 in DPG/Tasks/AOTTrack/qaMatchEff.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
tofNSigmaPion = track.tofNSigmaPi();
tofNSigmaKaon = track.tofNSigmaKa();
tofNSigmaProton = track.tofNSigmaPr();
Expand All @@ -1583,7 +1584,7 @@
bool protonPIDwithTOF = (nSigmaPID->get("TOF", "nSigProtonMin") < tofNSigmaProton && tofNSigmaProton < nSigmaPID->get("TOF", "nSigProtonMax"));
// isPion
bool isPion = false;
if (isPIDPionRequired && pionPIDwithTPC && ((!trkWTOF) || pionPIDwithTOF))

Check failure on line 1587 in DPG/Tasks/AOTTrack/qaMatchEff.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
isPion = true;
// isKaon
bool isKaon = false;
Expand Down Expand Up @@ -1621,15 +1622,15 @@
else
sayPrim = 2;
switch (siPDGCode) {
case 11:

Check failure on line 1625 in DPG/Tasks/AOTTrack/qaMatchEff.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
specind = 1;
break;
case 211:
specind = 2;
break;

Check failure on line 1630 in DPG/Tasks/AOTTrack/qaMatchEff.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
case 321:
specind = 3;
break;

Check failure on line 1633 in DPG/Tasks/AOTTrack/qaMatchEff.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
case 2212:
specind = 4;
break;
Expand Down Expand Up @@ -1705,7 +1706,7 @@
histos.fill(HIST("data/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), specind, signOfTrack, hasdet);
if (specind == 2 || specind == 3 || specind == 5) // pions and kaons together
histos.fill(HIST("data/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), 10, signOfTrack, hasdet);
}

Check failure on line 1709 in DPG/Tasks/AOTTrack/qaMatchEff.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
}
}
if (trkWITS && trkWTPC && isTrackSelectedTPCCuts(track) && isTrackSelectedITSCuts(track)) { // ITS + TPC at least
Expand All @@ -1722,7 +1723,7 @@
histos.fill(HIST("data/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), specind, signOfTrack, hasdet);
if (specind == 2 || specind == 3 || specind == 5) // pions and kaons together
histos.fill(HIST("data/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), 10, signOfTrack, hasdet);
}

Check failure on line 1726 in DPG/Tasks/AOTTrack/qaMatchEff.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
}
}
if (trkWTOF && trkWTPC && isTrackSelectedTPCCuts(track)) { // TOF + TPC at least
Expand All @@ -1739,7 +1740,7 @@
histos.fill(HIST("data/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), specind, signOfTrack, hasdet);
if (specind == 2 || specind == 3 || specind == 5) // pions and kaons together
histos.fill(HIST("data/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), 10, signOfTrack, hasdet);
}

Check failure on line 1743 in DPG/Tasks/AOTTrack/qaMatchEff.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
}
}
if (trkWITS && isTrackSelectedITSCuts(track) && trkWTOF) { // TOF + ITS at least
Expand All @@ -1756,7 +1757,7 @@
histos.fill(HIST("data/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), specind, signOfTrack, hasdet);
if (specind == 2 || specind == 3 || specind == 5) // pions and kaons together
histos.fill(HIST("data/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), 10, signOfTrack, hasdet);
}

Check failure on line 1760 in DPG/Tasks/AOTTrack/qaMatchEff.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
}
}
if (trkWITS && trkWTOF && trkWTPC && isTrackSelectedTPCCuts(track) && isTrackSelectedITSCuts(track)) { // TOF + TPC +ITS at least
Expand Down Expand Up @@ -3295,10 +3296,18 @@
//////////////////////////////////////////////
void processMC(CollisionsEvSel::iterator const& collision, soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::McTrackLabels> const& tracks, aod::McParticles const& mcParticles)
{
if (isEnableEventSelection && !collision.sel8()) {
if (doDebug)
LOGF(info, "Event selection not passed, skipping...");
return;
if (isEnableEventSelection) {

if (!collision.selection_bit(aod::evsel::kNoITSROFrameBorder) && !disableITSROFCut) {
if (doDebug)
LOGF(info, "Event selection not passed to ITSROFrame border, skipping...");
return;
}
if (!collision.selection_bit(aod::evsel::kIsTriggerTVX) && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) {
if (doDebug)
LOGF(info, "Event selection not passed to TriggerTVX and TFBorder, skipping...");
return;
}
}
fillHistograms<true>(tracks, mcParticles, mcParticles); /// 3rd argument non-sense in this case
fillGeneralHistos<true>(collision);
Expand All @@ -3315,10 +3324,18 @@
LOGF(warning, "Centrality not defined for pp collision type, return...");
return;
}
if (isEnableEventSelection && !collision.sel8()) {
if (doDebug)
LOGF(info, "Event selection not passed, skipping...");
return;
if (isEnableEventSelection) {

if (!collision.selection_bit(aod::evsel::kNoITSROFrameBorder) && !disableITSROFCut) {
if (doDebug)
LOGF(info, "Event selection not passed to ITSROFrame border, skipping...");
return;
}
if (!collision.selection_bit(aod::evsel::kIsTriggerTVX) && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) {
if (doDebug)
LOGF(info, "Event selection not passed to TriggerTVX and TFBorder, skipping...");
return;
}
}
float centrality = collision.centFT0C();
if (isCentralityRequired) {
Expand All @@ -3338,10 +3355,18 @@
////////////////////////////////////////////////////////////
void processTrkIUMC(CollisionsMCEvSel::iterator const& collision, MCTracksIU const& tracks, aod::McParticles const& mcParticles)
{
if (isEnableEventSelection && !collision.sel8()) {
if (doDebug)
LOGF(info, "Event selection not passed, skipping...");
return;
if (isEnableEventSelection) {

if (!collision.selection_bit(aod::evsel::kNoITSROFrameBorder) && !disableITSROFCut) {
if (doDebug)
LOGF(info, "Event selection not passed to ITSROFrame border, skipping...");
return;
}
if (!collision.selection_bit(aod::evsel::kIsTriggerTVX) && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) {
if (doDebug)
LOGF(info, "Event selection not passed to TriggerTVX and TFBorder, skipping...");
return;
}
}
fillHistograms<true>(tracks, mcParticles, mcParticles); /// 3rd argument non-sense in this case
fillGeneralHistos<true>(collision);
Expand All @@ -3366,10 +3391,18 @@
// tracks.rawIteratorAt(0).collision().bc_as<BCsWithTimeStamp>().timestamp(); /// NB: in ms
setUpTimeMonitoring(bcs);
}
if (isEnableEventSelection && !collision.sel8()) {
if (doDebug)
LOGF(info, "Event selection not passed, skipping...");
return;
if (isEnableEventSelection) {

if (!collision.selection_bit(aod::evsel::kNoITSROFrameBorder) && !disableITSROFCut) {
if (doDebug)
LOGF(info, "Event selection not passed to ITSROFrame border, skipping...");
return;
}
if (!collision.selection_bit(aod::evsel::kIsTriggerTVX) && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) {
if (doDebug)
LOGF(info, "Event selection not passed to TriggerTVX and TFBorder, skipping...");
return;
}
}
fillHistograms<false>(tracks, tracks, bcs); // 2nd argument not used in this case
fillGeneralHistos<false>(collision);
Expand All @@ -3389,10 +3422,18 @@
if (enableMonitorVsTime) {
setUpTimeMonitoring(bcs);
}
if (isEnableEventSelection && !collision.sel8()) {
if (doDebug)
LOGF(info, "Event selection not passed, skipping...");
return;
if (isEnableEventSelection) {

if (!collision.selection_bit(aod::evsel::kNoITSROFrameBorder) && !disableITSROFCut) {
if (doDebug)
LOGF(info, "Event selection not passed to ITSROFrame border, skipping...");
return;
}
if (!collision.selection_bit(aod::evsel::kIsTriggerTVX) && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) {
if (doDebug)
LOGF(info, "Event selection not passed to TriggerTVX and TFBorder, skipping...");
return;
}
}
const float centrality = collision.centFT0C();
const int occupancy = collision.trackOccupancyInTimeRange();
Expand Down Expand Up @@ -3427,10 +3468,18 @@
/////////////////////////////////////////////////////////////
void processTrkIUData(CollisionsEvSel::iterator const& collision, TracksIUPID const& tracks)
{
if (isEnableEventSelection && !collision.sel8()) {
if (doDebug)
LOGF(info, "Event selection not passed, skipping...");
return;
if (isEnableEventSelection) {

if (!collision.selection_bit(aod::evsel::kNoITSROFrameBorder) && !disableITSROFCut) {
if (doDebug)
LOGF(info, "Event selection not passed to ITSROFrame border, skipping...");
return;
}
if (!collision.selection_bit(aod::evsel::kIsTriggerTVX) && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) {
Copy link
Collaborator

@mfaggin mfaggin Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in all the pieces of code you add the check on the TF border cut also in this line, even if you check it already a few lines above... why? This looks wrong to me

if (doDebug)
LOGF(info, "Event selection not passed to TriggerTVX and TFBorder, skipping...");
return;
}
}
fillHistograms<false>(tracks, tracks, tracks); // 2nd and 3rd arguments not used in this case
fillGeneralHistos<false>(collision);
Expand Down
Loading