21#include <TStopwatch.h>
67 auto cput = mTimer.CpuTime();
70 auto rofs = pc.
inputs().
get<gsl::span<o2::mch::ROFRecord>>(
"rofs", 0);
79 LOG(info) << iosize.asString() <<
" in " << mTimer.CpuTime() - cput <<
" s";
84 LOGF(info,
"MCH Entropy Encoding total timing: Cpu: %.3e Real: %.3e s in %d slots",
85 mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
90 std::vector<InputSpec> inputs;
91 inputs.emplace_back(
"rofs",
"MCH",
"DIGITROFS", 0, Lifetime::Timeframe);
92 inputs.emplace_back(
"digits",
"MCH",
"DIGITS", 0, Lifetime::Timeframe);
93 inputs.emplace_back(
"ctfdict",
"MCH",
"CTFDICT", 0, Lifetime::Condition,
ccdbParamSpec(
"MCH/Calib/CTFDictionaryTree"));
95 inputs.emplace_back(
"selIRFrames",
"CTF",
"SELIRFRAMES", 0, Lifetime::Timeframe);
100 Outputs{{
"MCH",
"CTFDATA", 0, Lifetime::Timeframe},
101 {{
"ctfrep"},
"MCH",
"CTFENCREP", 0, Lifetime::Timeframe}},
103 Options{{
"ctf-dict", VariantType::String,
"ccdb", {
"CTF dictionary: empty or ccdb=CCDB, none=no external dictionary otherwise: local filename"}},
104 {
"irframe-margin-bwd", VariantType::UInt32, 0u, {
"margin in BC to add to the IRFrame lower boundary when selection is requested"}},
105 {
"irframe-margin-fwd", VariantType::UInt32, 0u, {
"margin in BC to add to the IRFrame upper boundary when selection is requested"}},
106 {
"mem-factor", VariantType::Float, 1.f, {
"Memory allocation margin factor"}},
107 {
"ans-version", VariantType::String, {
"version of ans entropy coder implementation to use"}}}};
116void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
119 std::vector<ConfigParamSpec> options{
120 ConfigParamSpec{
"configKeyValues", VariantType::String,
"", {
"Semicolon separated key=value strings"}},
121 ConfigParamSpec{
"select-ir-frames", VariantType::Bool,
false, {
"Subscribe and filter according to external IR Frames"}}};
123 std::swap(workflowOptions, options);
135 bool selIR = cfgc.
options().
get<
bool>(
"select-ir-frames");
class for entropy encoding/decoding of MCH digit data
void customize(std::vector< o2::framework::ConfigParamSpec > &workflowOptions)
WorkflowSpec defineDataProcessing(ConfigContext const &cfgc)
static void updateFromString(std::string const &)
void updateTimeDependentParams(o2::framework::ProcessingContext &pc, bool askTree=false)
void init(o2::framework::InitContext &ic)
void setSelectedIRFrames(const SPAN &sp)
bool finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj)
ConfigParamRegistry & options() const
T get(const char *key) const
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 gsl::span< const ROFRecord > &rofData, const gsl::span< const Digit > &digData)
entropy-encode data to buffer with CTF
void finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj) final
EntropyEncoderSpec(bool selIR)
void init(o2::framework::InitContext &ic) final
void run(o2::framework::ProcessingContext &pc) final
~EntropyEncoderSpec() override=default
void endOfStream(o2::framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > ccdbParamSpec(std::string const &path, int runDependent, std::vector< CCDBMetadata > metadata={}, int qrate=0)
std::vector< DataProcessorSpec > WorkflowSpec
std::vector< ConfigParamSpec > Options
std::vector< OutputSpec > Outputs
DataProcessorSpec getEntropyEncoderSpec(const char *specName, bool selIR)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
wrapper for the Entropy-encoded clusters of the TF
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
std::vector< Digit > digits