Belle II Software  release-08-01-10
ARICHTrack.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 #ifndef ARICHTRACK_H
10 #define ARICHTRACK_H
11 
12 #include <tracking/dataobjects/ExtHit.h>
13 #include <arich/dataobjects/ARICHPhoton.h>
14 #include <arich/dataobjects/ARICHAeroHit.h>
15 #include <vector>
16 
17 namespace Belle2 {
32  class ARICHTrack : public RelationsObject {
33  public:
34 
39  {}
40 
46  ARICHTrack(TVector3 position,
47  TVector3 momentum)
48  {
49 
50  m_x = (float) position.X();
51  m_y = (float) position.Y();
52  m_z = (float) position.Z();
53  m_momentum = (float) momentum.Mag();
54  momentum = momentum.Unit();
55  m_dx = (float) momentum.X();
56  m_dy = (float) momentum.Y();
57  m_dz = (float) momentum.Z();
58 
59  }
60 
61 
66  explicit ARICHTrack(const ARICHAeroHit* aeroHit)
67  {
68 
69  TVector3 pos = aeroHit->getPosition();
70  m_x = (float) pos.X();
71  m_y = (float) pos.Y();
72  m_z = (float) pos.Z();
73 
74  TVector3 mom = aeroHit->getMomentum();
75  m_momentum = (float) mom.Mag();
76  mom = mom.Unit();
77  m_dx = (float) mom.X();
78  m_dy = (float) mom.Y();
79  m_dz = (float) mom.Z();
80  }
81 
82 
87  explicit ARICHTrack(const ExtHit* extHit)
88  {
89 
90  ROOT::Math::XYZVector pos = extHit->getPosition();
91  m_x = (float) pos.X();
92  m_y = (float) pos.Y();
93  m_z = (float) pos.Z();
94 
95  ROOT::Math::XYZVector mom = extHit->getMomentum();
96  m_momentum = (float) mom.R();
97  mom = mom.Unit();
98  m_dx = (float) mom.X();
99  m_dy = (float) mom.Y();
100  m_dz = (float) mom.Z();
101  }
102 
103 
108  void setHapdWindowHit(const ExtHit* extHit)
109  {
110  ROOT::Math::XYZVector pos = extHit->getPosition();
111  m_winX = (float) pos.X();
112  m_winY = (float) pos.Y();
113  m_hitWin = true;
114  }
115 
121  void setHapdWindowHit(double x, double y)
122  {
123  m_winX = (float) x;
124  m_winY = (float) y;
125  m_hitWin = true;
126  }
127 
128 
133  TVector3 getPosition() const { return TVector3(m_x, m_y, m_z);}
134 
139  TVector3 getDirection() const { return TVector3(m_dx, m_dy, m_dz);}
140 
145  double getMomentum() const { return double(m_momentum);}
146 
151  bool hitsWindow() const { return m_hitWin;}
152 
157  TVector2 windowHitPosition() const {return TVector2(m_winX, m_winY);}
158 
159 
166  void setReconstructedValues(TVector3 r, TVector3 dir, double p)
167  {
168  m_x = (float) r.X();
169  m_y = (float) r.Y();
170  m_z = (float) r.Z();
171  m_dx = (float) dir.X();
172  m_dy = (float) dir.Y();
173  m_dz = (float) dir.Z();
174  m_momentum = (float) p;
175  }
176 
180  void addPhoton(ARICHPhoton photon)
181  {
182  m_photons.emplace_back(photon);
183  }
184 
189  const std::vector<ARICHPhoton>& getPhotons() const { return m_photons; }
190 
191  private:
192 
193  float m_x = 0;
194  float m_y = 0;
195  float m_z = 0;
196  float m_dx = 0;
197  float m_dy = 0;
198  float m_dz = 0;
199  float m_momentum;
201  bool m_hitWin = 0;
202  float m_winX = 0;
203  float m_winY = 0;
206  std::vector<ARICHPhoton> m_photons;
210  };
212 } // namespace Belle2
213 
214 #endif // ARICHTRACK_H
Datastore class that holds information on track parameters at the entrance in aerogel.
Definition: ARICHAeroHit.h:27
TVector3 getMomentum() const
Get track momentum (at entrance in 1. aerogel plane)
Definition: ARICHAeroHit.h:71
TVector3 getPosition() const
Get track position (at entrance in 1. aerogel plane)
Definition: ARICHAeroHit.h:68
Struct for ARICH reconstructed photon (hit related to track) information.
Definition: ARICHPhoton.h:25
Datastore class that holds position and momentum information of tracks that hit ARICH.
Definition: ARICHTrack.h:32
ARICHTrack(const ExtHit *extHit)
Constructor from ExtHit.
Definition: ARICHTrack.h:87
ClassDef(ARICHTrack, 2)
the class title
ARICHTrack()
Empty constructor for ROOT IO.
Definition: ARICHTrack.h:38
void setReconstructedValues(TVector3 r, TVector3 dir, double p)
Sets the reconstructed value of track parameters.
Definition: ARICHTrack.h:166
ARICHTrack(const ARICHAeroHit *aeroHit)
Constructor from ARICHAeroHit.
Definition: ARICHTrack.h:66
const std::vector< ARICHPhoton > & getPhotons() const
Returns vector of ARICHPhoton's associated with track.
Definition: ARICHTrack.h:189
float m_dy
Reconstructed direction.
Definition: ARICHTrack.h:197
float m_dx
Reconstructed direction.
Definition: ARICHTrack.h:196
bool hitsWindow() const
Returns true if track hits HAPD window.
Definition: ARICHTrack.h:151
void setHapdWindowHit(const ExtHit *extHit)
Set information about hit on HAPD window.
Definition: ARICHTrack.h:108
void setHapdWindowHit(double x, double y)
Set information about hit on HAPD window.
Definition: ARICHTrack.h:121
float m_momentum
Reconstructed momentum.
Definition: ARICHTrack.h:199
float m_winY
y position of track extrapolated to HAPD plane
Definition: ARICHTrack.h:203
ARICHTrack(TVector3 position, TVector3 momentum)
Useful constructor.
Definition: ARICHTrack.h:46
float m_winX
x position of track extrapolated to HAPD plane
Definition: ARICHTrack.h:202
TVector3 getPosition() const
returns track position vector
Definition: ARICHTrack.h:133
float m_y
Reconstructed position.
Definition: ARICHTrack.h:194
float m_dz
Reconstructed direction.
Definition: ARICHTrack.h:198
void addPhoton(ARICHPhoton photon)
Add ARICHPhoton to collection of photons.
Definition: ARICHTrack.h:180
std::vector< ARICHPhoton > m_photons
collection of ARICHPhotons associated with the track
Definition: ARICHTrack.h:206
TVector2 windowHitPosition() const
Get HAPD window hit position.
Definition: ARICHTrack.h:157
bool m_hitWin
true if track hits HAPD window
Definition: ARICHTrack.h:201
float m_z
Reconstructed position.
Definition: ARICHTrack.h:195
float m_x
Reconstructed position.
Definition: ARICHTrack.h:193
TVector3 getDirection() const
returns track direction vector
Definition: ARICHTrack.h:139
double getMomentum() const
returns track momentum
Definition: ARICHTrack.h:145
Store one Ext hit as a ROOT object.
Definition: ExtHit.h:32
ROOT::Math::XYZVector getMomentum() const
Get momentum at this extrapolation hit.
Definition: ExtHit.h:159
ROOT::Math::XYZVector getPosition() const
Get position of this extrapolation hit.
Definition: ExtHit.h:145
Defines interface for accessing relations of objects in StoreArray.
Abstract base class for different kinds of events.