Belle II Software development
BKLMElementNumbers Class Reference

BKLM element numbers. More...

#include <BKLMElementNumbers.h>

Public Types

enum  Section {
  c_BackwardSection = 0 ,
  c_ForwardSection = 1
}
 Constants for section numbers. More...
 
enum  Sector { c_ChimneySector = 3 }
 Constants for sector numbers. More...
 
enum  Layer { c_FirstRPCLayer = 3 }
 Constants for layer numbers. More...
 
enum  Plane {
  c_ZPlane = 0 ,
  c_PhiPlane = 1
}
 Constants for plane numbers. More...
 

Public Member Functions

 BKLMElementNumbers ()
 Constructor.
 
 ~BKLMElementNumbers ()
 Destructor.
 

Static Public Member Functions

static KLMChannelNumber channelNumber (int section, int sector, int layer, int plane, int strip)
 Get channel number.
 
static void channelNumberToElementNumbers (KLMChannelNumber channel, int *section, int *sector, int *layer, int *plane, int *strip)
 Get element numbers by channel number.
 
static KLMPlaneNumber planeNumber (int section, int sector, int layer, int plane)
 Get plane number.
 
static void planeNumberToElementNumbers (KLMPlaneNumber planeGlobal, int *section, int *sector, int *layer, int *plane)
 Get element numbers by plane number.
 
static KLMModuleNumber moduleNumber (int section, int sector, int layer, bool fatalError=true)
 Get module number.
 
static void moduleNumberToElementNumbers (KLMModuleNumber module, int *section, int *sector, int *layer)
 Get element numbers by module number.
 
static KLMSectorNumber sectorNumber (int section, int sector)
 Get sector number.
 
static int layerGlobalNumber (int section, int sector, int layer)
 Get layer global number.
 
static int getNStrips (int section, int sector, int layer, int plane)
 Get number of strips.
 
static bool checkSection (int section, bool fatalError=true)
 Check if section number is correct.
 
static bool checkSector (int sector, bool fatalError=true)
 Check if sector number is correct.
 
static bool checkLayer (int layer, bool fatalError=true)
 Check if layer number is correct.
 
static bool checkPlane (int plane, bool fatalError=true)
 Check if plane number is correct.
 
static bool checkChannelNumber (int section, int sector, int layer, int plane, int strip, bool fatalError=true)
 Check channel number.
 
static std::string getHSLBName (int copper, int slot)
 Get HSLB name.
 
static constexpr int getMaximalSectionNumber ()
 Get maximal section number (0-based).
 
static constexpr int getMaximalSectorNumber ()
 Get maximal sector number (1-based).
 
static constexpr int getMaximalLayerNumber ()
 Get maximal layer number (1-based).
 
static constexpr int getMaximalPlaneNumber ()
 Get maximal plane number (0-based).
 
static constexpr int getMaximalSectorGlobalNumber ()
 Get maximal sector global number.
 
static constexpr int getMaximalLayerGlobalNumber ()
 Get maximal layer global number.
 
static constexpr int getTotalChannelNumber ()
 Get total number of channels.
 
static void layerGlobalNumberToElementNumbers (int layerGlobal, int *section, int *sector, int *layer)
 Get element numbers by layer global number (0-based).
 
static int getSectionByModule (int module)
 Get section number by module identifier.
 
static int getSectorByModule (int module)
 Get sector number by module identifier.
 
static int getLayerByModule (int module)
 Get layer number by module identifier.
 
static int getPlaneByModule (int module)
 Get plane number (0 = z, 1 = phi) by module identifier.
 
static int getStripByModule (int module)
 Get strip number by module identifier.
 
static void setSectionInModule (int &module, int section)
 Set section number in module identifier.
 
static void setSectorInModule (int &module, int sector)
 Set sector number in module identifier.
 
static void setLayerInModule (int &module, int layer)
 Set layer number in module identifier.
 
static void setPlaneInModule (int &module, int plane)
 Set plane number in module identifier.
 
static void setStripInModule (int &module, int strip)
 Set strip number in module identifier.
 
static uint16_t getModuleByModule (int module)
 Get module number by module identifier (the input identifier may contain other data).
 
