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

The class collects utility functions for numbering layers, sensors snd chips based on current VXD geometry. More...

#include <GeoTools.h>

Collaboration diagram for GeoTools:

Public Member Functions

 GeoTools ()
 Constructor builds lookup maps from GeoCache. More...
 
unsigned short getNumberOfLayers () const
 Get number of VXD layers. More...
 
unsigned short getNumberOfPXDLayers () const
 Get number of PXD layers. More...
 
unsigned short getNumberOfSVDLayers () const
 Get number of SVD layers. More...
 
std::vector< unsigned short > getLayers () const
 Get numbers of VXD layers. More...
 
std::vector< unsigned short > getPXDLayers () const
 Get numbers of PXD layers. More...
 
std::vector< unsigned short > getSVDLayers () const
 Get numbers of SVD layers. More...
 
unsigned short getFirstLayer () const
 Get first (innermost) layer number. More...
 
unsigned short getLastLayer () const
 Get last (outermost) layer number. More...
 
short getFirstPXDLayer () const
 Get first (innermost) PXD layer number. More...
 
short getLastPXDLayer () const
 Get last (outermost) PXD layer number. More...
 
short getFirstSVDLayer () const
 Get first (innermost) SVD layer number. More...
 
short getLastSVDLayer () const
 Get last (outermost) SVD layer number. More...
 
unsigned short getNumberOfSensors () const
 Get total number of sensors. More...
 
unsigned short getNumberOfPXDSensors () const
 Get number of PXD sensors. More...
 
unsigned short getNumberOfSVDSensors () const
 Get number of SVD sensors. More...
 
size_t getTotalPXDChips () const
 Get total number of chips in PXD. More...
 
unsigned short getNumberOfPXDUSideChips () const
 Get number of u-side PXD chips. More...
 
unsigned short getNumberOfPXDVSideChips () const
 Get number of v-side PXD chips. More...
 
unsigned short getNumberOfPXDReadoutGates () const
 Get number of PXD readout gates. More...
 
size_t getTotalSVDChips () const
 Get total number of chips in SVD. More...
 
unsigned short getNumberOfSVDUSideChips () const
 Get number of u-side SVD chips. More...
 
unsigned short getNumberOfSVDVSideChips (unsigned short layer) const
 Get number of v-side SVD chips. More...
 
unsigned short getSVDChannelsPerChip () const
 Get number of strips per APV chip in SVD. More...
 
int getSensorIndex (VxdID sensorID) const
 Return index of s VXD sensor for plotting. More...
 
VxdID getSensorIDFromIndex (int vxdIndex) const
 Reverse lookup VxdID from list index. More...
 
int getPXDSensorIndex (VxdID sensorID) const
 Return index of sensor in plots. More...
 
int getPXDSensorIndex (int layer, int ladder, int sensor) const
 Return index of sensor in plots. More...
 
VxdID getSensorIDFromPXDIndex (int pxdIndex) const
 Return index of a PXD sensor in plots. More...
 
int getPXDChipIndex (VxdID sensorID, bool isU, int chip) const
 Return PXD chip index in the list of PXD chips. More...
 
int getPXDChipIndex (int layer, int ladder, int sensor, bool isU, int chip) const
 Return PXD chip index in the list of PXD chips. More...
 
VxdID getChipIDFromPXDIndex (int pxdChipIndex) const
 Return chipID (VxdID + side and chipNo) for index in the list. More...
 
bool isPXDSideU (VxdID chipID) const
 Decode sensor side from a PXD ChipID. More...
 
unsigned short getPXDChipNumber (VxdID chipID) const
 Decode (1-based) chip number from a PXD ChipID. More...
 
int getSVDSensorIndex (VxdID sensorID) const
 Return index of SVD sensor in plots. More...
 
int getSVDSensorIndex (int layer, int ladder, int sensor) const
 Return index of SVD sensor in plots. More...
 
VxdID getSensorIDFromSVDIndex (int svdIndex) const
 Return VxdID for SVD index of sensor in plots. More...
 
int getSVDChipIndex (VxdID sensorID, bool isU, int chip) const
 Return SVD chip index in the list of SVD chips. More...
 
