Skip to content

Commit c9f4528

Browse files
committed
[PWGCF] Don't reject V0s with daughters that don't have TOF.
1 parent 6c2c131 commit c9f4528

2 files changed

Lines changed: 36 additions & 11 deletions

File tree

PWGCF/Femto/Core/cascadeBuilder.h

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ 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, only keep candidates whose daughters have a TOF signal"};
8283

8384
struct ConfXiBits : o2::framework::ConfigurableGroup {
8485
std::string prefix = std::string("XiBits");
@@ -242,7 +243,7 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
242243
mOmegaMassLowerLimit = filter.rejectMassOmegaMin.value;
243244
mOmegaMassUpperLimit = filter.rejectMassOmegaMax.value;
244245
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);
246+
this->addSelection(kBachelorTofPion, cascadeSelectionNames.at(kBachelorTofPion), config.bachelorTofPion.value, limits::kAbsUpperLimit, true, false, false);
246247
}
247248
if constexpr (modes::isEqual(cascadeType, modes::Cascade::kOmega)) {
248249
mOmegaMassLowerLimit = filter.massOmegaMin.value;
@@ -251,7 +252,7 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
251252
mXiMassLowerLimit = filter.rejectMassXiMin.value;
252253
mXiMassUpperLimit = filter.rejectMassXiMax.value;
253254
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);
255+
this->addSelection(kBachelorTofKaon, cascadeSelectionNames.at(kBachelorTofKaon), config.bachelorTofKaon.value, limits::kAbsUpperLimit, true, false, false);
255256
}
256257

257258
mPtMin = filter.ptMin.value;
@@ -262,11 +263,12 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
262263
mPhiMax = filter.phiMax.value;
263264
mLambdaMassMin = filter.massLambdaMin.value;
264265
mLambdaMassMax = filter.massLambdaMax.value;
266+
mRequireTof = config.requireTof.value;
265267

266268
this->addSelection(kPosDauTpc, cascadeSelectionNames.at(kPosDauTpc), config.posDauTpc.value, limits::kAbsUpperLimit, true, true, false);
267269
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);
270+
this->addSelection(kPosDauTof, cascadeSelectionNames.at(kPosDauTof), config.posDauTof.value, limits::kAbsUpperLimit, true, false, false);
271+
this->addSelection(kNegDauTof, cascadeSelectionNames.at(kNegDauTof), config.negDauTof.value, limits::kAbsUpperLimit, true, false, false);
270272

271273
this->addSelection(kCascadeCpaMin, cascadeSelectionNames.at(kCascadeCpaMin), config.cascadeCpaMin.value, limits::kLowerLimit, true, true, false);
272274
this->addSelection(kCascadeTransRadMin, cascadeSelectionNames.at(kCascadeTransRadMin), config.cascadeTransRadMin.value, limits::kLowerLimit, true, true, false);
@@ -336,6 +338,9 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
336338
if (bachelor.hasTOF()) {
337339
this->evaluateObservable(kBachelorTofPion, bachelor.tofNSigmaPi());
338340
this->evaluateObservable(kBachelorTofKaon, bachelor.tofNSigmaKa());
341+
} else if (!mRequireTof) {
342+
this->setBitmask(kBachelorTofPion, std::numeric_limits<datatypes::CascadeMaskType>::max());
343+
this->setBitmask(kBachelorTofKaon, std::numeric_limits<datatypes::CascadeMaskType>::max());
339344
}
340345