static uint16_t getChannelByModule (int module)
 Get channel number by module identifier.
 
static bool hitsFromSameModule (int module1, int module2)
 Check whether the hits are from the same module.
 
static bool hitsFromSamePlane (int module1, int module2)
 Check whether the hits are from the same plane.
 
static bool hitsFromSameChannel (int module1, int module2)
 Check whether the hits are from the same channel.
 

Static Protected Attributes

static constexpr int m_MaximalSectionNumber = 1
 Maximal section number (0-based).
 
static constexpr int m_MaximalSectorNumber = 8
 Maximal sector number (1-based).
 
static constexpr int m_MaximalLayerNumber = 15
 Maximal layer number (1-based).
 
static constexpr int m_MaximalPlaneNumber = 1
 Maximal plane number (0-based).
 
static constexpr int m_TotalChannelNumber = 21978
 Total number of channels (1-based).
 
static constexpr int BKLM_STRIP_BIT = 0
 Bit position for strip-1 [0..47].
 
static constexpr int BKLM_PLANE_BIT = 6
 Bit position for plane-1 [0..1].
 
static constexpr int BKLM_LAYER_BIT = 7
 Bit position for layer-1 [0..14]; 0 is innermost.
 
static constexpr int BKLM_SECTOR_BIT = 11
 Bit position for sector-1 [0..7].
 
static constexpr int BKLM_SECTION_BIT = 14
 Bit position for detector end [0..1]; forward is 0.
 
static constexpr int BKLM_STRIP_MASK = (63 << BKLM_STRIP_BIT)
 Bit mask for strip-1 [0..47].
 
static constexpr int BKLM_PLANE_MASK = (1 << BKLM_PLANE_BIT)
 Bit mask for plane-1 [0..1]; 0 is inner-plane and phiReadout plane,.
 
static constexpr int BKLM_LAYER_MASK = (15 << BKLM_LAYER_BIT)
 Bit mask for layer-1 [0..15]; 0 is innermost and 14 is outermost.
 
static constexpr int BKLM_SECTOR_MASK = (7 << BKLM_SECTOR_BIT)
 Bit mask for sector-1 [0..7].
 
static constexpr int BKLM_SECTION_MASK = (1 << BKLM_SECTION_BIT)
 Bit mask for detector end [0..1]; forward is 0.
 
static constexpr int BKLM_MODULEID_MASK
 Bit mask for module identifier.
 
static constexpr int BKLM_MODULESTRIPID_MASK
 Bit mask for module-and-strip identifier.
 

Detailed Description

BKLM element numbers.

Definition at line 27 of file BKLMElementNumbers.h.

Member Enumeration Documentation

◆ Layer

enum Layer

Constants for layer numbers.

Enumerator
c_FirstRPCLayer 

First RPC layer.

Definition at line 61 of file BKLMElementNumbers.h.

61 {
62
65
66 };
@ c_FirstRPCLayer
First RPC layer.

◆ Plane

enum Plane

Constants for plane numbers.

Enumerator
c_ZPlane 

Z.

c_PhiPlane 

Phi.

Definition at line 71 of file BKLMElementNumbers.h.

71 {
72
74 c_ZPlane = 0,
75
77 c_PhiPlane = 1,
78
79 };

◆ Section

enum Section

Constants for section numbers.

Enumerator
c_BackwardSection 

Backward.

c_ForwardSection 

Forward.

Definition at line 34 of file BKLMElementNumbers.h.

34 {
35
38
41
42 };

◆ Sector

enum Sector

Constants for sector numbers.

Enumerator
c_ChimneySector 

Chimney sector: BB3 in 1-based notation; BB2 in 0-based notation.

Definition at line 47 of file BKLMElementNumbers.h.

47 {
48
55
56 };
@ c_ChimneySector
Chimney sector: BB3 in 1-based notation; BB2 in 0-based notation.

Constructor & Destructor Documentation

◆ BKLMElementNumbers()

Constructor.

Definition at line 17 of file BKLMElementNumbers.cc.

18{
19}

◆ ~BKLMElementNumbers()

Destructor.

Definition at line 21 of file BKLMElementNumbers.cc.

22{
23}

Member Function Documentation