int getSVDChipIndex (int layer, int ladder, int sensor, bool isU, int chip) const
 Return SVD chip index in the list of SVD chips. More...
 
VxdID getChipIDFromSVDIndex (int svdChipIndex) const
 Return chipID (VxdID with side and chipNo) for index in the list. More...
 
bool isSVDSideU (VxdID chipID) const
 Decode sensor side from a SVD ChipID. More...
 
unsigned short getSVDChipNumber (VxdID chipID) const
 Decode (1-based) chip number from a SVD ChipID. More...
 
int getLayerIndex (unsigned short layer) const
 Return index of layer in plots. More...
 
unsigned short getLayerNumberFromLayerIndex (int index) const
 Return layer number for list index. More...
 

Private Member Functions

void createListOfLayers ()
 Create list of VXD layers.
 
void createListOfPXDChips ()
 Create list of PXD chips.
 
void createListOfSVDChips ()
 Create list of SVD chips.
 

Private Attributes

std::vector< VxdIDm_listOfSensors
 List of all VXD sesnros.
 
size_t m_firstSVDIndex
 Number of the first SVD sensor in the list.
 
std::vector< unsigned short > m_listOfLayers
 List of all VXD layers.
 
unsigned short m_firstSVDLayer
 List index of the first SVD layer.
 
std::vector< VxdIDm_listOfPXDChips
 List of all PXD chips.
 
std::vector< VxdIDm_listOfSVDChips
 List of all SVD chips.
 
const unsigned short c_nPXDChipsU = 4
 Number of PXD chips per sensor in u (DCD) (=4) on Belle II.
 
const unsigned short c_nPXDChipsV = 6
 Number of PXD chips per sensor in v (Switchers) (=6) on Belle II.
 
const unsigned short c_nPXDReadoutGates = 192
 Number of PXD readout gates (or total number of Switcher channels) on Belle II.
 
const unsigned short c_nSVDChipsL3 = 6
 Number of SVD chips per sensor in u,v in layer 3 (=6) on Belle II.
 
const unsigned short c_nSVDChipsLu = 6
 Number of SVD chips per sensor in u in layers 4,5,6 (=6) on Belle II.
 
const unsigned short c_nSVDChipsLv = 4
 Number of SVD chips per sensor in v in layers 4,5,6 (=4) on Belle II.
 
const unsigned short c_nSVDChannelsPerChip = 128
 Number of SVD strips per chip on Belle II.
 

Detailed Description

The class collects utility functions for numbering layers, sensors snd chips based on current VXD geometry.

Definition at line 25 of file GeoTools.h.

Constructor & Destructor Documentation

◆ GeoTools()

GeoTools ( )

Constructor builds lookup maps from GeoCache.

The constructor calls VXD::GeoCache, should be called in initialize() method of modules, not in module constructor.

Definition at line 17 of file GeoTools.cc.

18 {
21  // The list comes from a map, and is NOT sorted!
22  std::sort(m_listOfSensors.begin(), m_listOfSensors.end());
23  m_firstSVDIndex = std::distance(
24  m_listOfSensors.begin(),
25  std::find_if(m_listOfSensors.begin(), m_listOfSensors.end(),
26  [](VxdID id)->bool { return (id.getLayerNumber() > 2); })
27  ); // works correctly even with no SVD sensors
31 }
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
Definition: GeoCache.h:39
const std::vector< VxdID > getListOfSensors() const
Get list of all sensors.
Definition: GeoCache.cc:59
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214
void createListOfLayers()
Create list of VXD layers.
Definition: GeoTools.cc:34
size_t m_firstSVDIndex
Number of the first SVD sensor in the list.
Definition: GeoTools.h:459
void createListOfPXDChips()
Create list of PXD chips.
Definition: GeoTools.cc:52
void createListOfSVDChips()
Create list of SVD chips.
Definition: GeoTools.cc:73
std::vector< VxdID > m_listOfSensors
List of all VXD sesnros.
Definition: GeoTools.h:456
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33

Member Function Documentation

◆ getChipIDFromPXDIndex()

VxdID getChipIDFromPXDIndex ( int  pxdChipIndex) const
inline

