22#include <TStopwatch.h>
55 LOG(
debug) <<
"FV0DPLDigitizerTask:init";
57 mDisableQED = ic.
options().
get<
bool>(
"disable-qed");
58 mUseDeadChannelMap = !ic.
options().
get<
bool>(
"disable-dead-channel-map");
59 mUpdateDeadChannelMap = mUseDeadChannelMap;
66 mUpdateDeadChannelMap =
false;
75 LOG(
debug) <<
"FV0DPLDigitizerTask:run";
80 const bool withQED = context->isQEDProvided() && !mDisableQED;
82 if (mUseDeadChannelMap && mUpdateDeadChannelMap) {
87 mDigitizer.
setTimeStamp(context->getGRP().getTimeStart());
89 auto& irecords = context->getEventRecords(withQED);
90 auto& eventParts = context->getEventParts(withQED);
97 std::vector<o2::fv0::Hit> hits;
98 for (
int collID = 0; collID < irecords.size(); ++collID) {
103 if (irecords[collID] < firstTF) {
104 LOG(info) <<
"Too early: Not digitizing collision " << collID;
109 const auto& irec = irecords[collID];
113 for (
auto& part : eventParts[collID]) {
115 context->retrieveHits(mSimChains,
"FV0Hit", part.sourceID, part.entryID, &hits);
116 LOG(
debug) <<
"[FV0] For collision " << collID <<
" eventID " << part.entryID <<
" found " << hits.size() <<
" hits ";
121 mDigitizer.
process(hits, mDigitsBC, mDigitsCh, mDigitsTrig, mLabels);
123 LOG(
debug) <<
"[FV0] Has " << mDigitsBC.size() <<
" BC elements, " << mDigitsCh.size() <<
" mDigitsCh elements";
127 terminateIR.
orbit = 0xffffffff;
129 mDigitizer.
flush(mDigitsBC, mDigitsCh, mDigitsTrig, mLabels);
132 LOG(info) <<
"FV0: Sending " << mDigitsBC.size() <<
" digitsBC and " << mDigitsCh.size() <<
" digitsCh.";
141 LOG(info) <<
"FV0: Sending ROMode= " << mROMode <<
" to GRPUpdater";
150 bool mFinished =
false;
151 bool mUseDeadChannelMap =
true;
152 bool mUpdateDeadChannelMap =
true;
154 std::vector<TChain*> mSimChains;
155 std::vector<o2::fv0::ChannelData> mDigitsCh;
156 std::vector<o2::fv0::Digit> mDigitsBC;
157 std::vector<o2::fv0::DetTrigInput> mDigitsTrig;
162 bool mDisableQED =
false;
172 std::vector<OutputSpec> outputs;
173 outputs.emplace_back(
"FV0",
"DIGITSBC", 0, Lifetime::Timeframe);
174 outputs.emplace_back(
"FV0",
"DIGITSCH", 0, Lifetime::Timeframe);
175 outputs.emplace_back(
"FV0",
"TRIGGERINPUT", 0, Lifetime::Timeframe);
177 outputs.emplace_back(
"FV0",
"DIGITLBL", 0, Lifetime::Timeframe);
179 outputs.emplace_back(
"FV0",
"ROMode", 0, Lifetime::Timeframe);
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);
190 Options{{
"pileup", VariantType::Int, 1, {
"whether to run in continuous time mode"}},
Definition of the base digitizer task class.
Dead channel map for FIT.
o2::framework::DataAllocator::SubSpecificationType SubSpecificationType
Header of the General Run Parameters object.
Definition of a container to keep Monte Carlo truth external to simulation objects.
BaseDPLDigitizer()=default
static const HBFUtils & Instance()
T get(const char *key) const
void snapshot(const Output &spec, T const &object)
o2::header::DataHeader::SubSpecificationType SubSpecificationType
bool isAllowed(Output const &query)
check if a certain output is allowed
ConfigParamRegistry const & options()
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
InputRecord & inputs()
The inputs associated with this processing context.
ServiceRegistryRef services()
The services registry associated with this processing context.
void flush(std::vector< o2::fv0::Digit > &digitsBC, std::vector< o2::fv0::ChannelData > &digitsCh, std::vector< o2::fv0::DetTrigInput > &digitsTrig, o2::dataformats::MCTruthContainer< o2::fv0::MCLabel > &labels)
void setTimeStamp(long t)
void setInteractionRecord(const InteractionTimeRecord &ir)
void setEventId(Int_t id)
void setDeadChannelMap(o2::fit::DeadChannelMap const *deadChannelMap)
void process(const std::vector< o2::fv0::Hit > &hits, std::vector< o2::fv0::Digit > &digitsBC, std::vector< o2::fv0::ChannelData > &digitsCh, std::vector< o2::fv0::DetTrigInput > &digitsTrig, o2::dataformats::MCTruthContainer< o2::fv0::MCLabel > &labels)
void finaliseCCDB(ConcreteDataMatcher &matcher, void *obj)
~FV0DPLDigitizerTask() override=default
void initDigitizerTask(framework::InitContext &ic) override
void run(framework::ProcessingContext &pc)
bool initSimChains(o2::detectors::DetID detid, std::vector< TChain * > &simchains) const
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > ccdbParamSpec(std::string const &path, int runDependent, std::vector< CCDBMetadata > metadata={}, int qrate=0)
std::vector< ConfigParamSpec > Options
header::DataHeader::SubSpecificationType SubSpecificationType
o2::framework::DataProcessorSpec getFV0DigitizerSpec(int channel, bool mctruth)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"