48 auto cput = mTimer.CpuTime();
51 auto compDigits = pc.
inputs().
get<gsl::span<Digit>>(
"compDigits");
52 auto pspan = pc.
inputs().
get<gsl::span<uint8_t>>(
"patterns");
53 auto rofs = pc.
inputs().
get<gsl::span<ReadoutWindowData>>(
"ROframes");
58 auto iosize = mCTFCoder.
encode(
buffer, rofs, compDigits, pspan);
64 LOG(info) << iosize.asString() <<
" in " << mTimer.CpuTime() - cput <<
" s";
69 LOGF(
debug,
"TOF Entropy Encoding total timing: Cpu: %.3e Real: %.3e s in %d slots",
70 mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
75 std::vector<InputSpec> inputs;
80 if (ctfdictOpt.empty() || ctfdictOpt ==
"ccdb") {
81 inputs.emplace_back(
"ctfdict",
"TOF",
"CTFDICT", 0, Lifetime::Condition,
ccdbParamSpec(
"TOF/Calib/CTFDictionaryTree"));
84 inputs.emplace_back(
"selIRFrames",
"CTF",
"SELIRFRAMES", 0, Lifetime::Timeframe);
87 "tof-entropy-encoder",
90 {{
"ctfrep"},
"TOF",
"CTFENCREP", 0, Lifetime::Timeframe}},
91 AlgorithmSpec{adaptFromTask<EntropyEncoderSpec>(selIR, ctfdictOpt)},
92 Options{{
"irframe-margin-bwd", VariantType::UInt32, 0u, {
"margin in BC to add to the IRFrame lower boundary when selection is requested"}},
93 {
"irframe-margin-fwd", VariantType::UInt32, 0u, {
"margin in BC to add to the IRFrame upper boundary when selection is requested"}},
95 {
"mem-factor", VariantType::Float, 1.f, {
"Memory allocation margin factor"}},
96 {
"ans-version", VariantType::String, {
"version of ans entropy coder implementation to use"}}}};
Convert clusters streams to CTF (EncodedBlocks)
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 gsl::span< const ReadoutWindowData > &rofRecVec, const gsl::span< const Digit > &cdigVec, const gsl::span< const uint8_t > &pattVec)
entropy-encode clusters to buffer with CTF
void run(o2::framework::ProcessingContext &pc) final
EntropyEncoderSpec(bool selIR, const std::string &ctfdictOpt="none")
void endOfStream(o2::framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void init(o2::framework::InitContext &ic) final
void finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj) final
static constexpr Int_t LATENCYWINDOW_IN_BC
constexpr o2::header::DataOrigin gDataOriginTOF
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
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"