@@ -55,6 +55,7 @@ struct Alice3Dilepton {
5555 SliceCache cache_rec;
5656
5757 Configurable<int > pdg{" pdg" , 11 , " pdg code for analysis. dielectron:11, dimuon:13" };
58+ Configurable<bool > requireHFEid{" requireHFEid" , true , " Require HFE identification for both leptons" };
5859 Configurable<float > ptMin{" pt-min" , 0 .f , " Lower limit in pT" };
5960 Configurable<float > ptMax{" pt-max" , 5 .f , " Upper limit in pT" };
6061 Configurable<float > etaMin{" eta-min" , -5 .f , " Lower limit in eta" };
@@ -97,7 +98,9 @@ struct Alice3Dilepton {
9798 registry.add (" Generated/Particle/prodVx" , " Particle Prod. Vertex X" , kTH1F , {axisProdx});
9899 registry.add (" Generated/Particle/prodVy" , " Particle Prod. Vertex Y" , kTH1F , {axisPrody});
99100 registry.add (" Generated/Particle/prodVz" , " Particle Prod. Vertex Z" , kTH1F , {axisProdz});
101+ registry.add (" Generated/Particle/ParticlesPerEvent" , " Particles per event" , kTH1F , {{100 , 0 , 100 }});
100102
103+ registry.add (" Generated/Pair/ULS/Tried" , " Pair tries" , kTH1F , {{10 , -0.5 , 9.5 }});
101104 registry.add (" Generated/Pair/ULS/Mass" , " Pair Mass" , kTH1F , {axisM});
102105 registry.add (" Generated/Pair/ULS/Pt" , " Pair Pt" , kTH1F , {axisPt});
103106 registry.add (" Generated/Pair/ULS/Eta" , " Pair Eta" , kTH1F , {axisEta});
@@ -451,24 +454,29 @@ struct Alice3Dilepton {
451454 {
452455 if constexpr (pairtype == PairType::kULS ) {
453456 for (auto & [t1, t2] : combinations (soa::CombinationsFullIndexPolicy (tracks1, tracks2))) {
457+ registry.fill (HIST (" Generated/Pair/ULS/Tried" ), 0 );
454458 if (std::abs (t1.pdgCode ()) != pdg || std::abs (t2.pdgCode ()) != pdg) {
455459 continue ;
456460 }
461+ registry.fill (HIST (" Generated/Pair/ULS/Tried" ), 1 );
457462
458463 if (!t1.isPhysicalPrimary () || !t2.isPhysicalPrimary ()) {
459464 continue ;
460465 }
466+ registry.fill (HIST (" Generated/Pair/ULS/Tried" ), 2 );
461467
462468 if (!IsInAcceptance (t1) || !IsInAcceptance (t2)) {
463469 continue ;
464470 }
471+ registry.fill (HIST (" Generated/Pair/ULS/Tried" ), 3 );
465472
466- int motherid = IsSameMother (t1, t2, mcParticles);
467- int hfee_type = IsHFULS (t1, t2, mcParticles);
473+ const int motherid = IsSameMother (t1, t2, mcParticles);
474+ const int hfee_type = IsHFULS (t1, t2, mcParticles);
468475
469- if (motherid < 0 && hfee_type == HFllType::kUndef ) {
476+ if (requireHFEid. value && motherid < 0 && hfee_type == HFllType::kUndef ) {
470477 continue ;
471478 }
479+ registry.fill (HIST (" Generated/Pair/ULS/Tried" ), 4 );
472480 // auto mother = mcparticles.iteratorAt(motherid);
473481
474482 ROOT::Math::PtEtaPhiMVector v1 (t1.pt (), t1.eta (), t1.phi (), std::abs (pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon);
@@ -484,24 +492,49 @@ struct Alice3Dilepton {
484492
485493 } else if constexpr (pairtype == PairType::kLSpp || pairtype == PairType::kLSnn ) {
486494 for (auto & [t1, t2] : combinations (soa::CombinationsStrictlyUpperIndexPolicy (tracks1, tracks2))) {
495+ if constexpr (pairtype == PairType::kLSpp ) {
496+ registry.fill (HIST (" Generated/Pair/LSpp/Tried" ), 0 );
497+ } else if constexpr (pairtype == PairType::kLSnn ) {
498+ registry.fill (HIST (" Generated/Pair/LSnn/Tried" ), 0 );
499+ }
487500 if (std::abs (t1.pdgCode ()) != pdg || std::abs (t2.pdgCode ()) != pdg) {
488501 continue ;
489502 }
490-
503+ if constexpr (pairtype == PairType::kLSpp ) {
504+ registry.fill (HIST (" Generated/Pair/LSpp/Tried" ), 1 );
505+ } else if constexpr (pairtype == PairType::kLSnn ) {
506+ registry.fill (HIST (" Generated/Pair/LSnn/Tried" ), 1 );
507+ }
508+
491509 if (!t1.isPhysicalPrimary () || !t2.isPhysicalPrimary ()) {
492510 continue ;
493511 }
494-
512+ if constexpr (pairtype == PairType::kLSpp ) {
513+ registry.fill (HIST (" Generated/Pair/LSpp/Tried" ), 2 );
514+ } else if constexpr (pairtype == PairType::kLSnn ) {
515+ registry.fill (HIST (" Generated/Pair/LSnn/Tried" ), 2 );
516+ }
517+
495518 if (!IsInAcceptance (t1) || !IsInAcceptance (t2)) {
496519 continue ;
497520 }
498-
499- int motherid = -1 ;
500- int hfee_type = IsHFLS (t1, t2, mcParticles);
501-
502- if (motherid < 0 && hfee_type == HFllType::kUndef ) {
521+ if constexpr (pairtype == PairType::kLSpp ) {
522+ registry.fill (HIST (" Generated/Pair/LSpp/Tried" ), 3 );
523+ } else if constexpr (pairtype == PairType::kLSnn ) {
524+ registry.fill (HIST (" Generated/Pair/LSnn/Tried" ), 3 );
525+ }
526+
527+ const int motherid = -1 ;
528+ const int hfee_type = IsHFLS (t1, t2, mcParticles);
529+
530+ if (requireHFEid.value && motherid < 0 && hfee_type == HFllType::kUndef ) {
503531 continue ;
504532 }
533+ if constexpr (pairtype == PairType::kLSpp ) {
534+ registry.fill (HIST (" Generated/Pair/LSpp/Tried" ), 4 );
535+ } else if constexpr (pairtype == PairType::kLSnn ) {
536+ registry.fill (HIST (" Generated/Pair/LSnn/Tried" ), 4 );
537+ }
505538 // auto mother = mcparticles.iteratorAt(motherid);
506539
507540 ROOT::Math::PtEtaPhiMVector v1 (t1.pt (), t1.eta (), t1.phi (), std::abs (pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon);
@@ -563,6 +596,7 @@ struct Alice3Dilepton {
563596 registry.fill (HIST (" Generated/Event/VtxZ" ), mccollision.posZ ());
564597
565598 auto mcParticles_per_coll = mcParticles.sliceBy (perMCCollision, mccollision.globalIndex ());
599+ int nParticlesInEvent = 0 ;
566600 for (const auto & mcParticle : mcParticles_per_coll) {
567601 if (std::abs (mcParticle.pdgCode ()) != pdg) {
568602 continue ;
@@ -573,6 +607,7 @@ struct Alice3Dilepton {
573607 if (!IsInAcceptance (mcParticle)) {
574608 continue ;
575609 }
610+ nParticlesInEvent++;
576611
577612 registry.fill (HIST (" Generated/Particle/Pt" ), mcParticle.pt ());
578613 registry.fill (HIST (" Generated/Particle/Eta" ), mcParticle.eta ());
@@ -584,6 +619,7 @@ struct Alice3Dilepton {
584619 registry.fill (HIST (" Generated/Particle/prodVz" ), mcParticle.vz ());
585620
586621 } // end of mc particle loop
622+ registry.fill (HIST (" Generated/Particle/ParticlesPerEvent" ), nParticlesInEvent);
587623
588624 auto neg_mcParticles_coll = neg_mcParticles->sliceByCached (o2::aod::mcparticle::mcCollisionId, mccollision.globalIndex (), cache_mc);
589625 auto pos_mcParticles_coll = pos_mcParticles->sliceByCached (o2::aod::mcparticle::mcCollisionId, mccollision.globalIndex (), cache_mc);
0 commit comments