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"
3031#include " SimulationDataFormat/MCCompLabel.h"
3132#include " DetectorsBase/BaseDPLDigitizer.h"
3233#include " DetectorsRaw/HBFUtils.h"
34+ #include " Framework/CCDBParamSpec.h"
3335#include < TFile.h>
3436
3537using namespace o2 ::framework;
@@ -53,6 +55,16 @@ class FV0DPLDigitizerTask : public o2::base::BaseDPLDigitizer
5355 LOG (debug) << " FV0DPLDigitizerTask:init" ;
5456 mDigitizer .init ();
5557 mDisableQED = ic.options ().get <bool >(" disable-qed" ); // TODO: QED implementation to be tested
58+ mUseDeadChannelMap = !ic.options ().get <bool >(" disable-dead-channel-map" );
59+ mUpdateDeadChannelMap = mUseDeadChannelMap ;
60+ }
61+
62+ void finaliseCCDB (ConcreteDataMatcher& matcher, void * obj)
63+ {
64+ // Initialize the dead channel map only once
65+ if (matcher == ConcreteDataMatcher (" FV0" , " DeadChannelMap" , 0 )) {
66+ mUpdateDeadChannelMap = false ;
67+ }
5668 }
5769
5870 void run (framework::ProcessingContext& pc)
@@ -67,6 +79,11 @@ class FV0DPLDigitizerTask : public o2::base::BaseDPLDigitizer
6779 context->initSimChains (o2::detectors::DetID::FV0, mSimChains );
6880 const bool withQED = context->isQEDProvided () && !mDisableQED ; // TODO: QED implementation to be tested
6981
82+ if (mUseDeadChannelMap && mUpdateDeadChannelMap ) {
83+ auto deadChannelMap = pc.inputs ().get <o2::fit::DeadChannelMap*>(" fv0deadchannelmap" );
84+ mDigitizer .setDeadChannelMap (deadChannelMap.get ());
85+ }
86+
7087 mDigitizer .setTimeStamp (context->getGRP ().getTimeStart ());
7188
7289 auto & irecords = context->getEventRecords (withQED); // TODO: QED implementation to be tested
@@ -131,6 +148,8 @@ class FV0DPLDigitizerTask : public o2::base::BaseDPLDigitizer
131148
132149 private:
133150 bool mFinished = false ;
151+ bool mUseDeadChannelMap = true ;
152+ bool mUpdateDeadChannelMap = true ;
134153 Digitizer mDigitizer ;
135154 std::vector<TChain*> mSimChains ;
136155 std::vector<o2::fv0::ChannelData> mDigitsCh ;
@@ -159,16 +178,19 @@ o2::framework::DataProcessorSpec getFV0DigitizerSpec(int channel, bool mctruth)
159178 }
160179 outputs.emplace_back (" FV0" , " ROMode" , 0 , Lifetime::Timeframe);
161180
181+ std::vector<InputSpec> inputs;
182+ inputs.emplace_back (" fv0deadchannelmap" , " FV0" , " DeadChannelMap" , 0 , Lifetime::Condition, ccdbParamSpec (" FV0/Calib/DeadChannelMap" ));
183+ inputs.emplace_back (" collisioncontext" , " SIM" , " COLLISIONCONTEXT" , static_cast <SubSpecificationType>(channel), Lifetime::Timeframe);
162184 return DataProcessorSpec{
163185 " FV0Digitizer" ,
164- Inputs{InputSpec{" collisioncontext" , " SIM" , " COLLISIONCONTEXT" , static_cast <SubSpecificationType>(channel), Lifetime::Timeframe}},
165-
186+ inputs,
166187 outputs,
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" }}}};
171- // Options{{"pileup", VariantType::Int, 1, {"whether to run in continuous time mode"}}}};
191+ {" disable-qed" , o2::framework::VariantType::Bool, false , {" disable QED handling" }},
192+ {" disable-dead-channel-map" , o2::framework::VariantType::Bool, false , {" Don't mask dead channels" }}}};
193+ // Options{{"pileup", VariantType::Int, 1, {"whether to run in continuous time mode"}}}};
172194}
173195
174196} // end namespace fv0
0 commit comments