◆ channelNumber()

KLMChannelNumber channelNumber ( int  section,
int  sector,
int  layer,
int  plane,
int  strip 
)
static

Get channel number.

Parameters
[in]sectionSection (0-based).
[in]sectorSector (1-based).
[in]layerLayer (1-based).
[in]planePlane (0-based).
[in]stripStrip (1-based).

Definition at line 25 of file BKLMElementNumbers.cc.

27{
28 checkChannelNumber(section, sector, layer, plane, strip);
29 return (section << BKLM_SECTION_BIT)
30 | ((sector - 1) << BKLM_SECTOR_BIT)
31 | ((layer - 1) << BKLM_LAYER_BIT)
32 | ((plane) << BKLM_PLANE_BIT)
33 | ((strip - 1) << BKLM_STRIP_BIT);
34}
static constexpr int BKLM_STRIP_BIT
Bit position for strip-1 [0..47].
static constexpr int BKLM_PLANE_BIT
Bit position for plane-1 [0..1].
static bool checkChannelNumber(int section, int sector, int layer, int plane, int strip, bool fatalError=true)
Check channel number.
static constexpr int BKLM_SECTOR_BIT
Bit position for sector-1 [0..7].
static constexpr int BKLM_SECTION_BIT
Bit position for detector end [0..1]; forward is 0.
static constexpr int BKLM_LAYER_BIT
Bit position for layer-1 [0..14]; 0 is innermost.

◆ channelNumberToElementNumbers()

void channelNumberToElementNumbers ( KLMChannelNumber  channel,
int *  section,
int *  sector,
int *  layer,
int *  plane,
int *  strip 
)
static

Get element numbers by channel number.

Parameters
[in]channelChannel number.
[out]sectionSection (0-based).
[out]sectorSector (1-based).
[out]layerLayer (1-based).
[out]planePlane (0-based).
[out]stripStrip (1-based).

Definition at line 36 of file BKLMElementNumbers.cc.

39{
40 *section = ((channel & BKLM_SECTION_MASK) >> BKLM_SECTION_BIT);
41 *sector = ((channel & BKLM_SECTOR_MASK) >> BKLM_SECTOR_BIT) + 1;
42 *layer = ((channel & BKLM_LAYER_MASK) >> BKLM_LAYER_BIT) + 1;
43 *plane = ((channel & BKLM_PLANE_MASK) >> BKLM_PLANE_BIT);
44 *strip = ((channel & BKLM_STRIP_MASK) >> BKLM_STRIP_BIT) + 1;
45}
static constexpr int BKLM_SECTOR_MASK
Bit mask for sector-1 [0..7].
static constexpr int BKLM_LAYER_MASK
Bit mask for layer-1 [0..15]; 0 is innermost and 14 is outermost.
static constexpr int BKLM_PLANE_MASK
Bit mask for plane-1 [0..1]; 0 is inner-plane and phiReadout plane,.
static constexpr int BKLM_SECTION_MASK
Bit mask for detector end [0..1]; forward is 0.
static constexpr int BKLM_STRIP_MASK
Bit mask for strip-1 [0..47].

◆ checkChannelNumber()

bool checkChannelNumber ( int  section,
int  sector,
int  layer,
int  plane,
int  strip,
bool  fatalError = true 
)
static

Check channel number.

Parameters
[in]sectionSection (0-based).
[in]sectorSector (1-based).
[in]layerLayer (1-based).
[in]planePlane (0-based).
[in]stripStrip (1-based).
[in]fatalErrorIssue fatal error (default) or not.

Definition at line 183 of file BKLMElementNumbers.cc.

185{
186 if (strip < 1 || strip > getNStrips(section, sector, layer, plane)) {
187 if (fatalError)
188 B2FATAL("Invalid BKLM channel number: section = " << section << ", sector = " << sector << ", layer = " << layer << ", plane = " <<
189 plane << ", strip = " << strip << ".");
190 return false;
191 }
192 return true;
193}
static int getNStrips(int section, int sector, int layer, int plane)
Get number of strips.

◆ checkLayer()

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

Check if layer number is correct.

Parameters
[in]layerLayer (1-based)
[in]fatalErrorIssue fatal error (default) or not.

