19#include <unordered_map>
55 auto cput = mTimer.CpuTime();
61 tfData.
colData[subSpec] = pc.
inputs().
get<gsl::span<o2::mid::ColumnData>>(fmt::format(
"cols_{}", subSpec));
64 tfData.rofData[subSpec] = pc.
inputs().
get<gsl::span<o2::mid::ROFRecord>>(fmt::format(
"rofs_{}", subSpec));
77 iosize.rawIn = insize;
82 LOG(info) << iosize.asString() <<
" in " << mTimer.CpuTime() - cput <<
" s";
87 LOGF(info,
"MID Entropy Encoding total timing: Cpu: %.3e Real: %.3e s in %d slots",
88 mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
93 std::vector<InputSpec> inputs;
95 inputs.emplace_back(fmt::format(
"cols_{}", subSpec),
header::gDataOriginMID,
"DATA", subSpec, Lifetime::Timeframe);
96 inputs.emplace_back(fmt::format(
"rofs_{}", subSpec),
header::gDataOriginMID,
"DATAROF", subSpec, Lifetime::Timeframe);
99 if (ctfdictOpt.empty() || ctfdictOpt ==
"ccdb") {
103 inputs.emplace_back(
"selIRFrames",
"CTF",
"SELIRFRAMES", 0, Lifetime::Timeframe);
106 "mid-entropy-encoder",
110 AlgorithmSpec{adaptFromTask<EntropyEncoderSpec>(selIR, ctfdictOpt)},
111 Options{{
"irframe-margin-bwd", VariantType::UInt32, 0u, {
"margin in BC to add to the IRFrame lower boundary when selection is requested"}},
112 {
"irframe-margin-fwd", VariantType::UInt32, 0u, {
"margin in BC to add to the IRFrame upper boundary when selection is requested"}},
113 {
"mem-factor", VariantType::Float, 1.f, {
"Memory allocation margin factor"}},
114 {
"ans-version", VariantType::String, {
"version of ans entropy coder implementation to use"}}}};
Declarations for CTFCoderBase class (support of external dictionaries)
Convert MID data to CTF (EncodedBlocks)
Definition of the Names Generator class.
void updateTimeDependentParams(o2::framework::ProcessingContext &pc, bool askTree=false)
void init(o2::framework::InitContext &ic)
void setSelectedIRFrames(const SPAN &sp)
o2::utils::IRFrameSelector & getIRFramesSelector()
bool finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj)
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.
InputRecord & inputs()
The inputs associated with this processing context.
o2::ctf::CTFIOSize encode(VEC &buff, const CTFHelper::TFData &tfData)
entropy-encode data to buffer with CTF
void endOfStream(o2::framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void run(o2::framework::ProcessingContext &pc) final
void init(o2::framework::InitContext &ic) final
void finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj) final
EntropyEncoderSpec(bool selIR, const std::string &ctfdictOpt="none")
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
std::vector< OutputSpec > Outputs
framework::DataProcessorSpec getEntropyEncoderSpec(bool selIR=false, const std::string &ctfdictOpt="none")
create a processor spec
constexpr uint32_t NEvTypes
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::array< gsl::span< const o2::mid::ColumnData >, NEvTypes > colData
wrapper for the Entropy-encoded clusters of the TF
Column data structure for MID.
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"