Belle II Software  release-08-01-10
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. More...
 
static void channelNumberToElementNumbers (KLMChannelNumber channel, int *section, int *sector, int *layer, int *plane, int *strip)
 Get element numbers by channel number. More...
 
static KLMPlaneNumber planeNumber (int section, int sector, int layer, int plane)
 Get plane number. More...
 
static void planeNumberToElementNumbers (KLMPlaneNumber planeGlobal, int *section, int *sector, int *layer, int *plane)
 Get element numbers by plane number. More...
 
static KLMModuleNumber moduleNumber (int section, int sector, int layer, bool fatalError=true)
 Get module number. More...
 
static void moduleNumberToElementNumbers (KLMModuleNumber module, int *section, int *sector, int *layer)
 Get element numbers by module number. More...
 
static KLMSectorNumber sectorNumber (int section, int sector)
 Get sector number. More...
 
static int layerGlobalNumber (int section, int sector, int layer)
 Get layer global number. More...
 
static int getNStrips (int section, int sector, int layer, int plane)
 Get number of strips. More...
 
static bool checkSection (int section, bool fatalError=true)
 Check if section number is correct. More...
 
static bool checkSector (int sector, bool fatalError=true)
 Check if sector number is correct. More...
 
static bool checkLayer (int layer, bool fatalError=true)
 Check if layer number is correct. More...
 
static bool checkPlane (int plane, bool fatalError=true)
 Check if plane number is correct. More...
 
static bool checkChannelNumber (int section, int sector, int layer, int plane, int strip, bool fatalError=true)
 Check channel number. More...
 
static std::string getHSLBName (int copper, int slot)
 Get HSLB name. More...
 
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). More...
 
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. More...
 
static void setSectorInModule (int &module, int sector)
 Set sector number in module identifier. More...
 
static void setLayerInModule (int &module, int layer)
 Set layer number in module identifier. More...
 
static void setPlaneInModule (int &module, int plane)
 Set plane number in module identifier. More...
 
static void setStripInModule (int &module, int strip)
 Set strip number in module identifier. More...
 
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]. More...
 
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]. More...
 
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]. More...
 
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. More...
 
static constexpr int BKLM_MODULESTRIPID_MASK
 Bit mask for module-and-strip identifier. More...
 

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 
64  c_FirstRPCLayer = 3,
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.

◆ Section

enum Section

Constants for section numbers.

Enumerator
c_BackwardSection 

Backward.

c_ForwardSection 

Forward.

Definition at line 34 of file BKLMElementNumbers.h.

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

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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Member Data Documentation

◆ BKLM_MODULEID_MASK

constexpr int BKLM_MODULEID_MASK
staticconstexprprotected
Initial value:
=
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_SECTION_MASK
Bit mask for detector end [0..1]; forward is 0.

Bit mask for module identifier.

Definition at line 482 of file BKLMElementNumbers.h.

◆ BKLM_MODULESTRIPID_MASK

constexpr int BKLM_MODULESTRIPID_MASK
staticconstexprprotected
Initial value:
=
static constexpr int BKLM_PLANE_MASK
Bit mask for plane-1 [0..1]; 0 is inner-plane and phiReadout plane,.
static constexpr int BKLM_STRIP_MASK
Bit mask for strip-1 [0..47].

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


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