Return chipID (VxdID + side and chipNo) for index in the list.

Parameters
pxdChipIndexIndex in the list of PXD sensors.
Returns
chipID: VxdID + chip number/side encoded in segment part.

Definition at line 286 of file GeoTools.h.

287  {
288  return m_listOfPXDChips[pxdChipIndex];
289  }
std::vector< VxdID > m_listOfPXDChips
List of all PXD chips.
Definition: GeoTools.h:468

◆ getChipIDFromSVDIndex()

VxdID getChipIDFromSVDIndex ( int  svdChipIndex) const
inline

Return chipID (VxdID with side and chipNo) for index in the list.

Parameters
svdChipIndexIndex in the list of SVD sensors.
Returns
chipID: VxdID with chip number/side encoded in segment part.

Definition at line 384 of file GeoTools.h.

◆ getFirstLayer()

unsigned short getFirstLayer ( ) const
inline

Get first (innermost) layer number.

Returns
number of innermost layer

Definition at line 86 of file GeoTools.h.

◆ getFirstPXDLayer()

short getFirstPXDLayer ( ) const
inline

Get first (innermost) PXD layer number.

Returns
number of innermost PXD layer, -1 if no PXD layers

Definition at line 96 of file GeoTools.h.

◆ getFirstSVDLayer()

short getFirstSVDLayer ( ) const
inline

Get first (innermost) SVD layer number.

Returns
number of innermost SVD layer, -1 if no SVD layers

Definition at line 112 of file GeoTools.h.

◆ getLastLayer()

unsigned short getLastLayer ( ) const
inline

Get last (outermost) layer number.

Returns
number of last (outermost) layer

Definition at line 91 of file GeoTools.h.

◆ getLastPXDLayer()

short getLastPXDLayer ( ) const
inline

Get last (outermost) PXD layer number.

Returns
number of last (outermost) layer -1 if no PXD layers

Definition at line 104 of file GeoTools.h.

◆ getLastSVDLayer()

short getLastSVDLayer ( ) const
inline

Get last (outermost) SVD layer number.

Returns
number of last (outermost) layer -1 if no SVD layers

Definition at line 120 of file GeoTools.h.

◆ getLayerIndex()

int getLayerIndex ( unsigned short  layer) const
inline

Return index of layer in plots.

Parameters
layerlayer number.
Returns
Index of layer in plots.

Definition at line 426 of file GeoTools.h.

◆ getLayerNumberFromLayerIndex()

unsigned short getLayerNumberFromLayerIndex ( int  index) const
inline

Return layer number for list index.

Parameters
indexList index of the layer
Returns
Layer number

Definition at line 438 of file GeoTools.h.

◆ getLayers()

std::vector<unsigned short> getLayers ( ) const
inline

Get numbers of VXD layers.

Returns
std::vector with numbers of VXD layers

Definition at line 57 of file GeoTools.h.

◆ getNumberOfLayers()

unsigned short getNumberOfLayers ( ) const
inline

Get number of VXD layers.

Returns
number of VXD layers in current geometry

Definition at line 41 of file GeoTools.h.

◆ getNumberOfPXDLayers()

unsigned short getNumberOfPXDLayers ( ) const
inline

Get number of PXD layers.

Returns
number of PXD layers in current geometry

Definition at line 46 of file GeoTools.h.

◆ getNumberOfPXDReadoutGates()

unsigned short getNumberOfPXDReadoutGates ( ) const
inline

Get number of PXD readout gates.

Returns
number of v-side PXD readout gates

Definition at line 164 of file GeoTools.h.

◆ getNumberOfPXDSensors()

unsigned short getNumberOfPXDSensors ( ) const
inline

Get number of PXD sensors.

Returns
number of PXD sensors

Definition at line 133 of file GeoTools.h.

◆ getNumberOfPXDUSideChips()

unsigned short getNumberOfPXDUSideChips ( ) const
inline

Get number of u-side PXD chips.

Returns
number of u-side chips

Definition at line 152 of file GeoTools.h.

◆ getNumberOfPXDVSideChips()

unsigned short getNumberOfPXDVSideChips ( ) const
inline

Get number of v-side PXD chips.

