1717
1818#include " CommonConstants/Triggers.h"
1919#include " CommonDataFormat/InteractionRecord.h"
20+ #include " Framework/CCDBParamSpec.h"
2021#include " Framework/ConfigParamRegistry.h"
2122#include " Framework/ControlService.h"
2223#include " Framework/InputRecordWalker.h"
@@ -92,8 +93,6 @@ void RawToCellConverterSpec::init(framework::InitContext& ctx)
9293 mDisablePedestalEvaluation = ctx.options ().get <bool >(" no-evalpedestal" );
9394
9495 LOG (info) << " Running gain merging mode: " << (mMergeLGHG ? " yes" : " no" );
95- LOG (info) << " Using time shift: " << RecoParam::Instance ().getCellTimeShiftNanoSec () << " ns" ;
96- LOG (info) << " Using BCshfit phase:" << RecoParam::Instance ().getPhaseBCmod4 () << " BCs" ;
9796 LOG (info) << " Using L0LM delay: " << o2::ctp::TriggerOffsetsParam::Instance ().LM_L0 << " BCs" ;
9897
9998 mRawFitter ->setAmpCut (mNoiseThreshold );
@@ -103,6 +102,9 @@ void RawToCellConverterSpec::init(framework::InitContext& ctx)
103102void RawToCellConverterSpec::run (framework::ProcessingContext& ctx)
104103{
105104 LOG (debug) << " [EMCALRawToCellConverter - run] called" ;
105+ // for reading the reco param object from the ccdb
106+ ctx.inputs ().get <o2::emcal::RecoParam*>(" EMC_RecoParam" );
107+
106108 double timeshift = RecoParam::Instance ().getCellTimeShiftNanoSec (); // subtract offset in ns in order to center the time peak around the nominal delay
107109 constexpr auto originEMC = o2::header::gDataOriginEMC ;
108110 constexpr auto descRaw = o2::header::gDataDescriptionRawData ;
@@ -591,6 +593,16 @@ void RawToCellConverterSpec::run(framework::ProcessingContext& ctx)
591593 sendData (ctx, mOutputCells , mOutputTriggerRecords , mOutputDecoderErrors );
592594}
593595
596+ void RawToCellConverterSpec::finaliseCCDB (o2::framework::ConcreteDataMatcher& matcher, void * obj)
597+ {
598+ // check if calib params need to be updated
599+ if (matcher == framework::ConcreteDataMatcher (" EMC" , " EMCALRECOPARAM" , 0 )) {
600+ LOG (info) << " RecoParams updated" ;
601+ o2::emcal::RecoParam::Instance ().printKeyValues (true , true );
602+ return ;
603+ }
604+ }
605+
594606bool RawToCellConverterSpec::isLostTimeframe (framework::ProcessingContext& ctx) const
595607{
596608 constexpr auto originEMC = header::gDataOriginEMC ;
@@ -642,6 +654,8 @@ o2::framework::DataProcessorSpec o2::emcal::reco_workflow::getRawToCellConverter
642654 if (askDISTSTF) {
643655 inputs.emplace_back (" stdDist" , " FLP" , " DISTSUBTIMEFRAME" , 0 , o2::framework::Lifetime::Timeframe);
644656 }
657+ // CCDB objects
658+ inputs.emplace_back (" EMC_RecoParam" , o2::header::gDataOriginEMC , " EMCALRECOPARAM" , 0 , o2::framework::Lifetime::Condition, o2::framework::ccdbParamSpec (" EMC/Config/RecoParam" ));
645659
646660 return o2::framework::DataProcessorSpec{" EMCALRawToCellConverterSpec" ,
647661 inputs,
0 commit comments