Skip to content

Commit 6fb6a07

Browse files
committed
[PWGCF] Femto: Reject ML-ambiguous D0/D0bar candidates
1 parent 97f9805 commit 6fb6a07

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

PWGCF/Femto/Core/charmHadronBuilder.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ struct ConfD0Filters : o2::framework::ConfigurableGroup {
6060
// invariant-mass window
6161
o2::framework::Configurable<float> massMin{"massMin", 1.7f, "Minimum invariant mass for D0"};
6262
o2::framework::Configurable<float> massMax{"massMax", 2.0f, "Maximum invariant mass for D0"};
63+
o2::framework::Configurable<bool> rejectAmbiguousHypothesis{"rejectAmbiguousHypothesis", false, "Reject candidates selected under both D0 and D0bar hypotheses"};
6364
};
6465

6566
// derived selection bits for D0s
@@ -131,6 +132,7 @@ enum D0Filters {
131132
kYMax,
132133
kMassMin,
133134
kMassMax,
135+
kRejectAmbiguous,
134136
kD0FiltersMax
135137
};
136138

@@ -148,7 +150,8 @@ const std::unordered_map<D0Filters, std::string> d0FilterNames = {
148150
{kYMin, "Minimum rapidity"},
149151
{kYMax, "Maximum rapidity"},
150152
{kMassMin, "Minimum invariant mass"},
151-
{kMassMax, "Maximum invariant mass"}};
153+
{kMassMax, "Maximum invariant mass"},
154+
{kRejectAmbiguous, "Reject ambiguous D0/D0bar hypothesis"}};
152155

153156
template <modes::CharmHadron hadronType, auto& SelectionHistName, auto& FilterHistName>
154157
class D0Selection : public baseselection::BaseSelection<float, o2::analysis::femto::datatypes::CharmHadronMaskType, kD0SelsMax>
@@ -173,6 +176,7 @@ class D0Selection : public baseselection::BaseSelection<float, o2::analysis::fem
173176
mUseYCut = filter.useYCut.value;
174177
mYMin = filter.yMin.value;
175178
mYMax = filter.yMax.value;
179+
mRejectAmbiguousHypothesis = filter.rejectAmbiguousHypothesis.value;
176180

177181
this->addSelection(kCpaMin, d0SelectionNames.at(kCpaMin), config.cpaMin.value, limits::kLowerLimit, true, true, false);
178182
this->addSelection(kDecayLengthMin, d0SelectionNames.at(kDecayLengthMin), config.decayLengthMin.value, limits::kLowerLimit, true, true, false);
@@ -195,6 +199,7 @@ class D0Selection : public baseselection::BaseSelection<float, o2::analysis::fem
195199
{d0FilterNames.at(kYMax), mYMax},
196200
{d0FilterNames.at(kMassMin), mMassMin},
197201
{d0FilterNames.at(kMassMax), mMassMax},
202+
{d0FilterNames.at(kRejectAmbiguous), static_cast<float>(mRejectAmbiguousHypothesis)},
198203
});
199204
}
200205

@@ -229,6 +234,16 @@ class D0Selection : public baseselection::BaseSelection<float, o2::analysis::fem
229234
this->template fillFilter<FilterHistName>(kHypothesis, p);
230235
pass &= p;
231236

237+
bool competing = false;
238+
if constexpr (modes::isEqual(hadronType, modes::CharmHadron::kD0)) {
239+
competing = d0candidate.isSelD0bar();
240+
} else {
241+
competing = d0candidate.isSelD0();
242+
}
243+
p = !mRejectAmbiguousHypothesis || !competing;
244+
this->template fillFilter<FilterHistName>(kRejectAmbiguous, p);
245+
pass &= p;
246+
232247
p = d0candidate.pt() > mPtMin;
233248
this->template fillFilter<FilterHistName>(kPtMin, p);
234249
pass &= p;
@@ -292,6 +307,7 @@ class D0Selection : public baseselection::BaseSelection<float, o2::analysis::fem
292307
bool mUseYCut = true;
293308
float mYMin = -0.8f;
294309
float mYMax = 0.8f;
310+
bool mRejectAmbiguousHypothesis = false;
295311
};
296312

297313
// tables produced by the D0 builder: kinematics, bitmask and QA

0 commit comments

Comments
 (0)