Returns
number of v-side chips

Definition at line 158 of file GeoTools.h.

◆ getNumberOfSensors()

unsigned short getNumberOfSensors ( ) const
inline

Get total number of sensors.

Returns
total number of sensors, PXD+SVD

Definition at line 128 of file GeoTools.h.

◆ getNumberOfSVDLayers()

unsigned short getNumberOfSVDLayers ( ) const
inline

Get number of SVD layers.

Returns
number of SVD layers in current geometry

Definition at line 51 of file GeoTools.h.

◆ getNumberOfSVDSensors()

unsigned short getNumberOfSVDSensors ( ) const
inline

Get number of SVD sensors.

Returns
number of SVD sensors

Definition at line 138 of file GeoTools.h.

◆ getNumberOfSVDUSideChips()

unsigned short getNumberOfSVDUSideChips ( ) const
inline

Get number of u-side SVD chips.

Returns
number of u-side chips

Definition at line 175 of file GeoTools.h.

◆ getNumberOfSVDVSideChips()

unsigned short getNumberOfSVDVSideChips ( unsigned short  layer) const
inline

Get number of v-side SVD chips.

Parameters
layerLayer of the sensor
Returns
number of v-side chips

Definition at line 182 of file GeoTools.h.

◆ getPXDChipIndex() [1/2]

int getPXDChipIndex ( int  layer,
int  ladder,
int  sensor,
bool  isU,
int  chip 
) const
inline

Return PXD chip index in the list of PXD chips.

Parameters
layerlayer position of sensor
ladderladder position of sensor
sensorsensor position of sensor
isUtrue for u side of the sensor (DCD)
chipChip number on sensor (DCD or switcher, 1-based)
Returns
Index of sensor in plots.

Definition at line 277 of file GeoTools.h.

◆ getPXDChipIndex() [2/2]

int getPXDChipIndex ( VxdID  sensorID,
bool  isU,
int  chip 
) const
inline

Return PXD chip index in the list of PXD chips.

1-based chip numbering.

Parameters
sensorIDVxdID of the sensor
isUtrue for u side of the sensor (DCD)
chipChip position on sensor - DCDs or Switchers
Returns
Index of sensor in plots.

Definition at line 259 of file GeoTools.h.

◆ getPXDChipNumber()

unsigned short getPXDChipNumber ( VxdID  chipID) const
inline

Decode (1-based) chip number from a PXD ChipID.

Parameters
chipIDVxdID with chip number encoded in Segment part.
Returns
Chip number on the respective sensor side.

Definition at line 304 of file GeoTools.h.

◆ getPXDLayers()

std::vector<unsigned short> getPXDLayers ( ) const
inline

Get numbers of PXD layers.

Returns
std::vector with numbers of PXD layers

Definition at line 62 of file GeoTools.h.

◆ getPXDSensorIndex() [1/2]

int getPXDSensorIndex ( int  layer,
int  ladder,
int  sensor 
) const
inline

Return index of sensor in plots.

Use for only PXD sensor counting, without SVD.

Parameters
layerlayer position of sensor
ladderladder position of sensor
sensorsensor position of sensor
Returns
Index of sensor in plots.

Definition at line 235 of file GeoTools.h.

◆ getPXDSensorIndex() [2/2]

int getPXDSensorIndex ( VxdID  sensorID) const
inline

Return index of sensor in plots.

A simple alias to getSensorIndex()

Parameters
sensorIDVxdID of the sensor
Returns
Index of sensor in plots.

Definition at line 224 of file GeoTools.h.

◆ getSensorIDFromIndex()

VxdID getSensorIDFromIndex ( int  vxdIndex) const
inline

Reverse lookup VxdID from list index.

Parameters
vxdIndexlist index of sensor in geometry (PXD then SVD)
Returns
VxdID of the sensor NB: Use specialized moethod to get VxdIDs for SVD-only indices!

Definition at line 211 of file GeoTools.h.

◆ getSensorIDFromPXDIndex()

VxdID getSensorIDFromPXDIndex ( int  pxdIndex) const
inline

Return index of a PXD sensor in plots.

Use for only PXD sensor counting, without SVD.

