Belle II Software development
EKLMElementNumbers Class Reference

EKLM element numbers. More...

#include <EKLMElementNumbers.h>

Inheritance diagram for EKLMElementNumbers:

Public Types

enum  Section {
  c_BackwardSection = 1 ,
  c_ForwardSection = 2
}
 Constants for section numbers. More...
 

Public Member Functions

bool checkSection (int section, bool fatalError=true) const
 Check if section number is correct.
 
bool checkLayer (int layer, bool fatalError=true) const
 Check if layer number is correct.
 
bool checkDetectorLayer (int section, int layer, bool fatalError=true) const
 Check if detector layer number is correct (fatal error if not).
 
bool checkSector (int sector, bool fatalError=true) const
 Check if sector number is correct (fatal error if not).
 
bool checkPlane (int plane, bool fatalError=true) const
 Check if plane number is correct (fatal error if not).
 
bool checkSegment (int segment, bool fatalError=true) const
 Check if segment number is correct (fatal error if not).
 
bool checkStrip (int strip, bool fatalError=true) const
 Check if strip number is correct (fatal error if not).
 
int detectorLayerNumber (int section, int layer) const
 Get detector layer number.
 
void layerNumberToElementNumbers (int layerGlobal, int *section, int *layer) const
 Get element numbers by detector layer global number.
 
int sectorNumber (int section, int layer, int sector) const
 Get sector number.
 
int sectorNumberKLMOrder (int section, int sector) const
 Get sector number (KLM order of elements: section, sector, layer).
 
void sectorNumberToElementNumbers (int sectorGlobal, int *section, int *layer, int *sector) const
 Get element numbers by sector global number.
 
int planeNumber (int section, int layer, int sector, int plane) const
 Get plane number.
 
void planeNumberToElementNumbers (int planeGlobal, int *section, int *layer, int *sector, int *plane) const
 Get element numbers by plane global number.
 
int segmentNumber (int section, int layer, int sector, int plane, int segment) const
 Get segment number.
 
void segmentNumberToElementNumbers (int segmentGlobal, int *section, int *layer, int *sector, int *plane, int *segment) const
 Get element numbers by segment global number.
 
int stripNumber (int section, int layer, int sector, int plane, int strip) const
 Get strip number.
 
void stripNumberToElementNumbers (int stripGlobal, int *section, int *layer, int *sector, int *plane, int *strip) const
 Get element numbers by strip global number.
 
int getSectionByGlobalStrip (int stripGlobal)
 Get section number by global strip number.
 
int getLayerByGlobalStrip (int stripGlobal)
 Get layer number by global strip number.
 
int getSectorByGlobalStrip (int stripGlobal)
 Get sector number by global strip number.
 
int getPlaneByGlobalStrip (int stripGlobal)
 Get plane number by global strip number.
 
int getStripByGlobalStrip (int stripGlobal)
 Get strip number by global strip number.
 
int getMaximalDetectorLayerNumber (int section) const
 Get maximal detector layer number.
 

Static Public Member Functions

static const EKLMElementNumbersInstance ()
 Instantiation.
 
static std::string getHSLBName (int copper, int slot)
 Get HSLB name.
 
static constexpr int getMaximalSectionNumber ()
 Get maximal section number.
 
static constexpr int getMaximalLayerNumber ()
 Get maximal layer number.
 
static constexpr int getMaximalSectorNumber ()
 Get maximal sector number.
 
static constexpr int getMaximalPlaneNumber ()
 Get maximal plane number.
 
static constexpr int getMaximalSegmentNumber ()
 Get maximal segment number.
 
static constexpr int getMaximalStripNumber ()
 Get maximal strip number.
 
static constexpr int getMaximalLayerGlobalNumber ()
 Get maximal detector layer global number.
 
static constexpr int getMaximalSectorGlobalNumber ()
 Get maximal sector global number.
 
static constexpr int getMaximalSectorGlobalNumberKLMOrder ()
 Get maximal sector global number with KLM ordering (section, sector).
 
static constexpr int getMaximalPlaneGlobalNumber ()
 Get maximal plane global number.
 
static constexpr int getMaximalSegmentGlobalNumber ()
 Get maximal segment global number.
 
static constexpr int getMaximalStripGlobalNumber ()
 Get maximal strip global number.
 
static constexpr int getNStripsLayer ()
 Get number of strips in a layer.
 
