52 const auto inMCContainer = mUseMC ?
specs::getLabels(pc,
"mid_zs_in") :
nullptr;
59 zsData.reserve(patterns.size());
60 zsROFs.reserve(inROFRecords.size());
62 std::vector<ROFRecord> tmpROFs(1);
63 for (
auto& rof : inROFRecords) {
64 mConverter.
process(patterns.subspan(rof.firstEntry, rof.nEntries));
65 if (!mConverter.
getData().empty()) {
66 std::vector<ROBoard> decodedData = mConverter.
getData();
68 tmpROFs.front().interactionRecord = rof.interactionRecord;
69 tmpROFs.front().eventType = rof.eventType;
70 tmpROFs.front().firstEntry = 0;
71 tmpROFs.front().nEntries = decodedData.size();
72 mAggregator.
process(decodedData, tmpROFs);
73 auto& tmpOut = mAggregator.
getData();
74 zsROFs.emplace_back(rof.interactionRecord, rof.eventType, zsData.size(), tmpOut.size());
75 zsData.insert(zsData.end(), tmpOut.begin(), tmpOut.end());
78 for (
auto outColIt = zsData.begin() + zsROFs.back().firstEntry, outEnd = zsData.begin() + zsROFs.back().firstEntry + zsROFs.back().nEntries; outColIt != outEnd; ++outColIt) {
79 for (
auto inColIt = patterns.begin() + rof.firstEntry, inEnd = patterns.begin() + rof.firstEntry + rof.nEntries; inColIt != inEnd; ++inColIt) {
80 if (inColIt->deId == outColIt->deId && inColIt->columnId == outColIt->columnId) {
81 auto inIdx = std::distance(patterns.begin(), inColIt);
82 auto outIdx = std::distance(zsData.begin(), outColIt);
83 outMCContainer.
addElements(outIdx, inMCContainer->getLabels(inIdx));
99 DecodedDataAggregator mAggregator{};
100 ROBoardResponse mResponse{};
110 "MIDZeroSuppression",
Utilities for MID Column Data Specs.
Converter from ColumnData to raw local boards.
Strip pattern (aka digits)
MID decoded raw data aggregator.
Definition of a container to keep Monte Carlo truth external to simulation objects.
MID zero suppression spec.
void snapshot(const Output &spec, T const &object)
decltype(auto) make(const Output &spec, Args... args)
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
std::vector< ROBoard > getData() const
Gets vector of ROBoard.
void process(gsl::span< const ColumnData > data, bool allowEmpty=false)
void process(gsl::span< const ROBoard > localBoards, gsl::span< const ROFRecord > rofRecords)
const std::vector< ColumnData > & getData(EventType eventType=EventType::Standard)
Gets the vector of data.
bool applyZeroSuppression(std::vector< ROBoard > &locs) const
ZeroSuppressionDeviceDPL(bool useMC)
void run(o2::framework::ProcessingContext &pc)
void init(o2::framework::InitContext &ic)
constexpr o2::header::DataOrigin gDataOriginMID
Defining PrimaryVertex explicitly as messageable.
std::vector< framework::InputSpec > buildInputSpecs(std::string_view dataBind, std::string_view dataDesc, bool useMC)
std::vector< framework::OutputSpec > buildStandardOutputSpecs(std::string_view dataBind, std::string_view dataDesc, bool useMC)
std::array< gsl::span< const ColumnData >, NEvTypes > getData(framework::ProcessingContext &pc, std::string_view dataBind)
std::unique_ptr< const o2::dataformats::MCTruthContainer< MCLabel > > getLabels(framework::ProcessingContext &pc, std::string_view dataBind)
std::array< gsl::span< const ROFRecord >, NEvTypes > getRofs(framework::ProcessingContext &pc, std::string_view dataBind)
framework::DataProcessorSpec getZeroSuppressionSpec(bool useMC=true, std::string_view dataDesc="DATAMC")
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...