@@ -246,13 +246,22 @@ struct CascadeSelector {
246246 registry.add (" gen/hXiPlus" , " hXiPlus" , HistType::kTH2F , {ptAxis, rapidityAxis});
247247 registry.add (" gen/hOmegaMinus" , " hOmegaMinus" , HistType::kTH2F , {ptAxis, rapidityAxis});
248248 registry.add (" gen/hOmegaPlus" , " hOmegaPlus" , HistType::kTH2F , {ptAxis, rapidityAxis});
249+
250+ registry.add (" genwithrec/hXiMinus" , " hXiMinus" , HistType::kTH2F , {ptAxis, rapidityAxis});
251+ registry.add (" genwithrec/hXiPlus" , " hXiPlus" , HistType::kTH2F , {ptAxis, rapidityAxis});
252+ registry.add (" genwithrec/hOmegaMinus" , " hOmegaMinus" , HistType::kTH2F , {ptAxis, rapidityAxis});
253+ registry.add (" genwithrec/hOmegaPlus" , " hOmegaPlus" , HistType::kTH2F , {ptAxis, rapidityAxis});
254+
255+ registry.add (" genwithrec/hNevents" , " hNevents" , HistType::kTH1F , {{1 , 0 , 1 , " N generated events with reconstructed event" }});
256+ registry.add (" gen/hNevents" , " hNevents" , HistType::kTH1F , {{1 , 0 , 1 , " N generated events" }});
249257 }
250258 }
251259
252- bool eventSelection (MyCollisions::iterator const & collision)
260+ template <typename TCollision>
261+ bool eventSelection (TCollision const & collision)
253262 {
254263 if (useTrigger) {
255- auto bc = collision.bc_as <aod::BCsWithTimestamps>();
264+ auto bc = collision.template bc_as <aod::BCsWithTimestamps>();
256265 zorro.initCCDB (ccdb.service , bc.runNumber (), bc.timestamp (), triggerList);
257266 bool eventTrigger = zorro.isSelected (bc.globalBC ());
258267 if (eventTrigger) {
@@ -282,7 +291,8 @@ struct CascadeSelector {
282291 return true ;
283292 }
284293
285- void fillMatchedHistos (LabeledCascades::iterator rec, int flag, MyCollisions::iterator collision)
294+ template <typename TCollision>
295+ void fillMatchedHistos (LabeledCascades::iterator rec, int flag, TCollision collision)
286296 {
287297 if (flag == 0 )
288298 return ;
@@ -335,8 +345,8 @@ struct CascadeSelector {
335345 }
336346 }
337347
338- template <typename TCascade>
339- int processCandidate (TCascade const & casc, MyCollisions::iterator const & collision)
348+ template <typename TCascade, typename TCollision >
349+ int processCandidate (TCascade const & casc, TCollision const & collision)
340350 {
341351 // these are the tracks:
342352 auto bachTrack = casc.template bachelor_as <FullTracksExtIUWithPID>();
@@ -477,8 +487,11 @@ struct CascadeSelector {
477487 return 0 ;
478488 } // processCandidate
479489
480- void processGenMC (aod::McCollision const &, soa::SmallGroups<soa::Join<aod::McCollisionLabels, MyCollisionsMult >> const &, aod::McParticles const & mcParticles)
490+ void processGenMC (aod::McCollision const &, soa::SmallGroups<soa::Join<aod::McCollisionLabels, MyCollisions >> const & collisions , aod::McParticles const & mcParticles)
481491 {
492+ // N gen events without any event selection or matched reco event
493+ registry.fill (HIST (" gen/hNevents" ), 0 );
494+
482495 for (auto const & mcPart : mcParticles) {
483496 if (!mcPart.isPhysicalPrimary ())
484497 continue ;
@@ -501,15 +514,44 @@ struct CascadeSelector {
501514 }
502515 }
503516
504- // if (matchedCollisions.size() < 1) {
505- // return;
506- // } else if (matchedCollisions.size() == 1) {
507- // for (auto const& collision : matchedCollisions) { // not really a loop, as there is only one collision
508- // }
509- // } else if (matchedCollisions.size() > 1) {
510- // registry.fill(HIST("MC/hSplitEvents"), matchedCollisions.size());
511- // return;
512- // }
517+ // Do the same thing, but now making sure there is at least one matched reconstructed event:
518+ if (collisions.size () < 1 ) {
519+ return ;
520+ } else {
521+ bool evSel = false ; // will be true if at least one rec. collision passes evsel
522+ for (auto const & collision : collisions) {
523+ // can be more than 1 rec. collisions due to event splitting
524+ evSel = eventSelection (collision);
525+ if (evSel) // exit loop if we find 1 rec. event that passes evsel
526+ break ;
527+ }
528+ if (evSel) {
529+ // N gen events with a reconstructed event
530+ registry.fill (HIST (" genwithrec/hNevents" ), 0 );
531+
532+ for (auto const & mcPart : mcParticles) {
533+ if (!mcPart.isPhysicalPrimary ())
534+ continue ;
535+ if (TMath::Abs (mcPart.eta ()) > etaCascades)
536+ continue ;
537+
538+ switch (mcPart.pdgCode ()) {
539+ case 3312 :
540+ registry.fill (HIST (" genwithrec/hXiMinus" ), mcPart.pt (), mcPart.y ());
541+ break ;
542+ case -3312 :
543+ registry.fill (HIST (" genwithrec/hXiPlus" ), mcPart.pt (), mcPart.y ());
544+ break ;
545+ case 3334 :
546+ registry.fill (HIST (" genwithrec/hOmegaMinus" ), mcPart.pt (), mcPart.y ());
547+ break ;
548+ case -3334 :
549+ registry.fill (HIST (" genwithrec/hOmegaPlus" ), mcPart.pt (), mcPart.y ());
550+ break ;
551+ }
552+ }
553+ }
554+ }
513555 } // processGen
514556
515557 // wrappers for data/MC processes on reco level
0 commit comments