Definition at line 163 of file BKLMElementNumbers.cc.

164{
165 if (layer < 1 || layer > m_MaximalLayerNumber) {
166 if (fatalError)
167 B2FATAL("Invalid BKLM layer number: " << layer << ".");
168 return false;
169 }
170 return true;
171}
static constexpr int m_MaximalLayerNumber
Maximal layer number (1-based).

◆ checkPlane()

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

Check if plane number is correct.

Parameters
[in]planePlane (0-based)
[in]fatalErrorIssue fatal error (default) or not.

Definition at line 173 of file BKLMElementNumbers.cc.

174{
175 if (plane < 0 || plane > m_MaximalPlaneNumber) {
176 if (fatalError)
177 B2FATAL("Invalid BKLM plane number: " << plane << ".");
178 return false;
179 }
180 return true;
181}
static constexpr int m_MaximalPlaneNumber
Maximal plane number (0-based).

◆ checkSection()

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

Check if section number is correct.

Parameters
[in]sectionSection (0-based).
[in]fatalErrorIssue fatal error (default) or not.

Definition at line 143 of file BKLMElementNumbers.cc.

144{
145 if (section < BKLMElementNumbers::c_BackwardSection || section > BKLMElementNumbers::c_ForwardSection) {
146 if (fatalError)
147 B2FATAL("Invalid BKLM section number: " << section << ".");
148 return false;
149 }
150 return true;
151}

◆ checkSector()

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

Check if sector number is correct.

Parameters
[in]sectorSector (1-based)
[in]fatalErrorIssue fatal error (default) or not.

Definition at line 153 of file BKLMElementNumbers.cc.

154{
155 if (sector < 1 || sector > m_MaximalSectorNumber) {
156 if (fatalError)
157 B2FATAL("Invalid BKLM sector number: " << sector << ".");
158 return false;
159 }
160 return true;
161}
static constexpr int m_MaximalSectorNumber
Maximal sector number (1-based).

◆ getChannelByModule()

static uint16_t getChannelByModule ( int  module)
inlinestatic

Get channel number by module identifier.

Definition at line 395 of file BKLMElementNumbers.h.

396 {
397 return module & BKLM_MODULESTRIPID_MASK;
398 }
static constexpr int BKLM_MODULESTRIPID_MASK
Bit mask for module-and-strip identifier.

◆ getHSLBName()

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

Get HSLB name.

Parameters
[in]copperCopper.
[in]slotSlot.

Definition at line 202 of file BKLMElementNumbers.cc.

203{
204 char hslb = 'a' + slot - 1;
205 return "700" + std::to_string(copper - BKLM_ID) + hslb;
206}

◆ getLayerByModule()

static int getLayerByModule ( int  module)
inlinestatic

Get layer number by module identifier.

Definition at line 312 of file BKLMElementNumbers.h.

313 {
314 return ((module & BKLM_LAYER_MASK) >> BKLM_LAYER_BIT) + 1;
315 }

◆ getMaximalLayerGlobalNumber()

static constexpr int getMaximalLayerGlobalNumber ( )
inlinestaticconstexpr

Get maximal layer global number.

Definition at line 271 of file BKLMElementNumbers.h.

272 {
274 }
static constexpr int m_MaximalSectionNumber
Maximal section number (0-based).

◆ getMaximalLayerNumber()

static constexpr int getMaximalLayerNumber ( )
inlinestaticconstexpr

Get maximal layer number (1-based).

Definition at line 247 of file BKLMElementNumbers.h.

248 {
250 }

◆ getMaximalPlaneNumber()

static constexpr int getMaximalPlaneNumber ( )
inlinestaticconstexpr

Get maximal plane number (0-based).

Definition at line 255 of file BKLMElementNumbers.h.

256 {
258 }

◆ getMaximalSectionNumber()

static constexpr int getMaximalSectionNumber ( )
inlinestaticconstexpr

Get maximal section number (0-based).

Definition at line 231 of file BKLMElementNumbers.h.

232 {
234 }

◆ getMaximalSectorGlobalNumber()

static constexpr int getMaximalSectorGlobalNumber ( )
inlinestaticconstexpr

