Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions PWGHF/TableProducer/candidateCreator2Prong.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ struct HfCandidateCreator2Prong {
HfEventSelection hfEvSel; // event selection and monitoring
o2::vertexing::DCAFitterN<2> df; // 2-prong vertex fitter
Service<o2::ccdb::BasicCCDBManager> ccdb;
ctpRateFetcher mRateFetcher;

int runNumber{0};
double bz{0.};
Expand Down Expand Up @@ -747,7 +746,7 @@ struct HfCandidateCreator2Prong {
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::None, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), hfEvSel.irSource, true); // Hz
const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz
/// monitor the satisfied event selections
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);

Expand All @@ -766,7 +765,7 @@ struct HfCandidateCreator2Prong {
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0C, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), hfEvSel.irSource, true); // Hz
const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz
/// monitor the satisfied event selections
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);

Expand All @@ -785,7 +784,7 @@ struct HfCandidateCreator2Prong {
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0M, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), hfEvSel.irSource, true); // Hz
const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz
/// monitor the satisfied event selections
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);

Expand All @@ -809,7 +808,7 @@ struct HfCandidateCreator2Prong {
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc<true, CentralityEstimator::None, aod::BcFullInfos>(collision, centrality, ccdb, registry, bcs);
const auto bc = collision.template foundBC_as<aod::BcFullInfos>();
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), hfEvSel.irSource, true); // Hz
const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz
/// monitor the satisfied event selections
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);

Expand Down
9 changes: 4 additions & 5 deletions PWGHF/TableProducer/candidateCreator3Prong.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ struct HfCandidateCreator3Prong {
HfEventSelection hfEvSel; // event selection and monitoring
o2::vertexing::DCAFitterN<3> df; // 3-prong vertex fitter
Service<o2::ccdb::BasicCCDBManager> ccdb;
ctpRateFetcher mRateFetcher;

int runNumber{0};
double bz{0.};
Expand Down Expand Up @@ -904,7 +903,7 @@ struct HfCandidateCreator3Prong {
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::None, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), hfEvSel.irSource, true); // Hz
const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz
/// monitor the satisfied event selections
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);

Expand All @@ -923,7 +922,7 @@ struct HfCandidateCreator3Prong {
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0C, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), hfEvSel.irSource, true); // Hz
const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz
/// monitor the satisfied event selections
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);

Expand All @@ -942,7 +941,7 @@ struct HfCandidateCreator3Prong {
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0M, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), hfEvSel.irSource, true); // Hz
const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz
/// monitor the satisfied event selections
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);

Expand All @@ -966,7 +965,7 @@ struct HfCandidateCreator3Prong {
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc<true, CentralityEstimator::None, aod::BcFullInfos>(collision, centrality, ccdb, registry, bcs);
const auto bc = collision.template foundBC_as<aod::BcFullInfos>();
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), hfEvSel.irSource, true); // Hz
const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz
/// monitor the satisfied event selections
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);

Expand Down
7 changes: 3 additions & 4 deletions PWGHF/TableProducer/candidateCreatorCascade.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ struct HfCandidateCreatorCascade {
Service<o2::ccdb::BasicCCDBManager> ccdb;
o2::base::MatLayerCylSet* lut{};
o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT;
ctpRateFetcher mRateFetcher;

int runNumber{0};
double massP{0.};
Expand Down Expand Up @@ -385,7 +384,7 @@ struct HfCandidateCreatorCascade {
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::None, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), hfEvSel.irSource, true); // Hz
const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz
/// monitor the satisfied event selections
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);

Expand All @@ -404,7 +403,7 @@ struct HfCandidateCreatorCascade {
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0C, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), hfEvSel.irSource, true); // Hz
const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz
/// monitor the satisfied event selections
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);

Expand All @@ -423,7 +422,7 @@ struct HfCandidateCreatorCascade {
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0M, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), hfEvSel.irSource, true); // Hz
const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz
/// monitor the satisfied event selections
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);

Expand Down
7 changes: 3 additions & 4 deletions PWGHF/TableProducer/candidateCreatorDstar.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ struct HfCandidateCreatorDstar {
HfEventSelection hfEvSel; // event selection and monitoring
Service<o2::ccdb::BasicCCDBManager> ccdb; // From utilsBfieldCCDB.h
o2::base::Propagator::MatCorrType noMatCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE;
ctpRateFetcher mRateFetcher;
// D0-prong vertex fitter
o2::vertexing::DCAFitterN<2> df;
int runNumber{};
Expand Down Expand Up @@ -505,7 +504,7 @@ struct HfCandidateCreatorDstar {
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::None, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), hfEvSel.irSource, true); // Hz
const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz
/// monitor the satisfied event selections
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);

Expand All @@ -524,7 +523,7 @@ struct HfCandidateCreatorDstar {
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0C, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), hfEvSel.irSource, true); // Hz
const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz
/// monitor the satisfied event selections
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);

Expand All @@ -543,7 +542,7 @@ struct HfCandidateCreatorDstar {
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0M, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), hfEvSel.irSource, true); // Hz
const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz
/// monitor the satisfied event selections
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);

