@@ -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,128 @@ struct HfTaskDeuteronFromLb {
267305 continue ;
268306 }
269307 if (mcParticle.isPhysicalPrimary ()) {
270- bool isFromLb = false ;
308+ bool isFromBeauty = false ;
309+ int motherPdg = 0 ;
271310 if (separateAntideuterons) {
272311 for (const auto & mom : mcParticle.mothers_as <o2::aod::McParticles>()) {
273- if (mom.pdgCode () == pdgCodeMother) {
274- isFromLb = true ;
312+ QAHistos.fill (HIST (" MCReco/hMotherPdgCode" ), mom.pdgCode ());
313+ if (mom.pdgCode () == pdgCodeBeautyMeson || mom.pdgCode () == pdgCodeBeautyBaryon) {
314+ motherPdg = mom.pdgCode ();
315+ double dx = mcParticle.vx () - collision.posX ();
316+ double dy = mcParticle.vy () - collision.posY ();
317+ double dz = mcParticle.vz () - collision.posZ ();
318+
319+ double flightDistance = std::sqrt (dx * dx + dy * dy + dz * dz);
320+ double massBeauty = getBeautyHadronMass (mom.pdgCode ());
321+
322+ if (massBeauty > 0 .) {
323+ double ctauBeauty = flightDistance / mom.p () * massBeauty;
324+ ctauBeauty *= 1 .e4 ;
325+
326+ if (motherPdg == pdgCodeBeautyMeson) {
327+ QAHistos.fill (HIST (" MCReco/ctauBminus" ), ctauBeauty);
328+ } else if (motherPdg == pdgCodeBeautyBaryon) {
329+ QAHistos.fill (HIST (" MCReco/ctauAntiLambdaB" ), ctauBeauty);
330+ }
331+ }
275332 break ;
276333 }
277334 }
278335 }
279- if (isFromLb) {
280- QAHistos.fill (HIST (" MC/hDCAxy-FromLb" ), track.dcaXY ());
281- QAHistos.fill (HIST (" MC/ptAntiDeuteronFromLb" ), track.pt ());
336+ if (motherPdg == pdgCodeBeautyMeson) {
337+ QAHistos.fill (HIST (" MCReco/hDCAxy-FromBeautyHadron" ), track.dcaXY ());
338+ QAHistos.fill (HIST (" MCReco/ptAntiDeuteronFromBminus" ), track.pt ());
339+ } else if (motherPdg == pdgCodeBeautyBaryon) {
340+ QAHistos.fill (HIST (" MCReco/hDCAxy-FromBeautyHadron" ), track.dcaXY ());
341+ QAHistos.fill (HIST (" MCReco/ptAntiDeuteronFromAntiLambdaB" ), track.pt ());
282342 } else {
283- QAHistos.fill (HIST (" MC /hDCAxy-Primary" ), track.dcaXY ());
284- QAHistos.fill (HIST (" MC /ptAntiDeuteronPrimary" ), track.pt ());
343+ QAHistos.fill (HIST (" MCReco /hDCAxy-Primary" ), track.dcaXY ());
344+ QAHistos.fill (HIST (" MCReco /ptAntiDeuteronPrimary" ), track.pt ());
285345 }
286346 }
287347 }
288348 }
289349 }
290350 PROCESS_SWITCH (HfTaskDeuteronFromLb, processMC, " processMC" , false );
291351
292- void processGen (o2::aod::McCollision const &, o2::aod::McParticles const & mcParticles)
352+ void processGen (o2::aod::McCollision const & collision , o2::aod::McParticles const & mcParticles)
293353 {
294354 hProcessedEvents->Fill (0.5 );
355+
295356 for (const auto & mcParticle : mcParticles) {
296- if (mcParticle.pdgCode () == pdgCodeMother) {
357+
358+ // Beauty hadron mother
359+ if (isSelectedBeautyHadron (mcParticle.pdgCode ())) {
297360 if (std::abs (mcParticle.y ()) <= rapidityCut) {
298- QAHistos.fill (HIST (" MC/ptGeneratedLb" ), mcParticle.pt ());
361+ if (mcParticle.pdgCode () == pdgCodeBeautyMeson) {
362+ QAHistos.fill (HIST (" MCGen/ptGeneratedBminus" ), mcParticle.pt ());
363+ } else if (mcParticle.pdgCode () == pdgCodeBeautyBaryon) {
364+ QAHistos.fill (HIST (" MCGen/ptGeneratedAntiLambdaB" ), mcParticle.pt ());
365+ }
366+ }
367+
368+ if (mcParticle.has_daughters ()) {
369+
370+ for (const auto & daughter : mcParticle.daughters_as <o2::aod::McParticles>()) {
371+
372+ double dx = daughter.vx () - collision.posX ();
373+ double dy = daughter.vy () - collision.posY ();
374+ double dz = daughter.vz () - collision.posZ ();
375+
376+ double flightDistance = std::sqrt (dx * dx + dy * dy + dz * dz);
377+ double massBeauty = getBeautyHadronMass (mcParticle.pdgCode ());
378+ if (massBeauty > 0 .) {
379+ double ctauBeauty = flightDistance / mcParticle.p () * massBeauty;
380+ ctauBeauty *= 1 .e4 ; // cm -> micrometers
381+
382+ if (mcParticle.pdgCode () == pdgCodeBeautyMeson) {
383+ QAHistos.fill (HIST (" MCGen/ctauBminus" ), ctauBeauty);
384+ } else if (mcParticle.pdgCode () == pdgCodeBeautyBaryon) {
385+ QAHistos.fill (HIST (" MCGen/ctauAntiLambdaB" ), ctauBeauty);
386+ }
387+ }
388+ break ;
389+ }
299390 }
300391 }
301392
302393 if (mcParticle.pdgCode () == pdgCodeDaughter) {
303- if (std::abs (mcParticle.y ()) > rapidityCut)
394+
395+ if (std::abs (mcParticle.y ()) > rapidityCut) {
304396 continue ;
397+ }
305398
306- bool isFromLb = false ;
399+ bool isFromBeauty = false ;
400+ int motherPdg = 0 ;
307401 if (mcParticle.has_mothers ()) {
308402 for (const auto & mom : mcParticle.mothers_as <o2::aod::McParticles>()) {
309- if (mom.pdgCode () == pdgCodeMother) {
310- isFromLb = true ;
403+
404+ QAHistos.fill (HIST (" MCGen/hMotherPdgCode" ), mom.pdgCode ());
405+
406+ if (mom.pdgCode () == pdgCodeBeautyMeson) {
407+ motherPdg = mom.pdgCode ();
408+ break ;
409+ }
410+
411+ if (mom.pdgCode () == pdgCodeBeautyBaryon) {
412+ motherPdg = mom.pdgCode ();
311413 break ;
312414 }
313415 }
314416 }
315417
316- if (isFromLb) {
317- QAHistos.fill (HIST (" MC/ptAntiDeuteronFromLb" ), mcParticle.pt ());
418+ if (motherPdg == pdgCodeBeautyMeson) {
419+ QAHistos.fill (HIST (" MCGen/ptAntiDeuteronFromBminus" ), mcParticle.pt ());
420+ } else if (motherPdg == pdgCodeBeautyBaryon) {
421+ QAHistos.fill (HIST (" MCGen/ptAntiDeuteronFromAntiLambdaB" ), mcParticle.pt ());
318422 } else if (mcParticle.isPhysicalPrimary ()) {
319- QAHistos.fill (HIST (" MC /ptAntiDeuteronPrimary" ), mcParticle.pt ());
423+ QAHistos.fill (HIST (" MCGen /ptAntiDeuteronPrimary" ), mcParticle.pt ());
320424 }
321425 }
322426 }
323427 }
324- PROCESS_SWITCH (HfTaskDeuteronFromLb, processGen, " processGen" , false );
428+
429+ PROCESS_SWITCH (HfTaskDeuteronFromLb, processGen, " processGen" , true );
325430};
326431
327432WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
0 commit comments