32 : mOrigin(orig), mCTFCoder(
o2::ctf::CTFCoderBase::OpType::Encoder, orig ==
o2::header::gDataOriginITS ?
o2::detectors::
DetID::ITS :
o2::detectors::
DetID::MFT), mSelIR(selIR)
49 auto cput = mTimer.CpuTime();
53 auto compClusters = pc.
inputs().
get<gsl::span<o2::itsmft::CompClusterExt>>(
"compClusters");
54 auto pspan = pc.
inputs().
get<gsl::span<unsigned char>>(
"patterns");
55 auto rofs = pc.
inputs().
get<gsl::span<o2::itsmft::ROFRecord>>(
"ROframes");
60 auto iosize = mCTFCoder.
encode(
buffer, rofs, compClusters, pspan, mPattIdConverter, mStrobeLength);
66 LOG(info) << iosize.asString() <<
" in " << mTimer.CpuTime() - cput <<
" s";
71 LOGF(info,
"%s Entropy Encoding total timing: Cpu: %.3e Real: %.3e s in %d slots",
72 mOrigin.
as<std::string>(), mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
93 LOG(info) << mOrigin.
as<std::string>() <<
" cluster dictionary updated";
99 LOG(info) <<
"Alpide param updated";
102 mStrobeLength = par.roFrameLengthInBC;
105 mStrobeLength = par.roFrameLengthInBC;
117 std::vector<InputSpec> inputs;
118 inputs.emplace_back(
"compClusters", orig,
"COMPCLUSTERS", 0, Lifetime::Timeframe);
119 inputs.emplace_back(
"patterns", orig,
"PATTERNS", 0, Lifetime::Timeframe);
120 inputs.emplace_back(
"ROframes", orig,
"CLUSTERSROF", 0, Lifetime::Timeframe);
122 inputs.emplace_back(
"selIRFrames",
"CTF",
"SELIRFRAMES", 0, Lifetime::Timeframe);
123 inputs.emplace_back(
"cldict", orig,
"CLUSDICT", 0, Lifetime::Condition,
ccdbParamSpec(fmt::format(
"{}/Calib/ClusterDictionary", orig.
as<std::string>())));
124 inputs.emplace_back(
"alppar", orig,
"ALPIDEPARAM", 0, Lifetime::Condition,
ccdbParamSpec(fmt::format(
"{}/Config/AlpideParam", orig.
as<std::string>())));
126 inputs.emplace_back(
"ctfdict", orig,
"CTFDICT", 0, Lifetime::Condition,
ccdbParamSpec(fmt::format(
"{}/Calib/CTFDictionaryTree", orig.
as<std::string>())));
130 Outputs{{orig,
"CTFDATA", 0, Lifetime::Timeframe},
131 {{
"ctfrep"}, orig,
"CTFENCREP", 0, Lifetime::Timeframe}},
132 AlgorithmSpec{adaptFromTask<EntropyEncoderSpec>(orig, selIR)},
133 Options{{
"ctf-dict", VariantType::String,
"ccdb", {
"CTF dictionary: empty or ccdb=CCDB, none=no external dictionary otherwise: local filename"}},
134 {
"irframe-margin-bwd", VariantType::UInt32, 0u, {
"margin in BC to add to the IRFrame lower boundary when selection is requested"}},
135 {
"irframe-margin-fwd", VariantType::UInt32, 0u, {
"margin in BC to add to the IRFrame upper boundary when selection is requested"}},
136 {
"mem-factor", VariantType::Float, 1.f, {
"Memory allocation margin factor"}},
137 {
"ans-version", VariantType::String, {
"version of ans entropy coder implementation to use"}}}};
Definition of the ITSMFT compact cluster.
Convert clusters streams to CTF (EncodedBlocks)
static const DPLAlpideParam< N > & Instance()
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)
Static class with identifiers, bitmasks and names for ALICE detectors.
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.
ServiceRegistryRef services()
The services registry associated with this processing context.
o2::ctf::CTFIOSize encode(VEC &buff, const gsl::span< const ROFRecord > &rofRecVec, const gsl::span< const CompClusterExt > &cclusVec, const gsl::span< const unsigned char > &pattVec, const LookUp &clPattLookup, int strobeLength)
entropy-encode clusters to buffer with CTF
void init(o2::framework::InitContext &ic) final
void updateTimeDependentParams(o2::framework::ProcessingContext &pc)
EntropyEncoderSpec(o2::header::DataOrigin orig, bool selIR)
void run(o2::framework::ProcessingContext &pc) final
void finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj) final
void endOfStream(o2::framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void setDictionary(const TopologyDictionary *dict)
constexpr o2::header::DataOrigin gDataOriginMFT
constexpr o2::header::DataOrigin gDataOriginITS
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(o2::header::DataOrigin orig, bool selIR=false)
create a processor spec
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
bool globalRunNumberChanged
wrapper for the Entropy-encoded clusters of the TF
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"