Get maximal sector global number.

Definition at line 263 of file BKLMElementNumbers.h.

264 {
266 }

◆ getMaximalSectorNumber()

static constexpr int getMaximalSectorNumber ( )
inlinestaticconstexpr

Get maximal sector number (1-based).

Definition at line 239 of file BKLMElementNumbers.h.

240 {
242 }

◆ getModuleByModule()

static uint16_t getModuleByModule ( int  module)
inlinestatic

Get module number by module identifier (the input identifier may contain other data).

Definition at line 387 of file BKLMElementNumbers.h.

388 {
389 return module & BKLM_MODULEID_MASK;
390 }
static constexpr int BKLM_MODULEID_MASK
Bit mask for module identifier.

◆ getNStrips()

int getNStrips ( int  section,
int  sector,
int  layer,
int  plane 
)
static

Get number of strips.

Parameters
[in]sectionSection (0-based).
[in]sectorSector (1-based).
[in]layerLayer (1-based).
[in]planePlane (0-based).

Definition at line 107 of file BKLMElementNumbers.cc.

109{
110 checkSection(section);
111 checkSector(sector);
112 checkLayer(layer);
113 checkPlane(plane);
114 int strips = 0;
118 /* Chimney sector. */
119 if (layer < 3)
120 strips = 38;
121 if (layer > 2)
122 strips = 34;
123 } else {
124 /* Other sectors. */
125 if (layer == 1 && plane == BKLMElementNumbers::c_PhiPlane)
126 strips = 37;
127 if (layer == 2 && plane == BKLMElementNumbers::c_PhiPlane)
128 strips = 42;
129 if (layer > 2 && layer < 7 && plane == BKLMElementNumbers::c_PhiPlane)
130 strips = 36;
131 if (layer > 6 && plane == BKLMElementNumbers::c_PhiPlane)
132 strips = 48;
133 if (layer == 1 && plane == BKLMElementNumbers::c_ZPlane)
134 strips = 54;
135 if (layer == 2 && plane == BKLMElementNumbers::c_ZPlane)
136 strips = 54;
137 if (layer > 2 && plane == BKLMElementNumbers::c_ZPlane)
138 strips = 48;
139 }
140 return strips;
141}
static bool checkSector(int sector, bool fatalError=true)
Check if sector number is correct.
static bool checkSection(int section, bool fatalError=true)
Check if section number is correct.
static bool checkLayer(int layer, bool fatalError=true)
Check if layer number is correct.
static bool checkPlane(int plane, bool fatalError=true)
Check if plane number is correct.

◆ getPlaneByModule()

static int getPlaneByModule ( int  module)
inlinestatic

Get plane number (0 = z, 1 = phi) by module identifier.

Definition at line 320 of file BKLMElementNumbers.h.

321 {
322 return (module & BKLM_PLANE_MASK) >> BKLM_PLANE_BIT;
323 }

◆ getSectionByModule()

static int getSectionByModule ( int  module)
inlinestatic

Get section number by module identifier.

Definition at line 296 of file BKLMElementNumbers.h.

297 {
298 return (module & BKLM_SECTION_MASK) >> BKLM_SECTION_BIT;
299 }

◆ getSectorByModule()

static int getSectorByModule ( int  module)
inlinestatic

Get sector number by module identifier.

Definition at line 304 of file BKLMElementNumbers.h.

305 {
306 return ((module & BKLM_SECTOR_MASK) >> BKLM_SECTOR_BIT) + 1;
307 }

◆ getStripByModule()

static int getStripByModule ( int  module)
inlinestatic

Get strip number by module identifier.

Definition at line 328 of file BKLMElementNumbers.h.

329 {
330 return ((module & BKLM_STRIP_MASK) >> BKLM_STRIP_BIT) + 1;
331 }

◆ getTotalChannelNumber()

static constexpr int getTotalChannelNumber ( )
inlinestaticconstexpr

Get total number of channels.

Definition at line 279 of file BKLMElementNumbers.h.

280 {
282 }
static constexpr int m_TotalChannelNumber
Total number of channels (1-based).

◆ hitsFromSameChannel()

static bool hitsFromSameChannel ( int  module1,
int  module2 
)
inlinestatic