static constexpr int getNStripsSector ()
 Get number of strips in a sector.
 
static constexpr int getNStripsSegment ()
 Get number of strips in a segment.
 
static constexpr int getTotalChannelNumber ()
 Get total number of channels.
 

Static Protected Attributes

static constexpr int m_MaximalSectionNumber = 2
 Maximal section number.
 
static constexpr int m_MaximalLayerNumber = 14
 Maximal layer number.
 
static constexpr int m_MaximalDetectorLayerNumber [2] = {12, 14}
 Maximal detector layer number.
 
static constexpr int m_MaximalSectorNumber = 4
 Maximal sector number.
 
static constexpr int m_MaximalPlaneNumber = 2
 Maximal plane number.
 
static constexpr int m_MaximalSegmentNumber = 5
 Maximal segment number.
 
static constexpr int m_MaximalStripNumber = 75
 Maximal strip number.
 
static constexpr int m_NStripsSegment = 15
 Number of strips in a segment.
 
static constexpr int m_TotalChannelNumber = 15600
 Total number of channels.
 

Private Member Functions

 EKLMElementNumbers ()
 Constructor.
 
 ~EKLMElementNumbers ()
 Destructor.
 
 ClassDef (EKLMElementNumbers, 3)
 Class version.
 

Detailed Description

EKLM element numbers.

All class members are constants, they are not stored.

Definition at line 24 of file EKLMElementNumbers.h.

Member Enumeration Documentation

◆ Section

enum Section

Constants for section numbers.

Enumerator
c_BackwardSection 

Backward.

c_ForwardSection 

Forward.

Definition at line 31 of file EKLMElementNumbers.h.

31 {
32
35
38
39 };

Constructor & Destructor Documentation

◆ EKLMElementNumbers()

EKLMElementNumbers ( )
private

Constructor.

Definition at line 24 of file EKLMElementNumbers.cc.

25{
26}

◆ ~EKLMElementNumbers()

~EKLMElementNumbers ( )
private

Destructor.

Definition at line 28 of file EKLMElementNumbers.cc.

29{
30}

Member Function Documentation

◆ checkDetectorLayer()

bool checkDetectorLayer ( int  section,
int  layer,
bool  fatalError = true 
) const

Check if detector layer number is correct (fatal error if not).

Section number must be checked separately.

Parameters
[in]sectionSection number.
[in]layerLayer number.
[in]fatalErrorIssue fatal error (default) or not.
Returns
True if the detector layer number is correct.

Definition at line 55 of file EKLMElementNumbers.cc.

57{
58 /* cppcheck-suppress variableScope */
59 const char* sectionName[2] = {"backward", "forward"};
60 if (layer < 0 || layer > m_MaximalDetectorLayerNumber[section - 1]) {
61 if (fatalError) {
62 B2FATAL("Number of layer must be from 1 to the maximal number of "
63 "detector layers in the " << sectionName[section - 1] << " section ("
64 << m_MaximalDetectorLayerNumber[section - 1] << ").");
65 }
66 return false;
67 }
68 return true;
69}
static constexpr int m_MaximalDetectorLayerNumber[2]
Maximal detector layer number.

◆ checkLayer()

bool checkLayer ( int  layer,
bool  fatalError = true 
) const

Check if layer number is correct.

Parameters
[in]layerLayer number.
[in]fatalErrorIssue fatal error (default) or not.
Returns
True if the layer number is correct.

Definition at line 43 of file EKLMElementNumbers.cc.

44{
45 if (layer <= 0 || layer > m_MaximalLayerNumber) {
46 if (fatalError) {
47 B2FATAL("Number of layer must be from 1 to " << m_MaximalLayerNumber <<
48 ".");
49 }
50 return false;
51 }
52 return true;
53}
static constexpr int m_MaximalLayerNumber
Maximal layer number.

◆ checkPlane()

bool checkPlane ( int  plane,
bool  fatalError = true 
) const

Check if plane number is correct (fatal error if not).

Parameters
[in]planePlane number.
[in]fatalErrorIssue fatal error (default) or not.
Returns
True if the plane number is correct.

Definition at line 83 of file EKLMElementNumbers.cc.

84{
85 if (plane <= 0 || plane > m_MaximalPlaneNumber) {
86 if (fatalError) {
87 B2FATAL("Number of plane must be from 1 to " << m_MaximalPlaneNumber <<
88 ".");
89 }
90 return false;
91 }
92 return true;
93}
static constexpr int m_MaximalPlaneNumber
Maximal plane number.

