1111
1212#include " FV0DigitizerSpec.h"
1313#include " DataFormatsFV0/ChannelData.h"
14+ #include " DataFormatsFIT/DeadChannelMap.h"
1415#include " DataFormatsFV0/Digit.h"
1516#include " Framework/ControlService.h"
1617#include " Framework/ConfigParamRegistry.h"
@@ -53,6 +54,16 @@ class FV0DPLDigitizerTask : public o2::base::BaseDPLDigitizer
5354 LOG (debug) << " FV0DPLDigitizerTask:init" ;
5455 mDigitizer .init ();
5556 mDisableQED = ic.options ().get <bool >(" disable-qed" ); // TODO: QED implementation to be tested
57+ mUseDeadChannelMap = ic.options ().get <bool >(" disable-dead-channel-map" );
58+ mUpdateDeadChannelMap = mUseDeadChannelMap ;
59+ }
60+
61+ void finaliseCCDB (ConcreteDataMatcher& matcher, void * obj)
62+ {
63+ // Initialize the dead channel map only once
64+ if (matcher == ConcreteDataMatcher (" FV0" , " DeadChannelMap" , 0 )) {
65+ mUpdateDeadChannelMap = false ;
66+ }
5667 }
5768
5869 void run (framework::ProcessingContext& pc)
@@ -67,6 +78,11 @@ class FV0DPLDigitizerTask : public o2::base::BaseDPLDigitizer
6778 context->initSimChains (o2::detectors::DetID::FV0, mSimChains );
6879 const bool withQED = context->isQEDProvided () && !mDisableQED ; // TODO: QED implementation to be tested
6980
81+ if (mUseDeadChannelMap && mUpdateDeadChannelMap ) {
82+ auto deadChannelMap = pc.inputs ().get <o2::fit::DeadChannelMap>(" fv0deadchannelmap" );
83+ mDigitizer .setDeadChannelMap (deadChannelMap);
84+ }
85+
7086 mDigitizer .setTimeStamp (context->getGRP ().getTimeStart ());
7187
7288 auto & irecords = context->getEventRecords (withQED); // TODO: QED implementation to be tested
@@ -131,6 +147,8 @@ class FV0DPLDigitizerTask : public o2::base::BaseDPLDigitizer
131147
132148 private:
133149 bool mFinished = false ;
150+ bool mUseDeadChannelMap = true ;
151+ bool mUpdateDeadChannelMap = true ;
134152 Digitizer mDigitizer ;
135153 std::vector<TChain*> mSimChains ;
136154 std::vector<o2::fv0::ChannelData> mDigitsCh ;
@@ -159,6 +177,9 @@ o2::framework::DataProcessorSpec getFV0DigitizerSpec(int channel, bool mctruth)
159177 }
160178 outputs.emplace_back (" FV0" , " ROMode" , 0 , Lifetime::Timeframe);
161179
180+ std::vector<InputSpec> inputs;
181+ inputs.emplace_back (" fv0deadchannelmap" , " FV0" , " DeadChannelMap" , 0 , Lifetime::Condition, ccdbParamSpec (" FV0/Calib/DeadChannelMap" ));
182+
162183 return DataProcessorSpec{
163184 " FV0Digitizer" ,
164185 Inputs{InputSpec{" collisioncontext" , " SIM" , " COLLISIONCONTEXT" , static_cast <SubSpecificationType>(channel), Lifetime::Timeframe}},
@@ -167,7 +188,8 @@ o2::framework::DataProcessorSpec getFV0DigitizerSpec(int channel, bool mctruth)
167188
168189 AlgorithmSpec{adaptFromTask<FV0DPLDigitizerTask>()},
169190 Options{{" pileup" , VariantType::Int, 1 , {" whether to run in continuous time mode" }},
170- {" disable-qed" , o2::framework::VariantType::Bool, false , {" disable QED handling" }}}};
191+ {" disable-qed" , o2::framework::VariantType::Bool, false , {" disable QED handling" }}},
192+ {" disable-dead-channel-map" , o2::framework::VariantType::Bool, true , {" Don't mask dead channels" }}};
171193 // Options{{"pileup", VariantType::Int, 1, {"whether to run in continuous time mode"}}}};
172194}
173195
0 commit comments