@@ -35,6 +35,7 @@ using namespace o2::aod;
3535using namespace o2 ::analysis;
3636using namespace o2 ::framework;
3737using namespace o2 ::framework::expressions;
38+ using namespace o2 ::constants::physics;
3839
3940enum Selections : uint8_t {
4041 NoSel = 0 ,
@@ -118,16 +119,6 @@ struct HfCandidateCreatorCharmResoReduced {
118119 Preslice<aod::HfRed3PrNoTrks> candsDPerCollision = hf_track_index_reduced::hfRedCollisionId;
119120 Preslice<HfRed3PrNoTrksWithMl> candsDPerCollisionWithMl = hf_track_index_reduced::hfRedCollisionId;
120121
121- // Useful constants
122- double massK0{0 .};
123- double massLambda{0 .};
124- double massProton{0 .};
125- double massPion{0 .};
126- double massKaon{0 .};
127- double massDplus{0 .};
128- double massDstar{0 .};
129- double massD0{0 .};
130-
131122 HistogramRegistry registry{" registry" };
132123
133124 void init (InitContext const &)
@@ -140,10 +131,11 @@ struct HfCandidateCreatorCharmResoReduced {
140131 }
141132 // histograms
142133 const AxisSpec axisPt{(std::vector<double >)vecBinsPt, " #it{p}_{T} (GeV/#it{c})" };
143- registry.add (" hMassDs1" , " Ds1 candidates;m_{Ds1} (GeV/#it{c}^{2});entries" , {HistType::kTH2F , {{200 , 2.5 , 2.7 }, {(std::vector<double >)binsPt, " #it{p}_{T} (GeV/#it{c})" }}});
144- registry.add (" hMassDs2Star" , " Ds^{*}2 candidates; m_Ds^{*}2 (GeV/#it{c}^{2}) ;entries" , {HistType::kTH2F , {{100 , 2.4 , 2.7 }, {(std::vector<double >)binsPt, " #it{p}_{T} (GeV/#it{c})" }}});
145- registry.add (" hMassXcRes" , " XcRes candidates; m_XcRes (GeV/#it{c}^{2}) ;entries" , {HistType::kTH2F , {{100 , 2.9 , 3.3 }, {(std::vector<double >)binsPt, " #it{p}_{T} (GeV/#it{c})" }}});
146- registry.add (" hMassLambdaDminus" , " LambdaDminus candidates; m_LambdaDminus (GeV/#it{c}^{2}) ;entries" , {HistType::kTH2F , {{100 , 2.9 , 3.3 }, {(std::vector<double >)binsPt, " #it{p}_{T} (GeV/#it{c})" }}});
134+ const AxisSpec axisMassDsj{400 , 0 .49f , 0 .89f , " " };
135+ registry.add (" hMassDs1" , " Ds1 candidates;m_{Ds1} (GeV/#it{c}^{2});entries" , {HistType::kTH2F , {axisMassDsj, {(std::vector<double >)binsPt, " #it{p}_{T} (GeV/#it{c})" }}});
136+ registry.add (" hMassDs2Star" , " Ds^{*}2 candidates; m_Ds^{*}2 (GeV/#it{c}^{2}) ;entries" , {HistType::kTH2F , {axisMassDsj, {(std::vector<double >)binsPt, " #it{p}_{T} (GeV/#it{c})" }}});
137+ registry.add (" hMassXcRes" , " XcRes candidates; m_XcRes (GeV/#it{c}^{2}) ;entries" , {HistType::kTH2F , {{300 , 1.1 , 1.4 }, {(std::vector<double >)binsPt, " #it{p}_{T} (GeV/#it{c})" }}});
138+ registry.add (" hMassLambdaDminus" , " LambdaDminus candidates; m_LambdaDminus (GeV/#it{c}^{2}) ;entries" , {HistType::kTH2F , {{300 , 1.1 , 1.4 }, {(std::vector<double >)binsPt, " #it{p}_{T} (GeV/#it{c})" }}});
147139 registry.add (" hMassDstarTrack" , " DstarTrack candidates; m_DstarTrack (GeV/#it{c}^{2}) ;entries" , {HistType::kTH2F , {{100 , 0.9 , 1.4 }, {(std::vector<double >)binsPt, " #it{p}_{T} (GeV/#it{c})" }}});
148140 if (doprocessDs1ToDstarK0sMixedEvent) {
149141 registry.add (" hNPvContCorr" , " Collision number of PV contributors ; N contrib ; N contrib" , {HistType::kTH2F , {{100 , 0 , 250 }, {100 , 0 , 250 }}});
@@ -163,15 +155,6 @@ struct HfCandidateCreatorCharmResoReduced {
163155 registry.get <TH1>(HIST (" hSelections" ))->GetXaxis ()->SetBinLabel (iBin + 1 , labels[iBin].data ());
164156 }
165157 }
166- // mass constants
167- massK0 = o2::constants::physics::MassK0Short;
168- massLambda = o2::constants::physics::MassLambda;
169- massProton = o2::constants::physics::MassProton;
170- massPion = o2::constants::physics::MassPiPlus;
171- massKaon = o2::constants::physics::MassKPlus;
172- massDplus = o2::constants::physics::MassDPlus;
173- massDstar = o2::constants::physics::MassDStar;
174- massD0 = o2::constants::physics::MassD0;
175158 }
176159
177160 // / Basic selection of D candidates
@@ -225,10 +208,10 @@ struct HfCandidateCreatorCharmResoReduced {
225208 return false ;
226209 }
227210 if (channel == DecayChannel::Ds2StarToDplusK0s || channel == DecayChannel::Ds1ToDstarK0s) {
228- massV0 = massK0 ;
211+ massV0 = MassK0Short ;
229212 invMassV0 = candV0.invMassK0s ();
230213 } else if (channel == DecayChannel::XcToDplusLambda || channel == DecayChannel::LambdaDminus) {
231- massV0 = massLambda ;
214+ massV0 = MassLambda ;
232215 int wsFact{1 };
233216 if (channel == DecayChannel::LambdaDminus)
234217 wsFact = -1 ;
@@ -315,25 +298,30 @@ struct HfCandidateCreatorCharmResoReduced {
315298 float invMassReso{0 .};
316299 float invMassV0{0 .};
317300 std::array<float , 3 > pVecV0Tr = {candV0Tr.px (), candV0Tr.py (), candV0Tr.pz ()};
301+ std::array<std::array<float , 3 >, 3 > pVectorCharmProngs = {candD.pVectorProng0 (), candD.pVectorProng1 (), candD.pVectorProng2 ()};
318302 float ptReso = RecoDecay::pt (RecoDecay::sumOfVec (pVecV0Tr, pVecD));
319303
320304 if constexpr (channel == DecayChannel::DstarTrack) {
321305 if (candD.dType () > 0 ) {
322- invMassReso = RecoDecay::m (std::array{candD. pVectorProng0 (), candD. pVectorProng1 (), candD. pVectorProng2 () , pVecV0Tr}, std::array{massPion, massKaon, massPion, massProton });
306+ invMassReso = RecoDecay::m (std::array{pVectorCharmProngs[ 0 ], pVectorCharmProngs[ 1 ], pVectorCharmProngs[ 2 ] , pVecV0Tr}, std::array{MassPiPlus, MassKPlus, MassPiPlus, MassProton });
323307 } else {
324- invMassReso = RecoDecay::m (std::array{candD. pVectorProng1 (), candD. pVectorProng0 (), candD. pVectorProng2 () , pVecV0Tr}, std::array{massPion, massKaon, massPion, massProton });
308+ invMassReso = RecoDecay::m (std::array{pVectorCharmProngs[ 1 ], pVectorCharmProngs[ 0 ], pVectorCharmProngs[ 2 ] , pVecV0Tr}, std::array{MassPiPlus, MassKPlus, MassPiPlus, MassProton });
325309 }
326310 registry.fill (HIST (" hMassDstarTrack" ), invMassReso - invMassD, ptReso);
327311 } else {
328312 switch (channel) {
329313 case DecayChannel::Ds1ToDstarK0s:
330314 invMassV0 = candV0Tr.invMassK0s ();
331- invMassReso = RecoDecay::m (std::array{pVecD, pVecV0Tr}, std::array{massDstar, massK0});
315+ if (candD.dType () > 0 ) {
316+ invMassReso = RecoDecay::m (std::array{pVectorCharmProngs[0 ], pVectorCharmProngs[1 ], pVectorCharmProngs[2 ], pVecV0Tr}, std::array{MassPiPlus, MassKPlus, MassPiPlus, MassK0Short}) - invMassD;
317+ } else {
318+ invMassReso = RecoDecay::m (std::array{pVectorCharmProngs[1 ], pVectorCharmProngs[0 ], pVectorCharmProngs[2 ], pVecV0Tr}, std::array{MassPiPlus, MassKPlus, MassPiPlus, MassK0Short}) - invMassD;
319+ }
332320 registry.fill (HIST (" hMassDs1" ), invMassReso, ptReso);
333321 break ;
334322 case DecayChannel::Ds2StarToDplusK0s:
335323 invMassV0 = candV0Tr.invMassK0s ();
336- invMassReso = RecoDecay::m (std::array{pVecD, pVecV0Tr}, std::array{massDplus, massK0}) ;
324+ invMassReso = RecoDecay::m (std::array{pVectorCharmProngs[ 0 ], pVectorCharmProngs[ 1 ], pVectorCharmProngs[ 2 ], pVecV0Tr}, std::array{MassPiPlus, MassKPlus, MassPiPlus, MassK0Short}) - invMassD ;
337325 registry.fill (HIST (" hMassDs2Star" ), invMassReso, ptReso);
338326 break ;
339327 case DecayChannel::XcToDplusLambda:
@@ -342,7 +330,7 @@ struct HfCandidateCreatorCharmResoReduced {
342330 } else {
343331 invMassV0 = candV0Tr.invMassAntiLambda ();
344332 }
345- invMassReso = RecoDecay::m (std::array{pVecD, pVecV0Tr}, std::array{massDplus, massLambda}) ;
333+ invMassReso = RecoDecay::m (std::array{pVectorCharmProngs[ 0 ], pVectorCharmProngs[ 1 ], pVectorCharmProngs[ 2 ], pVecV0Tr}, std::array{MassPiPlus, MassKPlus, MassPiPlus, MassLambda}) - invMassD ;
346334 registry.fill (HIST (" hMassXcRes" ), invMassReso, ptReso);
347335 break ;
348336 case DecayChannel::LambdaDminus:
@@ -351,7 +339,7 @@ struct HfCandidateCreatorCharmResoReduced {
351339 } else {
352340 invMassV0 = candV0Tr.invMassAntiLambda ();
353341 }
354- invMassReso = RecoDecay::m (std::array{pVecD, pVecV0Tr}, std::array{massDplus, massLambda}) ;
342+ invMassReso = RecoDecay::m (std::array{pVectorCharmProngs[ 0 ], pVectorCharmProngs[ 1 ], pVectorCharmProngs[ 2 ], pVecV0Tr}, std::array{MassPiPlus, MassKPlus, MassPiPlus, MassLambda}) - invMassD ;
355343 registry.fill (HIST (" hMassLambdaDminus" ), invMassReso, ptReso);
356344 break ;
357345 default :
@@ -428,12 +416,12 @@ struct HfCandidateCreatorCharmResoReduced {
428416 switch (channel) {
429417 case DecayChannel::Ds1ToDstarK0s:
430418 invMassV0 = bachV0Tr.invMassK0s ();
431- invMassReso = RecoDecay::m (std::array{pVecD, pVecV0Tr}, std::array{massDstar, massK0 });
419+ invMassReso = RecoDecay::m (std::array{pVecD, pVecV0Tr}, std::array{MassDStar, MassK0Short });
432420 registry.fill (HIST (" hMassDs1" ), invMassReso, ptReso);
433421 break ;
434422 case DecayChannel::Ds2StarToDplusK0s:
435423 invMassV0 = bachV0Tr.invMassK0s ();
436- invMassReso = RecoDecay::m (std::array{pVecD, pVecV0Tr}, std::array{massDplus, massK0 });
424+ invMassReso = RecoDecay::m (std::array{pVecD, pVecV0Tr}, std::array{MassDPlus, MassK0Short });
437425 registry.fill (HIST (" hMassDs2Star" ), invMassReso, ptReso);
438426 break ;
439427 case DecayChannel::XcToDplusLambda:
@@ -442,7 +430,7 @@ struct HfCandidateCreatorCharmResoReduced {
442430 } else {
443431 invMassV0 = bachV0Tr.invMassAntiLambda ();
444432 }
445- invMassReso = RecoDecay::m (std::array{pVecD, pVecV0Tr}, std::array{massDplus, massLambda });
433+ invMassReso = RecoDecay::m (std::array{pVecD, pVecV0Tr}, std::array{MassDPlus, MassLambda });
446434 registry.fill (HIST (" hMassXcRes" ), invMassReso, ptReso);
447435 break ;
448436 case DecayChannel::LambdaDminus:
@@ -451,7 +439,7 @@ struct HfCandidateCreatorCharmResoReduced {
451439 } else {
452440 invMassV0 = bachV0Tr.invMassAntiLambda ();
453441 }
454- invMassReso = RecoDecay::m (std::array{pVecD, pVecV0Tr}, std::array{massDplus, massLambda });
442+ invMassReso = RecoDecay::m (std::array{pVecD, pVecV0Tr}, std::array{MassDPlus, MassLambda });
455443 registry.fill (HIST (" hMassLambdaDminus" ), invMassReso, ptReso);
456444 break ;
457445 default :
@@ -649,7 +637,7 @@ struct HfCandidateCreatorCharmResoReducedExpressions {
649637
650638 // Configurable axis
651639 ConfigurableAxis axisPt{" axisPt" , {VARIABLE_WIDTH, 0 ., 1 .f , 2 .f , 3 .f , 4 .f , 5 .f , 6 .f , 8 .f , 12 .f , 24 .f , 50 .f }, " #it{p}_{T} (GeV/#it{c})" };
652- ConfigurableAxis axisInvMassReso{" axisInvMassReso" , {200 , 2.5 , 2.7 }, " inv. mass (DV_{0}) (GeV/#it{c}^{2})" };
640+ ConfigurableAxis axisInvMassReso{" axisInvMassReso" , {400 , 0 . 49f , 0 . 89f }, " inv. mass (DV_{0}) (GeV/#it{c}^{2})" };
653641 ConfigurableAxis axisInvMassProng0{" axisInvMassProng0" , {200 , 0.14 , 0.17 }, " inv. mass (D) (GeV/#it{c}^{2})" };
654642 ConfigurableAxis axisInvMassProng1{" axisInvMassProng1" , {200 , 0.47 , 0.53 }, " inv. mass ({V}_{0}) (GeV/#it{c}^{2})" };
655643 ConfigurableAxis axisInvMassD0{" axisInvMassD0" , {200 , 1.65 , 2.05 }, " inv. mass ({V}_{0}) (GeV/#it{c}^{2})" };
@@ -708,7 +696,7 @@ struct HfCandidateCreatorCharmResoReducedExpressions {
708696 break ;
709697 }
710698 if (!filledMcInfo) { // protection to get same size tables in case something went wrong: we created a candidate that was not preselected in the D-Pi creator
711- // rowResoMcRec(0, -1, -1, -1.f);
699+ rowResoMcRec (0 , -1 , -1 , -1 .f );
712700 registry.fill (HIST (" hMassMcNoEntry" ), candReso.invMass (), candReso.pt ());
713701 }
714702 }
0 commit comments