@@ -119,8 +119,8 @@ struct Kstarqa {
119119 Configurable<float > nsigmaCutCombined{" nsigmaCutCombined" , 3.0 , " Combined Nsigma cut" };
120120
121121 // Event selection configurables
122- Configurable<bool > timFrameEvsel{" timFrameEvsel" , true , " TPC Time frame boundary cut" };
123- Configurable<bool > cTVXEvsel{" cTVXEvsel" , true , " Triggger selection" };
122+ // Configurable<bool> timFrameEvsel{"timFrameEvsel", true, "TPC Time frame boundary cut"};
123+ // Configurable<bool> cTVXEvsel{"cTVXEvsel", true, "Triggger selection"};
124124 Configurable<float > cutzvertex{" cutzvertex" , 10 .0f , " Accepted z-vertex range (cm)" };
125125 // Configurable<bool> cMID{"cMID", false, "Misidentification of tracks"};
126126
@@ -213,6 +213,8 @@ struct Kstarqa {
213213 rEventSelection.add (" events_check" , " No. of events in the generated MC" , kTH1I , {{20 , 0 , 20 }});
214214 rEventSelection.add (" events_checkrec" , " No. of events in the reconstructed MC" , kTH1I , {{20 , 0 , 20 }});
215215 hInvMass.add (" h1KSRecsplit" , " KS meson Rec split" , kTH1F , {{100 , 0 .0f , 10 .0f }});
216+ hInvMass.add (" kstargenBeforeEvtSel" , " Kstar generated before event selection" , kTH1F , {ptAxis});
217+ hInvMass.add (" kstargenAfterEvtSel" , " Kstar generated after event selection" , kTH1F , {ptAxis});
216218
217219 // Multplicity distribution
218220 if (cQAevents) {
@@ -229,6 +231,25 @@ struct Kstarqa {
229231 double massPi = o2::constants::physics::MassPiPlus;
230232 double massKa = o2::constants::physics::MassKPlus;
231233
234+ template <typename Coll>
235+ bool selectionEvent (const Coll& collision)
236+ {
237+ if (std::abs (collision.posZ ()) > cutzvertex)
238+ return false ;
239+ if (!collision.sel8 ())
240+ return false ;
241+ if (!collision.selection_bit (aod::evsel::kIsTriggerTVX )) {
242+ return false ;
243+ }
244+ if (!collision.selection_bit (aod::evsel::kNoTimeFrameBorder ) || !collision.selection_bit (aod::evsel::kNoITSROFrameBorder )) {
245+ return false ;
246+ }
247+ if (rctCut.requireRCTFlagChecker && !rctChecker (collision)) {
248+ return false ;
249+ }
250+ return true ;
251+ }
252+
232253 template <typename T>
233254 bool selectionTrack (const T& candidate)
234255 {
@@ -451,7 +472,7 @@ struct Kstarqa {
451472
452473 using EventCandidates = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::FT0Mults, aod::MultZeqs, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs>>;
453474 using TrackCandidates = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTOFbeta>>;
454- using EventCandidatesMC = soa::Join<aod::Collisions, aod::EvSels, aod::McCollisionLabels, aod::CentFT0Ms>;
475+ using EventCandidatesMC = soa::Join<aod::Collisions, aod::EvSels, aod::McCollisionLabels, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs >;
455476
456477 using TrackCandidatesMC = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::McTrackLabels, aod::pidTOFbeta>>;
457478
@@ -593,23 +614,24 @@ struct Kstarqa {
593614 {
594615 rEventSelection.fill (HIST (" events_check_data" ), 0.5 );
595616
596- if (cTVXEvsel && (!collision.selection_bit (aod::evsel::kIsTriggerTVX ))) {
597- return ;
598- }
599- rEventSelection.fill (HIST (" events_check_data" ), 1.5 );
617+ // if (cTVXEvsel && (!collision.selection_bit(aod::evsel::kIsTriggerTVX))) {
618+ // return;
619+ // }
620+ // rEventSelection.fill(HIST("events_check_data"), 1.5);
600621
601- if (timFrameEvsel && (!collision.selection_bit (aod::evsel::kNoTimeFrameBorder ) || !collision.selection_bit (aod::evsel::kNoITSROFrameBorder ))) {
602- return ;
603- }
622+ // if (timFrameEvsel && (!collision.selection_bit(aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(aod::evsel::kNoITSROFrameBorder))) {
623+ // return;
624+ // }
604625
605- if (!collision.sel8 ()) {
606- return ;
607- }
608- rEventSelection.fill (HIST (" events_check_data" ), 2.5 );
626+ // if (!collision.sel8()) {
627+ // return;
628+ // }
629+ // rEventSelection.fill(HIST("events_check_data"), 2.5);
609630
610- if (rctCut. requireRCTFlagChecker && ! rctChecker (collision)) {
631+ if (! selectionEvent (collision)) {
611632 return ;
612633 }
634+
613635 rEventSelection.fill (HIST (" events_check_data" ), 3.5 );
614636
615637 multiplicity = -1 ;
@@ -621,7 +643,7 @@ struct Kstarqa {
621643 } else if (cSelectMultEstimator == 2 ) {
622644 multiplicity = collision.centFT0C ();
623645 } else {
624- multiplicity = collision.multFT0M ();
646+ multiplicity = collision.centFT0M ();
625647 }
626648
627649 // Fill the event counter
@@ -755,11 +777,12 @@ struct Kstarqa {
755777 // Map estimator to pair and multiplicity accessor
756778 auto runMixing = [&](auto & pair, auto multiplicityGetter) {
757779 for (const auto & [c1, tracks1, c2, tracks2] : pair) {
758- if (!c1.sel8 () || !c2.sel8 ())
759- continue ;
780+ // if (!c1.sel8() || !c2.sel8())
781+ // continue;
760782
761- if (rctCut. requireRCTFlagChecker && (! rctChecker (c1) || !rctChecker (c2)))
783+ if (! selectionEvent (c1) || !selectionEvent (c2)) {
762784 continue ;
785+ }
763786
764787 multiplicity = multiplicityGetter (c1);
765788
@@ -823,10 +846,10 @@ struct Kstarqa {
823846 continue ;
824847 }
825848
826- if (timFrameEvsel && !collision.selection_bit (aod::evsel::kNoTimeFrameBorder )) {
849+ if (!collision.selection_bit (aod::evsel::kNoTimeFrameBorder )) {
827850 continue ;
828851 }
829- if (cTVXEvsel && ( !collision.selection_bit (aod::evsel::kIsTriggerTVX ) )) {
852+ if (!collision.selection_bit (aod::evsel::kIsTriggerTVX )) {
830853 continue ;
831854 }
832855 if (!collision.sel8 ()) {
@@ -890,6 +913,42 @@ struct Kstarqa {
890913 }
891914 PROCESS_SWITCH (Kstarqa, processGen, " Process Generated" , false );
892915
916+ void processEvtLossSigLossMC (aod::McCollisions::iterator const &, aod::McParticles const & mcParticles, const soa::SmallGroups<EventCandidatesMC>& recCollisions)
917+ {
918+
919+ bool isSel = false ;
920+ // auto multiplicity1 = -999.;
921+ for (const auto & RecCollision : recCollisions) {
922+ if (!selectionEvent (RecCollision))
923+ continue ;
924+
925+ // if (cSelectMultEstimator == 0) {
926+ // multiplicity1 = RecCollision.centFT0M();
927+ // } else if (cSelectMultEstimator == 1) {
928+ // multiplicity1 = RecCollision.centFT0A();
929+ // } else if (cSelectMultEstimator == 2) {
930+ // multiplicity1 = RecCollision.centFT0C();
931+ // } else {
932+ // multiplicity1 = RecCollision.centFT0M();
933+ // }
934+
935+ isSel = true ;
936+ }
937+
938+ // Generated MC
939+ for (const auto & mcPart : mcParticles) {
940+ if (std::abs (mcPart.y ()) >= 0.5 || std::abs (mcPart.pdgCode ()) != 313 )
941+ continue ;
942+
943+ // signal loss estimation
944+ hInvMass.fill (HIST (" kstargenBeforeEvtSel" ), mcPart.pt ());
945+ if (isSel) {
946+ hInvMass.fill (HIST (" kstargenAfterEvtSel" ), mcPart.pt ());
947+ }
948+ } // end loop on gen particles
949+ }
950+ PROCESS_SWITCH (Kstarqa, processEvtLossSigLossMC, " Process Signal Loss, Event Loss" , false );
951+
893952 void processRec (EventCandidatesMC::iterator const & collision, TrackCandidatesMC const & tracks, aod::McParticles const &, aod::McCollisions const & /* mcCollisions*/ )
894953 {
895954
@@ -906,12 +965,12 @@ struct Kstarqa {
906965 }
907966 rEventSelection.fill (HIST (" events_checkrec" ), 2.5 );
908967
909- if (timFrameEvsel && !collision.selection_bit (aod::evsel::kNoTimeFrameBorder )) {
968+ if (!collision.selection_bit (aod::evsel::kNoTimeFrameBorder )) {
910969 return ;
911970 }
912971 rEventSelection.fill (HIST (" events_checkrec" ), 3.5 );
913972
914- if (cTVXEvsel && ( !collision.selection_bit (aod::evsel::kIsTriggerTVX ) )) {
973+ if (!collision.selection_bit (aod::evsel::kIsTriggerTVX )) {
915974 return ;
916975 }
917976 rEventSelection.fill (HIST (" events_checkrec" ), 4.5 );
0 commit comments