38#include <TStopwatch.h>
88 const bool withQED = context->isQEDProvided() && !
mDisableQED;
89 auto& timesview = context->getEventRecords(withQED);
103 if (timesview.size() == 0) {
110 LOG(info) <<
"CALLING FT0 DIGITIZATION";
112 static std::vector<o2::ft0::HitType> hits;
120 auto& eventParts = context->getEventParts(withQED);
123 for (
int collID = 0; collID < timesview.size(); ++collID) {
128 if (timesview[collID] < firstTF) {
129 LOG(info) <<
"Too early: Not digitizing collision " << collID;
137 for (
auto& part : eventParts[collID]) {
140 context->retrieveHits(
mSimChains,
"FT0Hit", part.sourceID, part.entryID, &hits);
141 LOG(
debug) <<
"For collision " << collID <<
" eventID " << part.entryID <<
" source ID " << part.sourceID <<
" found " << hits.size() <<
" hits ";
142 if (hits.size() > 0) {
159 LOG(info) <<
"FT0: Sending ROMode= " <<
mROMode <<
" to GRPUpdater";
163 LOG(info) <<
"Digitization took " << timer.CpuTime() <<
"s";
199 std::vector<OutputSpec> outputs;
200 outputs.emplace_back(
"FT0",
"DIGITSBC", 0, Lifetime::Timeframe);
201 outputs.emplace_back(
"FT0",
"DIGITSCH", 0, Lifetime::Timeframe);
202 outputs.emplace_back(
"FT0",
"TRIGGERINPUT", 0, Lifetime::Timeframe);
204 outputs.emplace_back(
"FT0",
"DIGITSMCTR", 0, Lifetime::Timeframe);
206 outputs.emplace_back(
"FT0",
"ROMode", 0, Lifetime::Timeframe);
207 std::vector<InputSpec> inputs;
208 inputs.emplace_back(
"collisioncontext",
"SIM",
"COLLISIONCONTEXT",
static_cast<SubSpecificationType>(channel), Lifetime::Timeframe);
210 inputs.emplace_back(
"ft0offsets",
"FT0",
"TimeOffset", 0,
214 inputs.emplace_back(
"ft0deadchannelmap",
"FT0",
"DeadChannelMap", 0,
223 Options{{
"pileup", VariantType::Int, 1, {
"whether to run in continuous time mode"}},
224 {
"disable-qed", VariantType::Bool,
false, {
"disable QED handling"}},
225 {
"disable-dead-channel-map", VariantType::Bool,
false, {
"Don't mask dead channels"}}}};
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 the FIT hits class.
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.
uint32_t getOrbit() const
void setDeadChannelMap(o2::fit::DeadChannelMap const *deadChannelMap)
bool isContinuous() const
void setInteractionRecord(const o2::InteractionTimeRecord &src)
void process(const std::vector< o2::ft0::HitType > *hits, std::vector< o2::ft0::Digit > &digitsBC, std::vector< o2::ft0::ChannelData > &digitsCh, std::vector< o2::ft0::DetTrigInput > &digitsTrig, o2::dataformats::MCTruthContainer< o2::ft0::MCLabel > &label)
void flush_all(std::vector< o2::ft0::Digit > &digitsBC, std::vector< o2::ft0::ChannelData > &digitsCh, std::vector< o2::ft0::DetTrigInput > &digitsTrig, o2::dataformats::MCTruthContainer< o2::ft0::MCLabel > &label)
void SetChannelOffset(o2::ft0::FT0ChannelTimeCalibrationObject const *caliboffsets)
void setEventID(Int_t id)
o2::ft0::Digitizer mDigitizer
Digitizer.
o2::parameters::GRPObject::ROMode mROMode
void finaliseCCDB(ConcreteDataMatcher &matcher, void *obj)
bool mUpdateDeadChannelMap
FT0DPLDigitizerTask(bool useCCDB)
~FT0DPLDigitizerTask() override=default
void initDigitizerTask(framework::InitContext &ic) override
double mFairTimeUnitInNS
Fair time unit in ns.
std::vector< o2::ft0::ChannelData > mDigitsCh
Bool_t mContinuous
flag to do continuous simulation
std::vector< o2::ft0::Digit > mDigitsBC
std::vector< TChain * > mSimChains
std::vector< o2::ft0::DetTrigInput > mDigitsTrig
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 getFT0DigitizerSpec(int channel, bool mctruth, bool useCCDB)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"