Check whether the hits are from the same channel.

Definition at line 420 of file BKLMElementNumbers.h.

421 {
422 return getChannelByModule(module1) == getChannelByModule(module2);
423 }
static uint16_t getChannelByModule(int module)
Get channel number by module identifier.

◆ hitsFromSameModule()

static bool hitsFromSameModule ( int  module1,
int  module2 
)
inlinestatic

Check whether the hits are from the same module.

Definition at line 403 of file BKLMElementNumbers.h.

404 {
405 return getModuleByModule(module1) == getModuleByModule(module2);
406 }
static uint16_t getModuleByModule(int module)
Get module number by module identifier (the input identifier may contain other data).

◆ hitsFromSamePlane()

static bool hitsFromSamePlane ( int  module1,
int  module2 
)
inlinestatic

Check whether the hits are from the same plane.

Definition at line 411 of file BKLMElementNumbers.h.

412 {
413 const int mask = BKLM_MODULEID_MASK | BKLM_PLANE_MASK;
414 return (module1 & mask) == (module2 & mask);
415 }

◆ layerGlobalNumber()

int layerGlobalNumber ( int  section,
int  sector,
int  layer 
)
static

Get layer global number.

Parameters
[in]sectionSection (0-based).
[in]sectorSector (1-based).
[in]layerLayer (1-based).

Definition at line 96 of file BKLMElementNumbers.cc.

97{
98 checkSection(section);
99 checkSector(sector);
100 checkLayer(layer);
101 int layerGlobal = layer;
102 layerGlobal += (sector - 1) * m_MaximalLayerNumber;
103 layerGlobal += section * m_MaximalSectorNumber * m_MaximalLayerNumber;
104 return layerGlobal;
105}

◆ layerGlobalNumberToElementNumbers()

void layerGlobalNumberToElementNumbers ( int  layerGlobal,
int *  section,
int *  sector,
int *  layer 
)
static

Get element numbers by layer global number (0-based).

Parameters
[in]layerGlobalLayer global number.
[out]sectionSection (0-based).
[out]sectorSector (1-based).
[out]layerLayer (1-based).

Definition at line 195 of file BKLMElementNumbers.cc.

196{
197 *section = ((layerGlobal / m_MaximalLayerNumber) / m_MaximalSectorNumber) % (m_MaximalLayerNumber + 1);
198 *sector = ((layerGlobal / m_MaximalLayerNumber) % m_MaximalSectorNumber) + 1;
199 *layer = (layerGlobal % m_MaximalLayerNumber) + 1;
200}

◆ moduleNumber()

KLMModuleNumber moduleNumber ( int  section,
int  sector,
int  layer,
bool  fatalError = true 
)
static

Get module number.

Parameters
[in]sectionSection (0-based).
[in]sectorSector (1-based).
[in]layerLayer (1-based).
[in]fatalErrorIssue fatal error (default) or not.

Definition at line 69 of file BKLMElementNumbers.cc.

71{
72 checkSection(section);
73 checkSector(sector, fatalError);
74 checkLayer(layer, fatalError);
75 return (section << BKLM_SECTION_BIT)
76 | ((sector - 1) << BKLM_SECTOR_BIT)
77 | ((layer - 1) << BKLM_LAYER_BIT);
78}

◆ moduleNumberToElementNumbers()

void moduleNumberToElementNumbers ( KLMModuleNumber  module,
int *  section,
int *  sector,
int *  layer 
)
static

Get element numbers by module number.

Parameters
[in]moduleModule.
[out]sectionSection (0-based).
[out]sectorSector (1-based).
[out]layerLayer (1-based).

Definition at line 80 of file BKLMElementNumbers.cc.

82{
83 *section = ((module & BKLM_SECTION_MASK) >> BKLM_SECTION_BIT);
84 *sector = ((module & BKLM_SECTOR_MASK) >> BKLM_SECTOR_BIT) + 1;
85 *layer = ((module & BKLM_LAYER_MASK) >> BKLM_LAYER_BIT) + 1;
86}

◆ planeNumber()

KLMPlaneNumber planeNumber ( int  section,
int  sector,
int  layer,
int  plane 
)
static

