@@ -86,7 +86,7 @@ DECLARE_SOA_COLUMN(FlagCharmBachInterm, flagCharmBachInterm, int8_t);
8686DECLARE_SOA_COLUMN (NKinkedTracks, nKinkedTracks, int8_t ); // ! Number of kinked tracks found in MC matching
8787} // namespace hf_cand_reso_to_trk_lite
8888
89- DECLARE_SOA_TABLE (HfCandDTrkLites, " AOD" , " HFCANDDTRKLITE" , // ! Table with some B0 properties
89+ DECLARE_SOA_TABLE (HfCandDTrkLites, " AOD" , " HFCANDDTRKLITE" , // ! Table with candidate charm hadron properties
9090 // Candidate Properties
9191 hf_cand_reso_to_trk_lite::M,
9292 hf_cand_reso_to_trk_lite::Pt,
@@ -123,7 +123,7 @@ DECLARE_SOA_TABLE(HfCandDTrkLites, "AOD", "HFCANDDTRKLITE", //! Table with some
123123 hf_cand_reso_to_trk_lite::FlagCharmBachInterm,
124124 hf_cand_reso_to_trk_lite::NKinkedTracks);
125125
126- DECLARE_SOA_TABLE (HfGenResoLites, " AOD" , " HFGENRESOLITE" , // ! Table with some B0 properties
126+ DECLARE_SOA_TABLE (HfGenResoLites, " AOD" , " HFGENRESOLITE" , // ! Table with gen level charm hadron properties
127127 hf_cand_reso_to_trk_lite::Pt,
128128 hf_cand_reso_to_trk_lite::Y,
129129 hf_cand_reso_to_trk_lite::Origin,
@@ -132,7 +132,8 @@ DECLARE_SOA_TABLE(HfGenResoLites, "AOD", "HFGENRESOLITE", //! Table with some B0
132132} // namespace o2::aod
133133
134134enum DecayChannel : uint8_t {
135- D0Kplus = 0
135+ D0Kplus = 0 ,
136+ D0Proton
136137};
137138
138139struct HfTaskCharmResoToDTrkReduced {
@@ -210,17 +211,25 @@ struct HfTaskCharmResoToDTrkReduced {
210211 void fillCand (const Cand& candidate, const Coll& collision, const CharmBach& bach0, const TrkBach& bach1)
211212 {
212213 // Base
213- float massReso{0 }, cosThetaStar{0 };
214- int8_t sign{0 };
215214 float tpcNSigmaBach1{0 }, tofNSigmaBach1{0 }, tpcTofNSigmaBach1{0 };
215+ double bachMass = 0 .f ;
216+
216217 if constexpr (Channel == DecayChannel::D0Kplus) {
217- massReso = useDeltaMass ? candidate.invMass () + MassD0 : candidate.invMass ();
218- cosThetaStar = RecoDecay::cosThetaStar (std::array{bach0.pVector (), bach1.pVector ()}, std::array{MassD0, MassKPlus}, massReso, 0 );
218+ bachMass = MassKPlus;
219219 tpcNSigmaBach1 = bach1.tpcNSigmaKa ();
220220 tofNSigmaBach1 = bach1.tofNSigmaKa ();
221221 tpcTofNSigmaBach1 = bach1.tpcTofNSigmaKa ();
222- sign = bach1.sign ();
222+ } else if constexpr (Channel == DecayChannel::D0Proton) {
223+ bachMass = MassProton;
224+ tpcNSigmaBach1 = bach1.tpcNSigmaPr ();
225+ tofNSigmaBach1 = bach1.tofNSigmaPr ();
226+ tpcTofNSigmaBach1 = bach1.tpcTofNSigmaPr ();
223227 }
228+
229+ float massReso = useDeltaMass ? candidate.invMass () + MassD0 : candidate.invMass ();
230+ float cosThetaStar = RecoDecay::cosThetaStar (std::array{bach0.pVector (), bach1.pVector ()}, std::array{MassD0, bachMass}, massReso, 0 );
231+ int8_t sign = bach1.sign ();
232+
224233 float y = RecoDecay::y (std::array{candidate.px (), candidate.py (), candidate.pz ()}, massReso);
225234 float eta = RecoDecay::eta (std::array{candidate.px (), candidate.py (), candidate.pz ()});
226235 float phi = RecoDecay::phi (candidate.px (), candidate.py ());
@@ -362,6 +371,9 @@ struct HfTaskCharmResoToDTrkReduced {
362371 case DecayChannel::D0Kplus:
363372 massReso = cand.invMass () + MassD0;
364373 break ;
374+ case DecayChannel::D0Proton:
375+ massReso = cand.invMass () + MassD0;
376+ break ;
365377 default :
366378 break ;
367379 }
@@ -451,6 +463,25 @@ struct HfTaskCharmResoToDTrkReduced {
451463 }
452464 PROCESS_SWITCH (HfTaskCharmResoToDTrkReduced, processD0KplusDataWithMl, " Process data for D0Kplus analysis with Ml" , false );
453465
466+ void processD0ProtonData (aod::HfRedCollisions const & collisions,
467+ ReducedReso2PrTrk const & candidates,
468+ aod::HfRed2PrNoTrks const & charmBachs,
469+ aod::HfRedTrkNoParams const & trkBachs)
470+ {
471+ processData<false , false , DecayChannel::D0Proton>(collisions, candidates, charmBachs, trkBachs);
472+ }
473+ PROCESS_SWITCH (HfTaskCharmResoToDTrkReduced, processD0ProtonData, " Process data for D0Proton analysis" , true );
474+
475+ // Process data with ML
476+ void processD0ProtonDataWithMl (aod::HfRedCollisions const & collisions,
477+ ReducedReso2PrTrk const & candidates,
478+ soa::Join<aod::HfRed2PrNoTrks, aod::HfRed2ProngsMl> const & charmBachs,
479+ aod::HfRedTrkNoParams const & trkBachs)
480+ {
481+ processData<false , true , DecayChannel::D0Proton>(collisions, candidates, charmBachs, trkBachs);
482+ }
483+ PROCESS_SWITCH (HfTaskCharmResoToDTrkReduced, processD0ProtonDataWithMl, " Process data for D0Proton analysis with Ml" , false );
484+
454485 // MC
455486 void processD0KplusMC (aod::HfRedCollisions const & collisions,
456487 ReducedReso2PrTrkMC const & candidates,
0 commit comments