Belle II Software  release-05-02-19
KLMChannelIndex.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2019 Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Kirill Chilikin *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 /* KLM headers. */
14 #include <klm/dataobjects/KLMElementNumbers.h>
15 
16 namespace Belle2 {
25  class KLMChannelIndex {
26 
27  public:
28 
32  enum IndexLevel {
33 
36 
39 
42 
45 
48 
51 
52  };
53 
58  explicit KLMChannelIndex(enum IndexLevel indexLevel = c_IndexLevelStrip);
59 
70  KLMChannelIndex(int subdetector, int section, int sector,
71  int layer, int plane, int strip,
72  enum IndexLevel indexLevel = c_IndexLevelStrip);
73 
78 
83  void setIndexLevel(enum IndexLevel indexLevel);
84 
91  void useEKLMSegments(bool useSegments = true);
92 
97  void setKLMModule(uint16_t module);
98 
103  void setEKLMSegment(int segment);
104 
108  int getSubdetector() const
109  {
110  return m_Subdetector;
111  }
112 
116  int getSection() const
117  {
118  return m_Section;
119  }
120 
124  int getSector() const
125  {
126  return m_Sector;
127  }
128 
132  int getLayer() const
133  {
134  return m_Layer;
135  }
136 
140  int getPlane() const
141  {
142  return m_Plane;
143  }
144 
148  int getStrip() const
149  {
150  return m_Strip;
151  }
152 
156  uint16_t getKLMChannelNumber() const;
157 
161  uint16_t getKLMPlaneNumber() const;
162 
166  uint16_t getKLMModuleNumber() const;
167 
171  uint16_t getKLMSectorNumber() const;
172 
176  int getEKLMSegmentNumber() const;
177 
182 
187 
192 
197 
202  {
203  return beginBKLM();
204  }
205 
210  {
211  return endEKLM();
212  }
213 
218 
223 
227  bool operator==(const KLMChannelIndex& index);
228 
232  bool operator!=(const KLMChannelIndex& index);
233 
238 
239  protected:
240 
244  void setNStripsPlane();
245 
249  void increment(enum IndexLevel indexLevel);
250 
253 
255  int m_Subdetector;
256 
258  int m_Section;
259 
261  int m_Sector;
262 
264  int m_Layer;
265 
267  int m_Plane;
268 
270  int m_Strip;
271 
273  bool m_UseEKLMSegments = false;
274 
276  int m_NStripsPlane;
277 
280 
283 
284  };
285 
287 }
Belle2::KLMChannelIndex::endEKLM
KLMChannelIndex & endEKLM()
Last channel for EKLM.
Definition: KLMChannelIndex.cc:211
Belle2::KLMChannelIndex::getSector
int getSector() const
Get sector.
Definition: KLMChannelIndex.h:132
Belle2::KLMChannelIndex::operator*
KLMChannelIndex & operator*()
Operator *.
Definition: KLMChannelIndex.cc:382
Belle2::KLMChannelIndex::endBKLM
KLMChannelIndex & endBKLM()
Last channel for BKLM.
Definition: KLMChannelIndex.cc:195
Belle2::KLMChannelIndex::operator!=
bool operator!=(const KLMChannelIndex &index)
Operator !=.
Definition: KLMChannelIndex.cc:352
Belle2::EKLMElementNumbers
EKLM element numbers.
Definition: EKLMElementNumbers.h:34
Belle2::KLMChannelIndex::getStrip
int getStrip() const
Get strip.
Definition: KLMChannelIndex.h:156
Belle2::KLMChannelIndex::c_IndexLevelSection
@ c_IndexLevelSection
Section.
Definition: KLMChannelIndex.h:46
Belle2::KLMChannelIndex::operator==
bool operator==(const KLMChannelIndex &index)
Operator ==.
Definition: KLMChannelIndex.cc:322
Belle2::KLMChannelIndex::c_IndexLevelLayer
@ c_IndexLevelLayer
Layer.
Definition: KLMChannelIndex.h:52
Belle2::KLMChannelIndex::end
KLMChannelIndex & end()
Last channel.
Definition: KLMChannelIndex.h:217
Belle2::KLMChannelIndex::m_IndexLevel
enum IndexLevel m_IndexLevel
Index level.
Definition: KLMChannelIndex.h:260
Belle2::KLMChannelIndex::getSection
int getSection() const
Get section.
Definition: KLMChannelIndex.h:124
Belle2::KLMChannelIndex::KLMChannelIndex
KLMChannelIndex(enum IndexLevel indexLevel=c_IndexLevelStrip)
Constructor.
Definition: KLMChannelIndex.cc:20
Belle2::KLMChannelIndex::beginEKLM
KLMChannelIndex beginEKLM()
First channel for EKLM.
Definition: KLMChannelIndex.cc:205
Belle2::KLMChannelIndex::getKLMSectorNumber
uint16_t getKLMSectorNumber() const
Get KLM sector number.
Definition: KLMChannelIndex.cc:175
Belle2::KLMChannelIndex::getLayer
int getLayer() const
Get layer.
Definition: KLMChannelIndex.h:140
Belle2::KLMChannelIndex::getSubdetector
int getSubdetector() const
Get subdetector.
Definition: KLMChannelIndex.h:116
Belle2::KLMChannelIndex::increment
KLMChannelIndex & increment()
Increment (to use in Python).
Definition: KLMChannelIndex.cc:316
Belle2::KLMChannelIndex::~KLMChannelIndex
~KLMChannelIndex()
Destructor.
Definition: KLMChannelIndex.cc:50
Belle2::KLMChannelIndex::getKLMChannelNumber
uint16_t getKLMChannelNumber() const
Get KLM channel number.
Definition: KLMChannelIndex.cc:145
Belle2::KLMChannelIndex::beginBKLM
KLMChannelIndex beginBKLM()
First channel for BKLM.
Definition: KLMChannelIndex.cc:189
Belle2::KLMChannelIndex::c_IndexLevelSector
@ c_IndexLevelSector
Sector.
Definition: KLMChannelIndex.h:49
Belle2::KLMChannelIndex::IndexLevel
IndexLevel
Index level (loop over KLM elements at the specified level).
Definition: KLMChannelIndex.h:40
Belle2::KLMChannelIndex::c_IndexLevelPlane
@ c_IndexLevelPlane
Plane.
Definition: KLMChannelIndex.h:55
Belle2::KLMChannelIndex::setNStripsPlane
void setNStripsPlane()
Set number of strips in the current plane.
Definition: KLMChannelIndex.cc:54
Belle2::KLMChannelIndex::operator++
KLMChannelIndex & operator++()
Operator ++.
Definition: KLMChannelIndex.cc:310
Belle2::KLMChannelIndex::c_IndexLevelSubdetector
@ c_IndexLevelSubdetector
Subdetector (BKLM or EKLM).
Definition: KLMChannelIndex.h:43
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::KLMChannelIndex::begin
KLMChannelIndex begin()
First channel.
Definition: KLMChannelIndex.h:209
Belle2::KLMChannelIndex::m_Strip
int m_Strip
Strip.
Definition: KLMChannelIndex.h:278
Belle2::KLMChannelIndex::useEKLMSegments
void useEKLMSegments(bool useSegments=true)
Iterate over EKLM segments instead of strips.
Definition: KLMChannelIndex.cc:117
Belle2::KLMChannelIndex::setKLMModule
void setKLMModule(uint16_t module)
Set KLM module.
Definition: KLMChannelIndex.cc:123
Belle2::KLMChannelIndex::m_eklmElementNumbers
const EKLMElementNumbers * m_eklmElementNumbers
EKLM element numbers.
Definition: KLMChannelIndex.h:290
Belle2::KLMChannelIndex::getEKLMSegmentNumber
int getEKLMSegmentNumber() const
Get EKLM segment number.
Definition: KLMChannelIndex.cc:183
Belle2::KLMChannelIndex::getPlane
int getPlane() const
Get plane.
Definition: KLMChannelIndex.h:148
Belle2::KLMChannelIndex::m_Section
int m_Section
Section.
Definition: KLMChannelIndex.h:266
Belle2::KLMChannelIndex::m_UseEKLMSegments
bool m_UseEKLMSegments
Iterate over EKLM segments instead of strips.
Definition: KLMChannelIndex.h:281
Belle2::KLMChannelIndex
KLM channel index.
Definition: KLMChannelIndex.h:33
Belle2::KLMChannelIndex::getKLMModuleNumber
uint16_t getKLMModuleNumber() const
Get KLM module number.
Definition: KLMChannelIndex.cc:167
Belle2::KLMChannelIndex::m_NStripsPlane
int m_NStripsPlane
Number of strips in current plane.
Definition: KLMChannelIndex.h:284
Belle2::KLMElementNumbers
KLM element numbers.
Definition: KLMElementNumbers.h:37
Belle2::KLMChannelIndex::m_Subdetector
int m_Subdetector
Subdetector.
Definition: KLMChannelIndex.h:263
Belle2::KLMChannelIndex::m_Sector
int m_Sector
Sector.
Definition: KLMChannelIndex.h:269
Belle2::KLMChannelIndex::m_Plane
int m_Plane
Plane.
Definition: KLMChannelIndex.h:275
Belle2::KLMChannelIndex::setIndexLevel
void setIndexLevel(enum IndexLevel indexLevel)
Set index level.
Definition: KLMChannelIndex.cc:67
Belle2::KLMChannelIndex::m_Layer
int m_Layer
Layer.
Definition: KLMChannelIndex.h:272
Belle2::KLMChannelIndex::m_ElementNumbers
const KLMElementNumbers * m_ElementNumbers
KLM element numbers.
Definition: KLMChannelIndex.h:287
Belle2::KLMChannelIndex::setEKLMSegment
void setEKLMSegment(int segment)
Set EKLM segment.
Definition: KLMChannelIndex.cc:136
Belle2::KLMChannelIndex::getKLMPlaneNumber
uint16_t getKLMPlaneNumber() const
Get KLM plane number.
Definition: KLMChannelIndex.cc:156
Belle2::KLMChannelIndex::c_IndexLevelStrip
@ c_IndexLevelStrip
Strip.
Definition: KLMChannelIndex.h:58