Belle II Software development
|
Class to uniquely identify a any structure of the PXD and SVD. More...
#include <VxdID.h>
Public Types | |
enum | { LayerBits = 3 , LadderBits = 5 , SensorBits = 3 , SegmentBits = 5 , Bits = LayerBits + LadderBits + SensorBits + SegmentBits , MaxLayer = (1 << LayerBits) - 1 , MaxLadder = (1 << LadderBits) - 1 , MaxSensor = (1 << SensorBits) - 1 , MaxSegment = (1 << SegmentBits) - 1 , MaxID = (1 << Bits) - 1 } |
typedef unsigned short | baseType |
The base integer type for VxdID. | |
Public Member Functions | |
VxdID (baseType id=0) | |
Constructor using the unique id. | |
VxdID (baseType layer, baseType ladder, baseType sensor, baseType segment=0) | |
Constructor using layer, ladder and sensor ids. | |
VxdID (const std::string &sensor) | |
Construct ID from string representing the structure. | |
VxdID (const VxdID &b) | |
Copy constructor. | |
VxdID & | operator= (const VxdID &b) |
Assignment operator. | |
VxdID & | operator= (baseType id) |
Assignment from baseType. | |
operator baseType () const | |
Convert to baseType. | |
operator std::string () const | |
Convert to string. | |
bool | operator== (const VxdID &b) const |
Check for equality. | |
bool | operator< (const VxdID &b) const |
Order by unique id. | |
baseType | getID () const |
Get the unique id. | |
baseType | getLayerNumber () const |
Get the layer id. | |
baseType | getLadderNumber () const |
Get the ladder id. | |
baseType | getSensorNumber () const |
Get the sensor id. | |
baseType | getSegmentNumber () const |
Get the sensor segment. | |
void | setID (baseType id) |
Set the unique id. | |
void | setLayerNumber (baseType layer) |
Set the layer id. | |
void | setLadderNumber (baseType ladder) |
Set the ladder id. | |
void | setSensorNumber (baseType sensor) |
Set the sensor id. | |
void | setSegmentNumber (baseType segment) |
Set the sensor segment. | |
std::string | __str__ () const |
make this type printable in python with print(vxd_id) | |
Private Attributes | |
union { | |
baseType id: Bits | |
Unique id. More... | |
struct { | |
baseType segment: SegmentBits | |
Segment id. More... | |
baseType sensor: SensorBits | |
Sensor id. More... | |
baseType ladder: LadderBits | |
Ladder id. More... | |
baseType layer: LayerBits | |
Layer id. More... | |
} parts | |
< Struct to contain all id components | |
} | m_id |
Union to store the ID and all components in one go. | |
Class to uniquely identify a any structure of the PXD and SVD.
Internal use of a union gets rid of all the bit shifting which would be neccessary to represent the id as one baseType and get all the components out of it. Disadvantage is that it is not guaranteed to be portable, but neither is bit shifting
typedef unsigned short baseType |
anonymous enum |
Enumerator | |
---|---|
LayerBits | Number of bits available to represent a layer. |
LadderBits | Number of bits available to represent a ladder. |
SensorBits | Number of bits available to represent a sensor. |
SegmentBits | Number of bits available to represent segmentation of the sensor. |
Bits | Total bit size of the VxdID. |
MaxLayer | Maximum valid Layer ID. |
MaxLadder | Maximum valid Ladder ID. |
MaxSensor | Maximum valid Sensor ID. |
MaxSegment | Maximum valid Segment ID. |
MaxID | Maximum value for ID. |
Definition at line 37 of file VxdID.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |