39using DPMAP = std::unordered_map<o2::dcs::DataPointIdentifier, std::vector<o2::dcs::DataPointValue>>;
53 LOG(info) <<
"initializing MID digitization";
61 auto* chEffCounters =
static_cast<std::vector<ChEffCounter>*
>(obj);
62 mDigitizer->setChamberEfficiency(*chEffCounters);
66 auto* dpMap =
static_cast<DPMAP*
>(obj);
67 mDigitizer->getChamberResponse().setHV(*dpMap);
74 static bool finished =
false;
78 LOG(
debug) <<
"Doing MID digitization";
83 pc.
inputs().
get<std::vector<ChEffCounter>*>(
"mid_ch_eff");
86 auto& irecords = context->getEventRecords();
92 auto& eventParts = context->getEventParts();
93 std::vector<o2::mid::ColumnData>
digits, digitsAccum;
94 std::vector<o2::mid::ROFRecord> rofRecords;
99 for (
int collID = 0; collID < irecords.size(); ++collID) {
104 if (irecords[collID] < firstTimeTF) {
107 auto firstEntry = digitsAccum.size();
108 for (
auto& part : eventParts[collID]) {
109 mDigitizer->setEventID(part.entryID);
110 mDigitizer->setSrcID(part.sourceID);
113 std::vector<o2::mid::Hit> hits;
114 context->retrieveHits(mSimChains,
"MIDHit", part.sourceID, part.entryID, &hits);
115 LOG(
debug) <<
"For collision " << collID <<
" eventID " << part.entryID <<
" found MID " << hits.size() <<
" hits ";
117 mDigitizer->process(hits,
digits, labels);
121 digitsAccum.insert(digitsAccum.end(),
digits.begin(),
digits.end());
124 auto nEntries = digitsAccum.size() - firstEntry;
128 mDigitsMerger.
process(digitsAccum, labelsAccum, rofRecords);
130 LOG(
debug) <<
"MID: Sending " << digitsAccum.size() <<
" digits.";
136 LOG(
debug) <<
"MID: Sending ROMode= " << mROMode <<
" to GRPUpdater";
145 std::unique_ptr<Digitizer> mDigitizer;
147 std::vector<TChain*> mSimChains;
161 std::vector<InputSpec> inputSpecs;
162 inputSpecs.emplace_back(
"collisioncontext",
"SIM",
"COLLISIONCONTEXT",
static_cast<SubSpecificationType>(channel), Lifetime::Timeframe);
166 std::vector<OutputSpec> outputs;
167 outputs.emplace_back(
"MID",
"DIGITS", 0, Lifetime::Timeframe);
168 outputs.emplace_back(
"MID",
"DIGITSROF", 0, Lifetime::Timeframe);
170 outputs.emplace_back(
"MID",
"DIGITLABELS", 0, Lifetime::Timeframe);
172 outputs.emplace_back(
"MID",
"ROMode", 0, Lifetime::Timeframe);
Definition of the base digitizer task class.
Chamber efficiency counters.
MID RPC effciency response.
Strip pattern (aka digits)
o2::framework::DataAllocator::SubSpecificationType SubSpecificationType
Delay parameters for MID electronics.
Header of the General Run Parameters object.
Definition of a container to keep Monte Carlo truth external to simulation objects.
Implementation of the trigger-stations geometry.
BaseDPLDigitizer()=default
static const HBFUtils & 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.
const std::vector< ColumnData > & getColumnData() const
Gets the merged column data.
void process(const std::vector< ColumnData > &inDigitStore, const o2::dataformats::MCTruthContainer< MCLabel > &inMCContainer, const std::vector< ROFRecord > &inROFRecords, bool mergeInBunchPileup=true)
Merges the MC digits that are provided per hit into the format that we expect from data.
const o2::dataformats::MCTruthContainer< MCLabel > & getMCContainer() const
Gets the merged MC labels.
const std::vector< ROFRecord > & getROFRecords() const
Gets the merged RO frame records.
void initDigitizerTask(framework::InitContext &ic) override
void run(framework::ProcessingContext &pc)
void finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj)
std::unordered_map< DPID, std::vector< DPVAL > > DPMAP
constexpr o2::header::DataOrigin gDataOriginMID
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
GeometryTransformer createTransformationFromManager(const TGeoManager *geoManager)
ChamberEfficiencyResponse createDefaultChamberEfficiencyResponse()
o2::framework::DataProcessorSpec getMIDDigitizerSpec(int channel, bool mctruth)
ChamberResponse createDefaultChamberResponse()
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
int16_t localToBC
Delay between collision BC and local clock.
IR getFirstSampledTFIR() const
get TF and HB (abs) for this IR
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
std::vector< Digit > digits