Parameters
pxdIndexIndex of sensor in plots.

Definition at line 244 of file GeoTools.h.

◆ getSensorIDFromSVDIndex()

VxdID getSensorIDFromSVDIndex ( int  svdIndex) const
inline

Return VxdID for SVD index of sensor in plots.

Uses SVD sensor count, without PXD.

Parameters
svdIndexIndex of the SVD sensor.

Definition at line 339 of file GeoTools.h.

◆ getSensorIndex()

int getSensorIndex ( VxdID  sensorID) const
inline

Return index of s VXD sensor for plotting.

Parameters
sensorIDVxdID of the sensor
Returns
Index of sensor in plots.

Definition at line 198 of file GeoTools.h.

◆ getSVDChannelsPerChip()

unsigned short getSVDChannelsPerChip ( ) const
inline

Get number of strips per APV chip in SVD.

Returns
number of chips per APV in SVD.

Definition at line 188 of file GeoTools.h.

◆ getSVDChipIndex() [1/2]

int getSVDChipIndex ( int  layer,
int  ladder,
int  sensor,
bool  isU,
int  chip 
) const
inline

Return SVD chip index in the list of SVD chips.

Parameters
layerlayer position of sensor
ladderladder position of sensor
sensorsensor position of sensor
isUtrue for u side of the sensor
chipChip position on sensor (1-based)
Returns
Index of sensor in plots.

Definition at line 375 of file GeoTools.h.

◆ getSVDChipIndex() [2/2]

int getSVDChipIndex ( VxdID  sensorID,
bool  isU,
int  chip 
) const
inline

Return SVD chip index in the list of SVD chips.

Parameters
sensorIDVxdID of the sensor
isUtrue for u side of the sensor
chipChip position on sensor (1-based)
Returns
Index of sensor in plots.

Definition at line 354 of file GeoTools.h.

◆ getSVDChipNumber()

unsigned short getSVDChipNumber ( VxdID  chipID) const
inline

Decode (1-based) chip number from a SVD ChipID.

Parameters
chipIDVxdID with chip number encoded in Segment part.
Returns
Chip number on the respective sensor side.

Definition at line 403 of file GeoTools.h.

◆ getSVDLayers()

std::vector<unsigned short> getSVDLayers ( ) const
inline

Get numbers of SVD layers.

Returns
std::vector with numbers of SVD layers

Definition at line 74 of file GeoTools.h.

◆ getSVDSensorIndex() [1/2]

int getSVDSensorIndex ( int  layer,
int  ladder,
int  sensor 
) const
inline

Return index of SVD sensor in plots.

This is solely SVD counting starting from 0.

Parameters
layerlayer position of sensor
ladderladder position of sensor
sensorsensor position of sensor
Returns
Index of sensor in plots.

Definition at line 330 of file GeoTools.h.

◆ getSVDSensorIndex() [2/2]

int getSVDSensorIndex ( VxdID  sensorID) const
inline

Return index of SVD sensor in plots.

This is solely SVD counting starting from 0.

Parameters
sensorIDVxdID of the sensor
Returns
Index of sensor in plots.

Definition at line 318 of file GeoTools.h.

◆ getTotalPXDChips()

size_t getTotalPXDChips ( ) const
inline

Get total number of chips in PXD.

Returns
total number of chips in PXD

Definition at line 147 of file GeoTools.h.

◆ getTotalSVDChips()

size_t getTotalSVDChips ( ) const
inline

Get total number of chips in SVD.

Returns
total number of chips in SVD

Definition at line 170 of file GeoTools.h.

◆ isPXDSideU()

bool isPXDSideU ( VxdID  chipID) const
inline

Decode sensor side from a PXD ChipID.

Parameters
chipIDVxdID with chip number encoded in Segment part.
Returns
true if the chip is on u-side.

Definition at line 295 of file GeoTools.h.

◆ isSVDSideU()

bool isSVDSideU ( VxdID  chipID) const
inline

Decode sensor side from a SVD ChipID.

Parameters
chipIDVxdID with chip number encoded in Segment part.
Returns
true if the chip is on u-side.

Definition at line 393 of file GeoTools.h.


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