16#include <fmt/format.h>
17#include <TGeoGlobalMagField.h>
18#include <TGeoManager.h>
39GRPGeomRequest::GRPGeomRequest(
bool orbitResetTime,
bool GRPECS,
bool GRPLHCIF,
bool GRPMagField,
bool askMatLUT,
GeomRequest geom, std::vector<o2::framework::InputSpec>& inputs,
bool askOnce,
bool needPropD, std::string detMaskString)
40 : askGRPECS(GRPECS), askGRPLHCIF(GRPLHCIF), askGRPMagField(GRPMagField), askMatLUT(askMatLUT), askTime(orbitResetTime), askOnceAllButField(askOnce), needPropagatorD(needPropD)
44 addInput({
"geomAlg",
"GLO",
"GEOMALIGN", 0, Lifetime::Condition,
ccdbParamSpec(
"GLO/Config/GeometryAligned")}, inputs);
47 addInput({
"geomIdeal",
"GLO",
"GEOMIDEAL", 0, Lifetime::Condition,
ccdbParamSpec(
"GLO/Config/Geometry")}, inputs);
60 addInput({
"matLUT",
"GLO",
"MATLUT", 0, Lifetime::Condition,
ccdbParamSpec(
"GLO/Param/MatLUT")}, inputs);
63 addInput({
"orbitReset",
"CTP",
"ORBITRESET", 0, Lifetime::Condition,
ccdbParamSpec(
"CTP/Calib/OrbitReset")}, inputs);
66 addInput({
"grpecs",
"GLO",
"GRPECS", 0, Lifetime::Condition,
ccdbParamSpec(
"GLO/Config/GRPECS", 1)}, inputs);
69 addInput({
"grplhcif",
"GLO",
"GRPLHCIF", 0, Lifetime::Condition,
ccdbParamSpec(
"GLO/Config/GRPLHCIF")}, inputs);
72 addInput({
"grpfield",
"GLO",
"GRPMAGFIELD", 0, Lifetime::Condition,
ccdbParamSpec(
"GLO/Config/GRPMagField", {}, 1)}, inputs);
82 addInput({
"grpecs",
"GLO",
"GRPECS", 0, Lifetime::Condition,
ccdbParamSpec(
"GLO/Config/GRPECS", 1)}, inputs);
86 addInput({
"orbitReset",
"CTP",
"ORBITRESET", 0, Lifetime::Condition,
ccdbParamSpec(
"CTP/Calib/OrbitReset")}, inputs);
88 addInput({
"RCTRunInfo",
"RCT",
"RunInfo", 0, Lifetime::Condition,
ccdbParamSpec(
"RCT/Info/RunInformation", 2)}, inputs);
89 addInput({
"CTPRunOrbit",
"CTP",
"RunOrbit", 0, Lifetime::Condition,
ccdbParamSpec(
"CTP/Calib/FirstRunOrbit")}, inputs);
94 if (std::find(inputs.begin(), inputs.end(), isp) == inputs.end()) {
95 inputs.emplace_back(isp);
104 LOG(fatal) <<
"GRP/Geometry CCDB request was already set";
112 bool needInit = mGRPMagField ==
nullptr;
114 LOG(info) <<
"GRP MagField object updated";
117 if (mRequest->needPropagatorD) {
121 auto field = TGeoGlobalMagField::Instance()->GetField();
122 if (field->InheritsFrom(
"o2::field::MagneticField")) {
126 if (mRequest->needPropagatorD) {
134 LOG(info) <<
"GRP ECS object updated";
139 LOG(info) <<
"GRP LHCIF object updated";
143 mOrbitResetTimeMUS = (*(std::vector<Long64_t>*)obj)[0];
144 LOG(info) <<
"orbit reset time updated to " << mOrbitResetTimeMUS;
148 LOG(info) <<
"material LUT updated";
151 if (mRequest->needPropagatorD) {
157 LOG(info) <<
"aligned geometry updated";
161 LOG(info) <<
"ideal geometry updated";
165 if (mRequest->askAlignments && matcher.
description == algDesc) {
169 mAlignments[
id] = (std::vector<o2::detectors::AlignParam>*)obj;
182 if (mRequest->askGRPMagField) {
193 if (mRequest->askGRPLHCIF) {
200 if (mRequest->askGRPECS) {
207 if (mRequest->askTime) {
209 pc.
inputs().
get<std::vector<Long64_t>*>(
"orbitReset");
214 if (mRequest->askMatLUT) {
221 if (mRequest->askGeomAlign) {
223 pc.
inputs().
get<TGeoManager*>(
"geomAlg");
227 }
else if (mRequest->askGeomIdeal) {
229 pc.
inputs().
get<TGeoManager*>(
"geomIdeal");
234 if (mRequest->askAlignments) {
240 pc.
inputs().
get<std::vector<o2::detectors::AlignParam>*>(binding);
244 if (mRequest->askAggregateRunInfo) {
247 auto ctfFirstRunOrbitVec = pc.
inputs().
get<std::vector<Long64_t>*>(
"CTPRunOrbit");
249 LOGP(
debug,
"Extracted AggregateRunInfo: runNumber:{}, sor:{}, eor:{}, orbitsPerTF:{}, orbitReset:{}, orbitSOR:{}, orbitEOR:{}",
250 mAggregatedRunInfo.runNumber, mAggregatedRunInfo.sor, mAggregatedRunInfo.eor, mAggregatedRunInfo.orbitsPerTF, mAggregatedRunInfo.orbitReset, mAggregatedRunInfo.orbitSOR, mAggregatedRunInfo.orbitEOR);
Definition of the base alignment parameters class.
Header of the AggregatedRunInfo struct.
Helper for geometry and GRP related CCDB requests.
container for the LHC InterFace data
Header of the General Run Parameters object for B field values.
Definition of the MagF class.
Declarations for the wrapper for the set of cylindrical material layers.
void checkUpdates(o2::framework::ProcessingContext &pc)
bool finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj)
static int getNHBFPerTF()
static GRPGeomHelper & instance()
void setRequest(std::shared_ptr< GRPGeomRequest > req)
static MatLayerCylSet * rectifyPtrFromFile(MatLayerCylSet *ptr)
static int initFieldFromGRP(const o2::parameters::GRPMagField *grp, bool verbose=false)
GPUd() value_type estimateLTFast(o2 static GPUd() float estimateLTIncrement(const o2 PropagatorImpl * Instance(bool uninitialized=false)
std::pair< int64_t, int64_t > getRunDuration(int runnumber, bool fatal=true)
Static class with identifiers, bitmasks and names for ALICE detectors.
static constexpr const char * getName(ID id)
names of defined detectors
static constexpr ID First
static constexpr ID Last
if extra detectors added, update this !!!
static constexpr o2h::DataOrigin getDataOrigin(ID id)
static mask_t getMask(const std::string_view detList)
detector masks from any non-alpha-num delimiter-separated list (empty if NONE is supplied)
InputRecord & inputs()
The inputs associated with this processing context.
ServiceRegistryRef services()
The services registry associated with this processing context.
uint32_t getNHBFPerTF() const
o2::units::Current_t getDipoleCurrent() const
bool getFieldUniformity() const
o2::units::Current_t getL3Current() const
getters/setters for magnets currents
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > ccdbParamSpec(std::string const &path, int runDependent, std::vector< CCDBMetadata > metadata={}, int qrate=0)
void requireAggregateRunInfo(std::vector< o2::framework::InputSpec > &inputs)
void addInput(const o2::framework::InputSpec &&isp, std::vector< o2::framework::InputSpec > &inputs)
header::DataDescription description
header::DataOrigin origin
static AggregatedRunInfo buildAggregatedRunInfo(o2::ccdb::CCDBManagerInstance &ccdb, int runnumber)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"