Skip to content

Commit 63e723c

Browse files
[PWGHF] Add single track vars and MC validation for Bs meson (#12598)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 82ab24a commit 63e723c

File tree

3 files changed

+152
-66
lines changed

3 files changed

+152
-66
lines changed

PWGHF/D2H/Tasks/taskB0Reduced.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ DECLARE_SOA_COLUMN(FlagWrongCollision, flagWrongCollision, int8_t);
101101
} // namespace hf_cand_b0_lite
102102

103103
DECLARE_SOA_TABLE(HfRedCandB0Lites, "AOD", "HFREDCANDB0LITE", //! Table with some B0 properties
104-
// B meson features hf_cand_b0_lite::M,
104+
// B meson features
105105
hf_cand_b0_lite::M,
106106
hf_cand_b0_lite::Pt,
107107
hf_cand_b0_lite::Eta,

PWGHF/D2H/Tasks/taskBsReduced.cxx

Lines changed: 133 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -50,58 +50,111 @@ namespace o2::aod
5050
{
5151
namespace hf_cand_bs_lite
5252
{
53-
DECLARE_SOA_COLUMN(PtProng0, ptProng0, float); //! Transverse momentum of prong0 (GeV/c)
54-
DECLARE_SOA_COLUMN(PtProng1, ptProng1, float); //! Transverse momentum of prong1 (GeV/c)
55-
DECLARE_SOA_COLUMN(MProng0, mProng0, float); //! Invariant mass of prong0 (GeV/c)
53+
// B meson features
5654
DECLARE_SOA_COLUMN(M, m, float); //! Invariant mass of candidate (GeV/c2)
5755
DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of candidate (GeV/c)
58-
DECLARE_SOA_COLUMN(PtGen, ptGen, float); //! Transverse momentum of candidate (GeV/c)
59-
DECLARE_SOA_COLUMN(P, p, float); //! Momentum of candidate (GeV/c)
60-
DECLARE_SOA_COLUMN(Y, y, float); //! Rapidity of candidate
6156
DECLARE_SOA_COLUMN(Eta, eta, float); //! Pseudorapidity of candidate
6257
DECLARE_SOA_COLUMN(Phi, phi, float); //! Azimuth angle of candidate
63-
DECLARE_SOA_COLUMN(E, e, float); //! Energy of candidate (GeV)
64-
DECLARE_SOA_COLUMN(NSigTpcPi1, nSigTpcPi1, float); //! TPC Nsigma separation for prong1 with pion mass hypothesis
65-
DECLARE_SOA_COLUMN(NSigTofPi1, nSigTofPi1, float); //! TOF Nsigma separation for prong1 with pion mass hypothesis
58+
DECLARE_SOA_COLUMN(Y, y, float); //! Rapidity of candidate
59+
DECLARE_SOA_COLUMN(Cpa, cpa, float); //! Cosine pointing angle of candidate
60+
DECLARE_SOA_COLUMN(CpaXY, cpaXY, float); //! Cosine pointing angle of candidate in transverse plane
6661
DECLARE_SOA_COLUMN(DecayLength, decayLength, float); //! Decay length of candidate (cm)
6762
DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); //! Transverse decay length of candidate (cm)
6863
DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); //! Normalised decay length of candidate
6964
DECLARE_SOA_COLUMN(DecayLengthXYNormalised, decayLengthXYNormalised, float); //! Normalised transverse decay length of candidate
7065
DECLARE_SOA_COLUMN(ImpactParameterProduct, impactParameterProduct, float); //! Impact parameter product of candidate
71-
DECLARE_SOA_COLUMN(Cpa, cpa, float); //! Cosine pointing angle of candidate
72-
DECLARE_SOA_COLUMN(CpaXY, cpaXY, float); //! Cosine pointing angle of candidate in transverse plane
7366
DECLARE_SOA_COLUMN(MaxNormalisedDeltaIP, maxNormalisedDeltaIP, float); //! Maximum normalized difference between measured and expected impact parameter of candidate prongs
7467
DECLARE_SOA_COLUMN(MlScoreSig, mlScoreSig, float); //! ML score for signal class
68+
// D meson features
69+
DECLARE_SOA_COLUMN(MProng0, mProng0, float); //! Invariant mass of prong0 (GeV/c)
70+
DECLARE_SOA_COLUMN(PtProng0, ptProng0, float); //! Transverse momentum of prong0 (GeV/c)
71+
DECLARE_SOA_COLUMN(DecayLength0, decayLength0, float); //! Decay length of D-meson daughter candidate (cm)
72+
DECLARE_SOA_COLUMN(DecayLengthXY0, decayLengthXY0, float); //! Transverse decay length of D-meson daughter candidate (cm)
73+
DECLARE_SOA_COLUMN(ImpactParameter0, impactParameter0, float); //! Impact parameter product of D-meson daughter candidate
74+
DECLARE_SOA_COLUMN(PtDmesProngMin, ptDmesProngMin, float); //! Minimum pT of prongs of D-meson daughter candidate (GeV/c)
75+
DECLARE_SOA_COLUMN(AbsEtaDmesProngMin, absEtaDmesProngMin, float); //! Minimum absolute pseudorapidity of prongs of D-meson daughter candidate
76+
DECLARE_SOA_COLUMN(ItsNClsDmesProngMin, itsNClsDmesProngMin, int); //! Minimum number of ITS clusters of prongs of D-meson daughter candidate
77+
DECLARE_SOA_COLUMN(TpcNClsCrossedRowsDmesProngMin, tpcNClsCrossedRowsDmesProngMin, int); //! Minimum number of TPC crossed rows of prongs of D-meson daughter candidate
78+
DECLARE_SOA_COLUMN(TpcChi2NClDmesProngMax, tpcChi2NClDmesProngMax, float); //! Maximum TPC chi2 of prongs of D-meson daughter candidate
79+
DECLARE_SOA_COLUMN(NSigTpcPiDmesProng0, nSigTpcPiDmesProng0, float); //! TPC Nsigma separation for D-meson prong0 with pion mass hypothesis
80+
DECLARE_SOA_COLUMN(NSigTofPiDmesProng0, nSigTofPiDmesProng0, float); //! TOF Nsigma separation for D-meson prong0 with pion mass hypothesis
81+
DECLARE_SOA_COLUMN(NSigTpcTofPiDmesProng0, nSigTpcTofPiDmesProng0, float); //! Combined TPC and TOF Nsigma separation for D-meson prong0 with pion mass hypothesis
82+
DECLARE_SOA_COLUMN(NSigTpcKaDmesProng1, nSigTpcKaDmesProng1, float); //! TPC Nsigma separation for D-meson prong1 with kaon mass hypothesis
83+
DECLARE_SOA_COLUMN(NSigTofKaDmesProng1, nSigTofKaDmesProng1, float); //! TOF Nsigma separation for D-meson prong1 with kaon mass hypothesis
84+
DECLARE_SOA_COLUMN(NSigTpcTofKaDmesProng1, nSigTpcTofKaDmesProng1, float); //! Combined TPC and TOF Nsigma separation for D-meson prong1 with kaon mass hypothesis
85+
DECLARE_SOA_COLUMN(NSigTpcPiDmesProng2, nSigTpcPiDmesProng2, float); //! TPC Nsigma separation for D-meson prong2 with pion mass hypothesis
86+
DECLARE_SOA_COLUMN(NSigTofPiDmesProng2, nSigTofPiDmesProng2, float); //! TOF Nsigma separation for D-meson prong2 with pion mass hypothesis
87+
DECLARE_SOA_COLUMN(NSigTpcTofPiDmesProng2, nSigTpcTofPiDmesProng2, float); //! Combined TPC and TOF Nsigma separation for D-meson prong0 with pion mass hypothesis
88+
// pion features
89+
DECLARE_SOA_COLUMN(PtProng1, ptProng1, float); //! Transverse momentum of prong1 (GeV/c)
90+
DECLARE_SOA_COLUMN(AbsEtaProng1, absEtaProng1, float); //! Absolute pseudorapidity of Prong1
91+
DECLARE_SOA_COLUMN(ItsNClsProng1, itsNClsProng1, int); //! Number of ITS clusters of Prong1
92+
DECLARE_SOA_COLUMN(TpcNClsCrossedRowsProng1, tpcNClsCrossedRowsProng1, int); //! Number of TPC crossed rows of prongs of Prong1
93+
DECLARE_SOA_COLUMN(TpcChi2NClProng1, tpcChi2NClProng1, float); //! Maximum TPC chi2 of prongs of D-meson daughter candidate
94+
DECLARE_SOA_COLUMN(ImpactParameterProng1, impactParameterProng1, float); //! Impact parameter product of bachelor pion
95+
DECLARE_SOA_COLUMN(NSigTpcPiProng1, nSigTpcPiProng1, float); //! TPC Nsigma separation for prong1 with pion mass hypothesis
96+
DECLARE_SOA_COLUMN(NSigTofPiProng1, nSigTofPiProng1, float); //! TOF Nsigma separation for prong1 with pion mass hypothesis
97+
DECLARE_SOA_COLUMN(NSigTpcTofPiProng1, nSigTpcTofPiProng1, float); //! Combined TPC and TOF Nsigma separation for prong1 with pion mass hypothesis
98+
// MC truth
7599
DECLARE_SOA_COLUMN(FlagWrongCollision, flagWrongCollision, int8_t); //! Flag for association with wrong collision
100+
DECLARE_SOA_COLUMN(PtGen, ptGen, float); //! Transverse momentum of candidate (GeV/c)
101+
// General vars (unused for now)
102+
DECLARE_SOA_COLUMN(P, p, float); //! Momentum of candidate (GeV/c)
103+
DECLARE_SOA_COLUMN(E, e, float); //! Energy of candidate (GeV)
76104
} // namespace hf_cand_bs_lite
77105

