Belle II Software development
EKLMElementNumbers.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/* ROOT headers. */
12#include <TObject.h>
13
14namespace Belle2 {
24 class EKLMElementNumbers : public TObject {
25
26 public:
27
31 enum Section {
32
35
38
39 };
40
44 static const EKLMElementNumbers& Instance();
45
52 bool checkSection(int section, bool fatalError = true) const;
53
60 bool checkLayer(int layer, bool fatalError = true) const;
61
70 bool checkDetectorLayer(int section, int layer,
71 bool fatalError = true) const;
72
79 bool checkSector(int sector, bool fatalError = true) const;
80
87 bool checkPlane(int plane, bool fatalError = true) const;
88
95 bool checkSegment(int segment, bool fatalError = true) const;
96
103 bool checkStrip(int strip, bool fatalError = true) const;
104
113 int detectorLayerNumber(int section, int layer) const;
114
122 int layerGlobal, int* section, int* layer) const;
123
133 int sectorNumber(int section, int layer, int sector) const;
134
143 int sectorNumberKLMOrder(int section, int sector) const;
144
153 int sectorGlobal, int* section, int* layer, int* sector) const;
154
165 int planeNumber(int section, int layer, int sector, int plane) const;
166
176 int planeGlobal, int* section, int* layer, int* sector, int* plane)
177 const;
178
190 int segmentNumber(int section, int layer, int sector, int plane,
191 int segment) const;
192
203 int segmentGlobal, int* section, int* layer, int* sector, int* plane,
204 int* segment) const;
205
217 int stripNumber(int section, int layer, int sector, int plane,
218 int strip) const;
219
230 int stripGlobal, int* section, int* layer, int* sector, int* plane,
231 int* strip) const;
232
237 int getSectionByGlobalStrip(int stripGlobal);
238
243 int getLayerByGlobalStrip(int stripGlobal);
244
249 int getSectorByGlobalStrip(int stripGlobal);
250
255 int getPlaneByGlobalStrip(int stripGlobal);
256
261 int getStripByGlobalStrip(int stripGlobal);
262
268 static std::string getHSLBName(int copper, int slot);
269
273 static constexpr int getMaximalSectionNumber()
274 {
276 }
277
281 static constexpr int getMaximalLayerNumber()
282 {
284 }
285
290 int getMaximalDetectorLayerNumber(int section) const;
291
295 static constexpr int getMaximalSectorNumber()
296 {
298 }
299
303 static constexpr int getMaximalPlaneNumber()
304 {
306 }
307
311 static constexpr int getMaximalSegmentNumber()
312 {
314 }
315
319 static constexpr int getMaximalStripNumber()
320 {
322 }
323
327 static constexpr int getMaximalLayerGlobalNumber()
328 {
330 }
331
335 static constexpr int getMaximalSectorGlobalNumber()
336 {
338 }
339
344 {
346 }
347
351 static constexpr int getMaximalPlaneGlobalNumber()
352 {
354 }
355
359 static constexpr int getMaximalSegmentGlobalNumber()
360 {
362 }
363
367 static constexpr int getMaximalStripGlobalNumber()
368 {
370 }
371
375 static constexpr int getNStripsLayer()
376 {
378 }
379
383 static constexpr int getNStripsSector()
384 {
386 }
387
391 static constexpr int getNStripsSegment()
392 {
393 return m_NStripsSegment;
394 }
395
399 static constexpr int getTotalChannelNumber()
400 {
402 }
403
404 private:
405
410
415
416 protected:
417
419 static constexpr int m_MaximalSectionNumber = 2;
420
422 static constexpr int m_MaximalLayerNumber = 14;
423
425 static constexpr int m_MaximalDetectorLayerNumber[2] = {12, 14};
426
428 static constexpr int m_MaximalSectorNumber = 4;
429
431 static constexpr int m_MaximalPlaneNumber = 2;
432
434 static constexpr int m_MaximalSegmentNumber = 5;
435
437 static constexpr int m_MaximalStripNumber = 75;
438
440 static constexpr int m_NStripsSegment = 15;
441
443 static constexpr int m_TotalChannelNumber = 15600;
444
445 private:
446
449
450 };
451
453}
EKLM element numbers.
static constexpr int getNStripsSector()
Get number of strips in a sector.
static constexpr int m_MaximalStripNumber
Maximal strip number.
bool checkLayer(int layer, bool fatalError=true) const
Check if layer number is correct.
ClassDef(EKLMElementNumbers, 3)
Class version.
static constexpr int getMaximalLayerGlobalNumber()
Get maximal detector layer global number.
void planeNumberToElementNumbers(int planeGlobal, int *section, int *layer, int *sector, int *plane) const
Get element numbers by plane global number.
int getMaximalDetectorLayerNumber(int section) const
Get maximal detector layer number.
static const EKLMElementNumbers & Instance()
Instantiation.
int sectorNumber(int section, int layer, int sector) const
Get sector number.
void sectorNumberToElementNumbers(int sectorGlobal, int *section, int *layer, int *sector) const
Get element numbers by sector global number.
static constexpr int m_MaximalPlaneNumber
Maximal plane number.
static constexpr int m_MaximalSectionNumber
Maximal section number.
static constexpr int getMaximalStripNumber()
Get maximal strip number.
static constexpr int m_MaximalDetectorLayerNumber[2]
Maximal detector layer number.
int getPlaneByGlobalStrip(int stripGlobal)
Get plane number by global strip number.
bool checkPlane(int plane, bool fatalError=true) const
Check if plane number is correct (fatal error if not).
bool checkDetectorLayer(int section, int layer, bool fatalError=true) const
Check if detector layer number is correct (fatal error if not).
int getStripByGlobalStrip(int stripGlobal)
Get strip number by global strip number.
static constexpr int getTotalChannelNumber()
Get total number of channels.
int getSectorByGlobalStrip(int stripGlobal)
Get sector number by global strip number.
bool checkStrip(int strip, bool fatalError=true) const
Check if strip number is correct (fatal error if not).
static constexpr int getNStripsLayer()
Get number of strips in a layer.
void layerNumberToElementNumbers(int layerGlobal, int *section, int *layer) const
Get element numbers by detector layer global number.
int detectorLayerNumber(int section, int layer) const
Get detector layer number.
bool checkSegment(int segment, bool fatalError=true) const
Check if segment number is correct (fatal error if not).
int stripNumber(int section, int layer, int sector, int plane, int strip) const
Get strip number.
int sectorNumberKLMOrder(int section, int sector) const
Get sector number (KLM order of elements: section, sector, layer).
static constexpr int m_NStripsSegment
Number of strips in a segment.
void stripNumberToElementNumbers(int stripGlobal, int *section, int *layer, int *sector, int *plane, int *strip) const
Get element numbers by strip global number.
static constexpr int getMaximalLayerNumber()
Get maximal layer number.
static constexpr int getMaximalPlaneGlobalNumber()
Get maximal plane global number.
bool checkSector(int sector, bool fatalError=true) const
Check if sector number is correct (fatal error if not).
static constexpr int getMaximalStripGlobalNumber()
Get maximal strip global number.
Section
Constants for section numbers.
static std::string getHSLBName(int copper, int slot)
Get HSLB name.
static constexpr int getMaximalSectorNumber()
Get maximal sector number.
static constexpr int getNStripsSegment()
Get number of strips in a segment.
static constexpr int m_MaximalSectorNumber
Maximal sector number.
static constexpr int getMaximalSegmentGlobalNumber()
Get maximal segment global number.
int getSectionByGlobalStrip(int stripGlobal)
Get section number by global strip number.
static constexpr int getMaximalSectionNumber()
Get maximal section number.
int segmentNumber(int section, int layer, int sector, int plane, int segment) const
Get segment number.
static constexpr int m_MaximalLayerNumber
Maximal layer number.
static constexpr int m_TotalChannelNumber
Total number of channels.
int getLayerByGlobalStrip(int stripGlobal)
Get layer number by global strip number.
static constexpr int getMaximalSectorGlobalNumber()
Get maximal sector global number.
bool checkSection(int section, bool fatalError=true) const
Check if section number is correct.
int planeNumber(int section, int layer, int sector, int plane) const
Get plane number.
static constexpr int m_MaximalSegmentNumber
Maximal segment number.
static constexpr int getMaximalPlaneNumber()
Get maximal plane number.
static constexpr int getMaximalSectorGlobalNumberKLMOrder()
Get maximal sector global number with KLM ordering (section, sector).
void segmentNumberToElementNumbers(int segmentGlobal, int *section, int *layer, int *sector, int *plane, int *segment) const
Get element numbers by segment global number.
static constexpr int getMaximalSegmentNumber()
Get maximal segment number.
Abstract base class for different kinds of events.