Project
Loading...
Searching...
No Matches
Metadata.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
14
16
17#ifndef ALICEO2_METADATA_H
18#define ALICEO2_METADATA_H
19
20#include <cstddef>
21#include <Rtypes.h>
22
23namespace o2::ctf
24{
25
26struct Metadata {
27 enum class OptStore : uint8_t { // describe how the store the data described by this metadata
28 EENCODE, // entropy encoding applied
29 ROOTCompression, // original data repacked to array with slot-size = streamSize and saved with root compression
30 NONE, // original data repacked to array with slot-size = streamSize and saved w/o compression
31 NODATA, // no data was provided
32 PACK, // use Bitpacking
33 EENCODE_OR_PACK // decide at runtime if to encode or pack
34 };
35 uint8_t nStreams = 0; // Amount of concurrent Streams used by the encoder. only used by rANS version >=1.
36 size_t messageLength = 0; // Message length (multiply with messageWordSize to get size in Bytes).
37 size_t nLiterals = 0; // Number of samples that were stored as literals.
38 uint8_t messageWordSize = 0; // size in Bytes of a symbol in the encoded message.
39 uint8_t coderType = 0; // what type of CTF Coder is used? (32 vs 64 bit coders).
40 uint8_t streamSize = 0; // number of Bytes emmitted during rANS stream out (ransCompat) or lower renorming bound (ransV1).
41 uint8_t probabilityBits = 0; // The encoder renormed the distribution of source symbols to sum up to 2^probabilityBits.
42 OptStore opt = OptStore::EENCODE; // The type of storage operation that was conducted.
43 int32_t min = 0; // min symbol of the source dataset.
44 int32_t max = 0; // max symbol of the source dataset.
45 int32_t literalsPackingOffset = 0; // Offset from 0 used for bit packing of literal (incompressible) symbols. only used by rANS version >=1.
46 uint8_t literalsPackingWidth = 0; // Amount of bits used to pack literal (incompressible) symbols. only used by rANS version >=1.
47 int nDictWords = 0; // Amount of words used to store the encoding dictionary.
48 int nDataWords = 0; // Amount of words used to store the actual data.
49 int nLiteralWords = 0; // Amount of words used to store literal (incompressible) samples.
50
57
66 void clear()
67 {
68 nStreams = 0;
69 messageLength = 0;
70 nLiterals = 0;
72 coderType = 0;
73 streamSize = 0;
75 min = 0;
76 max = 0;
79 nDictWords = 0;
80 nDataWords = 0;
81 nLiteralWords = 0;
82 }
84};
85
86namespace detail
87{
88
89template <typename source_T, typename state_T, typename stream_T>
90[[nodiscard]] inline constexpr Metadata makeMetadataRansCompat(size_t nStreams, size_t messageLength,
91 size_t nLiterals, size_t symbolTablePrecision,
92 source_T min, source_T max, size_t dictWords,
93 size_t dataWords, size_t literalWords) noexcept
94{
95 return Metadata{
96 static_cast<uint8_t>(nStreams),
97 messageLength,
98 nLiterals,
99 static_cast<uint8_t>(sizeof(source_T)),
100 static_cast<uint8_t>(sizeof(state_T)),
101 static_cast<uint8_t>(sizeof(stream_T)),
102 static_cast<uint8_t>(symbolTablePrecision),
104 static_cast<int32_t>(min),
105 static_cast<int32_t>(max),
106 static_cast<int32_t>(0),
107 static_cast<uint8_t>(sizeof(source_T)),
108 static_cast<int32_t>(dictWords),
109 static_cast<int32_t>(dataWords),
110 static_cast<int32_t>(literalWords)};
111};
112
113template <typename source_T>
114[[nodiscard]] inline constexpr Metadata makeMetadataRansDict(size_t symbolTablePrecision, source_T min,
115 source_T max, size_t dictWords, ctf::Metadata::OptStore optStore) noexcept
116{
117 return Metadata{
118 static_cast<uint8_t>(0),
119 static_cast<uint8_t>(0),
120 static_cast<uint8_t>(0),
121 static_cast<uint8_t>(sizeof(source_T)),
122 static_cast<uint8_t>(0),
123 static_cast<uint8_t>(0),
124 static_cast<uint8_t>(symbolTablePrecision),
125 optStore,
126 static_cast<int32_t>(min),
127 static_cast<int32_t>(max),
128 static_cast<int32_t>(0),
129 static_cast<uint8_t>(0),
130 static_cast<int32_t>(dictWords),
131 static_cast<int32_t>(0),
132 static_cast<int32_t>(0)};
133};
134
135template <typename source_T, typename state_T, typename stream_T>
136[[nodiscard]] inline constexpr Metadata makeMetadataRansV1(size_t nStreams, size_t streamingLowerBound, size_t messageLength,
137 size_t nLiterals, size_t symbolTablePrecision,
138 source_T dictMin, source_T dictMax,
139 source_T literalsOffset, size_t literalsPackingWidth, size_t dictWords,
140 size_t dataWords, size_t literalWords) noexcept
141{
142 return Metadata{
143 static_cast<uint8_t>(nStreams),
144 messageLength,
145 nLiterals,
146 static_cast<uint8_t>(sizeof(source_T)),
147 static_cast<uint8_t>(sizeof(state_T)),
148 static_cast<uint8_t>(streamingLowerBound),
149 static_cast<uint8_t>(symbolTablePrecision),
151 static_cast<int32_t>(dictMin),
152 static_cast<int32_t>(dictMax),
153 static_cast<int32_t>(literalsOffset),
154 static_cast<uint8_t>(literalsPackingWidth),
155 static_cast<int32_t>(dictWords),
156 static_cast<int32_t>(dataWords),
157 static_cast<int32_t>(literalWords)};
158};
159
160template <typename source_T>
161[[nodiscard]] inline constexpr Metadata makeMetadataPack(size_t messageLength, size_t packingWidth,
162 source_T packingOffset, size_t dataWords) noexcept
163{
164 return Metadata{
165 static_cast<uint8_t>(1),
166 messageLength,
167 static_cast<size_t>(0),
168 static_cast<uint8_t>(sizeof(source_T)),
169 static_cast<uint8_t>(0),
170 static_cast<uint8_t>(0),
171 static_cast<uint8_t>(packingWidth),
173 static_cast<int32_t>(packingOffset),
174 static_cast<int32_t>(0),
175 static_cast<int32_t>(0),
176 static_cast<uint8_t>(0),
177 static_cast<int32_t>(0),
178 static_cast<int32_t>(dataWords),
179 static_cast<int32_t>(0)};
180};
181
182template <typename source_T, typename buffer_T>
183[[nodiscard]] inline constexpr Metadata makeMetadataStore(size_t messageLength, Metadata::OptStore opStore, size_t dataWords) noexcept
184{
185 return Metadata{
186 static_cast<uint8_t>(0),
187 messageLength,
188 static_cast<size_t>(0),
189 static_cast<uint8_t>(sizeof(source_T)),
190 static_cast<uint8_t>(0),
191 static_cast<uint8_t>(sizeof(buffer_T)),
192 static_cast<uint8_t>(0),
193 opStore,
194 static_cast<int32_t>(0),
195 static_cast<int32_t>(0),
196 static_cast<int32_t>(0),
197 static_cast<int32_t>(0),
198 static_cast<int32_t>(0),
199 static_cast<int32_t>(dataWords),
200 static_cast<int32_t>(0)};
201};
202
203} // namespace detail
204} // namespace o2::ctf
205
206#endif
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
constexpr Metadata makeMetadataRansCompat(size_t nStreams, size_t messageLength, size_t nLiterals, size_t symbolTablePrecision, source_T min, source_T max, size_t dictWords, size_t dataWords, size_t literalWords) noexcept
Definition Metadata.h:90
constexpr Metadata makeMetadataRansDict(size_t symbolTablePrecision, source_T min, source_T max, size_t dictWords, ctf::Metadata::OptStore optStore) noexcept
Definition Metadata.h:114
constexpr Metadata makeMetadataPack(size_t messageLength, size_t packingWidth, source_T packingOffset, size_t dataWords) noexcept
Definition Metadata.h:161
constexpr Metadata makeMetadataStore(size_t messageLength, Metadata::OptStore opStore, size_t dataWords) noexcept
Definition Metadata.h:183
constexpr Metadata makeMetadataRansV1(size_t nStreams, size_t streamingLowerBound, size_t messageLength, size_t nLiterals, size_t symbolTablePrecision, source_T dictMin, source_T dictMax, source_T literalsOffset, size_t literalsPackingWidth, size_t dictWords, size_t dataWords, size_t literalWords) noexcept
Definition Metadata.h:136
pair of input and output size
Definition ANSHeader.h:25
size_t getUncompressedSize() const
Uncompressed size of stored data in bytes.
Definition Metadata.h:56
uint8_t messageWordSize
Definition Metadata.h:38
uint8_t nStreams
Definition Metadata.h:35
ClassDefNV(Metadata, 3)
uint8_t literalsPackingWidth
Definition Metadata.h:46
size_t messageLength
Definition Metadata.h:36
uint8_t probabilityBits
Definition Metadata.h:41
uint8_t streamSize
Definition Metadata.h:40
int32_t literalsPackingOffset
Definition Metadata.h:45
uint8_t coderType
Definition Metadata.h:39
size_t getCompressedSize() const
Size of the stored, compressed data in multiples of the underlying buffer word size.
Definition Metadata.h:65
constexpr size_t min
constexpr size_t max