341346
// depending on the charge, we check lambda or antilambda hypothesis
@@ -344,18 +349,26 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
344349
this->evaluateObservable(kNegDauTpc, negDaughter.tpcNSigmaPi());
345350
if (posDaughter.hasTOF()) {
346351
this->evaluateObservable(kPosDauTof, posDaughter.tofNSigmaPr());
352+
} else if (!mRequireTof) {
353+
this->setBitmask(kPosDauTof, std::numeric_limits<datatypes::CascadeMaskType>::max());
347354
}
348355
if (negDaughter.hasTOF()) {
349356
this->evaluateObservable(kNegDauTof, negDaughter.tofNSigmaPi());
357+
} else if (!mRequireTof) {
358+
this->setBitmask(kNegDauTof, std::numeric_limits<datatypes::CascadeMaskType>::max());
350359
}
351360
} else if (cascade.sign() > 0) {
352361
this->evaluateObservable(kPosDauTpc, posDaughter.tpcNSigmaPi());
353362
this->evaluateObservable(kNegDauTpc, negDaughter.tpcNSigmaPr());
354363
if (posDaughter.hasTOF()) {
355364
this->evaluateObservable(kPosDauTof, posDaughter.tofNSigmaPi());
365+
} else if (!mRequireTof) {
366+
this->setBitmask(kPosDauTof, std::numeric_limits<datatypes::CascadeMaskType>::max());
356367
}
357368
if (negDaughter.hasTOF()) {
358369
this->evaluateObservable(kNegDauTof, negDaughter.tofNSigmaPr());
370+
} else if (!mRequireTof) {
371+
this->setBitmask(kNegDauTof, std::numeric_limits<datatypes::CascadeMaskType>::max());
359372
}
360373
} else {
361374
LOG(warn) << "Encountered Cascade candidate with 0 charge";
@@ -468,6 +481,7 @@ class CascadeSelection : public baseselection::BaseSelection<float, o2::analysis
468481
float mPhiMax = o2::constants::math::TwoPI;
469482
float mLambdaMassMin = 1.f;
470483
float mLambdaMassMax = 1.2f;
484+
bool mRequireTof = false;
471485
};
472486

473487
struct CascadeBuilderProducts : o2::framework::ProducesGroup {

PWGCF/Femto/Core/v0Builder.h

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ 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, only keep candidates whose daughters have a TOF signal"};
8889
};
8990

9091
// derived selection bits for K0Short
@@ -95,6 +96,7 @@ struct ConfK0shortBits : o2::framework::ConfigurableGroup {
9596
o2::framework::Configurable<std::vector<float>> negDauTpcPion{"negDauTpcPion", {5.f}, "Maximum |nsimga_Pion| TPC for negative daughter tracks"};
9697
o2::framework::Configurable<std::vector<float>> posDauTofPion{"posDauTofPion", {}, "Maximum |nsigma_Pion| TOF for positive daughter tracks"};
9798
o2::framework::Configurable<std::vector<float>> negDauTofPion{"negDauTofPion", {}, "Maximum |nsigma_Pion| TOF for negative daughter tracks"};
99+
o2::framework::Configurable<bool> requireTof{"requireTof", false, "If true, only keep candidates whose daughters have a TOF signal"};
98100
};
99101

100102
#undef V0_DEFAULT_BITS
@@ -246,6 +248,7 @@ class V0Selection : public baseselection::BaseSelection<float, datatypes::V0Mask
246248
mEtaMax = filter.etaMax.value;
247249
mPhiMin = filter.phiMin.value;
248250
mPhiMax = filter.phiMax.value;
251+
mRequireTof = config.requireTof.value;
249252

250253
if constexpr (modes::isEqual(v0Type, modes::V0::kLambda) || modes::isEqual(v0Type, modes::V0::kAntiLambda)) {
251254
mMassLambdaLowerLimit = filter.massMinLambda.value;
@@ -257,15 +260,15 @@ class V0Selection : public baseselection::BaseSelection<float, datatypes::V0Mask
257260
if constexpr (modes::isEqual(v0Type, modes::V0::kLambda)) {
258261
this->addSelection(kPosDaughTpcProton, v0SelectionNames.at(kPosDaughTpcProton), config.posDauTpcProton.value, limits::kAbsUpperLimit, true, true, false);
259262
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);
263+
this->addSelection(kPosDaughTofProton, v0SelectionNames.at(kPosDaughTofProton), config.posDauTofProton.value, limits::kAbsUpperLimit, true, false, false);
264+
this->addSelection(kNegDaughTofPion, v0SelectionNames.at(kNegDaughTofPion), config.negDauTofPion.value, limits::kAbsUpperLimit, true, false, false);
262265
}
263266

