Skip to content

Commit 6602527

Browse files
authored
[PWGHF] B2JPsi: Add tagging of swapped candidates and add more treatment for photons (#18775)
1 parent 88c3dff commit 6602527

6 files changed

Lines changed: 126 additions & 41 deletions

File tree

‎PWGHF/D2H/DataModel/ReducedDataModel.h‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,8 @@ using HfRedCandLb = soa::Join<HfCandLbExt, HfRedLbProngs>;
888888

889889
namespace hf_cand_mc_flag
890890
{
891-
DECLARE_SOA_COLUMN(FlagWrongCollision, flagWrongCollision, int8_t); //! reconstruction level
891+
DECLARE_SOA_COLUMN(FlagWrongCollision, flagWrongCollision, int8_t); //! reconstruction level
892+
DECLARE_SOA_COLUMN(IsHadronLeptonSwapped, isHadronLeptonSwapped, bool); //! flag to tag candidates with swapped hypotheses between leptons and hadrons
892893
}
893894

894895
namespace hf_b0_mc
@@ -951,7 +952,8 @@ DECLARE_SOA_TABLE(HfMcRecRedJPK0ss, "AOD", "HFMCRECREDJPK0S", //! Table with rec
951952
hf_cand_mc_flag::FlagMcDecayChanRec,
952953
hf_cand_mc_flag::FlagWrongCollision,
953954
hf_cand_mc_flag::DebugMcRec,
954-
hf_b0_mc::PtMother);
955+
hf_b0_mc::PtMother,
956+
hf_cand_mc_flag::IsHadronLeptonSwapped);
955957

956958
// Table with same size as HFCANDB0
957959
DECLARE_SOA_TABLE(HfMcRecRedB0s, "AOD", "HFMCRECREDB0", //! Reconstruction-level MC information on B0 candidates for reduced workflow
@@ -1041,7 +1043,8 @@ DECLARE_SOA_TABLE(HfMcRecRedJPKs, "AOD", "HFMCRECREDJPK", //! Table with reconst
10411043
hf_cand_mc_flag::FlagMcDecayChanRec,
10421044
hf_cand_mc_flag::FlagWrongCollision,
10431045
hf_cand_mc_flag::DebugMcRec,
1044-
hf_bplus_mc::PtMother);
1046+
hf_bplus_mc::PtMother,
1047+
hf_cand_mc_flag::IsHadronLeptonSwapped);
10451048

10461049
// DECLARE_SOA_EXTENDED_TABLE_USER(ExTable, Tracks, "EXTABLE",
10471050
DECLARE_SOA_TABLE(HfMcCheckD0Pis, "AOD", "HFMCCHECKD0PI", //! Table with reconstructed MC information on D0Pi(<-B0) pairs for MC checks in reduced workflow
@@ -1143,7 +1146,8 @@ DECLARE_SOA_TABLE(HfMcRecRedJPPhis, "AOD", "HFMCRECREDJPPHI", //! Table with rec
11431146
hf_cand_mc_flag::FlagMcDecayChanRec,
11441147
hf_cand_mc_flag::FlagWrongCollision,
11451148
hf_cand_mc_flag::DebugMcRec,
1146-
hf_bs_mc::PtMother);
1149+
hf_bs_mc::PtMother,
1150+
hf_cand_mc_flag::IsHadronLeptonSwapped);
11471151

11481152
// try with extended table ?
11491153
// DECLARE_SOA_EXTENDED_TABLE_USER(ExTable, Tracks, "EXTABLE",
@@ -1288,6 +1292,9 @@ DECLARE_SOA_TABLE(HfCandLbConfigs, "AOD", "HFCANDLBCONFIG", //! Table with confi
12881292
hf_cand_lb_config::MySelectionFlagLc,
12891293
hf_cand_lb_config::MyInvMassWindowLcPi);
12901294

