@@ -55,6 +55,8 @@ enum Decays { Sigmac2455Pi = 0,
5555 LambdacPiPi };
5656enum DecaysLambdac { PKPi = 0 ,
5757 PiKP };
58+ enum Reflections { NotReflected = 0 ,
59+ Reflected };
5860DECLARE_SOA_COLUMN (Y, y, float );
5961DECLARE_SOA_COLUMN (Pt, pt, float );
6062DECLARE_SOA_COLUMN (Mass, mass, float );
@@ -65,6 +67,7 @@ DECLARE_SOA_COLUMN(Decay, decay, int8_t);
6567DECLARE_SOA_COLUMN (DecayLambdac, decayLambdac, int8_t );
6668DECLARE_SOA_COLUMN (MlScoreFirstClass, mlScoreFirstClass, float ); // / background score Λc
6769DECLARE_SOA_COLUMN (MlScoreThirdClass, mlScoreThirdClass, float ); // / non-prompt score Λc
70+ DECLARE_SOA_COLUMN (IsReflected, isReflected, int8_t );
6871} // namespace hf_sigmac_bkg
6972DECLARE_SOA_TABLE (HfCorrBkgSc, " AOD" , " HFCORRBKGSC" ,
7073 hf_sigmac_bkg::Y,
@@ -76,7 +79,8 @@ DECLARE_SOA_TABLE(HfCorrBkgSc, "AOD", "HFCORRBKGSC",
7679 hf_sigmac_bkg::Decay,
7780 hf_sigmac_bkg::DecayLambdac,
7881 hf_sigmac_bkg::MlScoreFirstClass,
79- hf_sigmac_bkg::MlScoreThirdClass);
82+ hf_sigmac_bkg::MlScoreThirdClass,
83+ hf_sigmac_bkg::IsReflected);
8084} // namespace o2::aod
8185
8286struct HfTreeCreatorSigmacCorrBkg {
@@ -86,6 +90,7 @@ struct HfTreeCreatorSigmacCorrBkg {
8690 // / Selection of candidates Λc+
8791 Configurable<int > selectionFlagLc{" selectionFlagLc" , 1 , " Selection Flag for Lc" };
8892 Configurable<float > yCandRecoMax{" yCandRecoMax" , -1 , " Maximum Sc candidate rapidity" };
93+ Configurable<bool > keepReflectedSignals{" keepReflectedSignals" , false , " Keep also the reflected signals (i.e. generated pKpi reco as piKp, and viceversa)" };
8994
9095 using RecoLcMc = soa::Join<aod::HfCand3Prong, aod::HfCand3ProngMcRec, aod::HfSelLc, aod::HfMlLcToPKPi>;
9196 using RecoScMc = soa::Join<aod::HfCandSc, aod::HfCandScMcRec>;
@@ -103,33 +108,56 @@ struct HfTreeCreatorSigmacCorrBkg {
103108 float massLc = -1 .f ;
104109 float deltaMass = -1 .f ;
105110 const int8_t isCandPKPiPiKP = hf_sigmac_utils::isDecayToPKPiToPiKP (candLcDauSc, candidateSc);
106- std::array<float , 2 > outputMl{-1 ., -1 .};
111+ std::array<float , 2 > outputMlLcPKPi{-1 ., -1 .};
112+ std::array<float , 2 > outputMlLcPiKP{-1 ., -1 .};
107113 // / rapidity selection on Σc0,++
108114 if (yCandRecoMax >= 0 . && std::abs (rapidity) > yCandRecoMax) {
109115 return ;
110116 }
111117
112118 // / BDT scores
119+ // reconstructed Λc± → pK-π+
120+ if (!candLcDauSc.mlProbLcToPKPi ().empty ()) {
121+ outputMlLcPKPi.at (0 ) = candLcDauSc.mlProbLcToPKPi ()[0 ]; // / bkg score
122+ outputMlLcPKPi.at (1 ) = candLcDauSc.mlProbLcToPKPi ()[2 ]; // / non-prompt score
123+ }
124+ // reconstructed Λc± → π+K-p
113125 if (!candLcDauSc.mlProbLcToPiKP ().empty ()) {
114- outputMl .at (0 ) = candLcDauSc.mlProbLcToPiKP ()[0 ]; // / bkg score
115- outputMl .at (1 ) = candLcDauSc.mlProbLcToPiKP ()[2 ]; // / non-prompt score
126+ outputMlLcPiKP .at (0 ) = candLcDauSc.mlProbLcToPiKP ()[0 ]; // / bkg score
127+ outputMlLcPiKP .at (1 ) = candLcDauSc.mlProbLcToPiKP ()[2 ]; // / non-prompt score
116128 }
117129
118- if ((TESTBIT (isCandPKPiPiKP, o2::aod::hf_cand_sigmac::Decays::PKPi)) && std::abs (candLcDauSc.template prong0_as <aod::TracksWMc>().template mcParticle_as <ParticlesLcSigmac>().pdgCode ()) == kProton ) {
130+ int pdgCodeProng0Abs = std::abs (candLcDauSc.template prong0_as <aod::TracksWMc>().template mcParticle_as <ParticlesLcSigmac>().pdgCode ());
131+
132+ // / candidates with Λc± reconstructed in the pK-π+ decay
133+ if ((TESTBIT (isCandPKPiPiKP, o2::aod::hf_cand_sigmac::Decays::PKPi))) {
134+
119135 massSc = HfHelper::invMassScRecoLcToPKPi (candidateSc, candLcDauSc);
120136 massLc = HfHelper::invMassLcToPKPi (candLcDauSc);
121137 deltaMass = massSc - massLc;
122138
123- // / fill the tree
124- rowCorrBkgSc (rapidity, candidateSc.pt (), massSc, deltaMass, chargeSc, motherPdg, motherDecay, aod::hf_sigmac_bkg::DecaysLambdac::PKPi, outputMl.at (0 ), outputMl.at (1 ));
139+ if (pdgCodeProng0Abs == kProton ) {
140+ // / candidates with reconstructed Λc± → pK-π+ decay that are generated Λc± → pK-π+ (not reflected)
141+ rowCorrBkgSc (rapidity, candidateSc.pt (), massSc, deltaMass, chargeSc, motherPdg, motherDecay, aod::hf_sigmac_bkg::DecaysLambdac::PKPi, outputMlLcPKPi.at (0 ), outputMlLcPKPi.at (1 ), aod::hf_sigmac_bkg::Reflections::NotReflected);
142+ } else if (keepReflectedSignals && pdgCodeProng0Abs == kPiPlus ) {
143+ // / candidates with reconstructed Λc± → pK-π+ decay that are actually generated Λc± → π+K-p (reflected)
144+ rowCorrBkgSc (rapidity, candidateSc.pt (), massSc, deltaMass, chargeSc, motherPdg, motherDecay, aod::hf_sigmac_bkg::DecaysLambdac::PKPi, outputMlLcPKPi.at (0 ), outputMlLcPKPi.at (1 ), aod::hf_sigmac_bkg::Reflections::Reflected);
145+ }
125146 }
126- if ((TESTBIT (isCandPKPiPiKP, o2::aod::hf_cand_sigmac::Decays::PiKP)) && std::abs (candLcDauSc.template prong0_as <aod::TracksWMc>().template mcParticle_as <ParticlesLcSigmac>().pdgCode ()) == kPiPlus ) {
147+ // / candidates with Λc± reconstructed in the π+K-p decay
148+ if ((TESTBIT (isCandPKPiPiKP, o2::aod::hf_cand_sigmac::Decays::PiKP))) {
149+
127150 massSc = HfHelper::invMassScRecoLcToPiKP (candidateSc, candLcDauSc);
128151 massLc = HfHelper::invMassLcToPiKP (candLcDauSc);
129152 deltaMass = massSc - massLc;
130153
131- // / fill the tree
132- rowCorrBkgSc (rapidity, candidateSc.pt (), massSc, deltaMass, chargeSc, motherPdg, motherDecay, aod::hf_sigmac_bkg::DecaysLambdac::PiKP, outputMl.at (0 ), outputMl.at (1 ));
154+ if (pdgCodeProng0Abs == kPiPlus ) {
155+ // / candidates with reconstructed Λc± → π+K-p decay that are generated Λc± → π+K-p (not reflected)
156+ rowCorrBkgSc (rapidity, candidateSc.pt (), massSc, deltaMass, chargeSc, motherPdg, motherDecay, aod::hf_sigmac_bkg::DecaysLambdac::PiKP, outputMlLcPiKP.at (0 ), outputMlLcPiKP.at (1 ), aod::hf_sigmac_bkg::Reflections::NotReflected);
157+ } else if (keepReflectedSignals && pdgCodeProng0Abs == kProton ) {
158+ // / candidates with reconstructed Λc± → π+K-p decay that are actually generated Λc± → pK-π+ (reflected)
159+ rowCorrBkgSc (rapidity, candidateSc.pt (), massSc, deltaMass, chargeSc, motherPdg, motherDecay, aod::hf_sigmac_bkg::DecaysLambdac::PiKP, outputMlLcPiKP.at (0 ), outputMlLcPiKP.at (1 ), aod::hf_sigmac_bkg::Reflections::Reflected);
160+ }
133161 }
134162 }
135163
0 commit comments