21#include <TStopwatch.h>
53 LOG(
debug) <<
"FV0DPLDigitizerTask:init";
55 mDisableQED = ic.
options().
get<
bool>(
"disable-qed");
63 LOG(
debug) <<
"FV0DPLDigitizerTask:run";
68 const bool withQED = context->isQEDProvided() && !mDisableQED;
70 mDigitizer.
setTimeStamp(context->getGRP().getTimeStart());
72 auto& irecords = context->getEventRecords(withQED);
73 auto& eventParts = context->getEventParts(withQED);
80 std::vector<o2::fv0::Hit> hits;
81 for (
int collID = 0; collID < irecords.size(); ++collID) {
86 if (irecords[collID] < firstTF) {
87 LOG(info) <<
"Too early: Not digitizing collision " << collID;
92 const auto& irec = irecords[collID];
96 for (
auto& part : eventParts[collID]) {
98 context->retrieveHits(mSimChains,
"FV0Hit", part.sourceID, part.entryID, &hits);
99 LOG(
debug) <<
"[FV0] For collision " << collID <<
" eventID " << part.entryID <<
" found " << hits.size() <<
" hits ";
104 mDigitizer.
process(hits, mDigitsBC, mDigitsCh, mDigitsTrig, mLabels);
106 LOG(
debug) <<
"[FV0] Has " << mDigitsBC.size() <<
" BC elements, " << mDigitsCh.size() <<
" mDigitsCh elements";
110 terminateIR.
orbit = 0xffffffff;
112 mDigitizer.
flush(mDigitsBC, mDigitsCh, mDigitsTrig, mLabels);
115 LOG(info) <<
"FV0: Sending " << mDigitsBC.size() <<
" digitsBC and " << mDigitsCh.size() <<
" digitsCh.";
124 LOG(info) <<
"FV0: Sending ROMode= " << mROMode <<
" to GRPUpdater";
133 bool mFinished =
false;
135 std::vector<TChain*> mSimChains;
136 std::vector<o2::fv0::ChannelData> mDigitsCh;
137 std::vector<o2::fv0::Digit> mDigitsBC;
138 std::vector<o2::fv0::DetTrigInput> mDigitsTrig;
143 bool mDisableQED =
false;
153 std::vector<OutputSpec> outputs;
154 outputs.emplace_back(
"FV0",
"DIGITSBC", 0, Lifetime::Timeframe);
155 outputs.emplace_back(
"FV0",
"DIGITSCH", 0, Lifetime::Timeframe);
156 outputs.emplace_back(
"FV0",
"TRIGGERINPUT", 0, Lifetime::Timeframe);
158 outputs.emplace_back(
"FV0",
"DIGITLBL", 0, Lifetime::Timeframe);
160 outputs.emplace_back(
"FV0",
"ROMode", 0, Lifetime::Timeframe);
169 Options{{
"pileup", VariantType::Int, 1, {
"whether to run in continuous time mode"}},
Definition of the base digitizer task class.
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 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)
~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 > Options
header::DataHeader::SubSpecificationType SubSpecificationType
std::vector< InputSpec > Inputs
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"