264267
if constexpr (modes::isEqual(v0Type, modes::V0::kAntiLambda)) {
265268
this->addSelection(kPosDaughTpcPion, v0SelectionNames.at(kPosDaughTpcPion), config.posDauTpcPion.value, limits::kAbsUpperLimit, true, true, false);
266269
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);
270+
this->addSelection(kPosDaughTofPion, v0SelectionNames.at(kPosDaughTofPion), config.posDauTofPion.value, limits::kAbsUpperLimit, true, false, false);
271+
this->addSelection(kNegDaughTofProton, v0SelectionNames.at(kNegDaughTofProton), config.negDauTofProton.value, limits::kAbsUpperLimit, true, false, false);
269272
}
270273
}
271274
if constexpr (modes::isEqual(v0Type, modes::V0::kK0short)) {
@@ -277,8 +280,8 @@ class V0Selection : public baseselection::BaseSelection<float, datatypes::V0Mask
277280

278281
this->addSelection(kPosDaughTpcPion, v0SelectionNames.at(kPosDaughTpcPion), config.posDauTpcPion.value, limits::kAbsUpperLimit, true, true, false);
279282
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);
283+
this->addSelection(kPosDaughTofPion, v0SelectionNames.at(kPosDaughTofPion), config.posDauTofPion.value, limits::kAbsUpperLimit, true, false, false);
284+
this->addSelection(kNegDaughTofPion, v0SelectionNames.at(kNegDaughTofPion), config.negDauTofPion.value, limits::kAbsUpperLimit, true, false, false);
282285
}
283286

284287
this->addSelection(kDcaDaughMax, v0SelectionNames.at(kDcaDaughMax), config.dcaDauMax.value, limits::kAbsUpperLimit, true, true, false);
@@ -345,10 +348,16 @@ class V0Selection : public baseselection::BaseSelection<float, datatypes::V0Mask
345348
if (posDaughter.hasTOF()) {
346349
this->evaluateObservable(kPosDaughTofPion, posDaughter.tofNSigmaPi());
347350
this->evaluateObservable(kPosDaughTofProton, posDaughter.tofNSigmaPr());
351+
} else if (!mRequireTof) {
352+
this->setBitmask(kPosDaughTofPion, std::numeric_limits<datatypes::V0MaskType>::max());
353+
this->setBitmask(kPosDaughTofProton, std::numeric_limits<datatypes::V0MaskType>::max());
348354
}
349355
if (negDaughter.hasTOF()) {
350356
this->evaluateObservable(kNegDaughTofPion, negDaughter.tofNSigmaPi());
351357
this->evaluateObservable(kNegDaughTofProton, negDaughter.tofNSigmaPr());
358+
} else if (!mRequireTof) {
359+
this->setBitmask(kNegDaughTofPion, std::numeric_limits<datatypes::V0MaskType>::max());
360+
this->setBitmask(kNegDaughTofProton, std::numeric_limits<datatypes::V0MaskType>::max());
352361
}
353362

354363
this->assembleBitmask<SelectionHistName>();
@@ -452,6 +461,8 @@ class V0Selection : public baseselection::BaseSelection<float, datatypes::V0Mask
452461
float mEtaMax = 1.f;
453462
float mPhiMin = 0.f;
454463
float mPhiMax = o2::constants::math::TwoPI;
464+
465+
bool mRequireTof = false;
455466
};
456467

457468
struct V0BuilderProducts : o2::framework::ProducesGroup {

0 commit comments

Comments
 (0)