22#include <TStopwatch.h>
43 bool mCorrectLML0 =
false;
58 static int bcshift = 0;
63 if (bcshift != trigOffsParam.LM_L0) {
64 bcshift = trigOffsParam.LM_L0;
66 LOGP(info,
"Decoded IRs will be corrected by {} BCs (LM_L0 {} + custom {}), discarded if become prior to 1st orbit", -(bcshift - customShift), -bcshift, customShift);
76 mCorrectLML0 = ic.
options().
get<
bool>(
"correct-trd-trigger-offset");
78 int checkBogus = ic.
options().
get<
int>(
"bogus-trigger-rejection");
80 LOGP(info,
"Bogus triggers rejection flag: {}", checkBogus);
85 auto cput = mTimer.CpuTime();
90 auto buff = pc.
inputs().
get<gsl::span<o2::ctf::BufferType>>(
"ctf_TRD");
103 LOG(info) <<
"Decoded " <<
tracklets.size() <<
" TRD tracklets and " <<
digits.size() <<
" digits in " << triggers.size() <<
" triggers, (" << iosize.
asString() <<
") in " << mTimer.CpuTime() - cput <<
" s";
108 LOGF(info,
"TRD Entropy Decoding total timing: Cpu: %.3e Real: %.3e s in %d slots",
109 mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
114 std::vector<OutputSpec> outputs{
115 OutputSpec{{
"triggers"},
"TRD",
"TRKTRGRD", 0, Lifetime::Timeframe},
116 OutputSpec{{
"tracklets"},
"TRD",
"TRACKLETS", 0, Lifetime::Timeframe},
117 OutputSpec{{
"digits"},
"TRD",
"DIGITS", 0, Lifetime::Timeframe},
118 OutputSpec{{
"ctfrep"},
"TRD",
"CTFDECREP", 0, Lifetime::Timeframe}};
120 std::vector<InputSpec> inputs;
121 inputs.emplace_back(
"ctf_TRD",
"TRD",
"CTFDATA", sspec, Lifetime::Timeframe);
122 inputs.emplace_back(
"ctfdict_TRD",
"TRD",
"CTFDICT", 0, Lifetime::Condition,
ccdbParamSpec(
"TRD/Calib/CTFDictionaryTree"));
123 inputs.emplace_back(
"trigoffset",
"CTP",
"Trig_Offset", 0, Lifetime::Condition,
ccdbParamSpec(
"CTP/Config/TriggerOffsets"));
126 "trd-entropy-decoder",
130 Options{{
"ctf-dict", VariantType::String,
"ccdb", {
"CTF dictionary: empty or ccdb=CCDB, none=no external dictionary otherwise: local filename"}},
131 {
"correct-trd-trigger-offset", VariantType::Bool,
false, {
"Correct decoded IR by TriggerOffsetsParam::LM_L0"}},
132 {
"bogus-trigger-rejection", VariantType::Int, 10, {
">0 : discard, warn N times, <0 : warn only, =0: no check for triggers with no tracklets or bogus IR"}},
133 {
"ans-version", VariantType::String, {
"version of ans entropy coder implementation to use"}}}};
class for entropy encoding/decoding of TRD data
Convert CTF (EncodedBlocks) to TRD digit/tracklets stream.
static const TriggerOffsetsParam & Instance()
void setSupportBCShifts(bool v=true)
void updateTimeDependentParams(o2::framework::ProcessingContext &pc, bool askTree=false)
void setDictBinding(const std::string &s)
void init(o2::framework::InitContext &ic)
void setBCShift(int64_t n)
bool finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj)
static auto getImage(const void *newHead)
get const image of the container wrapper, with pointers in the image relocated to new head
T get(const char *key) const
void snapshot(const Output &spec, T const &object)
decltype(auto) make(const Output &spec, Args... args)
ConfigParamRegistry const & options()
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
InputRecord & inputs()
The inputs associated with this processing context.
void setCheckBogusTrig(int v)
o2::ctf::CTFIOSize decode(const CTF::base &ec, VTRG &trigVec, VTRK &trkVec, VDIG &digVec)
entropy decode data from buffer with CTF
void run(o2::framework::ProcessingContext &pc) final
void endOfStream(o2::framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
EntropyDecoderSpec(int verbosity)
void finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj) final
void init(o2::framework::InitContext &ic) final
~EntropyDecoderSpec() override=default
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
framework::DataProcessorSpec getEntropyDecoderSpec(int verbosity, unsigned int sspec)
create a processor spec
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string asString() const
wrapper for the Entropy-encoded triggers and cells of the TF
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
std::vector< Digit > digits
std::vector< Tracklet64 > tracklets