Belle II Software  release-08-01-10
VxdID Class Reference

Class to uniquely identify a any structure of the PXD and SVD. More...

#include <VxdID.h>

Collaboration diagram for VxdID:

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.
 
VxdIDoperator= (const VxdID &b)
 Assignment operator.
 
VxdIDoperator= (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.
 
   struct {
      baseType   segment: SegmentBits
 Segment id.
 
      baseType   sensor: SensorBits
 Sensor id.
 
      baseType   ladder: LadderBits
 Ladder id.
 
      baseType   layer: LayerBits
 Layer id.
 
   }   parts
 < Struct to contain all id components
 
m_id
 Union to store the ID and all components in one go.
 

Detailed Description

Class to uniquely identify a any structure of the PXD and SVD.

  • Ladder, Layer and Sensor all start at 1
  • Ladders are numbered with increasing phi
  • Sensors are numbered from front to back
  • Segment ID is used for PXD to encode frame number. Currently no use for 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

Definition at line 33 of file VxdID.h.

Member Enumeration Documentation

◆ anonymous enum

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.

37  {
39  LayerBits = 3,
41  LadderBits = 5,
43  SensorBits = 3,
45  SegmentBits = 5,
48 
50  MaxLayer = (1 << LayerBits) - 1,
52  MaxLadder = (1 << LadderBits) - 1,
54  MaxSensor = (1 << SensorBits) - 1,
56  MaxSegment = (1 << SegmentBits) - 1,
58  MaxID = (1 << Bits) - 1
59  };
@ LadderBits
Number of bits available to represent a ladder.
Definition: VxdID.h:41
@ SensorBits
Number of bits available to represent a sensor.
Definition: VxdID.h:43
@ MaxLayer
Maximum valid Layer ID.
Definition: VxdID.h:50
@ SegmentBits
Number of bits available to represent segmentation of the sensor.
Definition: VxdID.h:45
@ MaxLadder
Maximum valid Ladder ID.
Definition: VxdID.h:52
@ MaxID
Maximum value for ID.
Definition: VxdID.h:58
@ MaxSegment
Maximum valid Segment ID.
Definition: VxdID.h:56
@ LayerBits
Number of bits available to represent a layer.
Definition: VxdID.h:39
@ MaxSensor
Maximum valid Sensor ID.
Definition: VxdID.h:54
@ Bits
Total bit size of the VxdID.
Definition: VxdID.h:47

The documentation for this class was generated from the following files: