33#include <TGeoManager.h>
57 size_t nPileup, std::chrono::high_resolution_clock::time_point
start)
59 LOGP(info,
"Number of digits : {}",
digits.size());
60 LOGP(info,
"Number of rofs : {}", rofs.size());
61 LOGP(info,
"Number of labels : {} (indexed {})",
labels.getNElements(),
labels.getIndexedSize());
63 LOGP(
error,
"Number of labels != number of digits");
65 LOGP(info,
"Number of signal pileup : {} ({} %)", nPileup,
digits.empty() ? 0. : 100. * nPileup /
digits.size());
66 auto tEnd = std::chrono::high_resolution_clock::now();
67 auto duration = tEnd -
start;
68 auto d = std::chrono::duration_cast<std::chrono::milliseconds>(duration).count();
69 LOGP(info,
"Digitizer time {} ms",
d);
74 static bool finished =
false;
81 auto tStart = std::chrono::high_resolution_clock::now();
83 context->
initSimChains(o2::detectors::DetID::MCH, mSimChains);
84 const auto& eventRecords = context->getEventRecords();
89 const auto& eventParts = context->getEventParts();
90 for (
auto i = 0;
i < eventRecords.size();
i++) {
91 auto ir = eventRecords[
i];
97 for (
const auto& part : eventParts[
i]) {
98 std::vector<Hit> hits{};
99 context->retrieveHits(mSimChains,
"MCHHit", part.sourceID, part.entryID, &hits);
100 mDigitizer->processHits(hits,
ir, part.entryID, part.sourceID);
107 if (!eventRecords.empty()) {
110 mDigitizer->addNoise(firstIR, lastIR);
114 std::vector<Digit>
digits{};
115 std::vector<ROFRecord> rofs{};
117 auto nPileup = mDigitizer->digitize(rofs,
digits,
labels);
135 std::unique_ptr<Digitizer> mDigitizer{};
136 std::vector<TChain*> mSimChains{};
141 std::vector<OutputSpec> outputs{};
142 outputs.emplace_back(
"MCH",
"DIGITS", 0, Lifetime::Timeframe);
143 outputs.emplace_back(
"MCH",
"DIGITROFS", 0, Lifetime::Timeframe);
145 outputs.emplace_back(
"MCH",
"DIGITSLABELS", 0, Lifetime::Timeframe);
147 outputs.emplace_back(
"MCH",
"ROMode", 0, Lifetime::Timeframe);
Definition of the base digitizer task class.
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events d
Header of the General Run Parameters object.
char error[CURL_ERROR_SIZE]
std::vector< o2::MCCompLabel > labels
Definition of a container to keep Monte Carlo truth external to simulation objects.
BaseDPLDigitizer()=default
static const DigitFilterParam & Instance()
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
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 run(framework::ProcessingContext &pc)
void initDigitizerTask(framework::InitContext &ic) override
void logStatus(gsl::span< Digit > digits, gsl::span< ROFRecord > rofs, o2::dataformats::MCLabelContainer &labels, size_t nPileup, std::chrono::high_resolution_clock::time_point start)
bool initSimChains(o2::detectors::DetID detid, std::vector< TChain * > &simchains) const
Defining ITS Vertex explicitly as messageable.
std::vector< InputSpec > Inputs
TransformationCreator transformationFromTGeoManager(const TGeoManager &geo)
o2::framework::DataProcessorSpec getMCHDigitizerSpec(int channel, bool mctruth)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
static InteractionRecord long2IR(int64_t l)
o2::InteractionRecord ir(0, 0)
std::vector< Digit > digits