Belle II Software  release-06-01-15
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 
19 namespace Belle2 {
29 
30  public:
31 
35  enum Subdetector {
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 
145  KLMPlaneNumber planeNumberBKLM(int section, int sector, int layer,
146  int plane) const;
147 
155  KLMPlaneNumber planeNumberEKLM(int section, int sector, int layer,
156  int plane) const;
157 
165  KLMModuleNumber moduleNumber(int subdetector, int section, int sector,
166  int layer) const;
167 
174  KLMModuleNumber moduleNumberBKLM(int section, int sector, int layer) const;
175 
182  KLMModuleNumber moduleNumberEKLM(int section, int sector, int layer) const;
183 
189 
199  KLMModuleNumber module, int* subdetector, int* section, int* sector,
200  int* layer) const;
201 
206  unsigned int getNChannelsModule(KLMModuleNumber module) const;
207 
213  KLMSectorNumber sectorNumberBKLM(int section, int sector) const;
214 
220  KLMSectorNumber sectorNumberEKLM(int section, int sector) const;
221 
228  int getExtrapolationLayer(int subdetector, int layer) const;
229 
233  static constexpr int getMaximalExtrapolationLayer()
234  {
237  }
238 
242  static constexpr int getTotalModuleNumber()
243  {
246  }
247 
252  int getMinimalPlaneNumber(int subdetector) const;
253 
260  std::string getSectorDAQName(int subdetector, int section, int sector) const;
261 
265  static constexpr int getTotalChannelNumber()
266  {
269  }
270 
271  private:
272 
277 
282 
284  static constexpr uint16_t m_BKLMOffset = 0x8000;
285 
288 
289  };
290 
292 }
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).
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.
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.
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.
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.