Skip to content

Commit 1c25547

Browse files
[PWGHF] Improve the mass window selection and v0 type matched for lambda (AliceO2Group#12905)
1 parent 87063e3 commit 1c25547

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -246,25 +246,33 @@ struct HfCandidateCreatorCharmResoReduced {
246246
bool isV0Selected(V0RedTable const& candV0)
247247
{
248248
int ptBin = findBin(cfgV0Cuts.binsPtV0, candV0.pt());
249+
const float invMassLow = cfgV0Cuts.cutsV0->get(ptBin, "invMassLow");
250+
const float invMassHigh = cfgV0Cuts.cutsV0->get(ptBin, "invMassHigh");
249251
if (ptBin == -1) {
250252
return false;
251253
}
252254
if (cfgV0Cuts.v0Type == V0Type::K0s) { // K0s
253255
if (!TESTBIT(candV0.v0Type(), V0Type::K0s)) {
254256
return false;
255257
}
256-
if ((candV0.invMassK0s() - MassK0Short) > cfgV0Cuts.cutsV0->get(ptBin, "invMassLow") && (MassK0Short - candV0.invMassK0s()) < cfgV0Cuts.cutsV0->get(ptBin, "invMassLow")) {
258+
if (candV0.invMassK0s() < invMassLow || candV0.invMassK0s() > invMassHigh) {
257259
return false;
258260
}
259261
} else if (cfgV0Cuts.v0Type == V0Type::Lambda) { // Lambda
260262
if (!TESTBIT(candV0.v0Type(), V0Type::Lambda) && !TESTBIT(candV0.v0Type(), V0Type::AntiLambda)) {
261263
return false;
262264
}
263-
if ((candV0.invMassLambda() - MassLambda) > cfgV0Cuts.cutsV0->get(ptBin, "invMassLow") && (MassLambda - candV0.invMassLambda()) < cfgV0Cuts.cutsV0->get(ptBin, "invMassLow")) {
264-
return false;
265+
266+
if (TESTBIT(candV0.v0Type(), V0Type::Lambda)) {
267+
if (candV0.invMassLambda() < invMassLow || candV0.invMassLambda() > invMassHigh) {
268+
return false;
269+
}
265270
}
266-
if ((candV0.invMassAntiLambda() - MassLambda) > cfgV0Cuts.cutsV0->get(ptBin, "invMassLow") && (MassLambda - candV0.invMassAntiLambda()) < cfgV0Cuts.cutsV0->get(ptBin, "invMassLow")) {
267-
return false;
271+
272+
if (TESTBIT(candV0.v0Type(), V0Type::AntiLambda)) {
273+
if (candV0.invMassAntiLambda() < invMassLow || candV0.invMassAntiLambda() > invMassHigh) {
274+
return false;
275+
}
268276
}
269277
} else {
270278
LOG(error) << "Unsupported V0 type for selection: " << cfgV0Cuts.v0Type;
@@ -378,10 +386,10 @@ struct HfCandidateCreatorCharmResoReduced {
378386
invMassReso = RecoDecay::m(std::array{pVecD, pVecV0Tr}, std::array{MassDPlus, MassK0Short});
379387
}
380388
} else if (cfgV0Cuts.v0Type == V0Type::Lambda) { // Lambda
381-
if (candV0Tr.v0Type() == V0Type::Lambda) {
389+
if (TESTBIT(candV0Tr.v0Type(), V0Type::Lambda)) {
382390
invMassV0Tr = candV0Tr.invMassLambda();
383391
signReso = candD.sign();
384-
} else if (candV0Tr.v0Type() == V0Type::AntiLambda) {
392+
} else if (TESTBIT(candV0Tr.v0Type(), V0Type::AntiLambda)) {
385393
invMassV0Tr = candV0Tr.invMassAntiLambda();
386394
signReso = candD.sign();
387395
isWrongSign = 1;
@@ -464,9 +472,9 @@ struct HfCandidateCreatorCharmResoReduced {
464472
invMassReso = RecoDecay::m(std::array{pVecD, pVecV0Tr}, std::array{MassDStar, MassK0Short});
465473
}
466474
} else if (cfgV0Cuts.v0Type == V0Type::Lambda) { // Lambda
467-
if (candV0Tr.v0Type() == V0Type::Lambda) {
475+
if (TESTBIT(candV0Tr.v0Type(), V0Type::Lambda)) {
468476
invMassV0Tr = candV0Tr.invMassLambda();
469-
} else if (candV0Tr.v0Type() == V0Type::AntiLambda) {
477+
} else if (TESTBIT(candV0Tr.v0Type(), V0Type::AntiLambda)) {
470478
invMassV0Tr = candV0Tr.invMassAntiLambda();
471479
isWrongSign = 1;
472480
}
@@ -554,9 +562,9 @@ struct HfCandidateCreatorCharmResoReduced {
554562
invMassReso = RecoDecay::m(std::array{pVecD, pVecV0Tr}, std::array{MassD0, MassK0Short});
555563
}
556564
} else if (cfgV0Cuts.v0Type == V0Type::Lambda) { // Lambda
557-
if (candV0Tr.v0Type() == V0Type::Lambda) {
565+
if (TESTBIT(candV0Tr.v0Type(), V0Type::Lambda)) {
558566
invMassV0Tr = candV0Tr.invMassLambda();
559-
} else if (candV0Tr.v0Type() == V0Type::AntiLambda) {
567+
} else if (TESTBIT(candV0Tr.v0Type(), V0Type::AntiLambda)) {
560568
invMassV0Tr = candV0Tr.invMassAntiLambda();
561569
isWrongSign = 1;
562570
}
@@ -628,10 +636,10 @@ struct HfCandidateCreatorCharmResoReduced {
628636
invMassReso = RecoDecay::m(std::array{pVecD, pVecV0Tr}, std::array{MassD0Bar, MassK0Short});
629637
}
630638
} else if (cfgV0Cuts.v0Type == V0Type::Lambda) { // Lambda
631-
if (candV0Tr.v0Type() == V0Type::Lambda) {
639+
if (TESTBIT(candV0Tr.v0Type(), V0Type::Lambda)) {
632640
invMassV0Tr = candV0Tr.invMassLambda();
633641
isWrongSign = 1;
634-
} else if (candV0Tr.v0Type() == V0Type::AntiLambda) {
642+
} else if (TESTBIT(candV0Tr.v0Type(), V0Type::AntiLambda)) {
635643
invMassV0Tr = candV0Tr.invMassAntiLambda();
636644
}
637645
if (useDeltaMass) {

0 commit comments

Comments
 (0)