1295+
DECLARE_SOA_TABLE(HfMcRecBJpSwaps, "AOD", "HFMCRECBJPSWAP", //! Table with configurables information for reduced workflow
1296+
hf_cand_mc_flag::IsHadronLeptonSwapped);
1297+
12911298
// Charm resonances analysis
12921299
namespace hf_reso_3_prong
12931300
{

‎PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ struct HfCandidateCreatorBToJpsiReducedExpressions {
554554
Produces<aod::HfMcRecRedBps> rowBplusMcRec;
555555
Produces<aod::HfMcRecRedB0s> rowB0McRec;
556556
Produces<aod::HfMcRecRedBss> rowBsMcRec;
557+
Produces<aod::HfMcRecBJpSwaps> rowBToJPsiSwap;
557558

558559
/// Fill candidate information at MC reconstruction level
559560
/// \param rowsJpsiHadMcRec MC reco information on Jpsi hadron pairs
@@ -569,35 +570,41 @@ struct HfCandidateCreatorBToJpsiReducedExpressions {
569570
continue;
570571
}
571572
rowBplusMcRec(rowJpsiHadMcRec.flagMcMatchRec(), rowJpsiHadMcRec.flagMcDecayChanRec(), rowJpsiHadMcRec.flagWrongCollision(), rowJpsiHadMcRec.debugMcRec(), rowJpsiHadMcRec.ptMother());
573+
rowBToJPsiSwap(rowJpsiHadMcRec.isHadronLeptonSwapped());
572574
filledMcInfo = true;
573575
break;
574576
}
575577
if (!filledMcInfo) { // protection to get same size tables in case something went wrong: we created a candidate that was not preselected in the Jpsi-K creator
576578
rowBplusMcRec(0, -1, -1, -1, -1.f);
579+
rowBToJPsiSwap(false);
577580
}
578581
} else if constexpr (DecChannel == DecayChannel::B0ToJpsiK0Star) {
579582
for (const auto& rowJpsiHadMcRec : rowsJpsiHadMcRec) {
580583
if ((rowJpsiHadMcRec.jpsiId() != candB.jpsiId()) || (rowJpsiHadMcRec.prong0K0StarId() != candB.prong0K0StarId()) || (rowJpsiHadMcRec.prong1K0StarId() != candB.prong1K0StarId())) {
581584
continue;
582585
}
583586
rowB0McRec(rowJpsiHadMcRec.flagMcMatchRec(), rowJpsiHadMcRec.flagMcDecayChanRec(), rowJpsiHadMcRec.flagWrongCollision(), rowJpsiHadMcRec.debugMcRec(), rowJpsiHadMcRec.ptMother());
587+
rowBToJPsiSwap(rowJpsiHadMcRec.isHadronLeptonSwapped());
584588
filledMcInfo = true;
585589
break;
586590
}
587591
if (!filledMcInfo) { // protection to get same size tables in case something went wrong: we created a candidate that was not preselected in the Jpsi-K creator
588592
rowB0McRec(0, -1, -1, -1, -1.f);
593+
rowBToJPsiSwap(false);
589594
}
590595
} else if constexpr (DecChannel == DecayChannel::BsToJpsiPhi) {
591596
for (const auto& rowJpsiHadMcRec : rowsJpsiHadMcRec) {
592597
if ((rowJpsiHadMcRec.jpsiId() != candB.jpsiId()) || (rowJpsiHadMcRec.prong0PhiId() != candB.prong0PhiId()) || (rowJpsiHadMcRec.prong1PhiId() != candB.prong1PhiId())) {
593598
continue;
594599
}
595600
rowBsMcRec(rowJpsiHadMcRec.flagMcMatchRec(), rowJpsiHadMcRec.flagMcDecayChanRec(), rowJpsiHadMcRec.flagWrongCollision(), rowJpsiHadMcRec.debugMcRec(), rowJpsiHadMcRec.ptMother());
601+
rowBToJPsiSwap(rowJpsiHadMcRec.isHadronLeptonSwapped());
596602
filledMcInfo = true;
597603
break;
598604
}
599605
if (!filledMcInfo) { // protection to get same size tables in case something went wrong: we created a candidate that was not preselected in the Jpsi-K creator
600606
rowBsMcRec(0, -1, -1, -1, -1.f);
607+
rowBToJPsiSwap(false);
601608
}
602609
}
603610
}

0 commit comments

Comments
 (0)