Skip to content

Commit bc14f72

Browse files
committed
Mirror DsToKKPi table filling
1 parent 6b2ee6c commit bc14f72

1 file changed

Lines changed: 22 additions & 13 deletions

File tree

PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ DECLARE_SOA_COLUMN(CpaJpsi, cpaJpsi, float);
133133
DECLARE_SOA_COLUMN(CpaXYJpsi, cpaXYJpsi, float); //! Cosine pointing angle in transverse plane of Jpsi daughter candidate
134134
DECLARE_SOA_COLUMN(MaxNormalisedDeltaIP, maxNormalisedDeltaIP, float); //! Maximum normalized difference between measured and expected impact parameter of candidate prongs
135135
DECLARE_SOA_COLUMN(MlScoreSig, mlScoreSig, float); //! ML score for signal class
136+
DECLARE_SOA_COLUMN(IsSelB0KPi, isSelB0KPi, int8_t); //! Selection-step bitmask passed under the KPi K*0 mass hypothesis (see SelectionStep)
137+
DECLARE_SOA_COLUMN(IsSelB0PiK, isSelB0PiK, int8_t); //! Selection-step bitmask passed under the PiK K*0 mass hypothesis (see SelectionStep)
136138
DECLARE_SOA_COLUMN(FlagWrongCollision, flagWrongCollision, int8_t); //! Flag for association with wrong collision
137139
} // namespace hf_cand_b0tojpsik0star_lite
138140

@@ -155,7 +157,8 @@ DECLARE_SOA_TABLE(HfRedCandB0Lites, "AOD", "HFREDCANDB0LITE", //! Table with som
155157
hf_cand_b0tojpsik0star_lite::ImpactParameterProductK0Star,
156158
hf_cand_b0tojpsik0star_lite::MaxNormalisedDeltaIP,
157159
hf_cand_b0tojpsik0star_lite::MlScoreSig,
158-
// hf_sel_candidate_bplus::IsSelBsToJpsiPi,
160+
hf_cand_b0tojpsik0star_lite::IsSelB0KPi,
161+
hf_cand_b0tojpsik0star_lite::IsSelB0PiK,
159162
// Jpsi meson features
160163
hf_cand_b0tojpsik0star_lite::MJpsi,
161164
hf_cand_b0tojpsik0star_lite::PtJpsi,
@@ -403,8 +406,10 @@ struct HfTaskB0ToJpsiK0StarReduced {
403406
flagMcDecayChanRec == o2::hf_decay::hf_cand_beauty::B0ToJpsiKstar0;
404407
}
405408

406-
bool isSelectedKPi{selectionFlagB0 < BIT(SelectionStep::RecoSkims) * 2 - 1};
407-
bool isSelectedPiK{selectionFlagB0 < BIT(SelectionStep::RecoSkims) * 2 - 1};
409+
int8_t statusB0KPi{0};
410+
int8_t statusB0PiK{0};
411+
SETBIT(statusB0KPi, SelectionStep::RecoSkims);
412+
SETBIT(statusB0PiK, SelectionStep::RecoSkims);
408413

409414
// topological selection for the two K*0 mass hypotheses
410415
bool selKPi = HfHelper::selectionB0ToJpsiK0StarTopol(candidate, cuts, binsPt, useJpsiPdgMass, useK0StarPdgMass, true);
@@ -413,11 +418,11 @@ struct HfTaskB0ToJpsiK0StarReduced {
413418
if (!selKPi && !selPiK && selectionFlagB0 >= BIT(SelectionStep::RecoTopol) * 2 - 1) {
414419
return;
415420
}
416-
if (selKPi && selectionFlagB0 < BIT(SelectionStep::RecoTopol) * 2 - 1) {
417-
isSelectedKPi = true;
421+
if (selKPi) {
422+
SETBIT(statusB0KPi, SelectionStep::RecoTopol);
418423
}
419-
if (selPiK && selectionFlagB0 < BIT(SelectionStep::RecoTopol) * 2 - 1) {
420-
isSelectedPiK = true;
424+
if (selPiK) {
425+
SETBIT(statusB0PiK, SelectionStep::RecoTopol);
421426
}
422427

423428
// track-level PID selection
@@ -450,11 +455,11 @@ struct HfTaskB0ToJpsiK0StarReduced {
450455
if (!selKPi && !selPiK && selectionFlagB0 >= BIT(SelectionStep::RecoPID) * 2 - 1) {
451456
return;
452457
}
453-
if (selKPi && selectionFlagB0 < BIT(SelectionStep::RecoPID) * 2 - 1) {
454-
isSelectedKPi = true;
458+
if (selKPi) {
459+
SETBIT(statusB0KPi, SelectionStep::RecoPID);
455460
}
456-
if (selPiK && selectionFlagB0 < BIT(SelectionStep::RecoPID) * 2 - 1) {
457-
isSelectedPiK = true;
461+
if (selPiK) {
462+
SETBIT(statusB0PiK, SelectionStep::RecoPID);
458463
}
459464
}
460465

@@ -468,6 +473,7 @@ struct HfTaskB0ToJpsiK0StarReduced {
468473
selKPi = hfMlResponse.isSelectedMl(inputFeaturesKPi, ptCandB0, outputMl);
469474
if (selKPi) {
470475
mlScoreSigKPi = outputMl[1];
476+
SETBIT(statusB0KPi, SelectionStep::RecoMl);
471477
}
472478
}
473479
if (selPiK) {
@@ -476,6 +482,7 @@ struct HfTaskB0ToJpsiK0StarReduced {
476482
selPiK = hfMlResponse.isSelectedMl(inputFeaturesPiK, ptCandB0, outputMl);
477483
if (selPiK) {
478484
mlScoreSigPiK = outputMl[1];
485+
SETBIT(statusB0PiK, SelectionStep::RecoMl);
479486
}
480487
}
481488
if (!selKPi && !selPiK && selectionFlagB0 >= BIT(SelectionStep::RecoMl) * 2 - 1) {
@@ -558,6 +565,8 @@ struct HfTaskB0ToJpsiK0StarReduced {
558565
candidate.impactParameterProductK0Star(),
559566
candidate.maxNormalisedDeltaIP(),
560567
mlScoreSig,
568+
isSelKPi ? statusB0KPi : -1,
569+
isSelKPi ? -1 : statusB0PiK,
561570
// J/Psi features
562571
invMassJpsi,
563572
ptJpsi,
@@ -609,10 +618,10 @@ struct HfTaskB0ToJpsiK0StarReduced {
609618
ptMother);
610619
};
611620

612-
if (selKPi) {
621+
if (statusB0KPi >= selectionFlagB0) {
613622
fillTable(true);
614623
}
615-
if (selPiK) {
624+
if (statusB0PiK >= selectionFlagB0) {
616625
fillTable(false);
617626
}
618627
}

0 commit comments

Comments
 (0)