Skip to content

Commit 3d37d83

Browse files
committed
Add requireTof and keepTracksWithoutTof configurables, change setBitmask value to 0
1 parent 0aa1c28 commit 3d37d83

2 files changed

Lines changed: 37 additions & 30 deletions

File tree

PWGCF/Femto/Core/cascadeBuilder.h

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ struct ConfCascadeFilters : o2::framework::ConfigurableGroup {
8080
o2::framework::Configurable<std::vector<float>> negDauTpc{"negDauTpc", {5.f}, "Maximum |nsimga_Pion/Proton| TPC for negative daughter tracks"}; \
8181
o2::framework::Configurable<std::vector<float>> posDauTof{"posDauTof", {}, "Maximum |nsimga_Pion/Proton| TOF for positive daughter tracks"}; \
8282
o2::framework::Configurable<std::vector<float>> negDauTof{"negDauTof", {}, "Maximum |nsigma_Pion/Proton| TOF for negative daughter tracks"}; \
83-
o2::framework::Configurable<bool> requireTof{"requireTof", false, "If true, only keep candidates whose daughters have a TOF signal"};
83+
o2::framework::Configurable<bool> requireTof{"requireTof", false, "If true, TOF PID is a mandatory selection"}; \
84+
o2::framework::Configurable<bool> keepTracksWithoutTof{"keepTracksWithoutTof", true, "If true, candidates whose daughters have no TOF signal are kept"};
8485

8586
struct ConfXiBits : o2::framework::ConfigurableGroup {
8687
std::string prefix = std::string("XiBits");
@@ -244,7 +245,7 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
244245
mOmegaMassLowerLimit = filter.rejectMassOmegaMin.value;
245246
mOmegaMassUpperLimit = filter.rejectMassOmegaMax.value;
246247
this->addSelection(kBachelorTpcPion, cascadeSelectionNames.at(kBachelorTpcPion), config.bachelorTpcPion.value, limits::kAbsUpperLimit, true, true, false);
247-
this->addSelection(kBachelorTofPion, cascadeSelectionNames.at(kBachelorTofPion), config.bachelorTofPion.value, limits::kAbsUpperLimit, true, false, false);
248+
this->addSelection(kBachelorTofPion, cascadeSelectionNames.at(kBachelorTofPion), config.bachelorTofPion.value, limits::kAbsUpperLimit, true, mRequireTof, false);
248249
}
249250
if constexpr (modes::isEqual(cascadeType, modes::Cascade::kOmega)) {
250251
mOmegaMassLowerLimit = filter.massOmegaMin.value;
@@ -253,7 +254,7 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
253254
mXiMassLowerLimit = filter.rejectMassXiMin.value;
254255
mXiMassUpperLimit = filter.rejectMassXiMax.value;
255256
this->addSelection(kBachelorTpcKaon, cascadeSelectionNames.at(kBachelorTpcKaon), config.bachelorTpcKaon.value, limits::kAbsUpperLimit, true, true, false);
256-
this->addSelection(kBachelorTofKaon, cascadeSelectionNames.at(kBachelorTofKaon), config.bachelorTofKaon.value, limits::kAbsUpperLimit, true, false, false);
257+
this->addSelection(kBachelorTofKaon, cascadeSelectionNames.at(kBachelorTofKaon), config.bachelorTofKaon.value, limits::kAbsUpperLimit, true, mRequireTof, false);
257258
}
258259

259260
mPtMin = filter.ptMin.value;
@@ -265,11 +266,12 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
265266
mLambdaMassMin = filter.massLambdaMin.value;
266267
mLambdaMassMax = filter.massLambdaMax.value;
267268
mRequireTof = config.requireTof.value;
269+
mKeepTracksWithoutTof = config.keepTracksWithoutTof.value;
268270

269271
this->addSelection(kPosDauTpc, cascadeSelectionNames.at(kPosDauTpc), config.posDauTpc.value, limits::kAbsUpperLimit, true, true, false);
270272
this->addSelection(kNegDauTpc, cascadeSelectionNames.at(kNegDauTpc), config.negDauTpc.value, limits::kAbsUpperLimit, true, true, false);
271-
this->addSelection(kPosDauTof, cascadeSelectionNames.at(kPosDauTof), config.posDauTof.value, limits::kAbsUpperLimit, true, false, false);
272-
this->addSelection(kNegDauTof, cascadeSelectionNames.at(kNegDauTof), config.negDauTof.value, limits::kAbsUpperLimit, true, false, false);
273+
this->addSelection(kPosDauTof, cascadeSelectionNames.at(kPosDauTof), config.posDauTof.value, limits::kAbsUpperLimit, true, mRequireTof, false);
274+
this->addSelection(kNegDauTof, cascadeSelectionNames.at(kNegDauTof), config.negDauTof.value, limits::kAbsUpperLimit, true, mRequireTof, false);
273275

274276
this->addSelection(kCascadeCpaMin, cascadeSelectionNames.at(kCascadeCpaMin), config.cascadeCpaMin.value, limits::kLowerLimit, true, true, false);
275277
this->addSelection(kCascadeTransRadMin, cascadeSelectionNames.at(kCascadeTransRadMin), config.cascadeTransRadMin.value, limits::kLowerLimit, true, true, false);
@@ -339,9 +341,9 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
339341
if (bachelor.hasTOF()) {
340342
this->evaluateObservable(kBachelorTofPion, bachelor.tofNSigmaPi());
341343
this->evaluateObservable(kBachelorTofKaon, bachelor.tofNSigmaKa());
342-
} else if (!mRequireTof) {
343-
this->setBitmask(kBachelorTofPion, std::numeric_limits<datatypes::CascadeMaskType>::max());
344-
this->setBitmask(kBachelorTofKaon, std::numeric_limits<datatypes::CascadeMaskType>::max());
344+
} else if (mKeepTracksWithoutTof) {
345+
this->setBitmask(kBachelorTofPion, 0);
346+
this->setBitmask(kBachelorTofKaon, 0);
345347
}
346348

347349
// depending on the charge, we check lambda or antilambda hypothesis
@@ -350,26 +352,26 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
350352
this->evaluateObservable(kNegDauTpc, negDaughter.tpcNSigmaPi());
351353
if (posDaughter.hasTOF()) {
352354
this->evaluateObservable(kPosDauTof, posDaughter.tofNSigmaPr());
353-
} else if (!mRequireTof) {
354-
this->setBitmask(kPosDauTof, std::numeric_limits<datatypes::CascadeMaskType>::max());
355+
} else if (mKeepTracksWithoutTof) {
356+
this->setBitmask(kPosDauTof, 0);
355357
}
356358
if (negDaughter.hasTOF()) {
357359
this->evaluateObservable(kNegDauTof, negDaughter.tofNSigmaPi());
358-
} else if (!mRequireTof) {
359-
this->setBitmask(kNegDauTof, std::numeric_limits<datatypes::CascadeMaskType>::max());
360+
} else if (mKeepTracksWithoutTof) {
361+
this->setBitmask(kNegDauTof, 0);
360362
}
361363
} else if (cascade.sign() > 0) {
362364
this->evaluateObservable(kPosDauTpc, posDaughter.tpcNSigmaPi());
363365
this->evaluateObservable(kNegDauTpc, negDaughter.tpcNSigmaPr());
364366
if (posDaughter.hasTOF()) {
365367
this->evaluateObservable(kPosDauTof, posDaughter.tofNSigmaPi());
366-
} else if (!mRequireTof) {
367-
this->setBitmask(kPosDauTof, std::numeric_limits<datatypes::CascadeMaskType>::max());
368+
} else if (mKeepTracksWithoutTof) {
369+
this->setBitmask(kPosDauTof, 0);
368370
}
369371
if (negDaughter.hasTOF()) {
370372
this->evaluateObservable(kNegDauTof, negDaughter.tofNSigmaPr());
371-
} else if (!mRequireTof) {
372-
this->setBitmask(kNegDauTof, std::numeric_limits<datatypes::CascadeMaskType>::max());
373+
} else if (mKeepTracksWithoutTof) {
374+
this->setBitmask(kNegDauTof, 0);
373375
}
374376
} else {
375377
LOG(warn) << "Encountered Cascade candidate with 0 charge";
@@ -483,6 +485,7 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
483485
float mLambdaMassMin = 1.f;
484486
float mLambdaMassMax = 1.2f;
485487
bool mRequireTof = false;
488+
bool mKeepTracksWithoutTof = false;
486489
};
487490

