Belle II Software  release-08-01-10
KLMChannelIndex.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/KLMElementNumbers.h>
13 
14 namespace Belle2 {
24 
25  public:
26 
30  enum IndexLevel {
31 
34 
37 
40 
43 
46 
49 
50  };
51 
56  explicit KLMChannelIndex(enum IndexLevel indexLevel = c_IndexLevelStrip);
57 
68  KLMChannelIndex(int subdetector, int section, int sector,
69  int layer, int plane, int strip,
70  enum IndexLevel indexLevel = c_IndexLevelStrip);
71 
76 
81  void setIndexLevel(enum IndexLevel indexLevel);
82 
89  void useEKLMSegments(bool useSegments = true);
90 
95  void setKLMModule(KLMModuleNumber module);
96 
101  void setEKLMSegment(int segment);
102 
106  int getSubdetector() const
107  {
108  return m_Subdetector;
109  }
110 
114  int getSection() const
115  {
116  return m_Section;
117  }
118 
122  int getSector() const
123  {
124  return m_Sector;
125  }
126 
130  int getLayer() const
131  {
132  return m_Layer;
133  }
134 
138  int getPlane() const
139  {
140  return m_Plane;
141  }
142 
146  int getStrip() const
147  {
148  return m_Strip;
149  }
150 
155 
160 
165 
170 
174  int getEKLMSegmentNumber() const;
175 
180 
185 
190 
195 
200  {
201  return beginBKLM();
202  }
203 
208  {
209  return endEKLM();
210  }
211 
216 
221 
225  bool operator==(const KLMChannelIndex& index) const;
226 
230  bool operator!=(const KLMChannelIndex& index) const;
231 
236 
237  protected:
238 
242  void setNStripsPlane();
243 
247  void increment(enum IndexLevel indexLevel);
248 
251 
254 
257 
259  int m_Sector;
260 
262  int m_Layer;
263 
265  int m_Plane;
266 
268  int m_Strip;
269 
271  bool m_UseEKLMSegments = false;
272 
275 
278 
281 
282  };
283 
285 }
EKLM element numbers.
KLM channel index.
KLMChannelIndex & endEKLM()
Last channel for EKLM.
KLMChannelIndex beginBKLM()
First channel for BKLM.
int getSubdetector() const
Get subdetector.
int getLayer() const
Get layer.
KLMChannelIndex begin()
First channel.
KLMChannelIndex & end()
Last channel.
int getSection() const
Get section.
int getPlane() const
Get plane.
const KLMElementNumbers * m_ElementNumbers
KLM element numbers.
KLMChannelIndex & operator*()
Operator *.
int getStrip() const
Get strip.
KLMChannelIndex & operator++()
Operator ++.
const EKLMElementNumbers * m_eklmElementNumbers
EKLM element numbers.
int getEKLMSegmentNumber() const
Get EKLM segment number.
KLMModuleNumber getKLMModuleNumber() const
Get KLM module number.
int getSector() const
Get sector.
IndexLevel
Index level (loop over KLM elements at the specified level).
@ c_IndexLevelSubdetector
Subdetector (BKLM or EKLM).
KLMChannelIndex & increment()
Increment (to use in Python).
void setEKLMSegment(int segment)
Set EKLM segment.
KLMChannelNumber getKLMChannelNumber() const
Get KLM channel number.
bool operator==(const KLMChannelIndex &index) const
Operator ==.
int m_NStripsPlane
Number of strips in current plane.
bool operator!=(const KLMChannelIndex &index) const
Operator !=.
bool m_UseEKLMSegments
Iterate over EKLM segments instead of strips.
void setIndexLevel(enum IndexLevel indexLevel)
Set index level.
KLMSectorNumber getKLMSectorNumber() const
Get KLM sector number.
void useEKLMSegments(bool useSegments=true)
Iterate over EKLM segments instead of strips.
int m_Subdetector
Subdetector.
KLMChannelIndex & endBKLM()
Last channel for BKLM.
KLMChannelIndex(enum IndexLevel indexLevel=c_IndexLevelStrip)
Constructor.
void setNStripsPlane()
Set number of strips in the current plane.
KLMChannelIndex beginEKLM()
First channel for EKLM.
enum IndexLevel m_IndexLevel
Index level.
void setKLMModule(KLMModuleNumber module)
Set KLM module.
KLMPlaneNumber getKLMPlaneNumber() const
Get KLM plane number.
KLM element numbers.
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.