33 const int maxDumRep = 5;
40 if (tpcScaler == -1.f) {
42 if (canUseCTPScaling) {
43 LOGP(info,
"Invalid TPC scaler value {} received for IDC-based scaling! Using CTP fallback", tpcScaler);
50 const float storedIDC =
mCorrMap->getIDC();
51 LOGP(warning,
"Invalid TPC scaler value {} received for IDC-based scaling! CTP fallback not possible, using stored IDC of {} from the map to avoid applying wrong corrections", tpcScaler, storedIDC);
57 LOGP(info,
"Valid TPC scaler value {} received, switching back to IDC-based scaling", tpcScaler);
73 LOGP(alarm,
"Previous TF lumi used to substitute dummy input is empty, warning {} of {}", ++dumRep, maxDumRep);
89 LOGP(info,
"Requesting CCDB inputs for TPC correction maps with lumiType={} and lumiMode={}",
static_cast<int>(gloOpts.
lumiType),
static_cast<int>(gloOpts.
lumiMode));
101 LOG(fatal) <<
"Correction mode unknown! Choose either 0 (default) or 1 (derivative map) for flag corrmap-lumi-mode.";
105 addInput(inputs, {
"CTPLumi",
"CTP",
"LUMI", 0, Lifetime::Timeframe});
114 if (std::find(inputs.begin(), inputs.end(), isp) == inputs.end()) {
115 inputs.emplace_back(isp);
122 if (std::find(options.begin(), options.end(), osp) == options.end()) {
123 options.emplace_back(osp);
137 LOGP(info,
"CorrMap mean lumi rate is overridden to {}",
mCorrMap->getLumi());
140 LOGP(info,
"CorrMap mean IDC rate is overridden to {}",
mCorrMap->getIDC());
143 float mapMeanRate = 0;
166 LOGP(info,
"CorrMapRef mean lumi rate is overridden to {}",
mCorrMapRef->getLumi());
169 LOGP(info,
"CorrMapRef mean IDC rate is overridden to {}",
mCorrMapRef->getIDC());
172 float mapRefMeanRate = 0;
210 const std::array<std::string, 3> lumiS{
"OFF",
"CTP",
"TPC scaler"};
211 if (scaleType >= lumiS.size()) {
212 LOGP(fatal,
"Wrong corrmap-lumi-mode provided!");
215 LOGP(info,
"TPC correction map params updated: SP corrections: {} (corr.map scaling type={}, override values: lumiMean={} lumiRefMean={} lumiScaleMode={}), CTP Lumi: source={} lumiInstOverride={} , LumiInst scale={} ",
226 LOGP(fatal,
"TPC correction lumi scaling mode is not set");
229 bool foundCTP =
false;
230 for (
const auto& route : inputRouts) {
231 if (route.matcher ==
InputSpec{
"CTPLumi",
"CTP",
"LUMI", 0, Lifetime::Timeframe}) {
235 setLumiCTPAvailable(foundCTP);
237 LOGP(fatal,
"Lumi scaling source {}({}) is not available for TPC correction",
static_cast<int>(getLumiScaleType()), getLumiScaleType() ==
LumiScaleType::CTPLumi ?
"CTP" :
"TPCScaler");
244 if (meanLumi < threshold) {
245 LOGP(fatal,
"CTP Lumi scaling source is requested, but the map mean scale {} is below the threshold {}", meanLumi, threshold);
248 if (meanLumi > threshold) {
249 LOGP(fatal,
"IDC scaling source is requested, but the map mean scale {} is above the threshold {}", meanLumi, threshold);
CDB Type definitions for TPC.
Implementation of the parameter class for the CorrectionMapsLoader options.
Helper class to access load maps from CCDB.
static const CorrMapParam & Instance()
ServiceRegistryRef services()
InputRecord & inputs()
The inputs associated with this processing context.
float getMeanLumiRef() const
float mMeanLumiRefOverride
o2::gpu::TPCFastTransform * mCorrMap
float mInstCTPLumiOverride
void setMeanLumiRef(float v, bool report=false)
float getMeanLumiRefOverride() const
void setLumiScaleType(tpc::LumiScaleType v)
float getMeanLumi() const
tpc::LumiScaleType getLumiScaleType() const
bool getLumiCTPAvailable() const
void setInstLumi(float v, bool report=false)
bool mCheckCTPIDCConsistency
void setInstLumiCTP(float v)
void setCorrMapRef(o2::gpu::TPCFastTransform *m)
void setMeanLumi(float v, bool report=false)
o2::gpu::TPCFastTransform * mCorrMapRef
void setCorrMap(o2::gpu::TPCFastTransform *m)
bool canUseCorrections() const
float getMeanLumiOverride() const
float getInstLumiCTP() const
tpc::LumiScaleMode getLumiScaleMode() const
bool accountCCDBInputs(const o2::framework::ConcreteDataMatcher &matcher, void *obj)
void extractCCDBInputs(o2::framework::ProcessingContext &pc, float tpcScaler=-1.f)
void init(o2::framework::InitContext &ic, bool idcsAvailable)
static void addOption(std::vector< o2::framework::ConfigParamSpec > &options, o2::framework::ConfigParamSpec &&osp)
static void requestCCDBInputs(std::vector< o2::framework::InputSpec > &inputs, const o2::tpc::CorrectionMapsGloOpts &gloOpts)
void checkMeanScaleConsistency(float meanLumi, float threshold) const
bool mIDC2CTPFallbackActive
static void addInput(std::vector< o2::framework::InputSpec > &inputs, o2::framework::InputSpec &&isp)
Defining ITS Vertex explicitly as messageable.
std::vector< ConfigParamSpec > ccdbParamSpec(std::string const &path, int runDependent, std::vector< CCDBMetadata > metadata={}, int qrate=0)
Global TPC definitions and constants.
@ DerivativeMap
map(lumi) = mean_map + lumiScale * (derivativeMap) where derivativeMap = (mean_map_A - mean_map_B)
@ Linear
map(lumi) = (mean_map - referenceMap) * lumiScale + referenceMap
@ DerivativeMapMC
same DerivativeMap, but for MC
const std::unordered_map< CDBType, const std::string > CDBTypeMap
Storage name in CCDB for each calibration and parameter type.
@ TPCScaler
use TPC scaler for scaling
@ CTPLumi
use CTP luminosity for scaling
@ CalCorrMapMC
Cluster correction map (high IR rate distortions) for MC.
@ CalCorrMapRef
Cluster correction reference map (static distortions)
@ CalCorrMap
Cluster correction map (high IR rate distortions)
LumiScaleType lumiType
what estimator to used for corrections scaling: 0: no scaling, 1: CTP, 2: IDC
bool requestCTPLumi
request CTP Lumi regardless of what is used for corrections scaling
LumiScaleMode lumiMode
what corrections method to use: 0: classical scaling, 1: Using of the derivative map,...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"