26#include "TStopwatch.h"
58 LOG(info) <<
"Initializing ZDC digitization";
60 auto enableHitInfo = ic.
options().
get<
bool>(
"enable-hit-info");
83 LOG(info) <<
"Doing ZDC digitization";
98 const auto& grp = context->getGRP();
103 auto& irecords = context->getEventRecords();
104 auto& eventParts = context->getEventParts();
105 if (irecords.empty()) {
110 std::vector<o2::zdc::Hit> hits;
115 for (
int collID = 0; collID < irecords.size(); ++collID) {
120 if (irecords[collID] < firstTF) {
121 LOG(info) <<
"Too early: Not digitizing collision " << collID;
125 const auto& irec = irecords[collID];
128 for (
auto& part : eventParts[collID]) {
130 context->retrieveHits(mSimChains,
"ZDCHit", part.sourceID, part.entryID, &hits);
131 LOG(info) <<
"For collision " << collID <<
" eventID " << part.entryID <<
" found ZDC " << hits.size() <<
" hits ";
136 mDigitizer.
process(hits, mDigitsBC, mDigitsCh, mLabels);
141 terminateIR.
orbit = 0xffffffff;
143 mDigitizer.
flush(mDigitsBC, mDigitsCh, mLabels);
145 for (uint32_t ib = 0; ib < mDigitsBC.size(); ib++) {
149 const auto &
irFirst = irecords.front(),
irLast = irecords.back();
159 mDigitizer.
Finalize(mDigitsBC, mOrbitData);
169 LOG(info) <<
"ZDC: Sending ROMode= " << mROMode <<
" to GRPUpdater";
178 std::vector<TChain*> mSimChains;
179 std::vector<o2::zdc::ChannelData> mDigitsCh;
180 std::vector<o2::zdc::BCData> mDigitsBC;
181 std::vector<o2::zdc::OrbitData> mOrbitData;
196 std::vector<InputSpec> inputs;
197 inputs.emplace_back(
"collisioncontext",
"SIM",
"COLLISIONCONTEXT",
static_cast<SubSpecificationType>(channel), Lifetime::Timeframe);
201 std::vector<OutputSpec> outputs;
202 outputs.emplace_back(
"ZDC",
"DIGITSBC", 0, Lifetime::Timeframe);
203 outputs.emplace_back(
"ZDC",
"DIGITSCH", 0, Lifetime::Timeframe);
204 outputs.emplace_back(
"ZDC",
"DIGITSPD", 0, Lifetime::Timeframe);
206 outputs.emplace_back(
"ZDC",
"DIGITSLBL", 0, Lifetime::Timeframe);
208 outputs.emplace_back(
"ZDC",
"ROMode", 0, Lifetime::Timeframe);
Class to describe fired triggered and/or stored channels for the BC and to refer to channel data.
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.
Class to describe pedestal data accumulated over the orbit.
BaseDPLDigitizer()=default
static const DigiParams & 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.
bool initSimChains(o2::detectors::DetID detid, std::vector< TChain * > &simchains) const
void updatePedestalReference(OrbitData &pdata)
void flush(std::vector< o2::zdc::BCData > &digitsBC, std::vector< o2::zdc::ChannelData > &digitsCh, o2::dataformats::MCTruthContainer< o2::zdc::MCLabel > &labels)
void setEventID(int eventID)
void setInteractionRecord(const o2::InteractionTimeRecord &ir)
void setSkipMCLabels(bool v=true)
void process(const std::vector< o2::zdc::Hit > &hits, std::vector< o2::zdc::BCData > &digitsBC, std::vector< o2::zdc::ChannelData > &digitsCh, o2::dataformats::MCTruthContainer< o2::zdc::MCLabel > &labels)
void setTimeStamp(long t)
void Finalize(std::vector< BCData > &bcData, std::vector< o2::zdc::OrbitData > &pData)
void assignTriggerBits(uint32_t ibc, std::vector< BCData > &bcData)
void setMaskTriggerBits(bool v=true)
void setModuleConfig(const ModuleConfig *cfg)
void setSimCondition(const SimCondition *cfg)
int getNEmptyBunches() const
void findEmptyBunches(const std::bitset< o2::constants::lhc::LHCMaxBunches > &bunchPattern)
bool isContinuous() const
void finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj)
void run(framework::ProcessingContext &pc)
void initDigitizerTask(framework::InitContext &ic) override
ZDCDPLDigitizerTask(bool useMC)
constexpr int LHCMaxBunches
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 getZDCDigitizerSpec(int channel, bool mctruth)
const std::string CCDBPathConfigSim
const std::string CCDBPathConfigModule
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
o2::InteractionRecord irPed(o2::constants::lhc::LHCMaxBunches - 1, irFirst.orbit)