10#include <klm/dataobjects/bklm/BKLMElementNumbers.h>
13#include <rawdata/dataobjects/RawCOPPERFormat.h>
26 int section,
int sector,
int layer,
int plane,
int strip)
48 int section,
int sector,
int layer,
int plane)
61 KLMPlaneNumber planeGlobal,
int* section,
int* sector,
int* layer,
int* plane)
70 int section,
int sector,
int layer,
bool fatalError)
101 int layerGlobal = layer;
108 int section,
int sector,
int layer,
int plane)
147 B2FATAL(
"Invalid BKLM section number: " << section <<
".");
157 B2FATAL(
"Invalid BKLM sector number: " << sector <<
".");
167 B2FATAL(
"Invalid BKLM layer number: " << layer <<
".");
177 B2FATAL(
"Invalid BKLM plane number: " << plane <<
".");
184 int section,
int sector,
int layer,
int plane,
int strip,
bool fatalError)
186 if (strip < 1 || strip >
getNStrips(section, sector, layer, plane)) {
188 B2FATAL(
"Invalid BKLM channel number: section = " << section <<
", sector = " << sector <<
", layer = " << layer <<
", plane = " <<
189 plane <<
", strip = " << strip <<
".");
204 char hslb =
'a' + slot - 1;
205 return "700" + std::to_string(copper - BKLM_ID) + hslb;
static void planeNumberToElementNumbers(KLMPlaneNumber planeGlobal, int *section, int *sector, int *layer, int *plane)
Get element numbers by plane number.
static constexpr int BKLM_STRIP_BIT
Bit position for strip-1 [0..47].
static void channelNumberToElementNumbers(KLMChannelNumber channel, int *section, int *sector, int *layer, int *plane, int *strip)
Get element numbers by channel number.
@ c_ChimneySector
Chimney sector: BB3 in 1-based notation; BB2 in 0-based notation.
static constexpr int m_MaximalPlaneNumber
Maximal plane number (0-based).
static KLMPlaneNumber planeNumber(int section, int sector, int layer, int plane)
Get plane number.
static constexpr int BKLM_PLANE_BIT
Bit position for plane-1 [0..1].
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.
BKLMElementNumbers()
Constructor.
static bool checkChannelNumber(int section, int sector, int layer, int plane, int strip, bool fatalError=true)
Check channel number.
static constexpr int BKLM_SECTOR_MASK
Bit mask for sector-1 [0..7].
static KLMChannelNumber channelNumber(int section, int sector, int layer, int plane, int strip)
Get channel number.
static bool checkLayer(int layer, bool fatalError=true)
Check if layer number is correct.
static void layerGlobalNumberToElementNumbers(int layerGlobal, int *section, int *sector, int *layer)
Get element numbers by layer global number (0-based).
static bool checkPlane(int plane, bool fatalError=true)
Check if plane number is correct.
static constexpr int BKLM_LAYER_MASK
Bit mask for layer-1 [0..15]; 0 is innermost and 14 is outermost.
static KLMSectorNumber sectorNumber(int section, int sector)
Get sector number.
static constexpr int BKLM_PLANE_MASK
Bit mask for plane-1 [0..1]; 0 is inner-plane and phiReadout plane,.
@ c_ForwardSection
Forward.
@ c_BackwardSection
Backward.
static std::string getHSLBName(int copper, int slot)
Get HSLB name.
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_SECTION_MASK
Bit mask for detector end [0..1]; forward is 0.
static constexpr int m_MaximalSectorNumber
Maximal sector number (1-based).
static KLMModuleNumber moduleNumber(int section, int sector, int layer, bool fatalError=true)
Get module number.
static constexpr int m_MaximalLayerNumber
Maximal layer number (1-based).
static void moduleNumberToElementNumbers(KLMModuleNumber module, int *section, int *sector, int *layer)
Get element numbers by module number.
~BKLMElementNumbers()
Destructor.
static int layerGlobalNumber(int section, int sector, int layer)
Get layer global number.
static constexpr int BKLM_LAYER_BIT
Bit position for layer-1 [0..14]; 0 is innermost.
static constexpr int BKLM_STRIP_MASK
Bit mask for strip-1 [0..47].
static int getNStrips(int section, int sector, int layer, int plane)
Get number of strips.
uint16_t KLMSectorNumber
Sector number.
uint16_t KLMChannelNumber
Channel number.
uint16_t KLMModuleNumber
Module number.
uint16_t KLMPlaneNumber
Plane number.
Abstract base class for different kinds of events.