Project
Loading...
Searching...
No Matches
CTFCoderBase.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
16#ifndef _ALICEO2_CTFCODER_BASE_H_
17#define _ALICEO2_CTFCODER_BASE_H_
18
19#include <memory>
20#include <TFile.h>
21#include <TTree.h>
30#include "rANS/factory.h"
31#include "rANS/compat.h"
32#include "rANS/histogram.h"
33#include <filesystem>
37#include <any>
38
39namespace o2
40{
41namespace framework
42{
43class ProcessingContext;
44}
45namespace ctf
46{
47
50
52
54{
55
56 public:
57 enum class OpType : int { Encoder,
58 Decoder };
59
60 CTFCoderBase() = delete;
61 CTFCoderBase(int n, DetID det, float memFactor = 1.f, const std::string& ctfdictOpt = "none") : mCoders(n), mDet(det), mMemMarginFactor(memFactor > 1.f ? memFactor : 1.f), mDictOpt{ctfdictOpt} {}
62 CTFCoderBase(OpType op, int n, DetID det, float memFactor = 1.f, const std::string& ctfdictOpt = "none") : mOpType(op), mCoders(n), mDet(det), mMemMarginFactor(memFactor > 1.f ? memFactor : 1.f), mDictOpt{ctfdictOpt} {}
63 virtual ~CTFCoderBase() = default;
64
65 virtual void createCoders(const std::vector<char>& bufVec, o2::ctf::CTFCoderBase::OpType op) = 0;
66
67 // detector coder need to redefine this method if uses no default version, see comment in the cxx file
68 virtual void assignDictVersion(CTFDictHeader& h) const;
69
70 template <typename SPAN>
76
77 template <typename CTF>
78 std::vector<char> readDictionaryFromFile(const std::string& dictPath, bool mayFail = false);
79
80 template <typename CTF>
81 void createCodersFromFile(const std::string& dictPath, o2::ctf::CTFCoderBase::OpType op, bool mayFail = false);
82
83 template <typename S>
84 void createCoder(OpType op, const o2::rans::RenormedDenseHistogram<S>& renormedHistogram, int slot)
85 {
86 LOG_IF(warning, renormedHistogram.empty()) << fmt::format("Empty dictionary provided for slot {}, {} will assume literal symbols only", slot, (op == OpType::Encoder ? "encoding" : "decoding"));
87
89 switch (op) {
90 case OpType::Encoder:
91 mCoders[slot] = std::make_any<rans::compat::encoder_type<S>>(rans::compat::makeEncoder::fromRenormed(renormedHistogram));
92 break;
93 case OpType::Decoder:
94 mCoders[slot] = std::make_any<rans::compat::decoder_type<S>>(rans::compat::makeDecoder::fromRenormed(renormedHistogram));
95 break;
96 }
97 } else if (mANSVersion == ANSVersion1) {
98 switch (op) {
99 case OpType::Encoder:
100 mCoders[slot] = std::make_any<rans::denseEncoder_type<S>>(rans::makeDenseEncoder<>::fromRenormed(renormedHistogram));
101 break;
102 case OpType::Decoder:
103 mCoders[slot] = std::make_any<rans::defaultDecoder_type<S>>(rans::makeDecoder<>::fromRenormed(renormedHistogram));
104 break;
105 }
106 } else {
107 throw std::runtime_error("unsupported ANS version");
108 }
109 }
110
111 void clear()
112 {
113 for (auto c : mCoders) {
114 c.reset();
115 }
116 }
117
118 void setMemMarginFactor(float v) { mMemMarginFactor = v > 1.f ? v : 1.f; }
119 float getMemMarginFactor() const { return mMemMarginFactor; }
120
121 void setVerbosity(int v) { mVerbosity = v; }
122 int getVerbosity() const { return mVerbosity; }
123
124 const CTFDictHeader& getExtDictHeader() const { return mExtHeader; }
125
126 template <typename T>
127 static bool readFromTree(TTree& tree, const std::string brname, T& dest, int ev = 0);
128
129 // these are the helper methods for the parent encoding/decoding task
130 template <typename CTF>
132
133 template <typename CTF, typename BUF>
134 size_t finaliseCTFOutput(BUF& buffer);
135
136 template <typename CTF>
137 bool finaliseCCDB(o2::framework::ConcreteDataMatcher& matcher, void* obj);
138
139 void updateTimeDependentParams(o2::framework::ProcessingContext& pc, bool askTree = false);
140
144 long getIRFrameSelShift() const { return mIRFrameSelShift; }
145
146 inline const ctf::ANSHeader& getANSVersion() const noexcept { return mANSVersion; };
147 inline ctf::ANSHeader& getANSVersion() { return const_cast<ctf::ANSHeader&>(const_cast<const CTFCoderBase&>(*this).getANSVersion()); };
148 inline void setANSVersion(const ctf::ANSHeader& ansVersion) noexcept { mANSVersion = ansVersion; };
151 auto getBCShift() const { return mBCShift; }
152 auto getFirstTFOrbit() const { return mFirstTFOrbit; }
153 void setSupportBCShifts(bool v = true) { mSupportBCShifts = v; }
154 bool getSupportBCShifts() const { return mSupportBCShifts; }
155
156 void setDictBinding(const std::string& s) { mDictBinding = s; }
157 const std::string& getDictBinding() const { return mDictBinding; }
158
159 void setTrigOffsBinding(const std::string& s) { mTrigOffsBinding = s; }
160 const std::string& getTrigOffsBinding() const { return mTrigOffsBinding; }
161
162 const DetID getDet() const { return mDet; }
163
164 protected:
165 void reportIRFrames();
166 std::string getPrefix() const { return o2::utils::Str::concat_string(mDet.getName(), "_CTF: "); }
167 void checkDictVersion(const CTFDictHeader& h) const;
168 bool isTreeDictionary(const void* buff) const;
169 bool canApplyBCShift(const o2::InteractionRecord& ir, long shift) const
170 {
171 auto diff = ir.differenceInBC({0, mFirstTFOrbit});
172 return diff < 0 ? true : diff >= shift;
173 }
175
176 template <typename source_IT>
177 [[nodiscard]] size_t estimateBufferSize(size_t slot, source_IT samplesBegin, source_IT samplesEnd);
178
179 template <typename source_T>
180 size_t estimateBufferSize(size_t slot, size_t nSamples);
181
182 template <typename source_T>
183 [[nodiscard]] size_t estimateBufferSize(size_t slot, const std::vector<source_T>& samples)
184 {
185 return estimateBufferSize(slot, samples.begin(), samples.end());
186 }
187
188 template <typename CTF>
189 std::vector<char> loadDictionaryFromTree(TTree* tree);
190 std::vector<std::any> mCoders; // encoders/decoders
192 std::string mDictOpt{};
193 std::string mDictBinding{"ctfdict"};
194 std::string mTrigOffsBinding{"trigoffset"};
195 CTFDictHeader mExtHeader; // external dictionary header
196 o2::utils::IRFrameSelector mIRFrameSelector; // optional IR frames selector
197 float mMemMarginFactor = 1.0f; // factor for memory allocation in EncodedBlocks
199 bool mSupportBCShifts{false};
200 OpType mOpType; // Encoder or Decoder
201 ctf::ANSHeader mANSVersion{ctf::ANSVersionCompat}; // Version of the ANSEncoder/Decoder
202 int64_t mBCShift = 0; // shift to apply to decoded IR (i.e. CTP offset if was not corrected on raw data decoding level)
204 size_t mIRFrameSelMarginBwd = 0; // margin in BC to add to the IRFrame lower boundary when selection is requested
205 size_t mIRFrameSelMarginFwd = 0; // margin in BC to add to the IRFrame upper boundary when selection is requested
206 long mIRFrameSelShift = 0; // Global shift of the IRFrames, to account for e.g. detector latency
207 int mVerbosity = 0;
208};
209
211template <typename T>
212bool CTFCoderBase::readFromTree(TTree& tree, const std::string brname, T& dest, int ev)
213{
214 auto* br = tree.GetBranch(brname.c_str());
215 if (br && br->GetEntries() > ev) {
216 auto* ptr = &dest;
217 br->SetAddress(&ptr);
218 br->GetEntry(ev);
219 br->ResetAddress();
220 return true;
221 }
222 return false;
223}
224
226template <typename CTF>
227void CTFCoderBase::createCodersFromFile(const std::string& dictPath, o2::ctf::CTFCoderBase::OpType op, bool mayFail)
228{
229 auto buff = readDictionaryFromFile<CTF>(dictPath, mayFail);
230 if (!buff.size()) {
231 if (mayFail) {
232 return;
233 }
234 throw std::runtime_error("Failed to create CTF dictionaty");
235 }
236 createCoders(buff, op);
237}
238
240template <typename CTF>
242{
243 std::vector<char> bufVec;
244 CTFHeader ctfHeader;
245 if (readFromTree(*tree, "CTFHeader", ctfHeader) && ctfHeader.detectors[mDet]) {
246 CTF::readFromTree(bufVec, *tree, mDet.getName());
247 }
248 return bufVec;
249}
250
252template <typename CTF>
253std::vector<char> CTFCoderBase::readDictionaryFromFile(const std::string& dictPath, bool mayFail)
254{
255 std::vector<char> bufVec;
256 std::unique_ptr<TFile> fileDict;
257 if (std::filesystem::exists(dictPath)) {
258 fileDict.reset(TFile::Open(dictPath.c_str()));
259 }
260 if (!fileDict || fileDict->IsZombie()) {
261 std::string errstr = fmt::format("CTF dictionary file {} for detector {} is absent", dictPath, mDet.getName());
262 if (mayFail) {
263 LOGP(info, "{}, will assume dictionary stored in CTF", errstr);
264 } else {
265 throw std::runtime_error(errstr);
266 }
267 return bufVec;
268 }
269 std::unique_ptr<TTree> tree;
270 std::unique_ptr<std::vector<char>> bv((std::vector<char>*)fileDict->GetObjectChecked(o2::base::NameConf::CCDBOBJECT.data(), "std::vector<char>"));
271 tree.reset((TTree*)fileDict->GetObjectChecked(o2::base::NameConf::CTFDICT.data(), "TTree"));
272 if (!tree) {
273 tree.reset((TTree*)fileDict->GetObjectChecked(o2::base::NameConf::CCDBOBJECT.data(), "TTree"));
274 }
275 if (tree) {
276 auto v = loadDictionaryFromTree<CTF>(tree.get());
277 bufVec.swap(v);
278 } else if (bv) {
279 bufVec.swap(*bv);
280 if (bufVec.size()) {
281 auto dictHeader = static_cast<const o2::ctf::CTFDictHeader&>(CTF::get(bufVec.data())->getHeader());
282 if (dictHeader.det != mDet) {
283 bufVec.clear();
284 LOGP(error, "{} contains dictionary vector for {}, expected {}", dictPath, dictHeader.det.getName(), mDet.getName());
285 }
286 }
287 }
288 if (bufVec.size()) {
289 mExtHeader = static_cast<CTFDictHeader&>(CTF::get(bufVec.data())->getHeader());
290 LOGP(debug, "Found {} in {}", mExtHeader.asString(), dictPath);
291 } else {
292 if (mayFail) {
293 LOGP(info, "{}, will assume dictionary stored in CTF", mDet.getName());
294 } else {
295 LOGP(fatal, "CTF dictionary file for detector {} is empty", mDet.getName());
296 }
297 }
298 return bufVec;
299}
300
302template <typename CTF>
304{
305 if (ic.options().hasOption("mem-factor")) {
306 setMemMarginFactor(ic.options().get<float>("mem-factor"));
307 }
308 if (ic.options().hasOption("irframe-margin-bwd")) {
309 mIRFrameSelMarginBwd = ic.options().get<uint32_t>("irframe-margin-bwd");
310 }
311 if (ic.options().hasOption("irframe-margin-fwd")) {
312 mIRFrameSelMarginFwd = ic.options().get<uint32_t>("irframe-margin-fwd");
313 }
314 if (ic.options().hasOption("irframe-shift")) {
315 mIRFrameSelShift = (long)ic.options().get<int32_t>("irframe-shift");
316 }
317 bool ansVersionProvided = false;
318 if (ic.options().hasOption("ans-version")) {
319 if (ic.options().isSet("ans-version")) {
320 const std::string ansVersionString = ic.options().get<std::string>("ans-version");
321 if (!ansVersionString.empty()) {
322 mANSVersion = ansVersionFromString(ansVersionString);
323 LOGP(info, "parsing ansVersionString {} into {}", ansVersionString, static_cast<std::string>(mANSVersion));
325 throw std::invalid_argument(fmt::format("Invalid ANS Version {}", ansVersionString));
326 }
327 ansVersionProvided = true;
328 }
329 }
330 }
331 if (mDictOpt.empty() || mDictOpt == "ccdb") { // load from CCDB
332 mLoadDictFromCCDB = true;
333 } else {
334 if (mDictOpt != "none") { // none means per-CTF dictionary will created on the fly
335 createCodersFromFile<CTF>(mDictOpt, mOpType);
336 LOGP(info, "Loaded {} from {}, ANS Version {}", mExtHeader.asString(), mDictOpt, std::string(mANSVersion));
337 } else {
338 if (!ansVersionProvided) {
340 }
341 LOGP(info, "Internal per-TF CTF Dict will be created, ANS Version {}", std::string(mANSVersion));
342 }
343 mLoadDictFromCCDB = false; // don't try to load from CCDB
344 }
345}
346
348template <typename CTF, typename BUF>
350{
351 auto eeb = CTF::get(buffer.data()); // cast to container pointer
352 eeb->compactify(); // eliminate unnecessary padding
353 buffer.resize(eeb->size()); // shrink buffer to strictly necessary size
354 // eeb->print();
355 return eeb->size();
356}
357
359template <typename CTF>
361{
362 bool match = false;
363 if (mLoadDictFromCCDB && (match = (matcher == o2::framework::ConcreteDataMatcher(mDet.getDataOrigin(), "CTFDICT", 0)))) {
364 const auto* dict = (std::vector<char>*)obj;
365 if (dict->empty()) {
366 LOGP(info, "Empty dictionary object fetched from CCDB, internal per-TF CTF Dict will be created");
367 } else {
368 std::vector<char> bufVec;
369 if (isTreeDictionary(obj)) {
370 auto v = loadDictionaryFromTree<CTF>(reinterpret_cast<TTree*>(obj));
371 bufVec.swap(v);
372 dict = &bufVec;
373 }
374 createCoders(*dict, mOpType);
375 mExtHeader = static_cast<const CTFDictHeader&>(CTF::get(dict->data())->getHeader());
376 LOGP(info, "Loaded {} from CCDB, ANS Version {}", mExtHeader.asString(), std::string(mANSVersion));
377 }
378 mLoadDictFromCCDB = false; // we read the dictionary at most once!
379 } else if ((match = (matcher == o2::framework::ConcreteDataMatcher("CTP", "Trig_Offset", 0)))) {
380 const auto& trigOffsParam = o2::ctp::TriggerOffsetsParam::Instance();
381 auto bcshift = trigOffsParam.customOffset[mDet.getID()];
382 if (bcshift) {
383 if (mSupportBCShifts) {
384 LOGP(info, "Decoded IRs will be augmented by {} BCs, discarded if become prior to 1st orbit", bcshift);
385 setBCShift(-bcshift); // offset is subtracted
386 } else {
387 LOGP(alarm, "Decoding with {} BCs shift is requested, but the {} does not support this operation, ignoring request", bcshift, mDet.getName());
388 }
389 }
390 }
391 return match;
392}
393
394template <typename IT>
395[[nodiscard]] inline size_t CTFCoderBase::estimateBufferSize(size_t slot, IT samplesBegin, IT samplesEnd)
396{
397 using source_type = typename std::iterator_traits<IT>::value_type;
398 const size_t nSamples = std::distance(samplesBegin, samplesEnd);
399 return estimateBufferSize<source_type>(slot, nSamples);
400};
401
402template <typename source_T>
403[[nodiscard]] inline size_t CTFCoderBase::estimateBufferSize(size_t slot, size_t nSamples)
404{
405
406 std::any& coder = mCoders[slot];
407 if (coder.has_value()) {
408 const size_t alphabetRangeBits = [this, &coder]() {
410 const auto& encoder = std::any_cast<const rans::compat::encoder_type<source_T>&>(coder);
411 auto view = rans::trim(rans::makeHistogramView(encoder.getSymbolTable()));
412 return rans::utils::getRangeBits(view.getMin(), view.getMax());
413 } else if (mANSVersion == ANSVersion1) {
414 const auto& encoder = std::any_cast<const rans::denseEncoder_type<source_T>&>(coder);
415 auto view = rans::trim(rans::makeHistogramView(encoder.getSymbolTable()));
416 return rans::utils::getRangeBits(view.getMin(), view.getMax());
417 } else {
418 throw std::runtime_error("unsupported ANS version");
419 }
420 }();
421 return rans::compat::calculateMaxBufferSizeB(nSamples, alphabetRangeBits);
422 } else {
423 return nSamples * sizeof(source_T);
424 }
425};
426
427} // namespace ctf
428} // namespace o2
429
430#endif
representation of ANS Version number in a comparable way
Header: timestamps and format version for detector CTF dictionary.
Header for CTF collection.
std::ostringstream debug
int32_t nSamples
uint32_t op
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error s
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc Replace constant variables static by constexpr expressions Compile RTC in deterministic with NO_FAST_MATH flags and GPUCA_DETERMINISTIC_MODE define Use RTC to optimize GPU code h configStandalone Processing proc_rtctech Use a file lock to serialize access to the cache folder int32_t
char error[CURL_ERROR_SIZE]
Class to check if give InteractionRecord or IRFrame is selected by the external IRFrame vector.
Definition of the Names Generator class.
uint32_t c
Definition RawData.h:2
TBranch * ptr
Class for time synchronization of RawReader instances.
static constexpr std::string_view CCDBOBJECT
Definition NameConf.h:66
static constexpr std::string_view CTFDICT
Definition NameConf.h:92
size_t getIRFrameSelMarginBwd() const
ctf::ANSHeader & getANSVersion()
void createCoder(OpType op, const o2::rans::RenormedDenseHistogram< S > &renormedHistogram, int slot)
static bool readFromTree(TTree &tree, const std::string brname, T &dest, int ev=0)
void setTrigOffsBinding(const std::string &s)
void setSupportBCShifts(bool v=true)
void updateTimeDependentParams(o2::framework::ProcessingContext &pc, bool askTree=false)
long getIRFrameSelShift() const
void setDictBinding(const std::string &s)
void init(o2::framework::InitContext &ic)
const DetID getDet() const
CTFCoderBase(OpType op, int n, DetID det, float memFactor=1.f, const std::string &ctfdictOpt="none")
void setMemMarginFactor(float v)
void setANSVersion(const ctf::ANSHeader &ansVersion) noexcept
const ctf::ANSHeader & getANSVersion() const noexcept
std::vector< char > readDictionaryFromFile(const std::string &dictPath, bool mayFail=false)
void setSelectedIRFrames(const SPAN &sp)
bool canApplyBCShift(const o2::InteractionRecord &ir) const
bool getSupportBCShifts() const
void setBCShift(int64_t n)
const std::string & getDictBinding() const
float getMemMarginFactor() const
std::vector< std::any > mCoders
o2::utils::IRFrameSelector & getIRFramesSelector()
std::string mTrigOffsBinding
const CTFDictHeader & getExtDictHeader() const
std::vector< char > loadDictionaryFromTree(TTree *tree)
bool isTreeDictionary(const void *buff) const
bool finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj)
CTFCoderBase(int n, DetID det, float memFactor=1.f, const std::string &ctfdictOpt="none")
void checkDictVersion(const CTFDictHeader &h) const
const std::string & getTrigOffsBinding() const
ctf::ANSHeader mANSVersion
CTFDictHeader mExtHeader
size_t getIRFrameSelMarginFwd() const
std::string getPrefix() const
auto getBCShift() const
virtual void createCoders(const std::vector< char > &bufVec, o2::ctf::CTFCoderBase::OpType op)=0
auto getFirstTFOrbit() const
size_t finaliseCTFOutput(BUF &buffer)
size_t estimateBufferSize(size_t slot, source_IT samplesBegin, source_IT samplesEnd)
void createCodersFromFile(const std::string &dictPath, o2::ctf::CTFCoderBase::OpType op, bool mayFail=false)
o2::utils::IRFrameSelector mIRFrameSelector
void setFirstTFOrbit(uint32_t n)
virtual ~CTFCoderBase()=default
virtual void assignDictVersion(CTFDictHeader &h) const
size_t estimateBufferSize(size_t slot, const std::vector< source_T > &samples)
bool canApplyBCShift(const o2::InteractionRecord &ir, long shift) const
Static class with identifiers, bitmasks and names for ALICE detectors.
Definition DetID.h:60
static constexpr const char * getName(ID id)
names of defined detectors
Definition DetID.h:148
static constexpr o2h::DataOrigin getDataOrigin(ID id)
Definition DetID.h:150
bool hasOption(const char *key) const
ConfigParamRegistry const & options()
Definition InitContext.h:33
static constexpr decltype(auto) fromRenormed(const RenormedHistogramConcept< container_T > &renormed)
Definition compat.h:221
static constexpr decltype(auto) fromRenormed(const RenormedHistogramConcept< container_T > &renormed)
Definition compat.h:174
static constexpr decltype(auto) fromRenormed(const RenormedHistogramConcept< container_T > &renormed)
Definition factory.h:106
static constexpr decltype(auto) fromRenormed(const RenormedDenseHistogram< source_T > &renormed)
Definition factory.h:195
void setSelectedIRFrames(const SPAN &sp, size_t bwd=0, size_t fwd=0, long shift=0, bool removeOverlaps=true)
functionality to maintain compatibility with previous version of this library
bool match(const std::vector< std::string > &queries, const char *pattern)
Definition dcs-ccdb.cxx:229
static factory classes for building histograms, encoders and decoders.
GLdouble n
Definition glcorearb.h:1982
const GLdouble * v
Definition glcorearb.h:832
GLsizei samples
Definition glcorearb.h:1309
public interface for building and renorming histograms from source data.
ANSHeader ansVersionFromString(const std::string &ansVersionString)
Definition ANSHeader.h:57
constexpr ANSHeader ANSVersionCompat
Definition ANSHeader.h:54
constexpr ANSHeader ANSVersion1
Definition ANSHeader.h:55
constexpr ANSHeader ANSVersionUnspecified
Definition ANSHeader.h:53
size_t calculateMaxBufferSizeB(size_t nElements, size_t rangeBits)
Definition compat.h:282
constexpr uint32_t getRangeBits(T min, T max) noexcept
Definition utils.h:200
auto makeHistogramView(container_T &container, std::ptrdiff_t offset) noexcept -> HistogramView< decltype(std::begin(container))>
HistogramView< Hist_IT > trim(const HistogramView< Hist_IT > &buffer)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
int64_t differenceInBC(const InteractionRecord &other) const
Detector header base.
std::string asString() const
o2::detectors::DetID::mask_t detectors
Definition CTFHeader.h:33
static std::string concat_string(Ts const &... ts)
o2::InteractionRecord ir(0, 0)
std::unique_ptr< TTree > tree((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))