35#include <TStopwatch.h>
49 using BaseDPLDigitizer::init;
52 mWithMCTruth(mctruth) {}
56 mDisableQED = ic.
options().
get<
bool>(
"disable-qed");
77 const bool withQED = context->isQEDProvided() && !mDisableQED;
78 auto& timesview = context->getEventRecords();
79 LOG(info) <<
"GOT " << timesview.size() <<
" COLLISION TIMES";
80 LOG(info) <<
"SIMCHAINS " << mSimChains.size();
83 if (timesview.empty()) {
89 LOG(info) <<
" CALLING TF3 DIGITIZATION ";
97 auto& eventParts = context->getEventParts(withQED);
101 for (
int collID = 0; collID < timesview.size(); ++collID) {
108 for (
const auto& part : eventParts[collID]) {
114 if (mHits.size() > 0) {
120 LOG(
debug) <<
"For collision " << collID <<
" eventID " << part.entryID <<
" found " << mHits.size() <<
" hits ";
121 mDigitizer.
process(&mHits, part.entryID, part.sourceID);
126 LOG(
debug) <<
"Number of digits before final flush: " << mDigits.size();
131 LOG(
debug) <<
"Final flushing for continuous mode";
133 LOG(
debug) <<
"Number of digits after final flush: " << mDigits.size();
137 LOG(
debug) <<
"Digitization finished with " << mDigits.size() <<
" digits and " << mROFRecords.size() <<
" ROF records";
149 static std::vector<o2::itsmft::MC2ROFRecord> dummyMC2ROF;
154 LOG(info) <<
"Digitization took " << timer.CpuTime() <<
"s";
163 bool mDisableQED =
false;
164 bool mWithMCTruth{
true};
165 bool mFinished{
false};
166 unsigned long mFirstOrbitTF = 0x0;
170 std::vector<o2::iotof::Digit> mDigits{};
171 std::vector<o2::itsmft::ROFRecord> mROFRecords{};
172 std::vector<o2::itsmft::Hit> mHits{};
173 std::vector<o2::itsmft::Hit>* mHitsP{&mHits};
176 std::vector<TChain*> mSimChains{};
182 std::vector<o2::framework::OutputSpec> outputs;
183 outputs.emplace_back(detOrig,
"DIGITS", o2::framework::Lifetime::Timeframe);
184 outputs.emplace_back(detOrig,
"DIGITSROF", o2::framework::Lifetime::Timeframe);
186 outputs.emplace_back(detOrig,
"DIGITSMC2ROF", o2::framework::Lifetime::Timeframe);
187 outputs.emplace_back(detOrig,
"DIGITSMCTR", o2::framework::Lifetime::Timeframe);
189 outputs.emplace_back(detOrig,
"ROMode", 0, o2::framework::Lifetime::Timeframe);
195 std::vector<o2::framework::InputSpec> inputs;
197 inputs.emplace_back(
"IOTOF_aptsresp",
"TF3",
"APTSRESP", 0, o2::framework::Lifetime::Condition,
o2::framework::ccdbParamSpec(
"IT3/Calib/APTSResponse"));
Definition of the base digitizer task class.
A const (ready only) version of MCTruthContainer.
Header of the General Run Parameters object.
Definition of the ALICE3 TOF digitizer.
BaseDPLDigitizer()=default
Static class with identifiers, bitmasks and names for ALICE detectors.
static constexpr const char * getName(ID id)
names of defined detectors
static const std::array< std::vector< std::string >, DetID::nDetectors > DETECTORBRANCHNAMES
T get(const char *key) const
void snapshot(const Output &spec, T const &object)
decltype(auto) make(const Output &spec, Args... args)
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.
Digitizer for the ALICE3 Inner/Outer TOF detector.
void setROFRecords(std::vector< o2::itsmft::ROFRecord > *rec)
void init()
Initialize the digitizer.
void fillOutputContainer()
Flush the output container.
void setDigits(std::vector< o2::iotof::Digit > *dig)
void process(const std::vector< o2::itsmft::Hit > *hits, int evID, int srcID)
Steer conversion of hits to digits.
bool isContinuous() const
void setEventTime(const o2::InteractionTimeRecord &irt)
Set the event time.
void setChargeThreshold(float thr)
void setMCLabels(o2::dataformats::MCTruthContainer< o2::MCCompLabel > *mclb)
void setGeometry(const o2::iotof::GeometryTGeo *gm)
static GeometryTGeo * Instance()
void run(framework::ProcessingContext &pc)
void initDigitizerTask(framework::InitContext &ic) override
IOTOFDPLDigitizerTask(bool mctruth=true)
bool initSimChains(o2::detectors::DetID detid, std::vector< TChain * > &simchains) const
constexpr o2::header::DataOrigin gDataOriginTF3
Defining ITS Vertex explicitly as messageable.
std::vector< ConfigParamSpec > ccdbParamSpec(std::string const &path, int runDependent, std::vector< CCDBMetadata > metadata={}, int qrate=0)
std::vector< ConfigParamSpec > Options
std::vector< o2::framework::OutputSpec > makeOutChannels(o2::header::DataOrigin detOrig, bool mctruth)
o2::framework::DataProcessorSpec getIOTOFDigitizerSpec(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"