Skip to content

Commit 4447aa5

Browse files
allesgraualibuild
andauthored
[PWGCF] Change nsigma TOF selections to optional cuts, force bit=1 when no TOF is found (#17315)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent ede5910 commit 4447aa5

2 files changed

Lines changed: 43 additions & 11 deletions

File tree

PWGCF/Femto/Core/cascadeBuilder.h

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ struct ConfCascadeFilters : o2::framework::ConfigurableGroup {
7878
o2::framework::Configurable<std::vector<float>> posDauTpc{"posDauTpc", {5.f}, "Maximum |nsimga_Pion/Proton| TPC for positive daughter tracks"}; \
7979
o2::framework::Configurable<std::vector<float>> negDauTpc{"negDauTpc", {5.f}, "Maximum |nsimga_Pion/Proton| TPC for negative daughter tracks"}; \
8080
o2::framework::Configurable<std::vector<float>> posDauTof{"posDauTof", {}, "Maximum |nsimga_Pion/Proton| TOF for positive daughter tracks"}; \
81-
o2::framework::Configurable<std::vector<float>> negDauTof{"negDauTof", {}, "Maximum |nsigma_Pion/Proton| TOF for negative daughter tracks"};
81+
o2::framework::Configurable<std::vector<float>> negDauTof{"negDauTof", {}, "Maximum |nsigma_Pion/Proton| TOF for negative daughter tracks"}; \
82+
o2::framework::Configurable<bool> requireTof{"requireTof", false, "If true, TOF PID is a mandatory selection"}; \
83+
o2::framework::Configurable<bool> keepTracksWithoutTof{"keepTracksWithoutTof", true, "If true, candidates whose daughters have no TOF signal are kept"};
8284

8385
struct ConfXiBits : o2::framework::ConfigurableGroup {
8486
std::string prefix = std::string("XiBits");
@@ -242,7 +244,7 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
242244
mOmegaMassLowerLimit = filter.rejectMassOmegaMin.value;
243245
mOmegaMassUpperLimit = filter.rejectMassOmegaMax.value;
244246
this->addSelection(kBachelorTpcPion, cascadeSelectionNames.at(kBachelorTpcPion), config.bachelorTpcPion.value, limits::kAbsUpperLimit, true, true, false);
245-
this->addSelection(kBachelorTofPion, cascadeSelectionNames.at(kBachelorTofPion), config.bachelorTofPion.value, limits::kAbsUpperLimit, true, true, false);
247+
this->addSelection(kBachelorTofPion, cascadeSelectionNames.at(kBachelorTofPion), config.bachelorTofPion.value, limits::kAbsUpperLimit, true, mRequireTof, false);
246248
}
247249
if constexpr (modes::isEqual(cascadeType, modes::Cascade::kOmega)) {
248250
mOmegaMassLowerLimit = filter.massOmegaMin.value;
@@ -251,7 +253,7 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
251253
mXiMassLowerLimit = filter.rejectMassXiMin.value;
252254
mXiMassUpperLimit = filter.rejectMassXiMax.value;
253255
this->addSelection(kBachelorTpcKaon, cascadeSelectionNames.at(kBachelorTpcKaon), config.bachelorTpcKaon.value, limits::kAbsUpperLimit, true, true, false);
254-
this->addSelection(kBachelorTofKaon, cascadeSelectionNames.at(kBachelorTofKaon), config.bachelorTofKaon.value, limits::kAbsUpperLimit, true, true, false);
256+
this->addSelection(kBachelorTofKaon, cascadeSelectionNames.at(kBachelorTofKaon), config.bachelorTofKaon.value, limits::kAbsUpperLimit, true, mRequireTof, false);
255257
}
256258

257259
mPtMin = filter.ptMin.value;
@@ -262,11 +264,13 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
262264
mPhiMax = filter.phiMax.value;
263265
mLambdaMassMin = filter.massLambdaMin.value;
264266
mLambdaMassMax = filter.massLambdaMax.value;
267+
mRequireTof = config.requireTof.value;
268+
mKeepTracksWithoutTof = config.keepTracksWithoutTof.value;
265269

266270
this->addSelection(kPosDauTpc, cascadeSelectionNames.at(kPosDauTpc), config.posDauTpc.value, limits::kAbsUpperLimit, true, true, false);
267271
this->addSelection(kNegDauTpc, cascadeSelectionNames.at(kNegDauTpc), config.negDauTpc.value, limits::kAbsUpperLimit, true, true, false);
268-
this->addSelection(kPosDauTof, cascadeSelectionNames.at(kPosDauTof), config.posDauTof.value, limits::kAbsUpperLimit, true, true, false);
269-
this->addSelection(kNegDauTof, cascadeSelectionNames.at(kNegDauTof), config.negDauTof.value, limits::kAbsUpperLimit, true, true, false);
272+
this->addSelection(kPosDauTof, cascadeSelectionNames.at(kPosDauTof), config.posDauTof.value, limits::kAbsUpperLimit, true, mRequireTof, false);
273+
this->addSelection(kNegDauTof, cascadeSelectionNames.at(kNegDauTof), config.negDauTof.value, limits::kAbsUpperLimit, true, mRequireTof, false);
270274

271275
this->addSelection(kCascadeCpaMin, cascadeSelectionNames.at(kCascadeCpaMin), config.cascadeCpaMin.value, limits::kLowerLimit, true, true, false);
272276
this->addSelection(kCascadeTransRadMin, cascadeSelectionNames.at(kCascadeTransRadMin), config.cascadeTransRadMin.value, limits::kLowerLimit, true, true, false);
@@ -336,6 +340,9 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
336340
if (bachelor.hasTOF()) {
337341
this->evaluateObservable(kBachelorTofPion, bachelor.tofNSigmaPi());
338342
this->evaluateObservable(kBachelorTofKaon, bachelor.tofNSigmaKa());
343+
} else if (mKeepTracksWithoutTof) {
344+
this->evaluateObservable(kBachelorTofPion, 0);
345+
this->evaluateObservable(kBachelorTofKaon, 0);
339346
}
340347

341348
// depending on the charge, we check lambda or antilambda hypothesis
@@ -344,18 +351,26 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
344351
this->evaluateObservable(kNegDauTpc, negDaughter.tpcNSigmaPi());
345352
if (posDaughter.hasTOF()) {
346353
this->evaluateObservable(kPosDauTof, posDaughter.tofNSigmaPr());
354+
} else if (mKeepTracksWithoutTof) {
355+
this->evaluateObservable(kPosDauTof, 0);
347356
}
348357
if (negDaughter.hasTOF()) {
349358
this->evaluateObservable(kNegDauTof, negDaughter.tofNSigmaPi());
359+
} else if (mKeepTracksWithoutTof) {
360+
this->evaluateObservable(kNegDauTof, 0);
350361
}
351362
} else if (cascade.sign() > 0) {
352363
this->evaluateObservable(kPosDauTpc, posDaughter.tpcNSigmaPi());
353364
this->evaluateObservable(kNegDauTpc, negDaughter.tpcNSigmaPr());
354365
if (posDaughter.hasTOF()) {
355366
this->evaluateObservable(kPosDauTof, posDaughter.tofNSigmaPi());
367+
} else if (mKeepTracksWithoutTof) {
368+
this->evaluateObservable(kPosDauTof, 0);
356369
}
357370
if (negDaughter.hasTOF()) {
358371
this->evaluateObservable(kNegDauTof, negDaughter.tofNSigmaPr());
372+
} else if (mKeepTracksWithoutTof) {
373+
this->evaluateObservable(kNegDauTof, 0);
359374
}
360375
} else {
361376
LOG(warn) << "Encountered Cascade candidate with 0 charge";
@@ -468,6 +483,8 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
468483
float mPhiMax = o2::constants::math::TwoPI;
469484
float mLambdaMassMin = 1.f;
470485
float mLambdaMassMax = 1.2f;
486+
bool mRequireTof = false;
487+
bool mKeepTracksWithoutTof = false;
471488
};
472489

473490
struct CascadeBuilderProducts : o2::framework::ProducesGroup {

PWGCF/Femto/Core/v0Builder.h

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ struct ConfLambdaBits : o2::framework::ConfigurableGroup {
8585
o2::framework::Configurable<std::vector<float>> posDauTofProton{"posDauTofProton", {}, "Maximum |nsigma_Proton| TOF for positive daughter tracks"};
8686
o2::framework::Configurable<std::vector<float>> negDauTofPion{"negDauTofPion", {}, "Maximum |nsigma_Pion| TOF for negative daughter tracks"};
8787
o2::framework::Configurable<std::vector<float>> negDauTofProton{"negDauTofProton", {}, "Maximum |nsigma_Proton| TOF for negative daughter tracks"};
88+
o2::framework::Configurable<bool> requireTof{"requireTof", false, "If true, TOF PID is a mandatory selection"};
89+
o2::framework::Configurable<bool> keepTracksWithoutTof{"keepTracksWithoutTof", true, "If true, candidates whose daughters have no TOF signal are kept"};
8890
};
8991

9092
// derived selection bits for K0Short
@@ -95,6 +97,8 @@ struct ConfK0shortBits : o2::framework::ConfigurableGroup {
9597
o2::framework::Configurable<std::vector<float>> negDauTpcPion{"negDauTpcPion", {5.f}, "Maximum |nsimga_Pion| TPC for negative daughter tracks"};
9698
o2::framework::Configurable<std::vector<float>> posDauTofPion{"posDauTofPion", {}, "Maximum |nsigma_Pion| TOF for positive daughter tracks"};
9799
o2::framework::Configurable<std::vector<float>> negDauTofPion{"negDauTofPion", {}, "Maximum |nsigma_Pion| TOF for negative daughter tracks"};
100+
o2::framework::Configurable<bool> requireTof{"requireTof", false, "If true, TOF PID is a mandatory selection"};
101+
o2::framework::Configurable<bool> keepTracksWithoutTof{"keepTracksWithoutTof", true, "If true, candidates whose daughters have no TOF signal are kept"};
98102
};
99103

100104
#undef V0_DEFAULT_BITS
@@ -246,6 +250,8 @@ class V0Selection : public baseselection::BaseSelection<float, datatypes::V0Mask
246250
mEtaMax = filter.etaMax.value;
247251
mPhiMin = filter.phiMin.value;
248252
mPhiMax = filter.phiMax.value;
253+
mRequireTof = config.requireTof.value;
254+
mKeepTracksWithoutTof = config.keepTracksWithoutTof.value;
249255

250256
if constexpr (modes::isEqual(v0Type, modes::V0::kLambda) || modes::isEqual(v0Type, modes::V0::kAntiLambda)) {
251257
mMassLambdaLowerLimit = filter.massMinLambda.value;
@@ -257,15 +263,15 @@ class V0Selection : public baseselection::BaseSelection<float, datatypes::V0Mask
257263
if constexpr (modes::isEqual(v0Type, modes::V0::kLambda)) {
258264
this->addSelection(kPosDaughTpcProton, v0SelectionNames.at(kPosDaughTpcProton), config.posDauTpcProton.value, limits::kAbsUpperLimit, true, true, false);
259265
this->addSelection(kNegDaughTpcPion, v0SelectionNames.at(kNegDaughTpcPion), config.negDauTpcPion.value, limits::kAbsUpperLimit, true, true, false);
260-
this->addSelection(kPosDaughTofProton, v0SelectionNames.at(kPosDaughTofProton), config.posDauTofProton.value, limits::kAbsUpperLimit, true, true, false);
261-
this->addSelection(kNegDaughTofPion, v0SelectionNames.at(kNegDaughTofPion), config.negDauTofPion.value, limits::kAbsUpperLimit, true, true, false);
266+
this->addSelection(kPosDaughTofProton, v0SelectionNames.at(kPosDaughTofProton), config.posDauTofProton.value, limits::kAbsUpperLimit, true, mRequireTof, false);
267+
this->addSelection(kNegDaughTofPion, v0SelectionNames.at(kNegDaughTofPion), config.negDauTofPion.value, limits::kAbsUpperLimit, true, mRequireTof, false);
262268
}
263269

264270
if constexpr (modes::isEqual(v0Type, modes::V0::kAntiLambda)) {
265271
this->addSelection(kPosDaughTpcPion, v0SelectionNames.at(kPosDaughTpcPion), config.posDauTpcPion.value, limits::kAbsUpperLimit, true, true, false);
266272
this->addSelection(kNegDaughTpcProton, v0SelectionNames.at(kNegDaughTpcProton), config.negDauTpcProton.value, limits::kAbsUpperLimit, true, true, false);
267-
this->addSelection(kPosDaughTofPion, v0SelectionNames.at(kPosDaughTofPion), config.posDauTofPion.value, limits::kAbsUpperLimit, true, true, false);
268-
this->addSelection(kNegDaughTofProton, v0SelectionNames.at(kNegDaughTofProton), config.negDauTofProton.value, limits::kAbsUpperLimit, true, true, false);
273+
this->addSelection(kPosDaughTofPion, v0SelectionNames.at(kPosDaughTofPion), config.posDauTofPion.value, limits::kAbsUpperLimit, true, mRequireTof, false);
274+
this->addSelection(kNegDaughTofProton, v0SelectionNames.at(kNegDaughTofProton), config.negDauTofProton.value, limits::kAbsUpperLimit, true, mRequireTof, false);
269275
}
270276
}
271277
if constexpr (modes::isEqual(v0Type, modes::V0::kK0short)) {
@@ -277,8 +283,8 @@ class V0Selection : public baseselection::BaseSelection<float, datatypes::V0Mask
277283

278284
this->addSelection(kPosDaughTpcPion, v0SelectionNames.at(kPosDaughTpcPion), config.posDauTpcPion.value, limits::kAbsUpperLimit, true, true, false);
279285
this->addSelection(kNegDaughTpcPion, v0SelectionNames.at(kNegDaughTpcPion), config.negDauTpcPion.value, limits::kAbsUpperLimit, true, true, false);
280-
this->addSelection(kPosDaughTofPion, v0SelectionNames.at(kPosDaughTofPion), config.posDauTofPion.value, limits::kAbsUpperLimit, true, true, false);
281-
this->addSelection(kNegDaughTofPion, v0SelectionNames.at(kNegDaughTofPion), config.negDauTofPion.value, limits::kAbsUpperLimit, true, true, false);
286+
this->addSelection(kPosDaughTofPion, v0SelectionNames.at(kPosDaughTofPion), config.posDauTofPion.value, limits::kAbsUpperLimit, true, mRequireTof, false);
287+
this->addSelection(kNegDaughTofPion, v0SelectionNames.at(kNegDaughTofPion), config.negDauTofPion.value, limits::kAbsUpperLimit, true, mRequireTof, false);
282288
}
283289

284290
this->addSelection(kDcaDaughMax, v0SelectionNames.at(kDcaDaughMax), config.dcaDauMax.value, limits::kAbsUpperLimit, true, true, false);
@@ -345,10 +351,16 @@ class V0Selection : public baseselection::BaseSelection<float, datatypes::V0Mask
345351
if (posDaughter.hasTOF()) {
346352
this->evaluateObservable(kPosDaughTofPion, posDaughter.tofNSigmaPi());
347353
this->evaluateObservable(kPosDaughTofProton, posDaughter.tofNSigmaPr());
354+
} else if (mKeepTracksWithoutTof) {
355+
this->evaluateObservable(kPosDaughTofPion, 0);
356+
this->evaluateObservable(kPosDaughTofProton, 0);
348357
}
349358
if (negDaughter.hasTOF()) {
350359
this->evaluateObservable(kNegDaughTofPion, negDaughter.tofNSigmaPi());
351360
this->evaluateObservable(kNegDaughTofProton, negDaughter.tofNSigmaPr());
361+
} else if (mKeepTracksWithoutTof) {
362+
this->evaluateObservable(kNegDaughTofPion, 0);
363+
this->evaluateObservable(kNegDaughTofProton, 0);
352364
}
353365

354366
this->assembleBitmask<SelectionHistName>();
@@ -452,6 +464,9 @@ class V0Selection : public baseselection::BaseSelection<float, datatypes::V0Mask
452464
float mEtaMax = 1.f;
453465
float mPhiMin = 0.f;
454466
float mPhiMax = o2::constants::math::TwoPI;
467+
468+
bool mRequireTof = false;
469+
bool mKeepTracksWithoutTof = false;
455470
};
456471

457472
struct V0BuilderProducts : o2::framework::ProducesGroup {

0 commit comments

Comments
 (0)