44 auto digitsTR = ctx.
inputs().
get<std::vector<o2::phos::TriggerRecord>>(
"digitTriggerRecords");
45 if (!digitsTR.size()) {
48 mOutputCellTrigRecs.clear();
51 mOutputTruthCont.clear();
59 mInitSimParams =
false;
63 mOutputCellTrigRecs.clear();
66 std::unique_ptr<const o2::dataformats::MCTruthContainer<o2::phos::MCLabel>> truthcont(
nullptr);
69 mOutputTruthCont.clear();
72 LOG(info) <<
"[PHOSCellConverter - run] Received " <<
digits.size() <<
" digits and " << digitsTR.size() <<
" TriggerRecords" << truthcont->getNElements() <<
" MC labels";
74 LOG(info) <<
"[PHOSCellConverter - run] Received " <<
digits.size() <<
" digits and " << digitsTR.size() <<
" TriggerRecords";
80 mBadMap = std::make_unique<BadChannelsMap>(*(badMapPtr.get()));
84 mOutputCells.reserve(
digits.size());
86 for (
const auto& tr : digitsTR) {
87 int iFirstDigit = tr.getFirstEntry();
88 int iLastDigit = iFirstDigit + tr.getNumberOfObjects();
89 int indexStart = mOutputCells.size();
90 for (
int i = iFirstDigit;
i < iLastDigit;
i++) {
95 if (dig.isHighGain()) {
100 mOutputCells.emplace_back(dig.getAbsId(), dig.getAmplitude(), dig.getTime(), chantype);
103 if (!mBadMap->isChannelGood(dig.getAbsId())) {
108 if (dig.isHighGain()) {
113 mOutputCells.emplace_back(dig.getAbsId(), dig.getAmplitude(), dig.getTime(), chantype);
115 int iLab = dig.getLabel();
117 mOutputTruthCont.addElements(icell, truthcont->getLabels(iLab));
121 mOutputTruthCont.addElement(icell,
label);
127 mOutputCellTrigRecs.emplace_back(tr.getBCData(), indexStart, mOutputCells.size() - indexStart);
129 LOG(info) <<
"[PHOSCellConverter - run] Writing " << mOutputCells.size() <<
" cells, " << mOutputCellTrigRecs.size() <<
" Trig Records " << mOutputTruthCont.getNElements() <<
" PHOS labels ";
140 std::vector<o2::framework::InputSpec> inputs;
141 std::vector<o2::framework::OutputSpec> outputs;
143 inputs.emplace_back(
"digitTriggerRecords",
o2::header::gDataOriginPHS,
"DIGITTRIGREC", 0, o2::framework::Lifetime::Timeframe);
149 outputs.emplace_back(
"PHS",
"CELLS", 0, o2::framework::Lifetime::Timeframe);
150 outputs.emplace_back(
"PHS",
"CELLTRIGREC", 0, o2::framework::Lifetime::Timeframe);
152 inputs.emplace_back(
"digitsmctr",
"PHS",
"DIGITSMCTR", 0, o2::framework::Lifetime::Timeframe);
153 outputs.emplace_back(
"PHS",
"CELLSMCTR", 0, o2::framework::Lifetime::Timeframe);
158 o2::framework::adaptFromTask<o2::phos::reco_workflow::CellConverterSpec>(propagateMC, defBadMap)};
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
InputRecord & inputs()
The inputs associated with this processing context.