Belle II Software development
GeoTools Class Reference

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

#include <GeoTools.h>

Public Member Functions

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

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

◆ createListOfLayers()

void createListOfLayers ( )
private

Create list of VXD layers.

Definition at line 34 of file GeoTools.cc.

35{
37 auto layerSet = geo.getLayers();
38 std::transform(
39 layerSet.begin(), layerSet.end(),
40 std::back_inserter(m_listOfLayers),
41 [](VxdID id)->int { return id.getLayerNumber(); }
42 );
43 // Better to sort this too, just in case.
44 std::sort(m_listOfLayers.begin(), m_listOfLayers.end());
45 m_firstSVDLayer = static_cast<unsigned short>(
46 std::distance(m_listOfLayers.begin(),
47 std::find(m_listOfLayers.begin(), m_listOfLayers.end(), 3)
48 ));
49}
const std::set< Belle2::VxdID > getLayers(SensorInfoBase::SensorType sensortype=SensorInfoBase::VXD)
Return a set of all known Layers.
Definition: GeoCache.cc:176
std::vector< unsigned short > m_listOfLayers
List of all VXD layers.
Definition: GeoTools.h:462
unsigned short m_firstSVDLayer
List index of the first SVD layer.
Definition: GeoTools.h:465

◆ createListOfPXDChips()

void createListOfPXDChips ( )
private

Create list of PXD chips.

Definition at line 52 of file GeoTools.cc.

53{
54 // We set segment number to the number of chip.
55 std::vector<unsigned short> sensorChips(c_nPXDChipsU + c_nPXDChipsV);
56 std::iota(sensorChips.begin(), sensorChips.end(), 0);
57 for (auto sensorID : m_listOfSensors) {
58 if (sensorID.getLayerNumber() < getFirstPXDLayer() ||
59 sensorID.getLayerNumber() > getLastPXDLayer())
60 continue;
61 std::vector<VxdID> sensorIDs;
62 std::transform(
63 sensorChips.begin(), sensorChips.end(),
64 std::back_inserter(sensorIDs),
65 [sensorID](unsigned short i)->VxdID
66 { VxdID sID(sensorID); sID.setSegmentNumber(i); return sID; }
67 );
68 m_listOfPXDChips.insert(m_listOfPXDChips.end(), sensorIDs.begin(), sensorIDs.end());
69 }
70}
short getLastPXDLayer() const
Get last (outermost) PXD layer number.
Definition: GeoTools.h:104
const unsigned short c_nPXDChipsV
Number of PXD chips per sensor in v (Switchers) (=6) on Belle II.
Definition: GeoTools.h:476
std::vector< VxdID > m_listOfPXDChips
List of all PXD chips.
Definition: GeoTools.h:468
const unsigned short c_nPXDChipsU
Number of PXD chips per sensor in u (DCD) (=4) on Belle II.
Definition: GeoTools.h:474
short getFirstPXDLayer() const
Get first (innermost) PXD layer number.
Definition: GeoTools.h:96

◆ createListOfSVDChips()

void createListOfSVDChips ( )
private

Create list of SVD chips.

Definition at line 73 of file GeoTools.cc.

74{
75 // We set segment number to the number of chip.
76 std::vector<unsigned short> sensorChipsL456(c_nSVDChipsLu + c_nSVDChipsLv);
77 std::iota(sensorChipsL456.begin(), sensorChipsL456.end(), 0);
78 std::vector<unsigned short> sensorChipsL3(2 * c_nSVDChipsL3);
79 std::iota(sensorChipsL3.begin(), sensorChipsL3.end(), 0);
80 for (auto sensorID : m_listOfSensors) {
81 if (sensorID.getLayerNumber() < getFirstSVDLayer() ||
82 sensorID.getLayerNumber() > getLastSVDLayer())
83 continue;
84 std::vector<VxdID> sensorIDs;
85 std::vector<unsigned short>& sensorChips =
86 sensorID.getLayerNumber() == 3 ? sensorChipsL3 : sensorChipsL456;
87 std::transform(
88 sensorChips.begin(), sensorChips.end(),
89 std::back_inserter(sensorIDs),
90 [sensorID](unsigned short i)->VxdID
91 { VxdID sID(sensorID); sID.setSegmentNumber(i); return sID; }
92 );
93 m_listOfSVDChips.insert(m_listOfSVDChips.end(), sensorIDs.begin(), sensorIDs.end());
94 }
95}
short getLastSVDLayer() const
Get last (outermost) SVD layer number.
Definition: GeoTools.h:120
std::vector< VxdID > m_listOfSVDChips
List of all SVD chips.
Definition: GeoTools.h:471
short getFirstSVDLayer() const
Get first (innermost) SVD layer number.
Definition: GeoTools.h:112
const unsigned short c_nSVDChipsL3
Number of SVD chips per sensor in u,v in layer 3 (=6) on Belle II.
Definition: GeoTools.h:480
const unsigned short c_nSVDChipsLv
Number of SVD chips per sensor in v in layers 4,5,6 (=4) on Belle II.
Definition: GeoTools.h:484
const unsigned short c_nSVDChipsLu
Number of SVD chips per sensor in u in layers 4,5,6 (=6) on Belle II.
Definition: GeoTools.h:482