◆ checkSection()

bool checkSection ( int  section,
bool  fatalError = true 
) const

Check if section number is correct.

Parameters
[in]sectionSection number.
[in]fatalErrorIssue fatal error (default) or not.
Returns
True if the section number is correct.

Definition at line 32 of file EKLMElementNumbers.cc.

33{
34 if (section <= 0 || section > m_MaximalSectionNumber) {
35 if (fatalError) {
36 B2FATAL("Number of section must be 1 (backward) or 2 (forward).");
37 }
38 return false;
39 }
40 return true;
41}
static constexpr int m_MaximalSectionNumber
Maximal section number.

◆ checkSector()

bool checkSector ( int  sector,
bool  fatalError = true 
) const

Check if sector number is correct (fatal error if not).

Parameters
[in]sectorSector number.
[in]fatalErrorIssue fatal error (default) or not.
Returns
True if the sector number is correct.

Definition at line 71 of file EKLMElementNumbers.cc.

72{
73 if (sector <= 0 || sector > m_MaximalSectorNumber) {
74 if (fatalError) {
75 B2FATAL("Number of sector must be from 1 to " << m_MaximalSectorNumber <<
76 ".");
77 }
78 return false;
79 }
80 return true;
81}
static constexpr int m_MaximalSectorNumber
Maximal sector number.

◆ checkSegment()

bool checkSegment ( int  segment,
bool  fatalError = true 
) const

Check if segment number is correct (fatal error if not).

Parameters
[in]segmentSegment number.
[in]fatalErrorIssue fatal error (default) or not.
Returns
True if the segment number is correct.

Definition at line 95 of file EKLMElementNumbers.cc.

