Belle II Software  release-05-02-19
BKLMHit2d.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Leo Piilonen *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 /* KLM headers. */
14 #include <klm/dataobjects/bklm/BKLMElementNumbers.h>
15 #include <klm/dataobjects/bklm/BKLMHit1d.h>
16 #include <klm/dataobjects/bklm/BKLMStatus.h>
17 
18 /* Belle 2 headers. */
19 #include <framework/datastore/RelationsObject.h>
20 
21 /* ROOT headers. */
22 #include <TVector3.h>
23 
24 /* CLHEP headers. */
25 #include <CLHEP/Vector/ThreeVector.h>
26 
27 namespace Belle2 {
33  class BKLMHit2d : public RelationsObject {
35 
36  public:
37 
39  BKLMHit2d();
40 
44  BKLMHit2d(const BKLMHit1d* hitPhi, const BKLMHit1d* hitZ, const CLHEP::Hep3Vector& globalPos, double time);
45 
47  BKLMHit2d(const BKLMHit2d&);
48 
50  BKLMHit2d& operator=(const BKLMHit2d&);
51 
53  virtual ~BKLMHit2d()
54  {
55  }
56 
59  bool inRPC() const
60  {
62  }
63 
66  int getSection() const
67  {
69  }
70 
73  int getSector() const
74  {
76  }
77 
80  int getLayer() const
81  {
83  }
84 
87  int getPhiStripMin() const
88  {
90  }
91 
94  int getPhiStripMax() const
95  {
97  }
98 
101  double getPhiStripAve() const
102  {
103  return 0.5 * (getPhiStripMin() + getPhiStripMax());
104  }
105 
108  int getZStripMin() const
109  {
110  return (((m_ZStrips & BKLM_ZSTRIP_MASK) >> BKLM_ZSTRIP_BIT) + 1);
111  }
112 
115  int getZStripMax() const
116  {
117  return (((m_ZStrips & BKLM_ZMAXSTRIP_MASK) >> BKLM_ZMAXSTRIP_BIT) + 1);
118  }
119 
122  double getZStripAve() const
123  {
124  return 0.5 * (getZStripMin() + getZStripMax());
125  }
126 
130  int getModuleID() const
131  {
132  return m_ModuleID;
133  }
134 
137  bool isOutOfTime()
138  {
139  return (m_ModuleID & BKLM_OUTOFTIME_MASK) != 0;
140  }
141 
144  bool isOnTrack()
145  {
146  return (m_ModuleID & BKLM_ONTRACK_MASK) != 0;
147  }
148 
151  bool isOnStaTrack()
152  {
153  return (m_ModuleID & BKLM_ONSTATRACK_MASK) != 0;
154  }
155 
158  float getGlobalPositionX(void) const
159  {
160  return m_GlobalPosition[0];
161  }
162 
165  float getGlobalPositionY(void) const
166  {
167  return m_GlobalPosition[1];
168  }
169 
172  float getGlobalPositionZ(void) const
173  {
174  return m_GlobalPosition[2];
175  }
176 
179  TVector3 getGlobalPosition(void) const
180  {
181  return TVector3(m_GlobalPosition[0], m_GlobalPosition[1], m_GlobalPosition[2]);
182  }
183 
186  float getTime() const
187  {
188  return m_Time;
189  }
190 
193  float getEnergyDeposit() const
194  {
195  return m_EnergyDeposit;
196  }
197 
200  bool match(const BKLMHit2d* h) const
201  {
202  return BKLMElementNumbers::hitsFromSameModule(m_ModuleID, h->getModuleID());
203  }
204 
207  void isOutOfTime(bool flag)
208  {
209  if (flag) { m_ModuleID |= BKLM_OUTOFTIME_MASK; } else { m_ModuleID &= ~BKLM_OUTOFTIME_MASK; }
210  }
211 
214  void isOnTrack(bool flag)
215  {
216  if (flag) { m_ModuleID |= BKLM_ONTRACK_MASK; } else { m_ModuleID &= ~BKLM_ONTRACK_MASK; }
217  }
218 
221  void isOnStaTrack(bool flag)
222  {
223  if (flag) { m_ModuleID |= BKLM_ONSTATRACK_MASK; } else { m_ModuleID &= ~BKLM_ONSTATRACK_MASK; }
224  }
225 
226  private:
227 
229  static constexpr int BKLM_ZSTRIP_BIT = 0;
230 
232  static constexpr int BKLM_ZMAXSTRIP_BIT = 6;
233 
235  static constexpr int BKLM_ZSTRIP_MASK = (63 << BKLM_ZSTRIP_BIT);
236 
238  static constexpr int BKLM_ZMAXSTRIP_MASK = (63 << BKLM_ZMAXSTRIP_BIT);
239 
242  int m_ModuleID;
243 
247 
249  float m_GlobalPosition[3];
250 
252  float m_Time;
253 
255  float m_EnergyDeposit;
256 
258  ClassDef(BKLMHit2d, 6)
259 
260  };
261 
263 } // end of namespace Belle2
Belle2::BKLMHit2d::getPhiStripMin
int getPhiStripMin() const
Get lowest phi-measuring strip number.
Definition: BKLMHit2d.h:95
Belle2::BKLMHit2d::BKLM_ZMAXSTRIP_MASK
static constexpr int BKLM_ZMAXSTRIP_MASK
BKLMHit2d Zstrips bit mask for maxStrip-1 [0..47].
Definition: BKLMHit2d.h:246
Belle2::BKLMHit2d::m_ModuleID
int m_ModuleID
detector-module identifier
Definition: BKLMHit2d.h:250
Belle2::BKLMHit2d::getEnergyDeposit
float getEnergyDeposit() const
Get reconstructed energy deposition.
Definition: BKLMHit2d.h:201
Belle2::BKLMElementNumbers::getStripByModule
static int getStripByModule(int module)
Get strip number by module identifier.
Definition: BKLMElementNumbers.h:332
Belle2::BKLMElementNumbers::getSectorByModule
static int getSectorByModule(int module)
Get sector number by module identifier.
Definition: BKLMElementNumbers.h:308
Belle2::BKLMHit2d::isOnTrack
bool isOnTrack()
Determine whether this 2D hit is associated with a muid-extrapolated track.
Definition: BKLMHit2d.h:152
Belle2::BKLMStatus::getMaximalStrip
static int getMaximalStrip(int module)
Get maximal strip number.
Definition: BKLMStatus.h:87
Belle2::BKLMHit2d::match
bool match(const BKLMHit2d *h) const
Determine whether the two BKLMHit2ds are in the same module.
Definition: BKLMHit2d.h:208
Belle2::BKLMHit2d::~BKLMHit2d
virtual ~BKLMHit2d()
Destructor.
Definition: BKLMHit2d.h:61
Belle2::BKLMHit2d::m_Time
float m_Time
reconstructed hit time relative to trigger (ns)
Definition: BKLMHit2d.h:260
Belle2::BKLMHit2d::operator=
BKLMHit2d & operator=(const BKLMHit2d &)
Assignment operator.
Definition: BKLMHit2d.cc:68
Belle2::BKLMHit2d::getSection
int getSection() const
Get section number.
Definition: BKLMHit2d.h:74
Belle2::RelationsInterface::ClassDef
ClassDef(RelationsInterface, 0)
defines interface for accessing relations of objects in StoreArray.
Belle2::BKLMElementNumbers::getLayerByModule
static int getLayerByModule(int module)
Get layer number by module identifier.
Definition: BKLMElementNumbers.h:316
Belle2::BKLMHit2d::getZStripMin
int getZStripMin() const
Get lowest z-measuring strip number.
Definition: BKLMHit2d.h:116
Belle2::BKLMHit2d::BKLM_ZSTRIP_MASK
static constexpr int BKLM_ZSTRIP_MASK
BKLMHit2d Zstrips bit mask for strip-1 [0..47].
Definition: BKLMHit2d.h:243
Belle2::BKLMHit2d::getGlobalPosition
TVector3 getGlobalPosition(void) const
Get 3D hit position in global coordinates.
Definition: BKLMHit2d.h:187
Belle2::BKLMHit2d::m_ZStrips
int m_ZStrips
z-measuring strip numbers of the 2D hit
Definition: BKLMHit2d.h:254
Belle2::BKLMElementNumbers::getSectionByModule
static int getSectionByModule(int module)
Get section number by module identifier.
Definition: BKLMElementNumbers.h:300
Belle2::BKLMHit2d::BKLMHit2d
BKLMHit2d()
Empty constructor for ROOT IO (needed to make the class storable)
Definition: BKLMHit2d.cc:23
Belle2::BKLMHit2d::getSector
int getSector() const
Get sector number.
Definition: BKLMHit2d.h:81
Belle2::BKLMHit2d::isOnStaTrack
bool isOnStaTrack()
Determine whether this 2D hit is associated with a BKLM-stand-alone track.
Definition: BKLMHit2d.h:159
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::BKLMHit2d::isOutOfTime
bool isOutOfTime()
Determine whether this 2D hit is outside the trigger-coincidence window.
Definition: BKLMHit2d.h:145
Belle2::BKLMHit2d::getPhiStripAve
double getPhiStripAve() const
Get average phi-measuring strip number.
Definition: BKLMHit2d.h:109
Belle2::BKLMHit2d::getGlobalPositionZ
float getGlobalPositionZ(void) const
Get 3D hit position's z coordinate in global coordinates.
Definition: BKLMHit2d.h:180
Belle2::BKLMHit2d::getZStripMax
int getZStripMax() const
Get highest z-measuring strip number.
Definition: BKLMHit2d.h:123
Belle2::BKLMElementNumbers::hitsFromSameModule
static bool hitsFromSameModule(int module1, int module2)
Check whether the hits are from the same module.
Definition: BKLMElementNumbers.h:407
Belle2::RelationsObject
RelationsInterface< TObject > RelationsObject
Provides interface for getting/adding relations to objects in StoreArrays.
Definition: RelationsObject.h:443
Belle2::BKLMHit2d::m_GlobalPosition
float m_GlobalPosition[3]
position of the 2D hit in global coordinates (cm)
Definition: BKLMHit2d.h:257
Belle2::BKLMHit2d::m_EnergyDeposit
float m_EnergyDeposit
reconstructed pulse height (MeV)
Definition: BKLMHit2d.h:263
Belle2::BKLMHit2d::getModuleID
int getModuleID() const
Get detector-module identifier.
Definition: BKLMHit2d.h:138
Belle2::BKLMHit2d::BKLM_ZSTRIP_BIT
static constexpr int BKLM_ZSTRIP_BIT
BKLMHit2d Zstrips bit position for strip-1 [0..47].
Definition: BKLMHit2d.h:237
Belle2::BKLMElementNumbers::c_FirstRPCLayer
@ c_FirstRPCLayer
First RPC layer.
Definition: BKLMElementNumbers.h:71
Belle2::BKLMHit2d::getTime
float getTime() const
Get reconstructed hit time.
Definition: BKLMHit2d.h:194
Belle2::BKLMHit2d::inRPC
bool inRPC() const
Determine whether this 2D hit is in RPC or scintillator.
Definition: BKLMHit2d.h:67
Belle2::BKLMHit2d::getGlobalPositionX
float getGlobalPositionX(void) const
Get 3D hit position's x coordinate in global coordinates.
Definition: BKLMHit2d.h:166
Belle2::BKLMHit2d
Store one BKLM strip hit as a ROOT object.
Definition: BKLMHit2d.h:42
Belle2::BKLMHit2d::getLayer
int getLayer() const
Get layer number.
Definition: BKLMHit2d.h:88
Belle2::BKLMHit2d::BKLM_ZMAXSTRIP_BIT
static constexpr int BKLM_ZMAXSTRIP_BIT
BKLMHit2d Zstrips bit position for maxStrip-1 [0..47].
Definition: BKLMHit2d.h:240
Belle2::BKLMHit2d::getZStripAve
double getZStripAve() const
Get average z-measuring strip number.
Definition: BKLMHit2d.h:130
Belle2::BKLMHit2d::getGlobalPositionY
float getGlobalPositionY(void) const
Get 3D hit position's y coordinate in global coordinates.
Definition: BKLMHit2d.h:173
Belle2::BKLMHit2d::getPhiStripMax
int getPhiStripMax() const
Get highest phi-measuring strip number.
Definition: BKLMHit2d.h:102