LDMX Software
|
Provides information about a field within a DetectorID. More...
#include <IDField.h>
Public Types | |
typedef std::map< std::string, IDField * > | IDFieldMap |
Map of name to field. | |
typedef std::vector< IDField * > | IDFieldList |
List of fields. | |
Public Member Functions | |
IDField (std::string name, unsigned index, unsigned startBit, unsigned endBit) | |
Class constructor. | |
const std::string & | getFieldName () |
Get the name of the field. | |
unsigned | getIndex () |
Get the index of the field. | |
unsigned | getStartBit () |
Get the start bit of the field. | |
unsigned | getEndBit () |
Get the end bit of the field. | |
unsigned | getBitMask () |
Get a bit mask for this field. | |
Static Public Member Functions | |
static unsigned | createBitMask (unsigned startBit, unsigned endBit) |
Utility for creating a bit mask from a start to end bit. | |
static unsigned | countOnes (unsigned mask) |
Utility for counting number of 1 in a mask. | |
Private Attributes | |
std::string | fieldName_ |
The name of the field. | |
unsigned | index_ |
The index of the field. | |
unsigned | startBit_ |
The start bit of the field. | |
unsigned | endBit_ |
The end bit of the field. | |
unsigned | bitMask_ |
The bit mask of the field. | |
Provides information about a field within a DetectorID.
typedef std::vector<IDField*> ldmx::IDField::IDFieldList |
typedef std::map<std::string, IDField*> ldmx::IDField::IDFieldMap |
ldmx::IDField::IDField | ( | std::string | name, |
unsigned | index, | ||
unsigned | startBit, | ||
unsigned | endBit | ||
) |
Class constructor.
name | The name of the field. |
index | The index of the field in the ID. |
startBit | The start bit of the field. |
endBit | The end bit of the field. |
Definition at line 5 of file IDField.cxx.
References bitMask_, and createBitMask().
|
static |
Utility for counting number of 1 in a mask.
startBit | The start bit. |
endBit | The end bit. |
Definition at line 33 of file IDField.cxx.
|
static |
unsigned ldmx::IDField::getBitMask | ( | ) |
Get a bit mask for this field.
Definition at line 23 of file IDField.cxx.
References bitMask_.
Referenced by ldmx::DetectorIDInterpreter::getFieldValue().
unsigned ldmx::IDField::getEndBit | ( | ) |
Get the end bit of the field.
Definition at line 21 of file IDField.cxx.
References endBit_.
const std::string & ldmx::IDField::getFieldName | ( | ) |
Get the name of the field.
Definition at line 15 of file IDField.cxx.
References fieldName_.
unsigned ldmx::IDField::getIndex | ( | ) |
Get the index of the field.
Definition at line 17 of file IDField.cxx.
References index_.
unsigned ldmx::IDField::getStartBit | ( | ) |
Get the start bit of the field.
Definition at line 19 of file IDField.cxx.
References startBit_.
Referenced by ldmx::DetectorIDInterpreter::getFieldValue().
|
private |
The bit mask of the field.
Definition at line 104 of file IDField.h.
Referenced by getBitMask(), and IDField().
|
private |
|
private |
|
private |
|
private |