Skip to content

Commit e0bb705

Browse files
committed
apply previously decalred cuts
1 parent 7f161ec commit e0bb705

1 file changed

Lines changed: 31 additions & 14 deletions

File tree

DPG/Tasks/AOTTrack/PID/TPC/treeCreatorPidTpcQa.cxx

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,24 +61,39 @@ struct TreeCreatorPidTpcQa {
6161
Produces<o2::aod::QaPidTpc> rowPidTpcQa;
6262

6363
Configurable<int> applyEvSel{"applyEvSel", 2, "Flag to apply event selection: 0 -> no event selection, 1 -> Run 2 event selection, 2 -> Run 3 event selection"};
64-
Configurable<float> cutVtxZ{"cutVtxZ", 10.f, "Cut on vertex Z position [cm]. Set negative value to switch this cut off"};
64+
Configurable<float> cutVtxZ{"cutVtxZ", 10.f, "Cut on vertex Z position [cm]"};
6565
Configurable<int> trackSelection{"trackSelection", 1, "Track selection: 0 -> No Cut, 1 -> kGlobalTrack, 2 -> kGlobalTrackWoPtEta, 3 -> kGlobalTrackWoDCA, 4 -> kQualityTracks, 5 -> kInAcceptanceTracks"};
6666
Configurable<bool> requireGlobalTrack{"requireGlobalTrack", true, "Skip non-global tracks"};
6767
Configurable<bool> requireIts{"requireIts", true, "Skip tracks without ITS"};
6868
Configurable<int16_t> cutMinTPCNcls{"cutMinTPCNcls", 0, "Minimum number or TPC Clusters for tracks"};
69-
Configurable<float> cutRapidity{"cutRapidity", 0.5, "Rapidity cut. Set negative value to switch this cut off"};
69+
Configurable<float> cutRapidity{"cutRapidity", 999.f, "Rapidity cut"};
7070
Configurable<float> nClNorm{"nClNorm", 152., "Number of cluster normalization. Run 2: 159, Run 3 152"};
7171
// Configurable for the path of CCDB General Run Parameters LHC Interface information
7272
Configurable<std::string> ccdbPathGrpLhcIf{"ccdbPathGrpLhcIf", "GLO/Config/GRPLHCIF", "Path on the CCDB for the GRPLHCIF object"};
7373

74-
#define DECLARE_PARTICLE_WISE_CONFIGURABLES(ParticleNameShort, ParticleNameLong) \
75-
Configurable<float> cutTpcInnerParameterMin##ParticleNameLong{"cutTpcInnerParameterMin" #ParticleNameLong, -1., "Lower-value cut on tpcInnerParam for " #ParticleNameLong}; /* o2-linter: disable=name/configurable (Configurable defined in macro)*/ \
76-
Configurable<float> cutTpcInnerParameterMax##ParticleNameLong{"cutTpcInnerParameterMax" #ParticleNameLong, -1., "Upper-value cut on tpcInnerParam for " #ParticleNameLong}; /* o2-linter: disable=name/configurable (Configurable defined in macro)*/ \
77-
Configurable<float> cutNSigmaTpcAbs##ParticleNameLong{"cutNSigmaTpcAbs" #ParticleNameLong, -1., "Cut on absolute value of nSigmaTpc for " #ParticleNameLong}; // o2-linter: disable=name/configurable (Configurable defined in macro)
74+
#define DECLARE_PARTICLE_WISE_CONFIGURABLES(ParticleNameShort, ParticleNameLong) \
75+
Configurable<float> cutTpcInnerParameterMin##ParticleNameLong{"cutTpcInnerParameterMin" #ParticleNameLong, 0.f, "Lower-value cut on tpcInnerParam for " #ParticleNameLong}; /* o2-linter: disable=name/configurable (Configurable defined in macro)*/ \
76+
Configurable<float> cutTpcInnerParameterMax##ParticleNameLong{"cutTpcInnerParameterMax" #ParticleNameLong, 999.f, "Upper-value cut on tpcInnerParam for " #ParticleNameLong}; /* o2-linter: disable=name/configurable (Configurable defined in macro)*/ \
77+
Configurable<float> cutNSigmaTpcAbs##ParticleNameLong{"cutNSigmaTpcAbs" #ParticleNameLong, 999.f, "Cut on absolute value of nSigmaTpc for " #ParticleNameLong}; // o2-linter: disable=name/configurable (Configurable defined in macro)
7878

7979
PARTICLE_LIST(DECLARE_PARTICLE_WISE_CONFIGURABLES)
8080
#undef DECLARE_PARTICLE_WISE_CONFIGURABLES
8181

82+
#define PACK_CONFIGURABLES_TO_ARRAY(ParticleNameShort, ParticleNameLong) &cutTpcInnerParameterMin##ParticleNameLong,
83+
std::array<Configurable<float>*, PID::Alpha + 1> cutTpcInnerParameterMin{
84+
PARTICLE_LIST(PACK_CONFIGURABLES_TO_ARRAY)};
85+
#undef PACK_CONFIGURABLES_TO_ARRAY
86+
87+
#define PACK_CONFIGURABLES_TO_ARRAY(ParticleNameShort, ParticleNameLong) &cutTpcInnerParameterMax##ParticleNameLong,
88+
std::array<Configurable<float>*, PID::Alpha + 1> cutTpcInnerParameterMax{
89+
PARTICLE_LIST(PACK_CONFIGURABLES_TO_ARRAY)};
90+
#undef PACK_CONFIGURABLES_TO_ARRAY
91+
92+
#define PACK_CONFIGURABLES_TO_ARRAY(ParticleNameShort, ParticleNameLong) &cutNSigmaTpcAbs##ParticleNameLong,
93+
std::array<Configurable<float>*, PID::Alpha + 1> cutNSigmaTpcAbs{
94+
PARTICLE_LIST(PACK_CONFIGURABLES_TO_ARRAY)};
95+
#undef PACK_CONFIGURABLES_TO_ARRAY
96+
8297
Service<o2::ccdb::BasicCCDBManager> ccdb{};
8398

8499
ctpRateFetcher mRateFetcher{};
@@ -144,7 +159,7 @@ struct TreeCreatorPidTpcQa {
144159
float sqrtSNN{}; // placeholder to satisfy evaluateIrSourceAndSqrtSnn's signature
145160
bool isFirstCollision{true};
146161
for (const auto& collision : collisions) {
147-
if (!isEventSelected(collision, applyEvSel) || ((cutVtxZ > 0.f) && std::abs(collision.posZ()) > cutVtxZ)) {
162+
if (!isEventSelected(collision, applyEvSel) || (std::abs(collision.posZ()) > cutVtxZ)) {
148163
continue;
149164
}
150165

@@ -165,16 +180,9 @@ struct TreeCreatorPidTpcQa {
165180
isGoodTrack &= (!requireIts || track.hasITS());
166181
isGoodTrack &= track.hasTPC();
167182
isGoodTrack &= (track.tpcNClsFound() >= cutMinTPCNcls);
168-
if (!isGoodTrack) {
169-
continue;
170-
}
171183

172184
const float rapidity = track.rapidity(PID::getMass(Id));
173-
if (cutRapidity > 0.f && std::fabs(rapidity) > cutRapidity) {
174-
continue;
175-
}
176185
const float momentum = track.p();
177-
178186
const float nClNormalized = std::sqrt(nClNorm / track.tpcNClsFound());
179187
const float nclPID = static_cast<float>(track.tpcNClsPID());
180188
const float phi = track.phi();
@@ -183,6 +191,15 @@ struct TreeCreatorPidTpcQa {
183191
const float signed1Pt = track.signed1Pt();
184192
const float nSigmaTpc = o2::aod::pidutils::tpcNSigma<Id>(track);
185193

194+
isGoodTrack &= (std::fabs(rapidity) <= cutRapidity);
195+
isGoodTrack &= (tpcInnerParam >= *cutTpcInnerParameterMin.at(Id));
196+
isGoodTrack &= (tpcInnerParam <= *cutTpcInnerParameterMax.at(Id));
197+
isGoodTrack &= (std::fabs(nSigmaTpc) <= *cutNSigmaTpcAbs.at(Id));
198+
199+
if (!isGoodTrack) {
200+
continue;
201+
}
202+
186203
float dedxDiff{UndefValueFloat};
187204
float dedxExpected{UndefValueFloat};
188205
float expSigma{UndefValueFloat};

0 commit comments

Comments
 (0)