 |
Belle II Software
release-05-02-19
|
12 #include <klm/dataobjects/KLMElementNumbers.h>
15 #include <klm/dataobjects/bklm/BKLMElementNumbers.h>
18 #include <framework/logging/Logger.h>
34 return klmElementNumbers;
38 int subdetector,
int section,
int sector,
int layer,
int plane,
41 switch (subdetector) {
47 B2FATAL(
"Incorrect subdetector number: " << subdetector);
51 int section,
int sector,
int layer,
int plane,
int strip)
const
55 section, sector, layer, plane, strip);
65 int section,
int sector,
int layer,
int plane,
int strip)
const
73 section, layer, sector, plane, strip);
95 B2FATAL(
"Cannot get BKLM local channel number for non-BKLM channel.");
102 B2FATAL(
"Cannot get EKLM local channel number for non-EKLM channel.");
107 uint16_t channel,
int* subdetector,
int* section,
int* sector,
int* layer,
108 int* plane,
int* strip)
const
115 localChannel, section, sector, layer, plane, strip);
124 localChannel, section, layer, sector, plane, strip);
129 int section,
int sector,
int layer,
int plane)
const
131 uint16_t planeGlobal;
137 int section,
int sector,
int layer,
int plane)
const
139 uint16_t planeGlobal;
145 section, layer, sector, plane);
150 int subdetector,
int section,
int sector,
int layer)
const
152 if (subdetector ==
c_BKLM)
159 int section,
int sector,
int layer)
const
167 int section,
int sector,
int layer)
const
180 int subdetector, section, sector, layer, plane, strip;
182 &layer, &plane, &strip);
183 return moduleNumber(subdetector, section, sector, layer);
187 uint16_t module,
int* subdetector,
int* section,
int* sector,
195 localModule, section, sector, layer);
204 localModule, section, layer, sector);
212 int section, sector, layer;
214 localModule, §ion, §or, &layer);
238 if (subdetector ==
c_BKLM)
246 if (subdetector ==
c_BKLM)
255 if (subdetector ==
c_BKLM) {
258 name =
"BB" + std::to_string(sector - 1);
260 name =
"BF" + std::to_string(sector - 1);
262 if (subdetector ==
c_EKLM) {
265 name =
"EB" + std::to_string(sector - 1);
267 name =
"EF" + std::to_string(sector - 1);
270 B2FATAL(
"Invalid KLM sector."
271 <<
LogVar(
"Subdetector", subdetector)
272 <<
LogVar(
"Section", section)
273 <<
LogVar(
"Sector", sector));
uint16_t sectorNumberBKLM(int section, int sector) const
Get sector number for BKLM.
static uint16_t planeNumber(int section, int sector, int layer, int plane)
Get plane number.
static uint16_t sectorNumber(int section, int sector)
Get sector number.
bool isEKLMChannel(uint16_t channel) const
Determine whether a given channel is in EKLM.
static constexpr int getNStripsSector()
Get number of strips in a sector.
bool isBKLMChannel(uint16_t channel) const
Determine whether a given channel is in BKLM.
uint16_t moduleNumberByChannel(uint16_t channel) const
Get module number by channel number.
int localChannelNumberBKLM(uint16_t channel) const
Get local BKLM channel number.
void stripNumberToElementNumbers(int stripGlobal, int *section, int *layer, int *sector, int *plane, int *strip) const
Get element numbers by strip global number.
int planeNumber(int section, int layer, int sector, int plane) const
Get plane number.
int getMinimalPlaneNumber(int subdetector) const
Get minimal plane number.
uint16_t planeNumberBKLM(int section, int sector, int layer, int plane) const
Get plane number for BKLM.
int localChannelNumberEKLM(uint16_t channel) const
Get local EKLM channel number.
@ c_ForwardSection
Forward.
uint16_t channelNumber(int subdetector, int section, int sector, int layer, int plane, int strip) const
Get channel number.
int sectorNumberKLMOrder(int section, int sector) const
Get sector number (KLM order of elements: section, sector, layer).
static const KLMElementNumbers & Instance()
Instantiation.
void moduleNumberToElementNumbers(uint16_t module, int *subdetector, int *section, int *sector, int *layer) const
Get element numbers by module number.
~KLMElementNumbers()
Destructor.
uint16_t channelNumberBKLM(int section, int sector, int layer, int plane, int strip) const
Get channel number for BKLM.
@ c_BackwardSection
Backward.
KLMElementNumbers()
Constructor.
int sectorNumber(int section, int layer, int sector) const
Get sector number.
@ c_BackwardSection
Backward.
unsigned int getNChannelsModule(uint16_t module) const
Get number of channels in module.
static constexpr int getMaximalLayerNumber()
Get maximal layer number (1-based).
uint16_t sectorNumberEKLM(int section, int sector) const
Get sector number for EKLM.
Abstract base class for different kinds of events.
void sectorNumberToElementNumbers(int sectorGlobal, int *section, int *layer, int *sector) const
Get element numbers by sector global number.
static void channelNumberToElementNumbers(uint16_t channel, int *section, int *sector, int *layer, int *plane, int *strip)
Get element numbers by channel number.
Class to store variables with their name which were sent to the logging service.
static bool checkSector(int sector, bool fatalError=true)
Check if sector number is correct.
uint16_t moduleNumberEKLM(int section, int sector, int layer) const
Get module number for EKLM.
int stripNumber(int section, int layer, int sector, int plane, int strip) const
Get strip number.
uint16_t planeNumberEKLM(int section, int sector, int layer, int plane) const
Get channel number for EKLM.
uint16_t moduleNumberBKLM(int section, int sector, int layer) const
Get module number for BKLM.
uint16_t channelNumberEKLM(int section, int sector, int layer, int plane, int strip) const
Get channel number for EKLM.
static constexpr uint16_t m_BKLMOffset
BKLM offset.
@ c_ForwardSection
Forward.
uint16_t moduleNumber(int subdetector, int section, int sector, int layer) const
Get module number.
const EKLMElementNumbers * m_eklmElementNumbers
EKLM element numbers.
static void moduleNumberToElementNumbers(uint16_t module, int *section, int *sector, int *layer)
Get element numbers by module number.
static uint16_t channelNumber(int section, int sector, int layer, int plane, int strip)
Get channel number.
std::string getSectorDAQName(int subdetector, int section, int sector) const
Get DAQ name for a given sector.
static int getNStrips(int section, int sector, int layer, int plane)
Get number of strips.
bool checkSector(int sector, bool fatalError=true) const
Check if sector number is correct (fatal error if not).
int getExtrapolationLayer(int subdetector, int layer) const
Get extrapolation layer number (BKLM - from 1 to 15, EKLM - from 16 to 29).
static uint16_t moduleNumber(int section, int sector, int layer, bool fatalError=true)
Get module number.
void channelNumberToElementNumbers(uint16_t channel, int *subdetector, int *section, int *sector, int *layer, int *plane, int *strip) const
Get element numbers by channel number.