ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Attributes | List of all members
CaloCellPackerUtils::Floatfield2 Class Reference

Helper for packing a float into/out of a bit field, with a minimum of 0. More...

#include <CaloCellPackerUtils.h>

Inheritance diagram for CaloCellPackerUtils::Floatfield2:
Collaboration diagram for CaloCellPackerUtils::Floatfield2:

Public Member Functions

 Floatfield2 (unsigned int mask=1, double xmax=1)
 Constructor. More...
 
unsigned int in (double x) const
 Shift and mask a value into the bitfield. More...
 
double out (unsigned int x) const
 Extract a value from the bitfield. More...
 
unsigned int in (unsigned int x) const
 Shift and mask a value into 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_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...
 

Detailed Description

Helper for packing a float into/out of a bit field, with a minimum of 0.

This is just like Floatfield, specialized for the case where xmin==0.

Definition at line 130 of file CaloCellPackerUtils.h.

Constructor & Destructor Documentation

◆ Floatfield2()

CaloCellPackerUtils::Floatfield2::Floatfield2 ( unsigned int  mask = 1,
double  xmax = 1 
)

Constructor.

Parameters
Thebit mask. Should contain a single contiguous string of 1's.
xmaxThe largest storable value.

Definition at line 61 of file CaloCellPackerUtils.cxx.

63  : Bitfield (mask),
64  m_xmax (xmax),
65  m_fact (xmax / (m_mask + 1)),
66  m_ifact (1/m_fact)
67 {
68 }

Member Function Documentation

◆ in() [1/2]

unsigned int CaloCellPackerUtils::Floatfield2::in ( double  x) const

Shift and mask a value into the bitfield.

Parameters
xThe input value.
Returns
The converted value shifted and masked to go into the bitfield.

◆ in() [2/2]

unsigned int CaloCellPackerUtils::Bitfield::in ( unsigned int  x) const
inherited

Shift and mask a value into the bitfield.

Parameters
xThe input value.
Returns
The value shifted and masked to go into the bitfield.

◆ out()

double CaloCellPackerUtils::Floatfield2::out ( unsigned int  x) const

Extract a value from the bitfield.

Parameters
xThe input bitfield.
Returns
The value extracted from the bitfield.

Member Data Documentation

◆ m_fact

double CaloCellPackerUtils::Floatfield2::m_fact
private

Cached factor for int->float conversions.

Definition at line 163 of file CaloCellPackerUtils.h.

◆ m_ifact

double CaloCellPackerUtils::Floatfield2::m_ifact
private

Cached factor for float->int conversions.

Definition at line 166 of file CaloCellPackerUtils.h.

◆ m_mask

unsigned int CaloCellPackerUtils::Bitfield::m_mask
protectedinherited

Bitmask. Lower bit should be 1.

Definition at line 64 of file CaloCellPackerUtils.h.

◆ m_shift

unsigned int CaloCellPackerUtils::Bitfield::m_shift
protectedinherited

Shift count.

Definition at line 67 of file CaloCellPackerUtils.h.

◆ m_xmax

double CaloCellPackerUtils::Floatfield2::m_xmax
private

Largest representable value.

Definition at line 160 of file CaloCellPackerUtils.h.


The documentation for this class was generated from the following files:
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
CaloCellPackerUtils::Bitfield::Bitfield
Bitfield(unsigned int mask=1)
Constructor.
Definition: CaloCellPackerUtils.cxx:25
CaloCellPackerUtils::Floatfield2::m_xmax
double m_xmax
Largest representable value.
Definition: CaloCellPackerUtils.h:160
CaloCellPackerUtils::Bitfield::m_mask
unsigned int m_mask
Bitmask. Lower bit should be 1.
Definition: CaloCellPackerUtils.h:64
CaloCellPackerUtils::Floatfield2::m_ifact
double m_ifact
Cached factor for float->int conversions.
Definition: CaloCellPackerUtils.h:166
CaloCellPackerUtils::Floatfield2::m_fact
double m_fact
Cached factor for int->float conversions.
Definition: CaloCellPackerUtils.h:163
xmax
double xmax
Definition: listroot.cxx:61