@@ -75,7 +75,8 @@ struct HfTaskDeuteronFromLb {
7575 Configurable<float > cfgDCAmax{" cfgDCAmax" , 1000 .0f , " Maximum DCA for deuteron PID" };
7676 Configurable<float > rapidityCut{" rapidityCut" , 0 .5f , " Rapidity cut" };
7777 // PDG codes
78- Configurable<int > pdgCodeMother{" pdgCodeMother" , -5122 , " PDG code of the mother particle (default: anti-Lambda_b)" };
78+ Configurable<int > pdgCodeBeautyMeson{" pdgCodeBeautyMeson" , -521 , " PDG code of the beauty meson mother particle (default: B-)" };
79+ Configurable<int > pdgCodeBeautyBaryon{" pdgCodeBeautyBaryon" , -5122 , " PDG code of the beauty baryon mother particle (default: anti-Lambda_b)" };
7980 Configurable<int > pdgCodeDaughter{" pdgCodeDaughter" , -1000010020 , " PDG code of the daughter particle (default: anti-deuteron)" };
8081
8182 int mRunNumber = 0 ;
@@ -91,7 +92,7 @@ struct HfTaskDeuteronFromLb {
9192
9293 Preslice<o2::aod::TrackAssoc> trackIndicesPerCollision = o2::aod::track_association::collisionId;
9394
94- ConfigurableAxis ptAxis{" ptAxis" , {100 , 0 ., 10 .f }, " p_{T} GeV/c" };
95+ ConfigurableAxis ptAxis{" ptAxis" , {100 , 0 .f , 10 .f }, " p_{T} GeV/c" };
9596 ConfigurableAxis nSigmaAxis{" nSigmaAxis" , {200 , -10 .f , 10 .f }, " nSigma" };
9697 ConfigurableAxis dcaXyAxis{" dcaXyAxis" , {1000 , -0 .2f , 0 .2f }, " DCA xy (cm)" };
9798 ConfigurableAxis dcaZAxis{" dcaZAxis" , {1000 , -0 .2f , 0 .2f }, " DCA z (cm)" };
@@ -102,6 +103,23 @@ struct HfTaskDeuteronFromLb {
102103 OutputObj<ZorroSummary> zorroSummary{" zorroSummary" };
103104 OutputObj<TH1D > hProcessedEvents{TH1D (" hProcessedEvents" , " Event filtered;; Number of events" , 4 , 0 ., 4 .)};
104105
106+ bool isSelectedBeautyHadron (int pdgCode)
107+ {
108+ return pdgCode == pdgCodeBeautyMeson || pdgCode == pdgCodeBeautyBaryon;
109+ }
110+
111+ double getBeautyHadronMass (int pdgCode)
112+ {
113+ if (pdgCode == pdgCodeBeautyMeson) {
114+ return o2::constants::physics::MassBPlus;
115+ }
116+
117+ if (pdgCode == pdgCodeBeautyBaryon) {
118+ return o2::constants::physics::MassLambdaB0;
119+ }
120+ return -1 .;
121+ }
122+
105123 void init (framework::InitContext&)
106124 {
107125 ccdb->setURL (" http://alice-ccdb.cern.ch" );
@@ -113,18 +131,38 @@ struct HfTaskDeuteronFromLb {
113131 zorroSummary.setObject (zorro.getZorroSummary ());
114132 }
115133
116- QAHistos.add (" MC/ptGeneratedLb" , " ptGeneratedLb" , HistType::kTH1F , {ptAxis});
117- QAHistos.add (" MC/ptAntiDeuteronPrimary" , " ptAntiDeuteronPrimaryReco" , HistType::kTH1F , {ptAxis});
118- QAHistos.add (" MC/ptAntiDeuteronFromLb" , " ptAntiDeuteronFromLbReco" , HistType::kTH1F , {ptAxis});
119- QAHistos.add (" MC/hDCAxy-Primary" , " DCAxy-Primary" , {HistType::kTH1D , {{400 , -0 .2f , 0 .2f , " DCA xy (cm)" }}});
120- QAHistos.add (" MC/hDCAxy-FromLb" , " DCAxy-FromLb" , {HistType::kTH1D , {{400 , -0 .2f , 0 .2f , " DCA xy (cm)" }}});
121134 QAHistos.add (" Data/hDCAxyVsPt" , " DCAxy #bar{d} vs p_{T}" , {HistType::kTH2D , {ptAxis, dcaXyAxis}});
122135 QAHistos.add (" Data/hDCAzVsPt" , " DCAz #bar{d} vs p_{T}" , {HistType::kTH2D , {ptAxis, dcaZAxis}});
123136 QAHistos.add (" Data/hnSigmaTPCVsPt" , " n#sigma TPC vs p_{T} for #bar{d} hypothesis; p_{T} (GeV/c); n#sigma TPC" , {HistType::kTH2D , {ptAxis, nSigmaAxis}});
124137 QAHistos.add (" Data/hnSigmaTOFVsPt" , " n#sigma TOF vs p_{T} for #bar{d} hypothesis; p_{T} (GeV/c); n#sigma TOF" , {HistType::kTH2D , {ptAxis, nSigmaAxis}});
125138 QAHistos.add (" Data/ptAntiDeuteron" , " ptAntiDeuteron" , {HistType::kTH1F , {ptAxis}});
126139 QAHistos.add (" Data/etaAntideuteron" , " etaAntideuteron" , {HistType::kTH1F , {{100 , -1 .0f , 1 .0f , " eta #bar{d}" }}});
127140 QAHistos.add (" Data/hVtxZ" , " Z-Vertex distribution after selection;Z (cm)" , HistType::kTH1F , {{100 , -50 , 50 }});
141+ // MC generated-level histograms
142+ QAHistos.add (" MCGen/ptGeneratedBminus" , " p_{T} generated B^{-};p_{T} (GeV/c);Counts" , HistType::kTH1F , {ptAxis});
143+ QAHistos.add (" MCGen/ptGeneratedAntiLambdaB" , " p_{T} generated #bar{#Lambda}_{b};p_{T} (GeV/c);Counts" , HistType::kTH1F , {ptAxis});
144+
145+ QAHistos.add (" MCGen/ptAntiDeuteronPrimary" , " p_{T} #bar{d} primary gen;p_{T} (GeV/c);Counts" , HistType::kTH1F , {ptAxis});
146+ QAHistos.add (" MCGen/ptAntiDeuteronFromBeautyHadron" , " p_{T} #bar{d} from beauty gen hadrons;p_{T} (GeV/c);Counts" , HistType::kTH1F , {ptAxis});
147+
148+ QAHistos.add (" MCGen/hMotherPdgCode" , " PDG code of mother, gen level;PDG code;Counts" , HistType::kTH1I , {{12000 , -6000 , 6000 }});
149+ QAHistos.add (" MCGen/ctauBminus" , " ctau of B^{-}, gen level;ctau (#mu m);Counts" , HistType::kTH1F , {{25 , 0 ., 2000 .f }});
150+ QAHistos.add (" MCGen/ctauAntiLambdaB" , " ctau of #bar{#Lambda}_{b}, gen level;ctau (#mu m);Counts" , HistType::kTH1F , {{25 , 0 ., 2000 .f }});
151+ // MC reco/MC-anchored histograms
152+ QAHistos.add (" MCReco/ptAntiDeuteronFromBminus" ,
153+ " p_{T} #bar{d} from B^{-} reco/MC anchored;p_{T} (GeV/c);Counts" ,
154+ HistType::kTH1F , {ptAxis});
155+
156+ QAHistos.add (" MCReco/ptAntiDeuteronFromAntiLambdaB" ,
157+ " p_{T} #bar{d} from #bar{#Lambda}_{b} reco/MC anchored;p_{T} (GeV/c);Counts" ,
158+ HistType::kTH1F , {ptAxis});
159+ QAHistos.add (" MCGen/ptAntiDeuteronFromBminus" , " p_{T} #bar{d} from B^{-} gen;p_{T} (GeV/c);Counts" , HistType::kTH1F , {ptAxis});
160+ QAHistos.add (" MCGen/ptAntiDeuteronFromAntiLambdaB" , " p_{T} #bar{d} from #bar{#Lambda}_{b} gen;p_{T} (GeV/c);Counts" , HistType::kTH1F , {ptAxis});
161+ QAHistos.add (" MCReco/hDCAxy-Primary" , " DCAxy primary reco/MC anchored;DCA xy (cm);Counts" , {HistType::kTH1D , {{400 , -0 .2f , 0 .2f , " DCA xy (cm)" }}});
162+ QAHistos.add (" MCReco/hDCAxy-FromBeautyHadron" , " DCAxy from beauty reco/MC anchored;DCA xy (cm);Counts" , {HistType::kTH1D , {{400 , -0 .2f , 0 .2f , " DCA xy (cm)" }}});
163+ QAHistos.add (" MCReco/hMotherPdgCode" , " PDG code of mother, reco/MC anchored;PDG code;Counts" , HistType::kTH1I , {{12000 , -6000 , 6000 }});
164+ QAHistos.add (" MCReco/ctauBminus" , " ctau of B^{-}, reco/MC anchored;ctau (#mu m);Counts" , HistType::kTH1F , {{25 , 0 ., 2000 .f }});
165+ QAHistos.add (" MCReco/ctauAntiLambdaB" , " ctau of #bar{#Lambda}_{b}, reco/MC anchored;ctau (#mu m);Counts" , HistType::kTH1F , {{25 , 0 ., 2000 .f }});
128166
129167 hProcessedEvents->GetXaxis ()->SetBinLabel (1 , " Events processed" );
130168 hProcessedEvents->GetXaxis ()->SetBinLabel (2 , " ZORRO" );
@@ -248,9 +286,9 @@ struct HfTaskDeuteronFromLb {
248286 }
249287 }
250288 }
251- PROCESS_SWITCH (HfTaskDeuteronFromLb, processData, " processData" , true );
289+ PROCESS_SWITCH (HfTaskDeuteronFromLb, processData, " processData" , false );
252290
253- void processMC (MCCollisionCandidates::iterator const &, MCTrackCandidates const & tracks, o2::aod::McParticles const &)
291+ void processMC (MCCollisionCandidates::iterator const & collision , MCTrackCandidates const & tracks, o2::aod::McParticles const &)
254292 {
255293 for (const auto & track : tracks) {
256294 if (!passedSingleTrackSelection (track)) {
@@ -267,61 +305,126 @@ struct HfTaskDeuteronFromLb {
267305 continue ;
268306 }
269307 if (mcParticle.isPhysicalPrimary ()) {
270- bool isFromLb = false ;
308+ int motherPdg = 0 ;
271309 if (separateAntideuterons) {
272310 for (const auto & mom : mcParticle.mothers_as <o2::aod::McParticles>()) {
273- if (mom.pdgCode () == pdgCodeMother) {
274- isFromLb = true ;
311+ QAHistos.fill (HIST (" MCReco/hMotherPdgCode" ), mom.pdgCode ());
312+ if (mom.pdgCode () == pdgCodeBeautyMeson || mom.pdgCode () == pdgCodeBeautyBaryon) {
313+ motherPdg = mom.pdgCode ();
314+ double dx = mcParticle.vx () - collision.posX ();
315+ double dy = mcParticle.vy () - collision.posY ();
316+ double dz = mcParticle.vz () - collision.posZ ();
317+
318+ double flightDistance = std::sqrt (dx * dx + dy * dy + dz * dz);
319+ double massBeauty = getBeautyHadronMass (mom.pdgCode ());
320+
321+ if (massBeauty > 0 .) {
322+ double ctauBeauty = flightDistance / mom.p () * massBeauty;
323+ ctauBeauty *= 1 .e4 ;
324+
325+ if (motherPdg == pdgCodeBeautyMeson) {
326+ QAHistos.fill (HIST (" MCReco/ctauBminus" ), ctauBeauty);
327+ } else if (motherPdg == pdgCodeBeautyBaryon) {
328+ QAHistos.fill (HIST (" MCReco/ctauAntiLambdaB" ), ctauBeauty);
329+ }
330+ }
275331 break ;
276332 }
277333 }
278334 }
279- if (isFromLb) {
280- QAHistos.fill (HIST (" MC/hDCAxy-FromLb" ), track.dcaXY ());
281- QAHistos.fill (HIST (" MC/ptAntiDeuteronFromLb" ), track.pt ());
335+ if (motherPdg == pdgCodeBeautyMeson) {
336+ QAHistos.fill (HIST (" MCReco/hDCAxy-FromBeautyHadron" ), track.dcaXY ());
337+ QAHistos.fill (HIST (" MCReco/ptAntiDeuteronFromBminus" ), track.pt ());
338+ } else if (motherPdg == pdgCodeBeautyBaryon) {
339+ QAHistos.fill (HIST (" MCReco/hDCAxy-FromBeautyHadron" ), track.dcaXY ());
340+ QAHistos.fill (HIST (" MCReco/ptAntiDeuteronFromAntiLambdaB" ), track.pt ());
282341 } else {
283- QAHistos.fill (HIST (" MC /hDCAxy-Primary" ), track.dcaXY ());
284- QAHistos.fill (HIST (" MC /ptAntiDeuteronPrimary" ), track.pt ());
342+ QAHistos.fill (HIST (" MCReco /hDCAxy-Primary" ), track.dcaXY ());
343+ QAHistos.fill (HIST (" MCReco /ptAntiDeuteronPrimary" ), track.pt ());
285344 }
286345 }
287346 }
288347 }
289348 }
290349 PROCESS_SWITCH (HfTaskDeuteronFromLb, processMC, " processMC" , false );
291350
292- void processGen (o2::aod::McCollision const &, o2::aod::McParticles const & mcParticles)
351+ void processGen (o2::aod::McCollision const & collision , o2::aod::McParticles const & mcParticles)
293352 {
294353 hProcessedEvents->Fill (0.5 );
354+
295355 for (const auto & mcParticle : mcParticles) {
296- if (mcParticle.pdgCode () == pdgCodeMother) {
356+
357+ // Beauty hadron mother
358+ if (isSelectedBeautyHadron (mcParticle.pdgCode ())) {
297359 if (std::abs (mcParticle.y ()) <= rapidityCut) {
298- QAHistos.fill (HIST (" MC/ptGeneratedLb" ), mcParticle.pt ());
360+ if (mcParticle.pdgCode () == pdgCodeBeautyMeson) {
361+ QAHistos.fill (HIST (" MCGen/ptGeneratedBminus" ), mcParticle.pt ());
362+ } else if (mcParticle.pdgCode () == pdgCodeBeautyBaryon) {
363+ QAHistos.fill (HIST (" MCGen/ptGeneratedAntiLambdaB" ), mcParticle.pt ());
364+ }
365+ }
366+
367+ if (mcParticle.has_daughters ()) {
368+
369+ for (const auto & daughter : mcParticle.daughters_as <o2::aod::McParticles>()) {
370+
371+ double dx = daughter.vx () - collision.posX ();
372+ double dy = daughter.vy () - collision.posY ();
373+ double dz = daughter.vz () - collision.posZ ();
374+
375+ double flightDistance = std::sqrt (dx * dx + dy * dy + dz * dz);
376+ double massBeauty = getBeautyHadronMass (mcParticle.pdgCode ());
377+ if (massBeauty > 0 .) {
378+ double ctauBeauty = flightDistance / mcParticle.p () * massBeauty;
379+ ctauBeauty *= 1 .e4 ; // cm -> micrometers
380+
381+ if (mcParticle.pdgCode () == pdgCodeBeautyMeson) {
382+ QAHistos.fill (HIST (" MCGen/ctauBminus" ), ctauBeauty);
383+ } else if (mcParticle.pdgCode () == pdgCodeBeautyBaryon) {
384+ QAHistos.fill (HIST (" MCGen/ctauAntiLambdaB" ), ctauBeauty);
385+ }
386+ }
387+ break ;
388+ }
299389 }
300390 }
301391
302392 if (mcParticle.pdgCode () == pdgCodeDaughter) {
303- if (std::abs (mcParticle.y ()) > rapidityCut)
393+
394+ if (std::abs (mcParticle.y ()) > rapidityCut) {
304395 continue ;
396+ }
305397
306- bool isFromLb = false ;
398+ int motherPdg = 0 ;
307399 if (mcParticle.has_mothers ()) {
308400 for (const auto & mom : mcParticle.mothers_as <o2::aod::McParticles>()) {
309- if (mom.pdgCode () == pdgCodeMother) {
310- isFromLb = true ;
401+
402+ QAHistos.fill (HIST (" MCGen/hMotherPdgCode" ), mom.pdgCode ());
403+
404+ if (mom.pdgCode () == pdgCodeBeautyMeson) {
405+ motherPdg = mom.pdgCode ();
406+ break ;
407+ }
408+
409+ if (mom.pdgCode () == pdgCodeBeautyBaryon) {
410+ motherPdg = mom.pdgCode ();
311411 break ;
312412 }
313413 }
314414 }
315415
316- if (isFromLb) {
317- QAHistos.fill (HIST (" MC/ptAntiDeuteronFromLb" ), mcParticle.pt ());
416+ if (motherPdg == pdgCodeBeautyMeson) {
417+ QAHistos.fill (HIST (" MCGen/ptAntiDeuteronFromBminus" ), mcParticle.pt ());
418+ } else if (motherPdg == pdgCodeBeautyBaryon) {
419+ QAHistos.fill (HIST (" MCGen/ptAntiDeuteronFromAntiLambdaB" ), mcParticle.pt ());
318420 } else if (mcParticle.isPhysicalPrimary ()) {
319- QAHistos.fill (HIST (" MC /ptAntiDeuteronPrimary" ), mcParticle.pt ());
421+ QAHistos.fill (HIST (" MCGen /ptAntiDeuteronPrimary" ), mcParticle.pt ());
320422 }
321423 }
322424 }
323425 }
324- PROCESS_SWITCH (HfTaskDeuteronFromLb, processGen, " processGen" , false );
426+
427+ PROCESS_SWITCH (HfTaskDeuteronFromLb, processGen, " processGen" , true );
325428};
326429
327430WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
0 commit comments