 |
Belle II Software
release-05-01-25
|
25 unsigned int ilog2(
unsigned int v);
53 void putNBits(
unsigned int value,
unsigned int n)
55 unsigned int bpos =
m_pos % 32, wpos =
m_pos / 32;
56 value &= 0xffffffffu >> (32 - n);
58 if (bpos + n > 32)
m_store[wpos + 1] = value >> (32 - bpos);
66 unsigned int getNBits(
unsigned int n)
68 unsigned int bpos =
m_pos % 32, wpos =
m_pos / 32;
69 unsigned int res =
m_store[wpos] >> bpos;
70 if (bpos + n > 32) res |=
m_store[wpos + 1] << (32 - bpos);
72 return res & (0xffffffffu >> (32 - n));
91 std::vector<unsigned int>
m_store;
140 class ECLDeltaCompress:
public ECLCompress {
142 void compress(BitStream& out,
const int* adc)
override;
143 void uncompress(BitStream& out,
int* adc)
override;
149 class ECLDCTCompress:
public ECLCompress {
const double m_scale
Scale factor for quantization.
const double m_c0
Average waveform amplitude.
ECL waveform compression/decompression to/from the BitStream storage with the BASE algorithm.
void resize()
Resize data vector to the current position.
unsigned char w0
Progressive bit width to encode an integer value.
unsigned char w1
Progressive bit width to encode an integer value.
void setPos(size_t pos)
Set position in the stream.
std::vector< unsigned int > m_store
The bit storage.
void compress(BitStream &out, const int *adc) override
Compress the ECL waveform.
unsigned char w2
Progressive bit width to encode an integer value.
virtual void uncompress(BitStream &in, int *adc)=0
Decompress the ECL waveform.
BitStream()
Default constructor for ROOT.
Bit widths for the prefix coding to encode integers which are mainly concentrated around zero and pro...
size_t m_pos
Current position in the storage.
const width_t * m_widths
Bit widths for the DCT coefficients for prefix encoding.
Abstract base class for different kinds of events.
Abstract class (interface) for ECL waveform compression/decompression to/from the BitStream storage.
virtual ~ECLCompress()
virtual destructure
unsigned int getNBits(unsigned int n)
Fetch n bits.
ECLDCTCompress(double scale, double c0, width_t *w)
Constructor for DCT based compression algorithm.
void uncompress(BitStream &out, int *adc) override
Decompress the ECL waveform.
std::vector< unsigned int > & getStore()
Get data vector.
void putNBits(unsigned int value, unsigned int n)
Push n least significant bits of "value" to the stream.
unsigned char w3
Progressive bit width to encode an integer value.
void uncompress(BitStream &out, int *adc) override
Decompress the ECL waveform.
void uncompress(BitStream &out, int *adc) override
Decompress the ECL waveform.
virtual void compress(BitStream &out, const int *adc)=0
Compress the ECL waveform.
size_t getPos() const
Get current position in the stream.
void compress(BitStream &out, const int *adc) override
Compress the ECL waveform.
void compress(BitStream &out, const int *adc) override
Compress the ECL waveform.