Expand Down
7 changes: 3 additions & 4 deletions PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ struct HfCandidateCreatorXic0Omegac0 {
Service<o2::ccdb::BasicCCDBManager> ccdb;
o2::base::MatLayerCylSet* lut{};
o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT;
ctpRateFetcher mRateFetcher;
int runNumber{-1};
double magneticField{0.};

Expand Down Expand Up @@ -2241,7 +2240,7 @@ struct HfCandidateCreatorXic0Omegac0 {
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::None, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), hfEvSel.irSource, true); // Hz
const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz
/// monitor the satisfied event selections
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);

Expand All @@ -2260,7 +2259,7 @@ struct HfCandidateCreatorXic0Omegac0 {
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0C, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), hfEvSel.irSource, true); // Hz
const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz
/// monitor the satisfied event selections
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);

Expand All @@ -2279,7 +2278,7 @@ struct HfCandidateCreatorXic0Omegac0 {
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0M, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), hfEvSel.irSource, true); // Hz
const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz
/// monitor the satisfied event selections
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);

Expand Down
7 changes: 3 additions & 4 deletions PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ struct HfCandidateCreatorXicToXiPiPi {
Service<o2::ccdb::BasicCCDBManager> ccdb;
o2::base::MatLayerCylSet* lut{};
o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT;
ctpRateFetcher mRateFetcher;

o2::vertexing::DCAFitterN<3> df;

Expand Down Expand Up @@ -807,7 +806,7 @@ struct HfCandidateCreatorXicToXiPiPi {
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::None, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), hfEvSel.irSource, true); // Hz
const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz
/// monitor the satisfied event selections
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);

Expand All @@ -825,7 +824,7 @@ struct HfCandidateCreatorXicToXiPiPi {
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0C, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), hfEvSel.irSource, true); // Hz
const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz
/// monitor the satisfied event selections
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);

Expand All @@ -843,7 +842,7 @@ struct HfCandidateCreatorXicToXiPiPi {
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0M, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), hfEvSel.irSource, true); // Hz
const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz
/// monitor the satisfied event selections
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);

Expand Down
31 changes: 30 additions & 1 deletion PWGHF/Utils/utilsEvSelHf.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@
#include "Common/CCDB/EventSelectionParams.h"
#include "Common/CCDB/RCTSelectionFlags.h"
#include "Common/CCDB/ctpRateFetcher.h"
#include "Common/Core/CollisionTypeHelper.h"
#include "Common/Core/Zorro.h"
#include "Common/Core/ZorroSummary.h"

#include "CCDB/BasicCCDBManager.h"
#include "DataFormatsParameters/GRPLHCIFData.h"
#include <Framework/AnalysisHelpers.h>
#include <Framework/Configurable.h>
#include <Framework/DeviceSpec.h>
Expand Down Expand Up @@ -181,7 +184,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup {
o2::framework::Configurable<std::string> rctLabel{"rctLabel", "CBT_hadronPID", "RCT selection flag (CBT, CBT_hadronPID, CBT_electronPID, CBT_calo, CBT_muon, CBT_muon_glo)"};
o2::framework::Configurable<bool> rctCheckZDC{"rctCheckZDC", false, "RCT flag to check whether the ZDC is present or not"};
o2::framework::Configurable<bool> rctTreatLimitedAcceptanceAsBad{"rctTreatLimitedAcceptanceAsBad", false, "RCT flag to reject events with limited acceptance for selected detectors"};
o2::framework::Configurable<std::string> irSource{"irSource", "ZNC hadronic", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"};
o2::framework::Configurable<std::string> irSource{"irSource", "", "Estimator of the interaction rate (Empty: automatically set. Otherwise recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"};

// SG selector
SGSelector sgSelector;
Expand Down Expand Up @@ -209,6 +212,10 @@ struct HfEventSelection : o2::framework::ConfigurableGroup {
Zorro zorro;
int currentRun{-1};

// util to retrieve IR
ctpRateFetcher irFetcher;
std::string irSourceForCptFetcher;

/// Set standard preselection gap trigger (values taken from UD group)
SGCutParHolder setSgPreselection()
{
Expand Down Expand Up @@ -261,6 +268,11 @@ struct HfEventSelection : o2::framework::ConfigurableGroup {

// we initialise histograms
addHistograms(registry);

// we initialise IR fetcher
if (!irSource.value.empty()) {
irSourceForCptFetcher = irSource.value;
}
}

/// \brief Applies event selection.
Expand Down Expand Up @@ -431,6 +443,23 @@ struct HfEventSelection : o2::framework::ConfigurableGroup {
hCollisionsCentOcc->Fill(centrality, occupancy);
hCollisionsCentIR->Fill(centrality, ir);
}

template <typename TBc>
double getInteractionRate(TBc const& bc,
o2::framework::Service<o2::ccdb::BasicCCDBManager> const& ccdb)
{
if (irSourceForCptFetcher.empty()) {
o2::parameters::GRPLHCIFData* grpo = ccdb.service->getSpecificForRun<o2::parameters::GRPLHCIFData>("GLO/Config/GRPLHCIF", bc.runNumber());
auto collsys = o2::common::core::CollisionSystemType::getCollisionTypeFromGrp(grpo);
if (collsys == o2::common::core::CollisionSystemType::kCollSyspp) {
irSourceForCptFetcher = std::string("T0VTX");
} else {
irSourceForCptFetcher = std::string("ZNC hadronic");
}
}

return irFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSourceForCptFetcher, true);
}
};

struct HfEventSelectionMc {
Expand Down
Loading