78106
DECLARE_SOA_TABLE(HfRedCandBsLites, "AOD", "HFREDCANDBSLITE", //! Table with some Bs properties
107+
// B meson features
108+
hf_cand_bs_lite::M,
109+
hf_cand_bs_lite::Pt,
110+
hf_cand_bs_lite::Eta,
111+
hf_cand_bs_lite::Phi,
112+
hf_cand_bs_lite::Y,
113+
hf_cand_bs_lite::Cpa,
114+
hf_cand_bs_lite::CpaXY,
79115
hf_cand::Chi2PCA,
80116
hf_cand_bs_lite::DecayLength,
81117
hf_cand_bs_lite::DecayLengthXY,
82118
hf_cand_bs_lite::DecayLengthNormalised,
83119
hf_cand_bs_lite::DecayLengthXYNormalised,
120+
hf_cand_bs_lite::ImpactParameterProduct,
121+
hf_cand_bs_lite::MaxNormalisedDeltaIP,
122+
hf_cand_bs_lite::MlScoreSig,
123+
hf_sel_candidate_bs::IsSelBsToDsPi,
124+
// D meson features
84125
hf_cand_bs_lite::MProng0,
85126
hf_cand_bs_lite::PtProng0,
86-
hf_cand_bs_lite::PtProng1,
87-
hf_cand::ImpactParameter0,
88-
hf_cand::ImpactParameter1,
89-
hf_cand_bs_lite::ImpactParameterProduct,
90-
hf_cand_bs_lite::NSigTpcPi1,
91-
hf_cand_bs_lite::NSigTofPi1,
127+
hf_cand_bs_lite::DecayLength0,
128+
hf_cand_bs_lite::DecayLengthXY0,
129+
hf_cand_bs_lite::ImpactParameter0,
130+
hf_cand_bs_lite::PtDmesProngMin,
131+
hf_cand_bs_lite::AbsEtaDmesProngMin,
132+
hf_cand_bs_lite::ItsNClsDmesProngMin,
133+
hf_cand_bs_lite::TpcNClsCrossedRowsDmesProngMin,
134+
hf_cand_bs_lite::TpcChi2NClDmesProngMax,
135+
hf_cand_bs_lite::NSigTpcPiDmesProng0,
136+
hf_cand_bs_lite::NSigTofPiDmesProng0,
137+
hf_cand_bs_lite::NSigTpcTofPiDmesProng0,
138+
hf_cand_bs_lite::NSigTpcKaDmesProng1,
139+
hf_cand_bs_lite::NSigTofKaDmesProng1,
140+
hf_cand_bs_lite::NSigTpcTofKaDmesProng1,
141+
hf_cand_bs_lite::NSigTpcPiDmesProng2,
142+
hf_cand_bs_lite::NSigTofPiDmesProng2,
143+
hf_cand_bs_lite::NSigTpcTofPiDmesProng2,
92144
hf_cand_bs_reduced::Prong0MlScoreBkg,
93145
hf_cand_bs_reduced::Prong0MlScorePrompt,
94146
hf_cand_bs_reduced::Prong0MlScoreNonprompt,
95-
hf_cand_bs_lite::MlScoreSig,
96-
hf_sel_candidate_bs::IsSelBsToDsPi,
97-
hf_cand_bs_lite::M,
98-
hf_cand_bs_lite::Pt,
99-
hf_cand_bs_lite::Cpa,
100-
hf_cand_bs_lite::CpaXY,
101-
hf_cand_bs_lite::MaxNormalisedDeltaIP,
102-
hf_cand_bs_lite::Eta,
103-
hf_cand_bs_lite::Phi,
104-
hf_cand_bs_lite::Y,
147+
// pion features
148+
hf_cand_bs_lite::PtProng1,
149+
hf_cand_bs_lite::AbsEtaProng1,
150+
hf_cand_bs_lite::ItsNClsProng1,
151+
hf_cand_bs_lite::TpcNClsCrossedRowsProng1,
152+
hf_cand_bs_lite::TpcChi2NClProng1,
153+
hf_cand_bs_lite::ImpactParameterProng1,
154+
hf_cand_bs_lite::NSigTpcPiProng1,
155+
hf_cand_bs_lite::NSigTofPiProng1,
156+
hf_cand_bs_lite::NSigTpcTofPiProng1,
157+
// MC truth
105158
hf_cand_3prong::FlagMcMatchRec,
106159
hf_cand_3prong::OriginMcRec,
107160
hf_cand_bs_lite::FlagWrongCollision,
@@ -143,6 +196,7 @@ struct HfTaskBsReduced {
143196
HfHelper hfHelper;
144197

145198
using TracksPion = soa::Join<HfRedTracks, HfRedTracksPid>;
199+
using CandsDS = soa::Join<HfRed3Prongs, HfRedPidDau0s, HfRedPidDau1s, HfRedPidDau2s>;
146200

147201
Filter filterSelectCandidates = (aod::hf_sel_candidate_bs::isSelBsToDsPi >= selectionFlagBs);
148202

@@ -344,13 +398,13 @@ struct HfTaskBsReduced {
344398
/// \param withBsMl is the flag to enable the filling with ML scores for the Bs candidate
345399
/// \param candidate is the Bs candidate
346400
/// \param candidatesD is the table with Ds- candidates
347-
template <bool doMc, bool withDecayTypeCheck, bool withDmesMl, bool withBsMl, typename Cand>
401+
template <bool doMc, bool withDecayTypeCheck, bool withDmesMl, bool withBsMl, typename Cand, typename CandsDmes>
348402
void fillCand(Cand const& candidate,
349-
aod::HfRed3Prongs const&)
403+
CandsDmes const&)
350404
{
351405
auto ptCandBs = candidate.pt();
352406
auto invMassBs = hfHelper.invMassBsToDsPi(candidate);
353-
auto candDs = candidate.template prong0_as<aod::HfRed3Prongs>();
407+
auto candDs = candidate.template prong0_as<CandsDmes>();
354408
auto ptDs = candidate.ptProng0();
355409
auto invMassDs = candDs.invMassHypo0() > 0 ? candDs.invMassHypo0() : candDs.invMassHypo1();
356410
// TODO: here we are assuming that only one of the two hypotheses is filled, to be checked
@@ -513,32 +567,57 @@ struct HfTaskBsReduced {
513567
}
514568

515569
hfRedCandBsLite(
570+
// B meson features
571+
invMassBs,
572+
ptCandBs,
573+
candidate.eta(),
574+
candidate.phi(),
575+
hfHelper.yBs(candidate),
576+
candidate.cpa(),
577+
candidate.cpaXY(),
516578
candidate.chi2PCA(),
517579
candidate.decayLength(),
518580
candidate.decayLengthXY(),
519581
candidate.decayLengthNormalised(),
520582
candidate.decayLengthXYNormalised(),
583+
candidate.impactParameterProduct(),
584+
candidate.maxNormalisedDeltaIP(),
585+
candidateMlScoreSig,
586+
candidate.isSelBsToDsPi(),
587+
// D meson features
521588
invMassDs,
522589
ptDs,
523-
candidate.ptProng1(),
590+
decLenDs,
591+
decLenXyDs,
524592
candidate.impactParameter0(),
525-
candidate.impactParameter1(),
526-
candidate.impactParameterProduct(),
527-
prong1.tpcNSigmaPi(),
528-
prong1.tofNSigmaPi(),
593+
candDs.ptProngMin(),
594+
candDs.absEtaProngMin(),
595+
candDs.itsNClsProngMin(),
596+
candDs.tpcNClsCrossedRowsProngMin(),
597+
candDs.tpcChi2NClProngMax(),
598+
candDs.tpcNSigmaPiProng0(),
599+
candDs.tofNSigmaPiProng0(),
600+
candDs.tpcTofNSigmaPiProng0(),
601+
candDs.tpcNSigmaKaProng1(),
602+
candDs.tofNSigmaKaProng1(),
603+
candDs.tpcTofNSigmaKaProng1(),
604+
candDs.tpcNSigmaKaProng2(),
605+
candDs.tofNSigmaKaProng2(),
606+
candDs.tpcTofNSigmaKaProng2(),
529607
prong0MlScoreBkg,
530608
prong0MlScorePrompt,
531609
prong0MlScoreNonprompt,
532-
candidateMlScoreSig,
533-
candidate.isSelBsToDsPi(),
534-
invMassBs,
535-
ptCandBs,
536-
candidate.cpa(),
537-
candidate.cpaXY(),
538-
candidate.maxNormalisedDeltaIP(),
539-
candidate.eta(),
540-
candidate.phi(),
541-
hfHelper.yBs(candidate),
610+
// pion features
611+
candidate.ptProng1(),
612+
std::abs(RecoDecay::eta(prong1.pVector())),
613+
prong1.itsNCls(),
614+
prong1.tpcNClsCrossedRows(),
615+
prong1.tpcChi2NCl(),
616+
candidate.impactParameter1(),
617+
prong1.tpcNSigmaPi(),
618+
prong1.tofNSigmaPi(),
619+
prong1.tpcTofNSigmaPi(),
620+
// MC truth
542621
flagMcMatchRec,
543622
isSignal,
544623
flagWrongCollision,
@@ -612,7 +691,7 @@ struct HfTaskBsReduced {
612691

613692
// Process functions
614693
void processData(soa::Filtered<soa::Join<aod::HfRedCandBs, aod::HfSelBsToDsPi>> const& candidates,
615-
aod::HfRed3Prongs const& candidatesD,
694+
CandsDS const& candidatesD,
616695
TracksPion const&)
617696
{
618697
for (const auto& candidate : candidates) {
@@ -625,7 +704,7 @@ struct HfTaskBsReduced {
625704
PROCESS_SWITCH(HfTaskBsReduced, processData, "Process data without ML scores for Bs and D daughter", true);
626705

627706
void processDataWithDmesMl(soa::Filtered<soa::Join<aod::HfRedCandBs, aod::HfRedBsDsMls, aod::HfSelBsToDsPi>> const& candidates,
628-
aod::HfRed3Prongs const& candidatesD,
707+
CandsDS const& candidatesD,
629708
TracksPion const&)
630709
{
631710
for (const auto& candidate : candidates) {
@@ -638,7 +717,7 @@ struct HfTaskBsReduced {
638717
PROCESS_SWITCH(HfTaskBsReduced, processDataWithDmesMl, "Process data with(out) ML scores for D daughter (Bs)", false);
639718

640719
void processDataWithBsMl(soa::Filtered<soa::Join<aod::HfRedCandBs, aod::HfMlBsToDsPi, aod::HfSelBsToDsPi>> const& candidates,
641-
aod::HfRed3Prongs const& candidatesD,
720+
CandsDS const& candidatesD,
642721
TracksPion const&)
643722
{
644723
for (const auto& candidate : candidates) {
@@ -652,7 +731,7 @@ struct HfTaskBsReduced {
652731

653732
void processMc(soa::Filtered<soa::Join<aod::HfRedCandBs, aod::HfSelBsToDsPi, aod::HfMcRecRedBss>> const& candidates,
654733
aod::HfMcGenRedBss const& mcParticles,
655-
aod::HfRed3Prongs const& candidatesD,
734+
CandsDS const& candidatesD,
656735
TracksPion const&)
657736
{
658737
// MC rec
@@ -672,7 +751,7 @@ struct HfTaskBsReduced {
672751

673752
void processMcWithDecayTypeCheck(soa::Filtered<soa::Join<aod::HfRedCandBs, aod::HfSelBsToDsPi, aod::HfMcRecRedBss, aod::HfMcCheckBss>> const& candidates,
674753
aod::HfMcGenRedBss const& mcParticles,
675-
aod::HfRed3Prongs const& candidatesD,
754+
CandsDS const& candidatesD,
676755
TracksPion const&)
677756
{
678757
// MC rec
@@ -692,7 +771,7 @@ struct HfTaskBsReduced {
692771

693772
void processMcWithDmesMl(soa::Filtered<soa::Join<aod::HfRedCandBs, aod::HfRedBsDsMls, aod::HfSelBsToDsPi, aod::HfMcRecRedBss>> const& candidates,
694773
aod::HfMcGenRedBss const& mcParticles,
695-
aod::HfRed3Prongs const& candidatesD,
774+
CandsDS const& candidatesD,
696775
TracksPion const&)
697776
{
698777
// MC rec
@@ -712,7 +791,7 @@ struct HfTaskBsReduced {
712791

713792
void processMcWithDmesMlAndDecayTypeCheck(soa::Filtered<soa::Join<aod::HfRedCandBs, aod::HfRedBsDsMls, aod::HfSelBsToDsPi, aod::HfMcRecRedBss, aod::HfMcCheckBss>> const& candidates,
714793
aod::HfMcGenRedBss const& mcParticles,
715-
aod::HfRed3Prongs const& candidatesD,
794+
CandsDS const& candidatesD,
716795
TracksPion const&)
717796
{
718797
// MC rec
@@ -732,7 +811,7 @@ struct HfTaskBsReduced {
732811

733812
void processMcWithBsMl(soa::Filtered<soa::Join<aod::HfRedCandBs, aod::HfMlBsToDsPi, aod::HfSelBsToDsPi, aod::HfMcRecRedBss>> const& candidates,
734813
aod::HfMcGenRedBss const& mcParticles,
735-
aod::HfRed3Prongs const& candidatesD,
814+
CandsDS const& candidatesD,
736815
TracksPion const&)
737816
{
738817
// MC rec
@@ -752,7 +831,7 @@ struct HfTaskBsReduced {
752831

753832
void processMcWithBsMlAndDecayTypeCheck(soa::Filtered<soa::Join<aod::HfRedCandBs, aod::HfMlBsToDsPi, aod::HfSelBsToDsPi, aod::HfMcRecRedBss, aod::HfMcCheckBss>> const& candidates,
754833
aod::HfMcGenRedBss const& mcParticles,
755-
aod::HfRed3Prongs const& candidatesD,
834+
CandsDS const& candidatesD,
756835
TracksPion const&)
757836
{
758837
// MC rec

0 commit comments

Comments
 (0)