2020#include " PWGLF/DataModel/LFStrangenessTables.h"
2121
2222#include " Common/CCDB/RCTSelectionFlags.h"
23+ #include " Common/CCDB/ctpRateFetcher.h"
2324#include " Common/Core/RecoDecay.h"
2425#include " Common/Core/TrackSelection.h"
2526#include " Common/Core/trackUtilities.h"
@@ -125,6 +126,7 @@ struct TreeCreatorElectronMLDDA {
125126 // Operation and minimisation criteria
126127 Configurable<double > d_bz_input{" d_bz_input" , -999 , " bz field, -999 is automatic" };
127128 Configurable<int > useMatCorrType{" useMatCorrType" , 2 , " 0: none, 1: TGeo, 2: LUT" };
129+ Configurable<std::string> irSource{" irSource" , " ZNC hadronic" , " Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)" };
128130
129131 // for zorro
130132 Configurable<std::string> cfg_swt_names{" cfg_swt_names" , " fHighTrackMult,fHighFt0cFv0Mult" , " comma-separated software trigger names" };
@@ -298,6 +300,7 @@ struct TreeCreatorElectronMLDDA {
298300 o2::base::MatLayerCylSet* lut = nullptr ;
299301 o2::dataformats::DCA mDcaInfoCov ;
300302 o2::aod::rctsel::RCTFlagsChecker rctChecker;
303+ ctpRateFetcher mRateFetcher ;
301304 Zorro zorro;
302305
303306 std::mt19937 engine;
@@ -611,7 +614,7 @@ struct TreeCreatorElectronMLDDA {
611614 }
612615
613616 template <typename TCollision, typename TTrack>
614- void fillTrackTable (TCollision const & collision, TTrack const & track, const uint8_t pidlabel)
617+ void fillTrackTable (TCollision const & collision, TTrack const & track, const uint8_t pidlabel, const float hadronicRate )
615618 {
616619 if (store_ele_band_only && !isElectron (track)) {
617620 return ;
@@ -673,7 +676,7 @@ struct TreeCreatorElectronMLDDA {
673676 }
674677
675678 if (std::find (stored_trackIds.begin (), stored_trackIds.end (), track.globalIndex ()) == stored_trackIds.end ()) {
676- emprimarytracks (collision.numContrib (), collision.trackOccupancyInTimeRange (), collision.ft0cOccupancyInTimeRange (),
679+ emprimarytracks (collision.numContrib (), collision.trackOccupancyInTimeRange (), collision.ft0cOccupancyInTimeRange (), hadronicRate,
677680 trackParCov.getP (), trackParCov.getTgl (), track.sign (),
678681 track.tpcNClsFindable (), track.tpcNClsFound (), track.tpcNClsCrossedRows (), track.tpcNClsPID (),
679682 track.tpcChi2NCl (), track.tpcInnerParam (),
@@ -816,6 +819,8 @@ struct TreeCreatorElectronMLDDA {
816819 registry.fill (HIST (" Event/hEventCounter" ), 2.0 ); // selected
817820 registry.fill (HIST (" Event/hNumContrib" ), collision.numContrib ());
818821
822+ float hadronicRate = mRateFetcher .fetch (ccdb.service , bc.timestamp (), bc.runNumber (), irSource) * 1 .e -3 ; // kHz
823+
819824 auto v0s_coll = v0s.sliceBy (perCollision_v0, collision.globalIndex ());
820825 for (const auto & v0 : v0s_coll) {
821826 // auto o2v0 = v0.template v0_as<aod::V0s>();
@@ -850,15 +855,15 @@ struct TreeCreatorElectronMLDDA {
850855 if (v0cuts.cfg_min_mass_k0s < v0.mK0Short () && v0.mK0Short () < v0cuts.cfg_max_mass_k0s ) {
851856 registry.fill (HIST (" V0/hTPCdEdx_P_Pi" ), neg.tpcInnerParam (), neg.tpcSignal ());
852857 registry.fill (HIST (" V0/hTOFbeta_P_Pi" ), neg.tpcInnerParam (), neg.beta ());
853- fillTrackTable (collision, neg, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kPion ));
858+ fillTrackTable (collision, neg, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kPion ), hadronicRate );
854859 }
855860 }
856861 if (isPion (pos) && isSelectedV0Leg (collision, pos) && isPionTightTOFreq (neg) && isSelectedV0LegTight (collision, neg)) {
857862 registry.fill (HIST (" V0/hMassK0Short" ), v0.mK0Short ());
858863 if (v0cuts.cfg_min_mass_k0s < v0.mK0Short () && v0.mK0Short () < v0cuts.cfg_max_mass_k0s ) {
859864 registry.fill (HIST (" V0/hTPCdEdx_P_Pi" ), pos.tpcInnerParam (), pos.tpcSignal ());
860865 registry.fill (HIST (" V0/hTOFbeta_P_Pi" ), pos.tpcInnerParam (), pos.beta ());
861- fillTrackTable (collision, pos, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kPion ));
866+ fillTrackTable (collision, pos, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kPion ), hadronicRate );
862867 }
863868 }
864869 } // end of K0S
@@ -868,15 +873,15 @@ struct TreeCreatorElectronMLDDA {
868873 if (isProton (pos) && isSelectedV0Leg (collision, pos) && isPionTight (neg) && isSelectedV0LegTight (collision, neg)) {
869874 registry.fill (HIST (" V0/hMassLambda" ), v0.mLambda ());
870875 if (v0cuts.cfg_min_mass_lambda < v0.mLambda () && v0.mLambda () < v0cuts.cfg_max_mass_lambda ) {
871- fillTrackTable (collision, pos, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kProton ));
876+ fillTrackTable (collision, pos, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kProton ), hadronicRate );
872877 registry.fill (HIST (" V0/hTPCdEdx_P_Pr" ), pos.tpcInnerParam (), pos.tpcSignal ());
873878 registry.fill (HIST (" V0/hTOFbeta_P_Pr" ), pos.tpcInnerParam (), pos.beta ());
874879 }
875880 } // end of Lambda
876881 if (isPionTight (pos) && isSelectedV0LegTight (collision, pos) && isProton (neg) && isSelectedV0Leg (collision, neg)) {
877882 registry.fill (HIST (" V0/hMassAntiLambda" ), v0.mAntiLambda ());
878883 if (v0cuts.cfg_min_mass_lambda < v0.mAntiLambda () && v0.mAntiLambda () < v0cuts.cfg_max_mass_lambda ) {
879- fillTrackTable (collision, neg, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kProton ));
884+ fillTrackTable (collision, neg, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kProton ), hadronicRate );
880885 registry.fill (HIST (" V0/hTPCdEdx_P_Pr" ), neg.tpcInnerParam (), neg.tpcSignal ());
881886 registry.fill (HIST (" V0/hTOFbeta_P_Pr" ), neg.tpcInnerParam (), neg.beta ());
882887 }
@@ -890,7 +895,7 @@ struct TreeCreatorElectronMLDDA {
890895 registry.fill (HIST (" V0/hMassGamma_Rxy" ), v0.v0radius (), v0.mGamma ());
891896 if (v0cuts.cfg_min_mass_photon < v0.mGamma () && v0.mGamma () < v0cuts.cfg_max_mass_photon ) {
892897 registry.fill (HIST (" V0/hXY_Gamma" ), v0.x (), v0.y ());
893- fillTrackTable (collision, neg, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kElectron ));
898+ fillTrackTable (collision, neg, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kElectron ), hadronicRate );
894899 registry.fill (HIST (" V0/hTPCdEdx_P_El" ), neg.tpcInnerParam (), neg.tpcSignal ());
895900 registry.fill (HIST (" V0/hTOFbeta_P_El" ), neg.tpcInnerParam (), neg.beta ());
896901 }
@@ -901,7 +906,7 @@ struct TreeCreatorElectronMLDDA {
901906 registry.fill (HIST (" V0/hMassGamma_Rxy" ), v0.v0radius (), v0.mGamma ());
902907 if (v0cuts.cfg_min_mass_photon < v0.mGamma () && v0.mGamma () < v0cuts.cfg_max_mass_photon ) {
903908 registry.fill (HIST (" V0/hXY_Gamma" ), v0.x (), v0.y ());
904- fillTrackTable (collision, pos, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kElectron ));
909+ fillTrackTable (collision, pos, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kElectron ), hadronicRate );
905910 registry.fill (HIST (" V0/hTPCdEdx_P_El" ), pos.tpcInnerParam (), pos.tpcSignal ());
906911 registry.fill (HIST (" V0/hTOFbeta_P_El" ), pos.tpcInnerParam (), pos.beta ());
907912 }
@@ -991,7 +996,7 @@ struct TreeCreatorElectronMLDDA {
991996 if (cascadecuts.cfg_min_mass_Omega < cascade.mOmega () && cascade.mOmega () < cascadecuts.cfg_max_mass_Omega ) { // select Omega candidates
992997 registry.fill (HIST (" V0/hTPCdEdx_P_Ka" ), bachelor.tpcInnerParam (), bachelor.tpcSignal ());
993998 registry.fill (HIST (" V0/hTOFbeta_P_Ka" ), bachelor.tpcInnerParam (), bachelor.beta ());
994- fillTrackTable (collision, bachelor, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kKaon ));
999+ fillTrackTable (collision, bachelor, static_cast <uint8_t >(o2::aod::pwgem::dilepton::ml::PID_Label::kKaon ), hadronicRate );
9951000 }
9961001 }
9971002 } // end of cascade loop
0 commit comments