3939#include " DetectorsRaw/RDHUtils.h"
4040#include " DPLUtils/DPLRawParser.h"
4141#include " CommonConstants/LHCConstants.h"
42+ #include " DetectorsBase/GRPGeomHelper.h"
4243#include " DetectorsRaw/HBFUtils.h"
4344
4445#include " DataFormatsMCH/Digit.h"
@@ -70,7 +71,9 @@ using RDH = o2::header::RDHAny;
7071class DataDecoderTask
7172{
7273 public:
73- DataDecoderTask (std::string spec) : mInputSpec (spec) {}
74+ DataDecoderTask (std::string spec,
75+ std::shared_ptr<base::GRPGeomRequest> request) : mInputSpec (spec),
76+ mCcdbRequest (request) {}
7477
7578 // _________________________________________________________________________________________________
7679 void init (framework::InitContext& ic)
@@ -98,13 +101,26 @@ class DataDecoderTask
98101 mDecoder = new DataDecoder (channelHandler, rdhHandler, mapCRUfile, mapFECfile, ds2manu, mDebug ,
99102 useDummyElecMap, timeRecoMode);
100103
104+ if (mCcdbRequest ) {
105+ base::GRPGeomHelper::instance ().setRequest (mCcdbRequest );
106+ }
107+
101108 auto stop = [this ]() {
102109 LOG (info) << " mch-data-decoder: decoding duration = " << mTimeDecoding .count () * 1000 / mTFcount << " us / TF" ;
103110 LOG (info) << " mch-data-decoder: ROF finder duration = " << mTimeROFFinder .count () * 1000 / mTFcount << " us / TF" ;
104111 };
105112 ic.services ().get <CallbackService>().set <CallbackService::Id::Stop>(stop);
106113 }
107114
115+ void finaliseCCDB (ConcreteDataMatcher& matcher, void * obj)
116+ {
117+ if (mCcdbRequest ) {
118+ base::GRPGeomHelper::instance ().finaliseCCDB (matcher, obj);
119+ uint32_t n = base::GRPGeomHelper::instance ().getNHBFPerTF ();
120+ LOGP (info, " Setting number of orbits per TF to {}" , n);
121+ mDecoder ->setOrbitsInTF (n);
122+ }
123+ }
108124 // _________________________________________________________________________________________________
109125 // the decodeTF() function processes the messages generated by the (sub)TimeFrame builder
110126 void decodeTF (framework::ProcessingContext& pc)
@@ -213,6 +229,10 @@ class DataDecoderTask
213229 return ;
214230 }
215231
232+ if (mCcdbRequest ) {
233+ base::GRPGeomHelper::instance ().checkUpdates (pc);
234+ }
235+
216236 static int32_t deltaMax = 0 ;
217237
218238 auto createBuffer = [&](auto & vec, size_t & size) {
@@ -323,6 +343,7 @@ class DataDecoderTask
323343
324344 std::chrono::duration<double , std::milli> mTimeDecoding {}; // /< timer
325345 std::chrono::duration<double , std::milli> mTimeROFFinder {}; // /< timer
346+ std::shared_ptr<base::GRPGeomRequest> mCcdbRequest ;
326347};
327348
328349// _________________________________________________________________________________________________
@@ -340,7 +361,14 @@ o2::framework::DataProcessorSpec getDecodingSpec(const char* specName, std::stri
340361 // to be present, even if none of our raw data is present.
341362 inputs.emplace_back (" stfDist" , " FLP" , " DISTSUBTIMEFRAME" , 0 , o2::framework::Lifetime::Timeframe);
342363 }
343- o2::mch::raw::DataDecoderTask task (inputSpec);
364+ auto ccdbRequest = std::make_shared<o2::base::GRPGeomRequest>(false , // orbitResetTime
365+ true , // GRPECS=true
366+ false , // GRPLHCIF
367+ false , // GRPMagField
368+ false , // askMatLUT
369+ o2::base::GRPGeomRequest::None, // geometry
370+ inputs);
371+ o2::mch::raw::DataDecoderTask task (inputSpec, ccdbRequest);
344372 return DataProcessorSpec{
345373 specName,
346374 inputs,
0 commit comments