◆ 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 }

◆ 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.

385 {
386 return m_listOfSVDChips[svdChipIndex];
387 }

◆ getFirstLayer()

unsigned short getFirstLayer ( ) const
inline

Get first (innermost) layer number.

Returns
number of innermost layer

Definition at line 86 of file GeoTools.h.

86{ return *m_listOfLayers.begin(); }

◆ 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.

97 {
98 return (m_firstSVDLayer > 0 ? *m_listOfLayers.begin() : -1);
99 }

◆ 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.

113 {
115 }

◆ 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.

91{ return *m_listOfLayers.rbegin(); }

◆ 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.

105 {
106 return (m_firstSVDLayer > 0 ? m_listOfLayers[m_firstSVDLayer - 1] : -1);
107 }

◆ 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.

121 {
122 return (m_firstSVDLayer < m_listOfLayers.size() ? *m_listOfLayers.rbegin() : -1);
123 }

◆ 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.

427 {
428 return std::distance(
429 m_listOfLayers.begin(),
430 std::find(m_listOfLayers.begin(), m_listOfLayers.end(), layer)
431 );
432 }

◆ 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.

439 {
440 return m_listOfLayers[index];
441 }

◆ 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.

57{ return m_listOfLayers; }

◆ 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.

41{ return m_listOfLayers.size(); }

◆ 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.

46{ return m_firstSVDLayer; }

◆ 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.

165 { return c_nPXDReadoutGates; }
const unsigned short c_nPXDReadoutGates
Number of PXD readout gates (or total number of Switcher channels) on Belle II.
Definition: GeoTools.h:478

◆ getNumberOfPXDSensors()

unsigned short getNumberOfPXDSensors ( ) const
inline

Get number of PXD sensors.

Returns
number of PXD sensors

Definition at line 133 of file GeoTools.h.

133{ return m_firstSVDIndex; }

◆ 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.

153 { return c_nPXDChipsU; }

◆ 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.

159 { return c_nPXDChipsV; }

◆ 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.

128{ return m_listOfSensors.size(); }

◆ 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.

52 { return m_listOfLayers.size() - m_firstSVDLayer; }

◆ getNumberOfSVDSensors()

unsigned short getNumberOfSVDSensors ( ) const
inline

Get number of SVD sensors.

Returns
number of SVD sensors

Definition at line 138 of file GeoTools.h.

139 { return m_listOfSensors.size() - m_firstSVDIndex; }

◆ 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.

176 { return c_nSVDChipsLu; }

◆ 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.

183 { return (layer == 3 ? c_nSVDChipsL3 : c_nSVDChipsLv); }

◆ 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.

278 {
279 return getPXDChipIndex(VxdID(layer, ladder, sensor), isU, chip);
280 }
int getPXDChipIndex(VxdID sensorID, bool isU, int chip) const
Return PXD chip index in the list of PXD chips.
Definition: GeoTools.h:259

◆ 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.

260 {
261 VxdID chipID(sensorID);
262 chip = isU ? chip - 1 : chip - 1 + c_nPXDChipsU;
263 chipID.setSegmentNumber(static_cast<unsigned short>(chip));
264 return std::distance(
265 m_listOfPXDChips.begin(),
266 std::find(m_listOfPXDChips.begin(), m_listOfPXDChips.end(), chipID));
267 }

◆ 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.

305 {
306 unsigned short chipNo = chipID.getSegmentNumber();
307 return (chipNo < c_nPXDChipsU ? chipNo + 1 : (chipNo + 1 - c_nPXDChipsU));
308 }

◆ 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.

63 {
64 std::vector<unsigned short> pxdLayers;
65 std::copy_if(m_listOfLayers.begin(), m_listOfLayers.end(),
66 std::back_inserter(pxdLayers),
67 [](unsigned short l)->bool {return l < 3;});
68 return pxdLayers;
69 }

◆ 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.

236 {
237 return getSensorIndex(VxdID(layer, ladder, sensor));
238 }
int getSensorIndex(VxdID sensorID) const
Return index of s VXD sensor for plotting.
Definition: GeoTools.h:198

◆ 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.

225 {
226 return getSensorIndex(sensorID);
227 }

◆ 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.

212 {
213 return m_listOfSensors[vxdIndex];
214 }

◆ 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.

245 {
246 return m_listOfSensors[pxdIndex];
247 }

◆ 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.

340 {
341 return m_listOfSensors[m_firstSVDIndex + svdIndex];
342 }

◆ 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.

199 {
200 return std::distance(
201 m_listOfSensors.begin(),
202 find(m_listOfSensors.begin(), m_listOfSensors.end(), sensorID)
203 );
204 }

◆ 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.

189 { return c_nSVDChannelsPerChip; }
const unsigned short c_nSVDChannelsPerChip
Number of SVD strips per chip on Belle II.
Definition: GeoTools.h:486

◆ 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.