96{
97 if (segment <= 0 || segment > m_MaximalSegmentNumber) {
98 if (fatalError) {
99 B2FATAL("Number of segment must be from 1 to " <<
101 }
102 return false;
103 }
104 return true;
105}
static constexpr int m_MaximalSegmentNumber
Maximal segment number.

◆ checkStrip()

bool checkStrip ( int  strip,
bool  fatalError = true 
) const

Check if strip number is correct (fatal error if not).

Parameters
[in]stripStrip number.
[in]fatalErrorIssue fatal error (default) or not.
Returns
True if the strip number is correct.

Definition at line 107 of file EKLMElementNumbers.cc.

108{
109 if (strip <= 0 || strip > m_MaximalStripNumber) {
110 if (fatalError) {
111 B2FATAL("Number of strip must be from 1 to " << m_MaximalStripNumber <<
112 ".");
113 }
114 return false;
115 }
116 return true;
117}
static constexpr int m_MaximalStripNumber
Maximal strip number.

◆ detectorLayerNumber()

int detectorLayerNumber ( int  section,
int  layer 
) const

Get detector layer number.

Parameters
[in]sectionSection number.
[in]layerLayer number.
Returns
Number of layer.

Number is from 1 to 12 + 14 = 26.

Definition at line 119 of file EKLMElementNumbers.cc.

120{
121 checkSection(section);
122 checkDetectorLayer(section, layer);
123 if (section == 1)
124 return layer;
125 return m_MaximalDetectorLayerNumber[0] + layer;
126}
bool checkDetectorLayer(int section, int layer, bool fatalError=true) const
Check if detector layer number is correct (fatal error if not).
bool checkSection(int section, bool fatalError=true) const
Check if section number is correct.

◆ getHSLBName()

std::string getHSLBName ( int  copper,
int  slot 
)
static

Get HSLB name.

Parameters
[in]copperCopper.
[in]slotSlot.

Definition at line 271 of file EKLMElementNumbers.cc.

272{
273 char hslb = 'a' + slot - 1;
274 return "800" + std::to_string(copper - EKLM_ID) + hslb;
275}

◆ getLayerByGlobalStrip()

int getLayerByGlobalStrip ( int  stripGlobal)

Get layer number by global strip number.

Parameters
[in]stripGlobalGlobal strip number.

Definition at line 239 of file EKLMElementNumbers.cc.

240{
241 int section, layer, sector, plane, strip;
242 stripNumberToElementNumbers(stripGlobal,
243 &section, &layer, &sector, &plane, &strip);
244 return layer;
245}
void stripNumberToElementNumbers(int stripGlobal, int *section, int *layer, int *sector, int *plane, int *strip) const
Get element numbers by strip global number.

◆ getMaximalDetectorLayerNumber()

int getMaximalDetectorLayerNumber ( int  section) const

Get maximal detector layer number.

Parameters
[in]sectionSection number.

Definition at line 277 of file EKLMElementNumbers.cc.

278{
279 checkSection(section);
280 return m_MaximalDetectorLayerNumber[section - 1];
281}

◆ getMaximalLayerGlobalNumber()

static constexpr int getMaximalLayerGlobalNumber ( )
inlinestaticconstexpr

Get maximal detector layer global number.

Definition at line 327 of file EKLMElementNumbers.h.

◆ getMaximalLayerNumber()

static constexpr int getMaximalLayerNumber ( )
inlinestaticconstexpr

Get maximal layer number.

Definition at line 281 of file EKLMElementNumbers.h.

282 {
284 }

◆ getMaximalPlaneGlobalNumber()

static constexpr int getMaximalPlaneGlobalNumber ( )
inlinestaticconstexpr

Get maximal plane global number.

Definition at line 351 of file EKLMElementNumbers.h.

352 {
354 }
static constexpr int getMaximalSectorGlobalNumber()
Get maximal sector global number.

◆ getMaximalPlaneNumber()

static constexpr int getMaximalPlaneNumber ( )
inlinestaticconstexpr

Get maximal plane number.

Definition at line 303 of file EKLMElementNumbers.h.

304 {
306 }

◆ getMaximalSectionNumber()

static constexpr int getMaximalSectionNumber ( )
inlinestaticconstexpr

Get maximal section number.

Definition at line 273 of file EKLMElementNumbers.h.

274 {
276 }

◆ getMaximalSectorGlobalNumber()

static constexpr int getMaximalSectorGlobalNumber ( )
inlinestaticconstexpr

Get maximal sector global number.

Definition at line 335 of file EKLMElementNumbers.h.

336 {
338 }
static constexpr int getMaximalLayerGlobalNumber()
Get maximal detector layer global number.

◆ getMaximalSectorGlobalNumberKLMOrder()

static constexpr int getMaximalSectorGlobalNumberKLMOrder ( )
inlinestaticconstexpr

Get maximal sector global number with KLM ordering (section, sector).

Definition at line 343 of file EKLMElementNumbers.h.

344 {
346 }

◆ getMaximalSectorNumber()

static constexpr int getMaximalSectorNumber ( )
inlinestaticconstexpr

Get maximal sector number.

Definition at line 295 of file EKLMElementNumbers.h.

296 {
298 }

◆ getMaximalSegmentGlobalNumber()

static constexpr int getMaximalSegmentGlobalNumber ( )
inlinestaticconstexpr

Get maximal segment global number.

Definition at line 359 of file EKLMElementNumbers.h.

360 {
362 }
static constexpr int getMaximalPlaneGlobalNumber()
Get maximal plane global number.

◆ getMaximalSegmentNumber()

static constexpr int getMaximalSegmentNumber ( )
inlinestaticconstexpr

Get maximal segment number.

Definition at line 311 of file EKLMElementNumbers.h.

312 {
314 }

◆ getMaximalStripGlobalNumber()

static constexpr int getMaximalStripGlobalNumber ( )
inlinestaticconstexpr

Get maximal strip global number.

Definition at line 367 of file EKLMElementNumbers.h.

◆ getMaximalStripNumber()

static constexpr int getMaximalStripNumber ( )
inlinestaticconstexpr

Get maximal strip number.

Definition at line 319 of file EKLMElementNumbers.h.

320 {
322 }

◆ getNStripsLayer()

static constexpr int getNStripsLayer ( )
inlinestaticconstexpr

Get number of strips in a layer.

Definition at line 375 of file EKLMElementNumbers.h.

376 {
378 }
static constexpr int getNStripsSector()
Get number of strips in a sector.

◆ getNStripsSector()

static constexpr int getNStripsSector ( )
inlinestaticconstexpr

Get number of strips in a sector.

Definition at line 383 of file EKLMElementNumbers.h.

384 {
386 }

◆ getNStripsSegment()

static constexpr int getNStripsSegment ( )
inlinestaticconstexpr

Get number of strips in a segment.

Definition at line 391 of file EKLMElementNumbers.h.

392 {
393 return m_NStripsSegment;
394 }
static constexpr int m_NStripsSegment
Number of strips in a segment.

◆ getPlaneByGlobalStrip()

int getPlaneByGlobalStrip ( int  stripGlobal)

Get plane number by global strip number.

Parameters
[in]stripGlobalGlobal strip number.

Definition at line 255 of file EKLMElementNumbers.cc.

256{
257 int section, layer, sector, plane, strip;
258 stripNumberToElementNumbers(stripGlobal,
259 &section, &layer, &sector, &plane, &strip);
260 return plane;
261}

◆ getSectionByGlobalStrip()

int getSectionByGlobalStrip ( int  stripGlobal)

Get section number by global strip number.

Parameters
[in]stripGlobalGlobal strip number.

Definition at line 231 of file EKLMElementNumbers.cc.

232{
233 int section, layer, sector, plane, strip;
234 stripNumberToElementNumbers(stripGlobal,
235 &section, &layer, &sector, &plane, &strip);
236 return section;
237}

◆ getSectorByGlobalStrip()

int getSectorByGlobalStrip ( int  stripGlobal)

Get sector number by global strip number.

Parameters
[in]stripGlobalGlobal strip number.

Definition at line 247 of file EKLMElementNumbers.cc.

248{
249 int section, layer, sector, plane, strip;
250 stripNumberToElementNumbers(stripGlobal,
251 &section, &layer, &sector, &plane, &strip);
252 return sector;
253}

◆ getStripByGlobalStrip()

int getStripByGlobalStrip ( int  stripGlobal)

Get strip number by global strip number.

Parameters
[in]stripGlobalGlobal strip number.

Definition at line 263 of file EKLMElementNumbers.cc.

264{
265 static int maxStrip = getMaximalStripGlobalNumber();
266 if (stripGlobal <= 0 || stripGlobal > maxStrip)
267 B2FATAL("Number of strip must be from 1 to " << maxStrip << ".");
268 return (stripGlobal - 1) % m_MaximalStripNumber + 1;
269}
static constexpr int getMaximalStripGlobalNumber()
Get maximal strip global number.

◆ getTotalChannelNumber()

static constexpr int getTotalChannelNumber ( )
inlinestaticconstexpr

Get total number of channels.

Definition at line 399 of file EKLMElementNumbers.h.

400 {
402 }
static constexpr int m_TotalChannelNumber
Total number of channels.

◆ Instance()

const EKLMElementNumbers & Instance ( )
static

Instantiation.

Definition at line 18 of file EKLMElementNumbers.cc.

19{
20 static EKLMElementNumbers ens;
21 return ens;
22}
EKLM element numbers.

◆ layerNumberToElementNumbers()

void layerNumberToElementNumbers ( int  layerGlobal,
int *  section,
int *  layer 
) const

Get element numbers by detector layer global number.

Parameters
[in]layerGlobalLayer global number.
[out]sectionSection number.
[out]layerLayer number.

Definition at line 128 of file EKLMElementNumbers.cc.

130{
131 static int maxLayer = getMaximalLayerGlobalNumber();
132 if (layerGlobal <= 0 || layerGlobal > maxLayer)
133 B2FATAL("Number of segment must be from 1 to " << maxLayer << ".");
134 if (layerGlobal <= m_MaximalDetectorLayerNumber[0]) {
135 *section = 1;
136 *layer = layerGlobal;
137 } else {
138 *section = 2;
139 *layer = layerGlobal - m_MaximalDetectorLayerNumber[0];
140 }
141}

◆ planeNumber()

int planeNumber ( int  section,
int  layer,
int  sector,
int  plane 
) const

Get plane number.

Parameters
[in]sectionSection number.
[in]layerLayer number.
[in]sectorSector number.
[in]planePlane number.
Returns
Number of plane.

Number is from 1 to 2*4*26 = 208.

Definition at line 169 of file EKLMElementNumbers.cc.

171{
172 checkPlane(plane);
173 return m_MaximalPlaneNumber * (sectorNumber(section, layer, sector) - 1) +
174 plane;
175}
int sectorNumber(int section, int layer, int sector) const
Get sector number.
bool checkPlane(int plane, bool fatalError=true) const
Check if plane number is correct (fatal error if not).

◆ planeNumberToElementNumbers()

void planeNumberToElementNumbers ( int  planeGlobal,
int *  section,
int *  layer,
int *  sector,
int *  plane 
) const

Get element numbers by plane global number.

Parameters
[in]planeGlobalPlane global number.
[out]sectionSection number.
[out]layerLayer number.
[out]sectorSector number.
[out]planePlane number.

Definition at line 177 of file EKLMElementNumbers.cc.

179{
180 static int maxPlane = getMaximalPlaneGlobalNumber();
181 int sectorGlobal;
182 if (planeGlobal <= 0 || planeGlobal > maxPlane)
183 B2FATAL("Number of segment must be from 1 to " << maxPlane << ".");
184 *plane = (planeGlobal - 1) % m_MaximalPlaneNumber + 1;
185 sectorGlobal = (planeGlobal - 1) / m_MaximalPlaneNumber + 1;
186 sectorNumberToElementNumbers(sectorGlobal, section, layer, sector);
187}
void sectorNumberToElementNumbers(int sectorGlobal, int *section, int *layer, int *sector) const
Get element numbers by sector global number.

◆ sectorNumber()

int sectorNumber ( int  section,
int  layer,
int  sector 
) const

Get sector number.

Parameters
[in]sectionSection number.
[in]layerLayer number.
[in]sectorSector number.
Returns
Number of sector.

Number is from 1 to 4*26 = 104.

Definition at line 143 of file EKLMElementNumbers.cc.

144{
145 checkSector(sector);
146 return m_MaximalSectorNumber * (detectorLayerNumber(section, layer) - 1) +
147 sector;
148}
int detectorLayerNumber(int section, int layer) const
Get detector layer number.
bool checkSector(int sector, bool fatalError=true) const
Check if sector number is correct (fatal error if not).

◆ sectorNumberKLMOrder()

int sectorNumberKLMOrder ( int  section,
int  sector 
) const

Get sector number (KLM order of elements: section, sector, layer).

Parameters
[in]sectionSection number.
[in]sectorSector number.
Returns
Number of sector.

Number is from 1 to 2*4 = 8.

Definition at line 150 of file EKLMElementNumbers.cc.

151{
152 checkSection(section);
153 checkSector(sector);
154 return m_MaximalSectorNumber * (section - 1) + sector;
155}

◆ sectorNumberToElementNumbers()

void sectorNumberToElementNumbers ( int  sectorGlobal,
int *  section,
int *  layer,
int *  sector 
) const

Get element numbers by sector global number.

Parameters
[in]sectorGlobalSector global number.
[out]sectionSection number.
[out]layerLayer number.
[out]sectorSector number.

Definition at line 157 of file EKLMElementNumbers.cc.

159{
160 static int maxSector = getMaximalSectorGlobalNumber();
161 int layerGlobal;
162 if (sectorGlobal <= 0 || sectorGlobal > maxSector)
163 B2FATAL("Number of segment must be from 1 to " << maxSector << ".");
164 *sector = (sectorGlobal - 1) % m_MaximalSectorNumber + 1;
165 layerGlobal = (sectorGlobal - 1) / m_MaximalSectorNumber + 1;
166 layerNumberToElementNumbers(layerGlobal, section, layer);
167}
void layerNumberToElementNumbers(int layerGlobal, int *section, int *layer) const
Get element numbers by detector layer global number.

◆ segmentNumber()

int segmentNumber ( int  section,
int  layer,
int  sector,
int  plane,
int  segment 
) const

Get segment number.

Parameters
[in]sectionSection number.
[in]layerLayer number.
[in]sectorSector number.
[in]planePlane number.
[in]segmentSegment number.
Returns
Number of strip.

Number is from 1 to 5*2*4*26 = 1040.

Definition at line 189 of file EKLMElementNumbers.cc.

191{
192 checkSegment(segment);
193 return m_MaximalSegmentNumber * (planeNumber(section, layer, sector, plane) -
194 1) + segment;
195}
bool checkSegment(int segment, bool fatalError=true) const
Check if segment number is correct (fatal error if not).
int planeNumber(int section, int layer, int sector, int plane) const
Get plane number.

◆ segmentNumberToElementNumbers()

void segmentNumberToElementNumbers ( int  segmentGlobal,
int *  section,
int *  layer,
int *  sector,
int *  plane,
int *  segment 
) const

Get element numbers by segment global number.

Parameters
[in]segmentGlobalSegment global number.
[out]sectionSection number.
[out]layerLayer number.
[out]sectorSector number.
[out]planePlane number.
[out]segmentSegment number.

Definition at line 197 of file EKLMElementNumbers.cc.

200{
201 static int maxSegment = getMaximalSegmentGlobalNumber();
202 int planeGlobal;
203 if (segmentGlobal <= 0 || segmentGlobal > maxSegment)
204 B2FATAL("Number of segment must be from 1 to " << maxSegment << ".");
205 *segment = (segmentGlobal - 1) % m_MaximalSegmentNumber + 1;
206 planeGlobal = (segmentGlobal - 1) / m_MaximalSegmentNumber + 1;
207 planeNumberToElementNumbers(planeGlobal, section, layer, sector, plane);
208}
void planeNumberToElementNumbers(int planeGlobal, int *section, int *layer, int *sector, int *plane) const
Get element numbers by plane global number.
static constexpr int getMaximalSegmentGlobalNumber()
Get maximal segment global number.

◆ stripNumber()

int stripNumber ( int  section,
int  layer,
int  sector,
int  plane,
int  strip 
) const

Get strip number.

Parameters
[in]sectionSection number.
[in]layerLayer number.
[in]sectorSector number.
[in]planePlane number.
[in]stripStrip number.
Returns
Number of strip.

Number is from 1 to 75*2*4*26 = 15600.

Definition at line 210 of file EKLMElementNumbers.cc.

212{
213 checkStrip(strip);
214 return m_MaximalStripNumber * (planeNumber(section, layer, sector, plane) - 1)
215 + strip;
216}
bool checkStrip(int strip, bool fatalError=true) const
Check if strip number is correct (fatal error if not).

◆ stripNumberToElementNumbers()

void stripNumberToElementNumbers ( int  stripGlobal,
int *  section,
int *  layer,
int *  sector,
int *  plane,
int *  strip 
) const

Get element numbers by strip global number.

Parameters
[in]stripGlobalStrip global number.
[out]sectionSection number.
[out]layerLayer number.
[out]sectorSector number.
[out]planePlane number.
[out]stripStrip number.

Definition at line 218 of file EKLMElementNumbers.cc.

221{
222 static int maxStrip = getMaximalStripGlobalNumber();
223 int planeGlobal;
224 if (stripGlobal <= 0 || stripGlobal > maxStrip)
225 B2FATAL("Number of strip must be from 1 to " << maxStrip << ".");
226 *strip = (stripGlobal - 1) % m_MaximalStripNumber + 1;
227 planeGlobal = (stripGlobal - 1) / m_MaximalStripNumber + 1;
228 planeNumberToElementNumbers(planeGlobal, section, layer, sector, plane);
229}

Member Data Documentation

◆ m_MaximalDetectorLayerNumber

constexpr int m_MaximalDetectorLayerNumber[2] = {12, 14}
staticconstexprprotected

Maximal detector layer number.

Definition at line 425 of file EKLMElementNumbers.h.

◆ m_MaximalLayerNumber

constexpr int m_MaximalLayerNumber = 14
staticconstexprprotected

Maximal layer number.

Definition at line 422 of file EKLMElementNumbers.h.

◆ m_MaximalPlaneNumber

constexpr int m_MaximalPlaneNumber = 2
staticconstexprprotected

Maximal plane number.

Definition at line 431 of file EKLMElementNumbers.h.

◆ m_MaximalSectionNumber

constexpr int m_MaximalSectionNumber = 2
staticconstexprprotected

Maximal section number.

Definition at line 419 of file EKLMElementNumbers.h.

◆ m_MaximalSectorNumber

constexpr int m_MaximalSectorNumber = 4
staticconstexprprotected

Maximal sector number.

Definition at line 428 of file EKLMElementNumbers.h.

◆ m_MaximalSegmentNumber

constexpr int m_MaximalSegmentNumber = 5
staticconstexprprotected

Maximal segment number.

Definition at line 434 of file EKLMElementNumbers.h.

◆ m_MaximalStripNumber

constexpr int m_MaximalStripNumber = 75
staticconstexprprotected

Maximal strip number.

Definition at line 437 of file EKLMElementNumbers.h.

◆ m_NStripsSegment

constexpr int m_NStripsSegment = 15
staticconstexprprotected

Number of strips in a segment.

Definition at line 440 of file EKLMElementNumbers.h.

◆ m_TotalChannelNumber

constexpr int m_TotalChannelNumber = 15600
staticconstexprprotected

Total number of channels.

Definition at line 443 of file EKLMElementNumbers.h.


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