Belle II Software development
KLMElementNumbers.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11/* KLM headers. */
12#include <klm/dataobjects/bklm/BKLMElementNumbers.h>
13#include <klm/dataobjects/eklm/EKLMElementNumbers.h>
14
15/* C++ headers. */
16#include <cstdint>
17#include <string>
18
19namespace Belle2 {
29
30 public:
31
36
38 c_BKLM = 1,
39
41 c_EKLM = 2,
42
43 };
44
48 static const KLMElementNumbers& Instance();
49
59 KLMChannelNumber channelNumber(int subdetector, int section, int sector, int layer,
60 int plane, int strip) const;
61
70 KLMChannelNumber channelNumberBKLM(int section, int sector, int layer, int plane,
71 int strip) const;
72
77 KLMChannelNumber channelNumberBKLM(int bklmChannel) const;
78
87 KLMChannelNumber channelNumberEKLM(int section, int sector, int layer, int plane,
88 int strip) const;
89
94 KLMChannelNumber channelNumberEKLM(int eklmStrip) const;
95
101 bool isBKLMChannel(KLMChannelNumber channel) const;
102
108 bool isEKLMChannel(KLMChannelNumber channel) const;
109
115 int localChannelNumberBKLM(KLMChannelNumber channel) const;
116
122 int localChannelNumberEKLM(KLMChannelNumber channel) const;
123
135 KLMChannelNumber channel, int* subdetector, int* section, int* sector,
136 int* layer, int* plane, int* strip) const;
137
146 KLMPlaneNumber planeNumber(int subdetector, int section, int sector,
147 int layer, int plane) const;
148
156 KLMPlaneNumber planeNumberBKLM(int section, int sector, int layer,
157 int plane) const;
158
166 KLMPlaneNumber planeNumberEKLM(int section, int sector, int layer,
167 int plane) const;
168
176 KLMModuleNumber moduleNumber(int subdetector, int section, int sector,
177 int layer) const;
178
185 KLMModuleNumber moduleNumberBKLM(int section, int sector, int layer) const;
186
193 KLMModuleNumber moduleNumberEKLM(int section, int sector, int layer) const;
194
200
210 KLMModuleNumber module, int* subdetector, int* section, int* sector,
211 int* layer) const;
212
217 unsigned int getNChannelsModule(KLMModuleNumber module) const;
218
224 KLMSectorNumber sectorNumberBKLM(int section, int sector) const;
225
231 KLMSectorNumber sectorNumberEKLM(int section, int sector) const;
232
239 int getExtrapolationLayer(int subdetector, int layer) const;
240
244 static constexpr int getMaximalExtrapolationLayer()
245 {
248 }
249
253 static constexpr int getTotalModuleNumber()
254 {
257 }
258
263 int getMinimalPlaneNumber(int subdetector) const;
264
268 static constexpr int getMaximalPlaneNumber()
269 {
270 /* BKLM plane number is 0-based! */
273 }
274
281 std::string getSectorDAQName(int subdetector, int section, int sector) const;
282
286 static constexpr int getTotalChannelNumber()
287 {
290 }
291
292 private:
293
298
303
305 static constexpr uint16_t m_BKLMOffset = 0x8000;
306
309
310 };
311
313}
static constexpr int getMaximalLayerGlobalNumber()
Get maximal layer global number.
static constexpr int getTotalChannelNumber()
Get total number of channels.
static constexpr int getMaximalLayerNumber()
Get maximal layer number (1-based).
static constexpr int getMaximalPlaneNumber()
Get maximal plane number (0-based).
EKLM element numbers.
static constexpr int getTotalChannelNumber()
Get total number of channels.
static constexpr int getMaximalLayerNumber()
Get maximal layer number.
static constexpr int getMaximalSectorGlobalNumber()
Get maximal sector global number.
static constexpr int getMaximalPlaneNumber()
Get maximal plane number.
KLM element numbers.
KLMSectorNumber sectorNumberEKLM(int section, int sector) const
Get sector number for EKLM.
KLMModuleNumber moduleNumberByChannel(KLMChannelNumber channel) const
Get module number by channel number.
KLMChannelNumber channelNumberBKLM(int section, int sector, int layer, int plane, int strip) const
Get channel number for BKLM.
static constexpr uint16_t m_BKLMOffset
BKLM offset.
KLMChannelNumber channelNumber(int subdetector, int section, int sector, int layer, int plane, int strip) const
Get channel number.
const EKLMElementNumbers * m_eklmElementNumbers
EKLM element numbers.
int getMinimalPlaneNumber(int subdetector) const
Get minimal plane number.
static const KLMElementNumbers & Instance()
Instantiation.
static constexpr int getTotalChannelNumber()
Get total number of channels.
int localChannelNumberEKLM(KLMChannelNumber channel) const
Get local EKLM channel number.
KLMPlaneNumber planeNumber(int subdetector, int section, int sector, int layer, int plane) const
Get plane number.
static constexpr int getTotalModuleNumber()
Get total number of modules.
KLMPlaneNumber planeNumberEKLM(int section, int sector, int layer, int plane) const
Get channel number for EKLM.
Subdetector
Subdetector constants.
bool isEKLMChannel(KLMChannelNumber channel) const
Determine whether a given channel is in EKLM.
void channelNumberToElementNumbers(KLMChannelNumber channel, int *subdetector, int *section, int *sector, int *layer, int *plane, int *strip) const
Get element numbers by channel number.
unsigned int getNChannelsModule(KLMModuleNumber module) const
Get number of channels in module.
int getExtrapolationLayer(int subdetector, int layer) const
Get extrapolation layer number (BKLM - from 1 to 15, EKLM - from 16 to 29).
void moduleNumberToElementNumbers(KLMModuleNumber module, int *subdetector, int *section, int *sector, int *layer) const
Get element numbers by module number.
KLMPlaneNumber planeNumberBKLM(int section, int sector, int layer, int plane) const
Get plane number for BKLM.
KLMModuleNumber moduleNumberBKLM(int section, int sector, int layer) const
Get module number for BKLM.
KLMModuleNumber moduleNumber(int subdetector, int section, int sector, int layer) const
Get module number.
KLMSectorNumber sectorNumberBKLM(int section, int sector) const
Get sector number for BKLM.
std::string getSectorDAQName(int subdetector, int section, int sector) const
Get DAQ name for a given sector.
static constexpr int getMaximalExtrapolationLayer()
Get maximal extrapolation layer.
KLMModuleNumber moduleNumberEKLM(int section, int sector, int layer) const
Get module number for EKLM.
bool isBKLMChannel(KLMChannelNumber channel) const
Determine whether a given channel is in BKLM.
static constexpr int getMaximalPlaneNumber()
Get maximal plane number.
int localChannelNumberBKLM(KLMChannelNumber channel) const
Get local BKLM channel number.
KLMChannelNumber channelNumberEKLM(int section, int sector, int layer, int plane, int strip) const
Get channel number for EKLM.
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.