Get plane number.

Parameters
[in]sectionSection (0-based).
[in]sectorSector (1-based).
[in]layerLayer (1-based).
[in]planePlane (0-based).

Definition at line 47 of file BKLMElementNumbers.cc.

49{
50 checkSection(section);
51 checkSector(sector);
52 checkLayer(layer);
53 checkPlane(plane);
54 return (section << BKLM_SECTION_BIT)
55 | ((sector - 1) << BKLM_SECTOR_BIT)
56 | ((layer - 1) << BKLM_LAYER_BIT)
57 | ((plane) << BKLM_PLANE_BIT);
58}

◆ planeNumberToElementNumbers()

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

Get element numbers by plane number.

Parameters
[in]planeGlobalPlane number.
[out]sectionSection (0-based).
[out]sectorSector (1-based).
[out]layerLayer (1-based).
[out]planePlane (0-based).

Definition at line 60 of file BKLMElementNumbers.cc.

62{
63 *section = ((planeGlobal & BKLM_SECTION_MASK) >> BKLM_SECTION_BIT);
64 *sector = ((planeGlobal & BKLM_SECTOR_MASK) >> BKLM_SECTOR_BIT) + 1;
65 *layer = ((planeGlobal & BKLM_LAYER_MASK) >> BKLM_LAYER_BIT) + 1;
66 *plane = ((planeGlobal & BKLM_PLANE_MASK) >> BKLM_PLANE_BIT);
67}

◆ sectorNumber()

KLMSectorNumber sectorNumber ( int  section,
int  sector 
)
static

Get sector number.

Parameters
[in]sectionSection (0-based).
[in]sectorSector (1-based).

Definition at line 88 of file BKLMElementNumbers.cc.

89{
90 checkSection(section);
91 checkSector(sector);
92 return (section ? BKLM_SECTION_MASK : 0)
93 | ((sector - 1) << BKLM_SECTOR_BIT);
94}

◆ setLayerInModule()

static void setLayerInModule ( int &  module,
int  layer 
)
inlinestatic

Set layer number in module identifier.

Parameters
[in,out]moduleModule identifier.
[in]layerLayer identifier.

Definition at line 358 of file BKLMElementNumbers.h.

359 {
360 module = (module & (~BKLM_LAYER_MASK)) | ((layer - 1) << BKLM_LAYER_BIT);
361 }

◆ setPlaneInModule()

static void setPlaneInModule ( int &  module,
int  plane 
)
inlinestatic

Set plane number in module identifier.

Parameters
[in,out]moduleModule identifier.
[in]planePlane.

Definition at line 368 of file BKLMElementNumbers.h.

369 {
370 module = (module & (~BKLM_PLANE_MASK)) | (plane << BKLM_PLANE_BIT);
371 }

◆ setSectionInModule()

static void setSectionInModule ( int &  module,
int  section 
)
inlinestatic

Set section number in module identifier.

Parameters
[in,out]moduleModule identifier.
[in]sectionSection.

Definition at line 338 of file BKLMElementNumbers.h.

339 {
340 module = (module & (~BKLM_SECTION_MASK)) | (section << BKLM_SECTION_BIT);
341 }

◆ setSectorInModule()

static void setSectorInModule ( int &  module,
int  sector 
)
inlinestatic

Set sector number in module identifier.

Parameters
[in,out]moduleModule identifier.
[in]sectorSector.

Definition at line 348 of file BKLMElementNumbers.h.

349 {
350 module = (module & (~BKLM_SECTOR_MASK)) | ((sector - 1) << BKLM_SECTOR_BIT);
351 }

◆ setStripInModule()

static void setStripInModule ( int &  module,
int  strip 
)
inlinestatic

Set strip number in module identifier.

Parameters
[in,out]moduleModule identifier.
[in]stripStrip.

Definition at line 378 of file BKLMElementNumbers.h.

379 {
380 module = (module & (~BKLM_STRIP_MASK)) | ((strip - 1) << BKLM_STRIP_BIT);
381 }

Member Data Documentation

◆ BKLM_LAYER_BIT

constexpr int BKLM_LAYER_BIT = 7
staticconstexprprotected