376 {
377 return getSVDChipIndex(VxdID(layer, ladder, sensor), isU, chip);
378 }
int getSVDChipIndex(VxdID sensorID, bool isU, int chip) const
Return SVD chip index in the list of SVD chips.
Definition: GeoTools.h:354

◆ 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.

355 {
356 VxdID chipID(sensorID);
357 if (sensorID.getLayerNumber() == 3)
358 chip = isU ? chip - 1 : chip - 1 + c_nSVDChipsL3;
359 else
360 chip = isU ? chip - 1 : chip - 1 + c_nSVDChipsLu;
361 chipID.setSegmentNumber(static_cast<unsigned short>(chip));
362 return std::distance(
363 m_listOfSVDChips.begin(),
364 std::find(m_listOfSVDChips.begin(), m_listOfSVDChips.end(), chipID));
365 }

◆ 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.

404 {
405 unsigned short chipNo = chipID.getSegmentNumber();
406 if (chipID.getLayerNumber() == 3) {
407 if (chipNo < c_nSVDChipsL3)
408 return chipNo + 1;
409 else
410 return (chipNo + 1 - c_nSVDChipsL3);
411 } else {
412 if (chipNo < c_nSVDChipsLu)
413 return chipNo + 1;
414 else
415 return (chipNo + 1 - c_nSVDChipsLu);
416 }
417 }

◆ 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.

75 {
76 std::vector<unsigned short> svdLayers;
77 std::copy_if(m_listOfLayers.begin(), m_listOfLayers.end(),
78 std::back_inserter(svdLayers),
79 [](unsigned short l)->bool {return l > 2;});
80 return svdLayers;
81 }

◆ 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.

331 {
332 return getSVDSensorIndex(VxdID(layer, ladder, sensor));
333 }
int getSVDSensorIndex(VxdID sensorID) const
Return index of SVD sensor in plots.
Definition: GeoTools.h:318

◆ 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.

319 {
320 return (getSensorIndex(sensorID) - m_firstSVDIndex);
321 }

◆ 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.

147{ return m_listOfPXDChips.size(); }

◆ 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.

170{ return m_listOfSVDChips.size(); }

◆ 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.

296 {
297 return (chipID.getSegmentNumber() < c_nPXDChipsU);
298 }

◆ 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.

394 {
395 /* cppcheck-suppress duplicateExpressionTernary */
396 return (chipID.getLayerNumber() == 3 ? chipID.getSegmentNumber() < c_nSVDChipsL3 : chipID.getSegmentNumber() < c_nSVDChipsLu);
397 }

Member Data Documentation

◆ c_nPXDChipsU

const unsigned short c_nPXDChipsU = 4
private

Number of PXD chips per sensor in u (DCD) (=4) on Belle II.

Definition at line 474 of file GeoTools.h.

◆ c_nPXDChipsV

const unsigned short c_nPXDChipsV = 6
private

Number of PXD chips per sensor in v (Switchers) (=6) on Belle II.

Definition at line 476 of file GeoTools.h.

◆ c_nPXDReadoutGates

const unsigned short c_nPXDReadoutGates = 192
private

Number of PXD readout gates (or total number of Switcher channels) on Belle II.

Definition at line 478 of file GeoTools.h.

◆ c_nSVDChannelsPerChip

const unsigned short c_nSVDChannelsPerChip = 128
private

Number of SVD strips per chip on Belle II.

Definition at line 486 of file GeoTools.h.

◆ c_nSVDChipsL3

const unsigned short c_nSVDChipsL3 = 6
private

Number of SVD chips per sensor in u,v in layer 3 (=6) on Belle II.

Definition at line 480 of file GeoTools.h.

◆ c_nSVDChipsLu

const unsigned short c_nSVDChipsLu = 6
private

Number of SVD chips per sensor in u in layers 4,5,6 (=6) on Belle II.

Definition at line 482 of file GeoTools.h.

◆ c_nSVDChipsLv

const unsigned short c_nSVDChipsLv = 4
private

Number of SVD chips per sensor in v in layers 4,5,6 (=4) on Belle II.

Definition at line 484 of file GeoTools.h.

◆ m_firstSVDIndex

size_t m_firstSVDIndex
private

Number of the first SVD sensor in the list.

Definition at line 459 of file GeoTools.h.

◆ m_firstSVDLayer

unsigned short m_firstSVDLayer
private

List index of the first SVD layer.

Definition at line 465 of file GeoTools.h.

◆ m_listOfLayers

std::vector<unsigned short> m_listOfLayers
private

List of all VXD layers.

Definition at line 462 of file GeoTools.h.

◆ m_listOfPXDChips

std::vector<VxdID> m_listOfPXDChips
private

List of all PXD chips.

Definition at line 468 of file GeoTools.h.

◆ m_listOfSensors

std::vector<VxdID> m_listOfSensors
private

List of all VXD sesnros.

Definition at line 456 of file GeoTools.h.

◆ m_listOfSVDChips

std::vector<VxdID> m_listOfSVDChips
private

List of all SVD chips.

Definition at line 471 of file GeoTools.h.


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