@@ -229,7 +229,6 @@ struct TreeCreatorElectronMLDDA {
229229 Configurable<int > cfg_min_ncluster_itsib{" cfg_min_ncluster_itsib" , 0 , " min ncluster itsib" };
230230 Configurable<float > cfg_max_chi2tpc{" cfg_max_chi2tpc" , 4.0 , " max chi2/NclsTPC" };
231231 Configurable<float > cfg_max_chi2its{" cfg_max_chi2its" , 5.0 , " max chi2/NclsITS" };
232- Configurable<bool > requireTOF_for_tagging{" requireTOF_for_tagging" , false , " flag to require TOF for tagging 1 leg from V0" };
233232
234233 Configurable<float > cfg_min_TPCNsigmaEl{" cfg_min_TPCNsigmaEl" , -2 , " min n sigma e in TPC for pc->ee" };
235234 Configurable<float > cfg_max_TPCNsigmaEl{" cfg_max_TPCNsigmaEl" , +2 , " max n sigma e in TPC for pc->ee" };
@@ -264,7 +263,6 @@ struct TreeCreatorElectronMLDDA {
264263 Configurable<float > cfg_min_dcaxy_v0leg{" cfg_min_dcaxy_v0leg" , 0.1 , " min dca XY for v0 legs in cm" };
265264 Configurable<float > cfg_min_dcaxy_bachelor{" cfg_min_dcaxy_bachelor" , 0.05 , " min dca XY for bachelor in cm" };
266265 Configurable<float > cfg_min_dcaxy_v0{" cfg_min_dcaxy_v0" , 0.05 , " min dca XY for V0 in cm" };
267- Configurable<bool > requireTOF_for_tagging{" requireTOF_for_tagging" , false , " flag to require TOF for tagging 1 leg from V0" };
268266 } cascadecuts;
269267
270268 // for RCT
@@ -577,6 +575,15 @@ struct TreeCreatorElectronMLDDA {
577575 return is_Pr_TPC && is_Pr_TOF;
578576 }
579577
578+ template <typename TTrack>
579+ bool isPionTightTOFreq (TTrack const & track)
580+ {
581+ // only for K0S-> pi+ pi-
582+ bool is_Pi_TPC = tightv0cuts.cfg_min_TPCNsigmaPi < track.tpcNSigmaPi () && track.tpcNSigmaPi () < tightv0cuts.cfg_max_TPCNsigmaPi ;
583+ bool is_Pi_TOF = tightv0cuts.cfg_min_TOFNsigmaPi < track.tofNSigmaPi () && track.tofNSigmaPi () < tightv0cuts.cfg_max_TOFNsigmaPi ; // TOFreq
584+ return is_Pi_TPC && is_Pi_TOF;
585+ }
586+
580587 template <typename TCollision, typename TTrack>
581588 void fillTrackTable (TCollision const & collision, TTrack const & track, const uint8_t pidlabel)
582589 {
@@ -800,77 +807,65 @@ struct TreeCreatorElectronMLDDA {
800807 if (v0cuts.cfg_min_qt_strangeness < v0.qtarm ()) {
801808 if (v0cuts.cfg_min_qt_k0s < v0.qtarm ()) {
802809 if (!(v0cuts.cfg_min_mass_lambda_veto < v0.mLambda () && v0.mLambda () < v0cuts.cfg_max_mass_lambda_veto ) && !(v0cuts.cfg_min_mass_lambda_veto < v0.mAntiLambda () && v0.mAntiLambda () < v0cuts.cfg_max_mass_lambda_veto )) {
803- if ((isPionTight (pos) && isSelectedV0LegTight (collision, pos)) && (isPion (neg) && isSelectedV0Leg (collision, neg))) {
804- if (!tightv0cuts.requireTOF_for_tagging || pos.hasTOF ()) {
805- registry.fill (HIST (" V0/hMassK0Short" ), v0.mK0Short ());
806- if (v0cuts.cfg_min_mass_k0s < v0.mK0Short () && v0.mK0Short () < v0cuts.cfg_max_mass_k0s ) {
807- registry.fill (HIST (" V0/hTPCdEdx_P_Pi" ), neg.tpcInnerParam (), neg.tpcSignal ());
808- registry.fill (HIST (" V0/hTOFbeta_P_Pi" ), neg.tpcInnerParam (), neg.beta ());
809- fillTrackTable (collision, neg, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kPion ));
810- }
810+ if ((isPionTightTOFreq (pos) && isSelectedV0LegTight (collision, pos)) && (isPion (neg) && isSelectedV0Leg (collision, neg))) {
811+ registry.fill (HIST (" V0/hMassK0Short" ), v0.mK0Short ());
812+ if (v0cuts.cfg_min_mass_k0s < v0.mK0Short () && v0.mK0Short () < v0cuts.cfg_max_mass_k0s ) {
813+ registry.fill (HIST (" V0/hTPCdEdx_P_Pi" ), neg.tpcInnerParam (), neg.tpcSignal ());
814+ registry.fill (HIST (" V0/hTOFbeta_P_Pi" ), neg.tpcInnerParam (), neg.beta ());
815+ fillTrackTable (collision, neg, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kPion ));
811816 }
812817 }
813- if (isPion (pos) && isSelectedV0Leg (collision, pos) && isPionTight (neg) && isSelectedV0LegTight (collision, neg)) {
814- if (!tightv0cuts.requireTOF_for_tagging || neg.hasTOF ()) {
815- registry.fill (HIST (" V0/hMassK0Short" ), v0.mK0Short ());
816- if (v0cuts.cfg_min_mass_k0s < v0.mK0Short () && v0.mK0Short () < v0cuts.cfg_max_mass_k0s ) {
817- registry.fill (HIST (" V0/hTPCdEdx_P_Pi" ), pos.tpcInnerParam (), pos.tpcSignal ());
818- registry.fill (HIST (" V0/hTOFbeta_P_Pi" ), pos.tpcInnerParam (), pos.beta ());
819- fillTrackTable (collision, pos, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kPion ));
820- }
818+ if (isPion (pos) && isSelectedV0Leg (collision, pos) && isPionTightTOFreq (neg) && isSelectedV0LegTight (collision, neg)) {
819+ registry.fill (HIST (" V0/hMassK0Short" ), v0.mK0Short ());
820+ if (v0cuts.cfg_min_mass_k0s < v0.mK0Short () && v0.mK0Short () < v0cuts.cfg_max_mass_k0s ) {
821+ registry.fill (HIST (" V0/hTPCdEdx_P_Pi" ), pos.tpcInnerParam (), pos.tpcSignal ());
822+ registry.fill (HIST (" V0/hTOFbeta_P_Pi" ), pos.tpcInnerParam (), pos.beta ());
823+ fillTrackTable (collision, pos, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kPion ));
821824 }
822825 }
823826 } // end of K0S
824827 }
825828
826829 if (!(v0cuts.cfg_min_mass_k0s_veto < v0.mK0Short () && v0.mK0Short () < v0cuts.cfg_max_mass_k0s_veto )) {
827830 if (isProton (pos) && isSelectedV0Leg (collision, pos) && isPionTight (neg) && isSelectedV0LegTight (collision, neg)) {
828- if (!tightv0cuts.requireTOF_for_tagging || (neg.hasTOF () || neg.tpcInnerParam () < 0.4 )) {
829- registry.fill (HIST (" V0/hMassLambda" ), v0.mLambda ());
830- if (v0cuts.cfg_min_mass_lambda < v0.mLambda () && v0.mLambda () < v0cuts.cfg_max_mass_lambda ) {
831- fillTrackTable (collision, pos, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kProton ));
832- registry.fill (HIST (" V0/hTPCdEdx_P_Pr" ), pos.tpcInnerParam (), pos.tpcSignal ());
833- registry.fill (HIST (" V0/hTOFbeta_P_Pr" ), pos.tpcInnerParam (), pos.beta ());
834- }
831+ registry.fill (HIST (" V0/hMassLambda" ), v0.mLambda ());
832+ if (v0cuts.cfg_min_mass_lambda < v0.mLambda () && v0.mLambda () < v0cuts.cfg_max_mass_lambda ) {
833+ fillTrackTable (collision, pos, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kProton ));
834+ registry.fill (HIST (" V0/hTPCdEdx_P_Pr" ), pos.tpcInnerParam (), pos.tpcSignal ());
835+ registry.fill (HIST (" V0/hTOFbeta_P_Pr" ), pos.tpcInnerParam (), pos.beta ());
835836 }
836837 } // end of Lambda
837838 if (isPionTight (pos) && isSelectedV0LegTight (collision, pos) && isProton (neg) && isSelectedV0Leg (collision, neg)) {
838- if (!tightv0cuts.requireTOF_for_tagging || (pos.hasTOF () || pos.tpcInnerParam () < 0.4 )) {
839- registry.fill (HIST (" V0/hMassAntiLambda" ), v0.mAntiLambda ());
840- if (v0cuts.cfg_min_mass_lambda < v0.mAntiLambda () && v0.mAntiLambda () < v0cuts.cfg_max_mass_lambda ) {
841- fillTrackTable (collision, neg, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kProton ));
842- registry.fill (HIST (" V0/hTPCdEdx_P_Pr" ), neg.tpcInnerParam (), neg.tpcSignal ());
843- registry.fill (HIST (" V0/hTOFbeta_P_Pr" ), neg.tpcInnerParam (), neg.beta ());
844- }
839+ registry.fill (HIST (" V0/hMassAntiLambda" ), v0.mAntiLambda ());
840+ if (v0cuts.cfg_min_mass_lambda < v0.mAntiLambda () && v0.mAntiLambda () < v0cuts.cfg_max_mass_lambda ) {
841+ fillTrackTable (collision, neg, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kProton ));
842+ registry.fill (HIST (" V0/hTPCdEdx_P_Pr" ), neg.tpcInnerParam (), neg.tpcSignal ());
843+ registry.fill (HIST (" V0/hTOFbeta_P_Pr" ), neg.tpcInnerParam (), neg.beta ());
845844 }
846845 } // end of AntiLambda
847846 }
848847
849848 } // end of stangeness
850849
851850 if (isElectronTight (pos) && isSelectedV0LegTight (collision, pos) && isElectron (neg) && isSelectedV0Leg (collision, neg)) {
852- if (!tightv0cuts.requireTOF_for_tagging || pos.hasTOF ()) {
853- registry.fill (HIST (" V0/hMassGamma" ), v0.mGamma ());
854- registry.fill (HIST (" V0/hMassGamma_Rxy" ), v0.v0radius (), v0.mGamma ());
855- if (v0cuts.cfg_min_mass_photon < v0.mGamma () && v0.mGamma () < v0cuts.cfg_max_mass_photon ) {
856- registry.fill (HIST (" V0/hXY_Gamma" ), v0.x (), v0.y ());
857- fillTrackTable (collision, neg, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kElectron ));
858- registry.fill (HIST (" V0/hTPCdEdx_P_El" ), neg.tpcInnerParam (), neg.tpcSignal ());
859- registry.fill (HIST (" V0/hTOFbeta_P_El" ), neg.tpcInnerParam (), neg.beta ());
860- }
851+ registry.fill (HIST (" V0/hMassGamma" ), v0.mGamma ());
852+ registry.fill (HIST (" V0/hMassGamma_Rxy" ), v0.v0radius (), v0.mGamma ());
853+ if (v0cuts.cfg_min_mass_photon < v0.mGamma () && v0.mGamma () < v0cuts.cfg_max_mass_photon ) {
854+ registry.fill (HIST (" V0/hXY_Gamma" ), v0.x (), v0.y ());
855+ fillTrackTable (collision, neg, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kElectron ));
856+ registry.fill (HIST (" V0/hTPCdEdx_P_El" ), neg.tpcInnerParam (), neg.tpcSignal ());
857+ registry.fill (HIST (" V0/hTOFbeta_P_El" ), neg.tpcInnerParam (), neg.beta ());
861858 }
862859 } // end of photon conversion
863860
864861 if (isElectron (pos) && isSelectedV0Leg (collision, pos) && isElectronTight (neg) && isSelectedV0LegTight (collision, neg)) {
865- if (!tightv0cuts.requireTOF_for_tagging || neg.hasTOF ()) {
866- registry.fill (HIST (" V0/hMassGamma" ), v0.mGamma ());
867- registry.fill (HIST (" V0/hMassGamma_Rxy" ), v0.v0radius (), v0.mGamma ());
868- if (v0cuts.cfg_min_mass_photon < v0.mGamma () && v0.mGamma () < v0cuts.cfg_max_mass_photon ) {
869- registry.fill (HIST (" V0/hXY_Gamma" ), v0.x (), v0.y ());
870- fillTrackTable (collision, pos, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kElectron ));
871- registry.fill (HIST (" V0/hTPCdEdx_P_El" ), pos.tpcInnerParam (), pos.tpcSignal ());
872- registry.fill (HIST (" V0/hTOFbeta_P_El" ), pos.tpcInnerParam (), pos.beta ());
873- }
862+ registry.fill (HIST (" V0/hMassGamma" ), v0.mGamma ());
863+ registry.fill (HIST (" V0/hMassGamma_Rxy" ), v0.v0radius (), v0.mGamma ());
864+ if (v0cuts.cfg_min_mass_photon < v0.mGamma () && v0.mGamma () < v0cuts.cfg_max_mass_photon ) {
865+ registry.fill (HIST (" V0/hXY_Gamma" ), v0.x (), v0.y ());
866+ fillTrackTable (collision, pos, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kElectron ));
867+ registry.fill (HIST (" V0/hTPCdEdx_P_El" ), pos.tpcInnerParam (), pos.tpcSignal ());
868+ registry.fill (HIST (" V0/hTOFbeta_P_El" ), pos.tpcInnerParam (), pos.beta ());
874869 }
875870 } // end of photon conversion
876871
@@ -890,16 +885,10 @@ struct TreeCreatorElectronMLDDA {
890885 if (!isProtonTight (pos) || !isPionTight (neg)) {
891886 continue ;
892887 }
893- if (cascadecuts.requireTOF_for_tagging && (!pos.hasTOF () && !neg.hasTOF ())) { // require TOF to proton candidates. // pion from L is soft. Don't require TOF for soft pions.
894- continue ;
895- }
896888 } else { // Omegabar+ -> Lbar + K+ -> pbar + pi+ + K+
897889 if (!isProtonTight (neg) || !isPionTight (pos)) {
898890 continue ;
899891 }
900- if (cascadecuts.requireTOF_for_tagging && (!pos.hasTOF () && !neg.hasTOF ())) { // require TOF to anti-proton candidates. // pion from L is soft. Don't require TOF for soft pions.
901- continue ;
902- }
903892 }
904893
905894 if (!(cascadecuts.cfg_min_mass_lambda < cascade.mLambda () && cascade.mLambda () < cascadecuts.cfg_max_mass_lambda )) {
0 commit comments