@@ -63,7 +63,7 @@ GRPGeomRequest::GRPGeomRequest(bool orbitResetTime, bool GRPECS, bool GRPLHCIF,
6363 addInput ({" orbitReset" , " CTP" , " ORBITRESET" , 0 , Lifetime::Condition, ccdbParamSpec (" CTP/Calib/OrbitReset" )}, inputs);
6464 }
6565 if (askGRPECS) {
66- addInput ({" grpecs" , " GLO" , " GRPECS" , 0 , Lifetime::Condition, ccdbParamSpec (" GLO/Config/GRPECS" , true )}, inputs); // Run dependent !!!
66+ addInput ({" grpecs" , " GLO" , " GRPECS" , 0 , Lifetime::Condition, ccdbParamSpec (" GLO/Config/GRPECS" , 1 )}, inputs); // Run dependent !!!
6767 }
6868 if (askGRPLHCIF) {
6969 addInput ({" grplhcif" , " GLO" , " GRPLHCIF" , 0 , Lifetime::Condition, ccdbParamSpec (" GLO/Config/GRPLHCIF" )}, inputs);
@@ -73,6 +73,22 @@ GRPGeomRequest::GRPGeomRequest(bool orbitResetTime, bool GRPECS, bool GRPLHCIF,
7373 }
7474}
7575
76+ void GRPGeomRequest::requireAggregateRunInfo (std::vector<o2::framework::InputSpec>& inputs)
77+ {
78+ askAggregateRunInfo = true ;
79+ // require dependencies
80+ if (!askGRPECS) {
81+ askGRPECS = true ;
82+ addInput ({" grpecs" , " GLO" , " GRPECS" , 0 , Lifetime::Condition, ccdbParamSpec (" GLO/Config/GRPECS" , 1 )}, inputs);
83+ }
84+ if (!askTime) {
85+ askTime = true ;
86+ addInput ({" orbitReset" , " CTP" , " ORBITRESET" , 0 , Lifetime::Condition, ccdbParamSpec (" CTP/Calib/OrbitReset" )}, inputs);
87+ }
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); // TODO: should become run-depenendent (1) object
90+ }
91+
7692void GRPGeomRequest::addInput (const o2::framework::InputSpec&& isp, std::vector<o2::framework::InputSpec>& inputs)
7793{
7894 if (std::find (inputs.begin (), inputs.end (), isp) == inputs.end ()) {
@@ -124,8 +140,8 @@ bool GRPGeomHelper::finaliseCCDB(ConcreteDataMatcher& matcher, void* obj)
124140 return true ;
125141 }
126142 if (mRequest ->askTime && matcher == ConcreteDataMatcher (" CTP" , " ORBITRESET" , 0 )) {
127- mOrbitResetTimeMS = (*(std::vector<Long64_t>*)obj)[0 ] / 1000 ;
128- LOG (info) << " orbit reset time updated to " << mOrbitResetTimeMS ;
143+ mOrbitResetTimeMUS = (*(std::vector<Long64_t>*)obj)[0 ];
144+ LOG (info) << " orbit reset time updated to " << mOrbitResetTimeMUS ;
129145 return true ;
130146 }
131147 if (mRequest ->askMatLUT && matcher == ConcreteDataMatcher (" GLO" , " MATLUT" , 0 )) {
@@ -159,7 +175,7 @@ bool GRPGeomHelper::finaliseCCDB(ConcreteDataMatcher& matcher, void* obj)
159175 return false ;
160176}
161177
162- void GRPGeomHelper::checkUpdates (ProcessingContext& pc) const
178+ void GRPGeomHelper::checkUpdates (ProcessingContext& pc)
163179{
164180 // request input just to trigger finaliseCCDB if there was an update
165181
@@ -225,6 +241,14 @@ void GRPGeomHelper::checkUpdates(ProcessingContext& pc) const
225241 }
226242 }
227243 }
244+ if (mRequest ->askAggregateRunInfo ) {
245+ const auto hmap = pc.inputs ().get <o2::framework::CCDBMetadataExtractor>(" RCTRunInfo" ); // metadata only!
246+ auto rl = o2::ccdb::BasicCCDBManager::getRunDuration (hmap);
247+ auto ctfFirstRunOrbitVec = pc.inputs ().get <std::vector<Long64_t>*>(" CTPRunOrbit" );
248+ mAggregatedRunInfo = o2::parameters::AggregatedRunInfo::buildAggregatedRunInfo (pc.services ().get <o2::framework::TimingInfo>().runNumber , rl.first , rl.second , mOrbitResetTimeMUS , mGRPECS , ctfFirstRunOrbitVec.get ());
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 );
251+ }
228252 }
229253}
230254
0 commit comments