488491
struct CascadeBuilderProducts : o2::framework::ProducesGroup {

PWGCF/Femto/Core/v0Builder.h

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ struct ConfLambdaBits : o2::framework::ConfigurableGroup {
8686
o2::framework::Configurable<std::vector<float>> posDauTofProton{"posDauTofProton", {}, "Maximum |nsigma_Proton| TOF for positive daughter tracks"};
8787
o2::framework::Configurable<std::vector<float>> negDauTofPion{"negDauTofPion", {}, "Maximum |nsigma_Pion| TOF for negative daughter tracks"};
8888
o2::framework::Configurable<std::vector<float>> negDauTofProton{"negDauTofProton", {}, "Maximum |nsigma_Proton| TOF for negative daughter tracks"};
89-
o2::framework::Configurable<bool> requireTof{"requireTof", false, "If true, only keep candidates whose daughters have a TOF signal"};
89+
o2::framework::Configurable<bool> requireTof{"requireTof", false, "If true, TOF PID is a mandatory selection"};
90+
o2::framework::Configurable<bool> keepTracksWithoutTof{"keepTracksWithoutTof", true, "If true, candidates whose daughters have no TOF signal are kept"};
9091
};
9192

9293
// derived selection bits for K0Short
@@ -97,7 +98,8 @@ struct ConfK0shortBits : o2::framework::ConfigurableGroup {
9798
o2::framework::Configurable<std::vector<float>> negDauTpcPion{"negDauTpcPion", {5.f}, "Maximum |nsimga_Pion| TPC for negative daughter tracks"};
9899
o2::framework::Configurable<std::vector<float>> posDauTofPion{"posDauTofPion", {}, "Maximum |nsigma_Pion| TOF for positive daughter tracks"};
99100
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, only keep candidates whose daughters have a TOF signal"};
101+
o2::framework::Configurable<bool> requireTof{"requireTof", false, "If true, TOF PID is a mandatory selection"};
102+
o2::framework::Configurable<bool> keepTracksWithoutTof{"keepTracksWithoutTof", true, "If true, candidates whose daughters have no TOF signal are kept"};
101103
};
102104

103105
#undef V0_DEFAULT_BITS
@@ -250,6 +252,7 @@ class V0Selection : public baseselection::BaseSelection<float, datatypes::V0Mask
250252
mPhiMin = filter.phiMin.value;
251253
mPhiMax = filter.phiMax.value;
252254
mRequireTof = config.requireTof.value;
255+
mKeepTracksWithoutTof = config.keepTracksWithoutTof.value;
253256

254257
if constexpr (modes::isEqual(v0Type, modes::V0::kLambda) || modes::isEqual(v0Type, modes::V0::kAntiLambda)) {
255258
mMassLambdaLowerLimit = filter.massMinLambda.value;
@@ -261,15 +264,15 @@ class V0Selection : public baseselection::BaseSelection<float, datatypes::V0Mask
261264
if constexpr (modes::isEqual(v0Type, modes::V0::kLambda)) {
262265
this->addSelection(kPosDaughTpcProton, v0SelectionNames.at(kPosDaughTpcProton), config.posDauTpcProton.value, limits::kAbsUpperLimit, true, true, false);
263266
this->addSelection(kNegDaughTpcPion, v0SelectionNames.at(kNegDaughTpcPion), config.negDauTpcPion.value, limits::kAbsUpperLimit, true, true, false);
264-
this->addSelection(kPosDaughTofProton, v0SelectionNames.at(kPosDaughTofProton), config.posDauTofProton.value, limits::kAbsUpperLimit, true, false, false);
265-
this->addSelection(kNegDaughTofPion, v0SelectionNames.at(kNegDaughTofPion), config.negDauTofPion.value, limits::kAbsUpperLimit, true, false, false);
267+
this->addSelection(kPosDaughTofProton, v0SelectionNames.at(kPosDaughTofProton), config.posDauTofProton.value, limits::kAbsUpperLimit, true, mRequireTof, false);
268+
this->addSelection(kNegDaughTofPion, v0SelectionNames.at(kNegDaughTofPion), config.negDauTofPion.value, limits::kAbsUpperLimit, true, mRequireTof, false);
266269
}
267270

268271
if constexpr (modes::isEqual(v0Type, modes::V0::kAntiLambda)) {
269272
this->addSelection(kPosDaughTpcPion, v0SelectionNames.at(kPosDaughTpcPion), config.posDauTpcPion.value, limits::kAbsUpperLimit, true, true, false);
270273
this->addSelection(kNegDaughTpcProton, v0SelectionNames.at(kNegDaughTpcProton), config.negDauTpcProton.value, limits::kAbsUpperLimit, true, true, false);
271-
this->addSelection(kPosDaughTofPion, v0SelectionNames.at(kPosDaughTofPion), config.posDauTofPion.value, limits::kAbsUpperLimit, true, false, false);
272-
this->addSelection(kNegDaughTofProton, v0SelectionNames.at(kNegDaughTofProton), config.negDauTofProton.value, limits::kAbsUpperLimit, true, false, false);
274+
this->addSelection(kPosDaughTofPion, v0SelectionNames.at(kPosDaughTofPion), config.posDauTofPion.value, limits::kAbsUpperLimit, true, mRequireTof, false);
275+
this->addSelection(kNegDaughTofProton, v0SelectionNames.at(kNegDaughTofProton), config.negDauTofProton.value, limits::kAbsUpperLimit, true, mRequireTof, false);
273276
}
274277
}
275278
if constexpr (modes::isEqual(v0Type, modes::V0::kK0short)) {
@@ -281,8 +284,8 @@ class V0Selection : public baseselection::BaseSelection<float, datatypes::V0Mask
281284

282285
this->addSelection(kPosDaughTpcPion, v0SelectionNames.at(kPosDaughTpcPion), config.posDauTpcPion.value, limits::kAbsUpperLimit, true, true, false);
283286
this->addSelection(kNegDaughTpcPion, v0SelectionNames.at(kNegDaughTpcPion), config.negDauTpcPion.value, limits::kAbsUpperLimit, true, true, false);
284-
this->addSelection(kPosDaughTofPion, v0SelectionNames.at(kPosDaughTofPion), config.posDauTofPion.value, limits::kAbsUpperLimit, true, false, false);
285-
this->addSelection(kNegDaughTofPion, v0SelectionNames.at(kNegDaughTofPion), config.negDauTofPion.value, limits::kAbsUpperLimit, true, false, false);
287+
this->addSelection(kPosDaughTofPion, v0SelectionNames.at(kPosDaughTofPion), config.posDauTofPion.value, limits::kAbsUpperLimit, true, mRequireTof, false);
288+
this->addSelection(kNegDaughTofPion, v0SelectionNames.at(kNegDaughTofPion), config.negDauTofPion.value, limits::kAbsUpperLimit, true, mRequireTof, false);
286289
}
287290

288291
this->addSelection(kDcaDaughMax, v0SelectionNames.at(kDcaDaughMax), config.dcaDauMax.value, limits::kAbsUpperLimit, true, true, false);
@@ -349,16 +352,16 @@ class V0Selection : public baseselection::BaseSelection<float, datatypes::V0Mask
349352
if (posDaughter.hasTOF()) {
350353
this->evaluateObservable(kPosDaughTofPion, posDaughter.tofNSigmaPi());
351354
this->evaluateObservable(kPosDaughTofProton, posDaughter.tofNSigmaPr());
352-
} else if (!mRequireTof) {
353-
this->setBitmask(kPosDaughTofPion, std::numeric_limits<datatypes::V0MaskType>::max());
354-
this->setBitmask(kPosDaughTofProton, std::numeric_limits<datatypes::V0MaskType>::max());
355+
} else if (mKeepTracksWithoutTof) {
356+
this->setBitmask(kPosDaughTofPion, 0);
357+
this->setBitmask(kPosDaughTofProton, 0);
355358
}
356359
if (negDaughter.hasTOF()) {
357360
this->evaluateObservable(kNegDaughTofPion, negDaughter.tofNSigmaPi());
358361
this->evaluateObservable(kNegDaughTofProton, negDaughter.tofNSigmaPr());
359-
} else if (!mRequireTof) {
360-
this->setBitmask(kNegDaughTofPion, std::numeric_limits<datatypes::V0MaskType>::max());
361-
this->setBitmask(kNegDaughTofProton, std::numeric_limits<datatypes::V0MaskType>::max());
362+
} else if (mKeepTracksWithoutTof) {
363+
this->setBitmask(kNegDaughTofPion, 0);
364+
this->setBitmask(kNegDaughTofProton, 0);
362365
}
363366

364367
this->assembleBitmask<SelectionHistName>();
@@ -464,6 +467,7 @@ class V0Selection : public baseselection::BaseSelection<float, datatypes::V0Mask
464467
float mPhiMax = o2::constants::math::TwoPI;
465468

466469
bool mRequireTof = false;
470+
bool mKeepTracksWithoutTof = false;
467471
};
468472

469473
struct V0BuilderProducts : o2::framework::ProducesGroup {

0 commit comments

Comments
 (0)