34#include <TGeoManager.h>
58 size_t nPileup, std::chrono::high_resolution_clock::time_point
start)
60 LOGP(info,
"Number of digits : {}",
digits.size());
61 LOGP(info,
"Number of rofs : {}", rofs.size());
62 LOGP(info,
"Number of labels : {} (indexed {})",
labels.getNElements(),
labels.getIndexedSize());
64 LOGP(error,
"Number of labels != number of digits");
66 LOGP(info,
"Number of signal pileup : {} ({} %)", nPileup, 100. * nPileup /
digits.size());
67 auto tEnd = std::chrono::high_resolution_clock::now();
68 auto duration = tEnd -
start;
69 auto d = std::chrono::duration_cast<std::chrono::milliseconds>(duration).count();
70 LOGP(info,
"Digitizer time {} ms", d);
75 static bool finished =
false;
82 auto tStart = std::chrono::high_resolution_clock::now();
85 const auto& eventRecords = context->getEventRecords();
90 const auto& eventParts = context->getEventParts();
91 for (
auto i = 0;
i < eventRecords.size();
i++) {
92 auto ir = eventRecords[
i];
98 for (
const auto& part : eventParts[
i]) {
99 std::vector<Hit> hits{};
100 context->retrieveHits(mSimChains,
"MCHHit", part.sourceID, part.entryID, &hits);
101 mDigitizer->processHits(hits,
ir, part.entryID, part.sourceID);
109 int64_t firstLong, lastLong;
110 if (eventRecords.empty()) {
115 firstLong = eventRecords.front().toLong();
116 lastLong = eventRecords.back().toLong();
120 mDigitizer->addNoise(firstIR, lastIR);
123 std::vector<Digit>
digits{};
124 std::vector<ROFRecord> rofs{};
126 auto nPileup = mDigitizer->digitize(rofs,
digits,
labels);
144 std::unique_ptr<Digitizer> mDigitizer{};
145 std::vector<TChain*> mSimChains{};
150 std::vector<OutputSpec> outputs{};
151 outputs.emplace_back(
"MCH",
"DIGITS", 0, Lifetime::Timeframe);
152 outputs.emplace_back(
"MCH",
"DIGITROFS", 0, Lifetime::Timeframe);
154 outputs.emplace_back(
"MCH",
"DIGITSLABELS", 0, Lifetime::Timeframe);
156 outputs.emplace_back(
"MCH",
"ROMode", 0, Lifetime::Timeframe);
std::vector< std::string > labels
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 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< ConfigParamSpec > Options
header::DataHeader::SubSpecificationType SubSpecificationType
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