Bit position for layer-1 [0..14]; 0 is innermost.

Definition at line 452 of file BKLMElementNumbers.h.

◆ BKLM_LAYER_MASK

constexpr int BKLM_LAYER_MASK = (15 << BKLM_LAYER_BIT)
staticconstexprprotected

Bit mask for layer-1 [0..15]; 0 is innermost and 14 is outermost.

Definition at line 470 of file BKLMElementNumbers.h.

◆ BKLM_MODULEID_MASK

constexpr int BKLM_MODULEID_MASK
staticconstexprprotected
Initial value:

Bit mask for module identifier.

Definition at line 482 of file BKLMElementNumbers.h.

◆ BKLM_MODULESTRIPID_MASK

constexpr int BKLM_MODULESTRIPID_MASK
staticconstexprprotected
Initial value:

Bit mask for module-and-strip identifier.

Definition at line 486 of file BKLMElementNumbers.h.

◆ BKLM_PLANE_BIT

constexpr int BKLM_PLANE_BIT = 6
staticconstexprprotected

Bit position for plane-1 [0..1].

0 is inner-plane and phiReadout plane.

Definition at line 449 of file BKLMElementNumbers.h.

◆ BKLM_PLANE_MASK

constexpr int BKLM_PLANE_MASK = (1 << BKLM_PLANE_BIT)
staticconstexprprotected

Bit mask for plane-1 [0..1]; 0 is inner-plane and phiReadout plane,.

Definition at line 467 of file BKLMElementNumbers.h.

◆ BKLM_SECTION_BIT

constexpr int BKLM_SECTION_BIT = 14
staticconstexprprotected

Bit position for detector end [0..1]; forward is 0.

Definition at line 461 of file BKLMElementNumbers.h.

◆ BKLM_SECTION_MASK

constexpr int BKLM_SECTION_MASK = (1 << BKLM_SECTION_BIT)
staticconstexprprotected

Bit mask for detector end [0..1]; forward is 0.

Definition at line 479 of file BKLMElementNumbers.h.

◆ BKLM_SECTOR_BIT

constexpr int BKLM_SECTOR_BIT = 11
staticconstexprprotected

Bit position for sector-1 [0..7].

0 is on the +x axis and 2 is on the +y axis

Definition at line 458 of file BKLMElementNumbers.h.

◆ BKLM_SECTOR_MASK

constexpr int BKLM_SECTOR_MASK = (7 << BKLM_SECTOR_BIT)
staticconstexprprotected

Bit mask for sector-1 [0..7].

0 is on the +x axis and 2 is on the +y axis.

Definition at line 476 of file BKLMElementNumbers.h.

◆ BKLM_STRIP_BIT

constexpr int BKLM_STRIP_BIT = 0
staticconstexprprotected

Bit position for strip-1 [0..47].

Definition at line 443 of file BKLMElementNumbers.h.

◆ BKLM_STRIP_MASK

constexpr int BKLM_STRIP_MASK = (63 << BKLM_STRIP_BIT)
staticconstexprprotected

Bit mask for strip-1 [0..47].

Definition at line 464 of file BKLMElementNumbers.h.

◆ m_MaximalLayerNumber

constexpr int m_MaximalLayerNumber = 15
staticconstexprprotected

Maximal layer number (1-based).

Definition at line 434 of file BKLMElementNumbers.h.

◆ m_MaximalPlaneNumber

constexpr int m_MaximalPlaneNumber = 1
staticconstexprprotected

Maximal plane number (0-based).

Definition at line 437 of file BKLMElementNumbers.h.

◆ m_MaximalSectionNumber

constexpr int m_MaximalSectionNumber = 1
staticconstexprprotected

Maximal section number (0-based).

Definition at line 428 of file BKLMElementNumbers.h.

◆ m_MaximalSectorNumber

constexpr int m_MaximalSectorNumber = 8
staticconstexprprotected

Maximal sector number (1-based).

Definition at line 431 of file BKLMElementNumbers.h.

◆ m_TotalChannelNumber

constexpr int m_TotalChannelNumber = 21978
staticconstexprprotected

Total number of channels (1-based).

Definition at line 440 of file BKLMElementNumbers.h.


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