3232#include " PWGHF/Utils/utilsTrkCandHf.h"
3333#include " PWGLF/DataModel/mcCentrality.h"
3434
35+ #include " Common/CCDB/ctpRateFetcher.h"
3536#include " Common/Core/RecoDecay.h"
3637#include " Common/Core/trackUtilities.h"
3738#include " Common/DataModel/Centrality.h"
@@ -120,6 +121,7 @@ struct HfCandidateCreator3Prong {
120121 Configurable<std::string> ccdbUrl{" ccdbUrl" , " http://alice-ccdb.cern.ch" , " url of the ccdb repository" };
121122 Configurable<std::string> ccdbPathGrp{" ccdbPathGrp" , " GLO/GRP/GRP" , " Path of the grp file (Run 2)" };
122123 Configurable<std::string> ccdbPathGrpMag{" ccdbPathGrpMag" , " GLO/Config/GRPMagField" , " CCDB path of the GRPMagField object (Run 3)" };
124+ Configurable<std::string> irSource{" irSource" , " ZNC hadronic" , " Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)" };
123125 // flags to enable creation for different particle species separately
124126 Configurable<bool > createDplus{" createDplus" , false , " enable D+/- candidate creation" };
125127 Configurable<bool > createDs{" createDs" , false , " enable Ds+/- candidate creation" };
@@ -133,6 +135,7 @@ struct HfCandidateCreator3Prong {
133135 HfEventSelection hfEvSel; // event selection and monitoring
134136 o2::vertexing::DCAFitterN<3 > df; // 3-prong vertex fitter
135137 Service<o2::ccdb::BasicCCDBManager> ccdb;
138+ ctpRateFetcher mRateFetcher ;
136139
137140 int runNumber{0 };
138141 double bz{0 .};
@@ -899,9 +902,10 @@ struct HfCandidateCreator3Prong {
899902 float centrality{-1 .f };
900903 const auto occupancy = o2::hf_occupancy::getOccupancyColl (collision, hfEvSel.occEstimator );
901904 const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask <true , CentralityEstimator::None, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
902-
905+ const auto bc = collision.template foundBC_as <aod::BCsWithTimestamps>();
906+ const auto ir = mRateFetcher .fetch (ccdb.service , bc.timestamp (), bc.runNumber (), irSource, true ); // Hz
903907 // / monitor the satisfied event selections
904- hfEvSel.fillHistograms (collision, rejectionMask, centrality, occupancy);
908+ hfEvSel.fillHistograms (collision, rejectionMask, centrality, occupancy, ir );
905909
906910 } // / end loop over collisions
907911 }
@@ -917,9 +921,10 @@ struct HfCandidateCreator3Prong {
917921 float centrality{-1 .f };
918922 const auto occupancy = o2::hf_occupancy::getOccupancyColl (collision, hfEvSel.occEstimator );
919923 const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask <true , CentralityEstimator::FT0C, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
920-
924+ const auto bc = collision.template foundBC_as <aod::BCsWithTimestamps>();
925+ const auto ir = mRateFetcher .fetch (ccdb.service , bc.timestamp (), bc.runNumber (), irSource, true ); // Hz
921926 // / monitor the satisfied event selections
922- hfEvSel.fillHistograms (collision, rejectionMask, centrality, occupancy);
927+ hfEvSel.fillHistograms (collision, rejectionMask, centrality, occupancy, ir );
923928
924929 } // / end loop over collisions
925930 }
@@ -935,9 +940,10 @@ struct HfCandidateCreator3Prong {
935940 float centrality{-1 .f };
936941 const auto occupancy = o2::hf_occupancy::getOccupancyColl (collision, hfEvSel.occEstimator );
937942 const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask <true , CentralityEstimator::FT0M, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
938-
943+ const auto bc = collision.template foundBC_as <aod::BCsWithTimestamps>();
944+ const auto ir = mRateFetcher .fetch (ccdb.service , bc.timestamp (), bc.runNumber (), irSource, true ); // Hz
939945 // / monitor the satisfied event selections
940- hfEvSel.fillHistograms (collision, rejectionMask, centrality, occupancy);
946+ hfEvSel.fillHistograms (collision, rejectionMask, centrality, occupancy, ir );
941947
942948 } // / end loop over collisions
943949 }
@@ -958,9 +964,10 @@ struct HfCandidateCreator3Prong {
958964 float centrality{-1 .f };
959965 const auto occupancy = o2::hf_occupancy::getOccupancyColl (collision, hfEvSel.occEstimator );
960966 const auto rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc <true , CentralityEstimator::None, aod::BcFullInfos>(collision, centrality, ccdb, registry, bcs);
961-
967+ const auto bc = collision.template foundBC_as <aod::BcFullInfos>();
968+ const auto ir = mRateFetcher .fetch (ccdb.service , bc.timestamp (), bc.runNumber (), irSource, true ); // Hz
962969 // / monitor the satisfied event selections
963- hfEvSel.fillHistograms (collision, rejectionMask, centrality, occupancy);
970+ hfEvSel.fillHistograms (collision, rejectionMask, centrality, occupancy, ir );
964971
965972 } // / end loop over collisions
966973 }
0 commit comments