21#include <TStopwatch.h>
66 auto cput = mTimer.CpuTime();
69 auto rofs = pc.
inputs().
get<gsl::span<o2::mch::ROFRecord>>(
"rofs", 0);
78 LOG(info) << iosize.asString() <<
" in " << mTimer.CpuTime() - cput <<
" s";
83 LOGF(info,
"MCH Entropy Encoding total timing: Cpu: %.3e Real: %.3e s in %d slots",
84 mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
89 std::vector<InputSpec> inputs;
90 inputs.emplace_back(
"rofs",
"MCH",
"DIGITROFS", 0, Lifetime::Timeframe);
91 inputs.emplace_back(
"digits",
"MCH",
"DIGITS", 0, Lifetime::Timeframe);
93 if (ctfdictOpt.empty() || ctfdictOpt ==
"ccdb") {
94 inputs.emplace_back(
"ctfdict",
"MCH",
"CTFDICT", 0, Lifetime::Condition,
ccdbParamSpec(
"MCH/Calib/CTFDictionaryTree"));
97 inputs.emplace_back(
"selIRFrames",
"CTF",
"SELIRFRAMES", 0, Lifetime::Timeframe);
102 Outputs{{
"MCH",
"CTFDATA", 0, Lifetime::Timeframe},
103 {{
"ctfrep"},
"MCH",
"CTFENCREP", 0, Lifetime::Timeframe}},
104 AlgorithmSpec{adaptFromTask<EntropyEncoderSpec>(selIR, ctfdictOpt)},
105 Options{{
"irframe-margin-bwd", VariantType::UInt32, 0u, {
"margin in BC to add to the IRFrame lower boundary when selection is requested"}},
106 {
"irframe-margin-fwd", VariantType::UInt32, 0u, {
"margin in BC to add to the IRFrame upper boundary when selection is requested"}},
107 {
"mem-factor", VariantType::Float, 1.f, {
"Memory allocation margin factor"}},
108 {
"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{
"ctf-dict", VariantType::String,
"ccdb", {
"CTF dictionary: empty or ccdb=CCDB, none=no external dictionary otherwise: local filename"}},
122 ConfigParamSpec{
"select-ir-frames", VariantType::Bool,
false, {
"Subscribe and filter according to external IR Frames"}}};
124 std::swap(workflowOptions, options);
136 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
void init(o2::framework::InitContext &ic) final
void run(o2::framework::ProcessingContext &pc) final
~EntropyEncoderSpec() override=default
EntropyEncoderSpec(bool selIR, const std::string &ctfdictOpt="none")
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, const std::string &ctfdictOpt)
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