ATLAS Offline Software
|
Helper for packing a float into/out of a bit field. More...
#include <CaloCellPackerUtils.h>
Public Member Functions | |
Floatfield (unsigned int mask=1, double xmin=1, double xmax=0) | |
Constructor. More... | |
unsigned int | in (double x) const |
Shift and mask a value into the bitfield. More... | |
double | out (unsigned int x, int &underflow) const |
Extract a value from the bitfield. More... | |
unsigned int | in (unsigned int x) const |
Shift and mask a value into the bitfield. More... | |
unsigned int | out (unsigned int x) const |
Extract a value from the bitfield. More... | |
Protected Attributes | |
unsigned int | m_mask |
Bitmask. Lower bit should be 1. More... | |
unsigned int | m_shift |
Shift count. More... | |
Private Attributes | |
double | m_xmin |
Smallest representable value. More... | |
double | m_xmax |
Largest representable value. More... | |
double | m_fact |
Cached factor for int->float conversions. More... | |
double | m_ifact |
Cached factor for float->int conversions. More... | |
Helper for packing a float into/out of a bit field.
This works like the bitfield class above, except that the in/
take floating-point values. The field takes a min/max range of values; the input value is converted to a fraction within the range, and that fraction is stored. out
methods
Definition at line 79 of file CaloCellPackerUtils.h.
CaloCellPackerUtils::Floatfield::Floatfield | ( | unsigned int | mask = 1 , |
double | xmin = 1 , |
||
double | xmax = 0 |
||
) |
Constructor.
The | bit mask. Should contain a single contiguous string of 1's. |
xmin | The smallest storable value. |
xmax | The largest storable value. |
Definition at line 44 of file CaloCellPackerUtils.cxx.
unsigned int CaloCellPackerUtils::Floatfield::in | ( | double | x | ) | const |
Shift and mask a value into the bitfield.
x | The input value. |
|
inherited |
Shift and mask a value into the bitfield.
x | The input value. |
|
inherited |
Extract a value from the bitfield.
x | The input bitfield. |
double CaloCellPackerUtils::Floatfield::out | ( | unsigned int | x, |
int & | underflow | ||
) | const |
Extract a value from the bitfield.
x | The input bitfield. |
underflag[out] | Set to 1 if the value was the lowest possible. |
|
private |
Cached factor for int->float conversions.
Definition at line 117 of file CaloCellPackerUtils.h.
|
private |
Cached factor for float->int conversions.
Definition at line 120 of file CaloCellPackerUtils.h.
|
protectedinherited |
Bitmask. Lower bit should be 1.
Definition at line 64 of file CaloCellPackerUtils.h.
|
protectedinherited |
Shift count.
Definition at line 67 of file CaloCellPackerUtils.h.
|
private |
Largest representable value.
Definition at line 114 of file CaloCellPackerUtils.h.
|
private |
Smallest representable value.
Definition at line 111 of file CaloCellPackerUtils.h.