42 pc.
inputs().
get<TTree*>(
"tpcSecFlucInfo");
45 const int maxDumRep = 5;
52 if (tpcScaler == -1.f) {
54 if (canUseCTPScaling) {
55 LOGP(info,
"Invalid TPC scaler value {} received for IDC-based scaling! Using CTP fallback", tpcScaler);
62 const float storedIDC =
mCorrMap->getIDC();
63 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);
69 LOGP(info,
"Valid TPC scaler value {} received, switching back to IDC-based scaling", tpcScaler);
85 LOGP(alarm,
"Previous TF lumi used to substitute dummy input is empty, warning {} of {}", ++dumRep, maxDumRep);
101 LOGP(info,
"Requesting CCDB inputs for TPC correction maps with lumiType={} and lumiMode={}",
static_cast<int>(gloOpts.
lumiType),
static_cast<int>(gloOpts.
lumiMode));
117 LOG(fatal) <<
"Correction mode unknown! Choose either 0 (default) or 1 (derivative map) for flag corrmap-lumi-mode.";
127 addInput(inputs, {
"CTPLumi",
"CTP",
"LUMI", 0, Lifetime::Timeframe});
136 if (std::find(inputs.begin(), inputs.end(), isp) == inputs.end()) {
137 inputs.emplace_back(isp);
144 if (std::find(options.begin(), options.end(), osp) == options.end()) {
145 options.emplace_back(osp);
159 LOGP(info,
"CorrMap mean lumi rate is overridden to {}",
mCorrMap->getLumi());
162 LOGP(info,
"CorrMap mean IDC rate is overridden to {}",
mCorrMap->getIDC());
165 float mapMeanRate = 0;
188 LOGP(info,
"CorrMapRef mean lumi rate is overridden to {}",
mCorrMapRef->getLumi());
191 LOGP(info,
"CorrMapRef mean IDC rate is overridden to {}",
mCorrMapRef->getIDC());
194 float mapRefMeanRate = 0;
232 const std::array<std::string, 3> lumiS{
"OFF",
"CTP",
"TPC scaler"};
233 if (scaleType >= lumiS.size()) {
234 LOGP(fatal,
"Wrong corrmap-lumi-mode provided!");
237 LOGP(info,
"TPC correction map params updated: SP corrections: {} (corr.map scaling type={}, override values: lumiMean={} lumiRefMean={} lumiScaleMode={}), CTP Lumi: source={} lumiInstOverride={} , LumiInst scale={} ",
248 LOGP(info,
"Updating TPC sector edge fluctuation info");
260 LOGP(fatal,
"TPC correction lumi scaling mode is not set");
263 bool foundCTP =
false;
264 for (
const auto& route : inputRouts) {
265 if (route.matcher ==
InputSpec{
"CTPLumi",
"CTP",
"LUMI", 0, Lifetime::Timeframe}) {
269 setLumiCTPAvailable(foundCTP);
271 LOGP(fatal,
"Lumi scaling source {}({}) is not available for TPC correction",
static_cast<int>(getLumiScaleType()), getLumiScaleType() ==
LumiScaleType::CTPLumi ?
"CTP" :
"TPCScaler");
278 if (meanLumi < threshold) {
279 LOGP(fatal,
"CTP Lumi scaling source is requested, but the map mean scale {} is below the threshold {}", meanLumi, threshold);
282 if (meanLumi > threshold) {
283 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)
void setCorrMapSecEdgeFluc(o2::gpu::TPCFastTransform *m)
float getMeanLumi() const
o2::gpu::TPCFastTransform * mCorrMapSecEdgeFluc
tpc::LumiScaleType getLumiScaleType() const
bool getLumiCTPAvailable() const
void setInstLumi(float v, bool report=false)
bool mCheckCTPIDCConsistency
void setInstLumiCTP(float v)
void setUpdatedMapSecEdgeFluc()
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
o2::tpc::SectorEdgeFluctuations mSecEdgeFlucInfo
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)
bool mApplySecEdgeFlucCorr
void checkMeanScaleConsistency(float meanLumi, float threshold) const
bool mIDC2CTPFallbackActive
static void addInput(std::vector< o2::framework::InputSpec > &inputs, o2::framework::InputSpec &&isp)
size_t size() const
Total number of intervals across all runs.
void setFromTree(TTree &tree, const int iEntry=0, const char *brName="SectorEdgeFluctuation")
set this object from input tree
size_t getNRuns() const
number of total runs stored
constexpr o2::header::DataOrigin gDataOriginTPC
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
@ NoCorrection
no corrections at all
@ StaticMapOnly
use only static map instead of main map
@ 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)
@ CalSecEdgeCorrection
calibration object for sector edge distortions
bool enableSecEdgeFlucCorrection
enable correction of sector edge fluctuations
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"