2222#include " PWGLF/DataModel/LFStrangenessTables.h"
2323#include " PWGMM/Mult/DataModel/Index.h"
2424
25+ #include " Common/CCDB/ctpRateFetcher.h"
2526#include " Common/Core/EventPlaneHelper.h"
2627#include " Common/Core/TrackSelection.h"
2728#include " Common/Core/trackUtilities.h"
@@ -141,6 +142,9 @@ struct FlowGfwOmegaXi {
141142 O2_DEFINE_CONFIGURABLE (cfgCutPtOmegaMin, float , 0 .2f , " Minimal pT for Omega" )
142143 O2_DEFINE_CONFIGURABLE (cfgCutPtOmegaMax, float , 10 .0f , " Maximal pT for Omega" )
143144 O2_DEFINE_CONFIGURABLE (cfgCutPtPIDDauMin, float , 0 .15f , " Minimal pT for daughter PID" )
145+ O2_DEFINE_CONFIGURABLE (cfgCutPtPIDbachMin, float , 0 .15f , " Minimal pT for daughter PID" )
146+ O2_DEFINE_CONFIGURABLE (cfgCutPtPIDposdauMin, float , 0 .15f , " Minimal pT for daughter PID" )
147+ O2_DEFINE_CONFIGURABLE (cfgCutPtPIDnegdauMin, float , 0 .15f , " Minimal pT for daughter PID" )
144148 // track quality selections for daughter track
145149 O2_DEFINE_CONFIGURABLE (cfgCheckITSNCls, bool , false , " check minimum number of ITS clusters" )
146150 O2_DEFINE_CONFIGURABLE (cfgCheckITSHits, bool , false , " check minimum number of ITS hits" )
@@ -160,6 +164,8 @@ struct FlowGfwOmegaXi {
160164 O2_DEFINE_CONFIGURABLE (cfgCutOccupancyHigh, int , 500 , " High cut on TPC occupancy" )
161165 O2_DEFINE_CONFIGURABLE (cfgMultPVCut, int , 5 , " Use apassX MultPVCut function or not (-1)" )
162166 O2_DEFINE_CONFIGURABLE (cfgDoV0AT0Acut, bool , true , " do V0A-T0A cut" )
167+ O2_DEFINE_CONFIGURABLE (cfgCutminIR, float , -1 , " cut min IR" )
168+ O2_DEFINE_CONFIGURABLE (cfgCutmaxIR, float , -1 , " cut max IR" )
163169 } evtSeleOpts;
164170
165171 O2_DEFINE_CONFIGURABLE (cfgCasc_rapidity, float , 0.5 , " rapidity" )
@@ -171,6 +177,8 @@ struct FlowGfwOmegaXi {
171177 O2_DEFINE_CONFIGURABLE (cfgLocDenParaK0s, std::vector<double >, (std::vector<double >{-0.00043057 , -3.2435 , -0.000385085 , -2.97687 , -0.000350298 , -2.81502 , -0.000326159 , -2.71091 , -0.000299563 , -2.65448 , -0.000294284 , -2.60865 , -0.000277938 , -2.589 , -0.000277091 , -2.56983 , -0.000272783 , -2.56825 , -0.000252706 , -2.58996 , -0.000247834 , -2.63158 , -0.00024379 , -2.76976 , -0.000286468 , -2.92484 , -0.000310149 , -3.27746 }), " Local density efficiency function parameter for K0s, exp(Ax + B)" )
172178 O2_DEFINE_CONFIGURABLE (cfgLocDenParaLambda, std::vector<double >, (std::vector<double >{-0.000510948 , -4.4846 , -0.000460629 , -4.14465 , -0.000433729 , -3.94173 , -0.000412751 , -3.81839 , -0.000411211 , -3.72502 , -0.000401511 , -3.68426 , -0.000407461 , -3.67005 , -0.000379371 , -3.71153 , -0.000392828 , -3.73214 , -0.000403996 , -3.80717 , -0.000403376 , -3.90917 , -0.000354624 , -4.34629 , -0.000477606 , -4.66307 , -0.000541139 , -4.61364 }), " Local density efficiency function parameter for Lambda, exp(Ax + B)" )
173179 O2_DEFINE_CONFIGURABLE (cfgRunNumbers, std::vector<int >, (std::vector<int >{544095 , 544098 , 544116 , 544121 , 544122 , 544123 , 544124 }), " Preconfigured run numbers" )
180+ O2_DEFINE_CONFIGURABLE (irSource, std::string, " ZNC hadronic" , " Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)" );
181+ O2_DEFINE_CONFIGURABLE (fIRCrashOnNull , bool , false , " Flag to avoid CTP RateFetcher crash." );
174182 // switch
175183 O2_DEFINE_CONFIGURABLE (cfgDoAccEffCorr, bool , false , " do acc and eff corr" )
176184 O2_DEFINE_CONFIGURABLE (cfgDoLocDenCorr, bool , false , " do local density corr" )
@@ -209,6 +217,7 @@ struct FlowGfwOmegaXi {
209217
210218 // Connect to ccdb
211219 Service<ccdb::BasicCCDBManager> ccdb;
220+ ctpRateFetcher rateFetcher;
212221 O2_DEFINE_CONFIGURABLE (cfgnolaterthan, int64_t , std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(), " latest acceptable timestamp of creation for the object" )
213222 O2_DEFINE_CONFIGURABLE (cfgurl, std::string, " http://alice-ccdb.cern.ch" , " url of the ccdb repository" )
214223
@@ -383,7 +392,7 @@ struct FlowGfwOmegaXi {
383392 }
384393 }
385394
386- registry.add (" hEventCount" , " " , {HistType::kTH1D , {{12 , 0 , 12 }}});
395+ registry.add (" hEventCount" , " " , {HistType::kTH1D , {{14 , 0 , 14 }}});
387396 registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (1 , " Filtered event" );
388397 registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (2 , " after sel8" );
389398 registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (3 , " after kTVXinTRD" );
@@ -396,6 +405,9 @@ struct FlowGfwOmegaXi {
396405 registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (10 , " after MultPVCut" );
397406 registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (11 , " after TPC occupancy cut" );
398407 registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (12 , " after V0AT0Acut" );
408+ registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (13 , " after IRmincut" );
409+ registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (14 , " after IRmaxcut" );
410+ registry.add (" hInteractionRate" , " " , {HistType::kTH1D , {{1000 , 0 , 1000 }}});
399411
400412 // QA
401413 if (cfgOutputQA) {
@@ -879,9 +891,10 @@ struct FlowGfwOmegaXi {
879891 weight_loc = 1 / eff;
880892 return true ;
881893 }
894+
882895 // event selection
883896 template <typename TCollision>
884- bool eventSelected (TCollision collision, const float centrality)
897+ bool eventSelected (TCollision collision, const float centrality , float interactionRate = - 1 )
885898 {
886899 if (evtSeleOpts.cfgDoTVXinTRD .value && collision.alias_bit (kTVXinTRD )) {
887900 // TRD triggered
@@ -958,13 +971,25 @@ struct FlowGfwOmegaXi {
958971 }
959972 registry.fill (HIST (" hEventCount" ), 11.5 );
960973
974+ registry.fill (HIST (" hInteractionRate" ), interactionRate);
975+ if (interactionRate > 0 && interactionRate < evtSeleOpts.cfgCutminIR .value )
976+ return false ;
977+ registry.fill (HIST (" hEventCount" ), 12.5 );
978+ if (interactionRate > evtSeleOpts.cfgCutmaxIR .value )
979+ return false ;
980+ registry.fill (HIST (" hEventCount" ), 13.5 );
981+
961982 return true ;
962983 }
963984
964985 void processData (AodCollisions::iterator const & collision, aod::BCsWithTimestamps const &, AodTracks const & tracks, aod::CascDataExt const & Cascades, aod::V0Datas const & V0s, DaughterTracks const &)
965986 {
966987 o2::aod::ITSResponse itsResponse;
967988 int nTot = tracks.size ();
989+ auto bc = collision.bc_as <aod::BCsWithTimestamps>();
990+ int runNumber = bc.runNumber ();
991+ double interactionRate = rateFetcher.fetch (ccdb.service , bc.timestamp (), runNumber, " ZNC hadronic" ) * 1 .e -3 ;
992+
968993 registry.fill (HIST (" hEventCount" ), 0.5 );
969994 if (nTot < 1 )
970995 return ;
@@ -973,11 +998,9 @@ struct FlowGfwOmegaXi {
973998 if (!collision.sel8 ())
974999 return ;
9751000 registry.fill (HIST (" hEventCount" ), 1.5 );
976- if (eventSelected (collision, cent))
1001+ if (eventSelected (collision, cent, interactionRate ))
9771002 return ;
9781003 TH1D* hLocalDensity = new TH1D (" hphi" , " hphi" , 400 , -constants::math::TwoPI, constants::math::TwoPI);
979- auto bc = collision.bc_as <aod::BCsWithTimestamps>();
980- int runNumber = bc.runNumber ();
9811004 loadCorrections (bc.timestamp ());
9821005 float vtxz = collision.posZ ();
9831006 registry.fill (HIST (" hVtxZ" ), vtxz);
@@ -1025,6 +1048,9 @@ struct FlowGfwOmegaXi {
10251048 }
10261049 // fill GFW of V0 flow
10271050 double lowpt = trkQualityOpts.cfgCutPtPIDDauMin .value ;
1051+ double bachPtcut = trkQualityOpts.cfgCutPtPIDbachMin .value ;
1052+ double posdauPtcut = trkQualityOpts.cfgCutPtPIDposdauMin .value ;
1053+ double negdauPtcut = trkQualityOpts.cfgCutPtPIDnegdauMin .value ;
10281054
10291055 if (cfgOutputV0) {
10301056 for (const auto & v0 : V0s) {
@@ -1199,14 +1225,14 @@ struct FlowGfwOmegaXi {
11991225 if (casc.pt () > trkQualityOpts.cfgCutPtOmegaMin .value && casc.pt () < trkQualityOpts.cfgCutPtOmegaMax .value ) {
12001226 if (casc.sign () < 0 && std::fabs (casc.yOmega ()) < cfgCasc_rapidity &&
12011227 (std::fabs (bachelor.tpcNSigmaKa ()) < cfgNSigma[2 ] && std::fabs (posdau.tpcNSigmaPr ()) < cfgNSigma[1 ] && std::fabs (negdau.tpcNSigmaPi ()) < cfgNSigma[0 ]) &&
1202- ((std::fabs (bachelor.tofNSigmaKa ()) < cfgNSigma[5 ] || bachelor.pt () < lowpt ) && (std::fabs (posdau.tofNSigmaPr ()) < cfgNSigma[4 ] || posdau.pt () < lowpt ) && (std::fabs (negdau.tofNSigmaPi ()) < cfgNSigma[3 ] || negdau.pt () < lowpt )) &&
1203- ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Kaon>(bachelor)) < cfgNSigma[8 ]) || bachelor.pt () < lowpt ) && ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Proton>(posdau)) < cfgNSigma[7 ]) || posdau.pt () < lowpt ) && ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Pion>(negdau)) < cfgNSigma[6 ]) || negdau.pt () < lowpt )) {
1228+ ((std::fabs (bachelor.tofNSigmaKa ()) < cfgNSigma[5 ] || bachelor.pt () < bachPtcut ) && (std::fabs (posdau.tofNSigmaPr ()) < cfgNSigma[4 ] || posdau.pt () < posdauPtcut ) && (std::fabs (negdau.tofNSigmaPi ()) < cfgNSigma[3 ] || negdau.pt () < negdauPtcut )) &&
1229+ ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Kaon>(bachelor)) < cfgNSigma[8 ]) || bachelor.pt () < bachPtcut ) && ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Proton>(posdau)) < cfgNSigma[7 ]) || posdau.pt () < posdauPtcut ) && ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Pion>(negdau)) < cfgNSigma[6 ]) || negdau.pt () < negdauPtcut )) {
12041230 registry.fill (HIST (" InvMassOmega_all" ), casc.pt (), casc.mOmega (), casc.eta (), cent);
12051231 isOmega = true ;
12061232 } else if (casc.sign () > 0 && std::fabs (casc.yOmega ()) < cfgCasc_rapidity &&
12071233 (std::fabs (bachelor.tpcNSigmaKa ()) < cfgNSigma[2 ] && std::fabs (negdau.tpcNSigmaPr ()) < cfgNSigma[1 ] && std::fabs (posdau.tpcNSigmaPi ()) < cfgNSigma[0 ]) &&
1208- ((std::fabs (bachelor.tofNSigmaKa ()) < cfgNSigma[5 ] || bachelor.pt () < lowpt ) && (std::fabs (negdau.tofNSigmaPr ()) < cfgNSigma[4 ] || negdau.pt () < lowpt ) && (std::fabs (posdau.tofNSigmaPi ()) < cfgNSigma[3 ] || posdau.pt () < lowpt )) &&
1209- ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Kaon>(bachelor)) < cfgNSigma[8 ]) || bachelor.pt () < lowpt ) && ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Proton>(posdau)) < cfgNSigma[7 ]) || posdau.pt () < lowpt ) && ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Pion>(negdau)) < cfgNSigma[6 ]) || negdau.pt () < lowpt )) {
1234+ ((std::fabs (bachelor.tofNSigmaKa ()) < cfgNSigma[5 ] || bachelor.pt () < bachPtcut ) && (std::fabs (negdau.tofNSigmaPr ()) < cfgNSigma[4 ] || negdau.pt () < negdauPtcut ) && (std::fabs (posdau.tofNSigmaPi ()) < cfgNSigma[3 ] || posdau.pt () < posdauPtcut )) &&
1235+ ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Kaon>(bachelor)) < cfgNSigma[8 ]) || bachelor.pt () < bachPtcut ) && ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Proton>(posdau)) < cfgNSigma[7 ]) || posdau.pt () < posdauPtcut ) && ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Pion>(negdau)) < cfgNSigma[6 ]) || negdau.pt () < negdauPtcut )) {
12101236 registry.fill (HIST (" InvMassOmega_all" ), casc.pt (), casc.mOmega (), casc.eta (), cent);
12111237 isOmega = true ;
12121238 }
@@ -1215,14 +1241,14 @@ struct FlowGfwOmegaXi {
12151241 if (casc.pt () > trkQualityOpts.cfgCutPtXiMin .value && casc.pt () < trkQualityOpts.cfgCutPtXiMax .value ) {
12161242 if (casc.sign () < 0 && std::fabs (casc.yXi ()) < cfgCasc_rapidity &&
12171243 (std::fabs (bachelor.tpcNSigmaPi ()) < cfgNSigma[0 ] && std::fabs (posdau.tpcNSigmaPr ()) < cfgNSigma[1 ] && std::fabs (negdau.tpcNSigmaPi ()) < cfgNSigma[0 ]) &&
1218- ((std::fabs (bachelor.tofNSigmaPi ()) < cfgNSigma[3 ] || bachelor.pt () < lowpt ) && (std::fabs (posdau.tofNSigmaPr ()) < cfgNSigma[4 ] || posdau.pt () < lowpt ) && (std::fabs (negdau.tofNSigmaPi ()) < cfgNSigma[3 ] || negdau.pt () < lowpt )) &&
1219- ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Pion>(bachelor)) < cfgNSigma[6 ]) || bachelor.pt () < lowpt ) && ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Proton>(posdau)) < cfgNSigma[7 ]) || posdau.pt () < lowpt ) && ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Pion>(negdau)) < cfgNSigma[6 ]) || negdau.pt () < lowpt )) {
1244+ ((std::fabs (bachelor.tofNSigmaPi ()) < cfgNSigma[3 ] || bachelor.pt () < bachPtcut ) && (std::fabs (posdau.tofNSigmaPr ()) < cfgNSigma[4 ] || posdau.pt () < posdauPtcut ) && (std::fabs (negdau.tofNSigmaPi ()) < cfgNSigma[3 ] || negdau.pt () < negdauPtcut )) &&
1245+ ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Pion>(bachelor)) < cfgNSigma[6 ]) || bachelor.pt () < bachPtcut ) && ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Proton>(posdau)) < cfgNSigma[7 ]) || posdau.pt () < posdauPtcut ) && ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Pion>(negdau)) < cfgNSigma[6 ]) || negdau.pt () < negdauPtcut )) {
12201246 registry.fill (HIST (" InvMassXi_all" ), casc.pt (), casc.mXi (), casc.eta (), cent);
12211247 isXi = true ;
12221248 } else if (casc.sign () > 0 && std::fabs (casc.yXi ()) < cfgCasc_rapidity &&
12231249 (std::fabs (bachelor.tpcNSigmaPi ()) < cfgNSigma[0 ] && std::fabs (negdau.tpcNSigmaPr ()) < cfgNSigma[1 ] && std::fabs (posdau.tpcNSigmaPi ()) < cfgNSigma[0 ]) &&
1224- ((std::fabs (bachelor.tofNSigmaPi ()) < cfgNSigma[3 ] || bachelor.pt () < lowpt ) && (std::fabs (negdau.tofNSigmaPr ()) < cfgNSigma[4 ] || negdau.pt () < lowpt ) && (std::fabs (posdau.tofNSigmaPi ()) < cfgNSigma[3 ] || posdau.pt () < lowpt )) &&
1225- ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Pion>(bachelor)) < cfgNSigma[6 ]) || bachelor.pt () < lowpt ) && ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Proton>(posdau)) < cfgNSigma[7 ]) || posdau.pt () < lowpt ) && ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Pion>(negdau)) < cfgNSigma[6 ]) || negdau.pt () < lowpt )) {
1250+ ((std::fabs (bachelor.tofNSigmaPi ()) < cfgNSigma[3 ] || bachelor.pt () < bachPtcut ) && (std::fabs (negdau.tofNSigmaPr ()) < cfgNSigma[4 ] || negdau.pt () < negdauPtcut ) && (std::fabs (posdau.tofNSigmaPi ()) < cfgNSigma[3 ] || posdau.pt () < posdauPtcut )) &&
1251+ ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Pion>(bachelor)) < cfgNSigma[6 ]) || bachelor.pt () < bachPtcut ) && ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Proton>(posdau)) < cfgNSigma[7 ]) || posdau.pt () < posdauPtcut ) && ((std::fabs (itsResponse.nSigmaITS <o2::track::PID::Pion>(negdau)) < cfgNSigma[6 ]) || negdau.pt () < negdauPtcut )) {
12261252 registry.fill (HIST (" InvMassXi_all" ), casc.pt (), casc.mXi (), casc.eta (), cent);
12271253 isXi = true ;
12281254 }
0 commit comments