Belle II Software development
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
16#include <Math/Vector2D.h>
17
18#include <vector>
19
20namespace Belle2 {
35 class ARICHTrack : public RelationsObject {
36 public:
37
42 {}
43
49 ARICHTrack(ROOT::Math::XYZVector position,
50 ROOT::Math::XYZVector momentum)
51 {
52
53 m_x = (float) position.X();
54 m_y = (float) position.Y();
55 m_z = (float) position.Z();
56 m_momentum = (float) momentum.R();
57 momentum = momentum.Unit();
58 m_dx = (float) momentum.X();
59 m_dy = (float) momentum.Y();
60 m_dz = (float) momentum.Z();
61
62 }
63
64
69 explicit ARICHTrack(const ARICHAeroHit* aeroHit)
70 {
71
72 ROOT::Math::XYZVector pos = aeroHit->getPosition();
73 m_x = (float) pos.X();
74 m_y = (float) pos.Y();
75 m_z = (float) pos.Z();
76
77 ROOT::Math::XYZVector mom = aeroHit->getMomentum();
78 m_momentum = (float) mom.R();
79 mom = mom.Unit();
80 m_dx = (float) mom.X();
81 m_dy = (float) mom.Y();
82 m_dz = (float) mom.Z();
83 }
84
85
90 explicit ARICHTrack(const ExtHit* extHit)
91 {
92
93 ROOT::Math::XYZVector pos = extHit->getPosition();
94 m_x = (float) pos.X();
95 m_y = (float) pos.Y();
96 m_z = (float) pos.Z();
97
98 ROOT::Math::XYZVector mom = extHit->getMomentum();
99 m_momentum = (float) mom.R();
100 mom = mom.Unit();
101 m_dx = (float) mom.X();
102 m_dy = (float) mom.Y();
103 m_dz = (float) mom.Z();
104 }
105
106
111 void setHapdWindowHit(const ExtHit* extHit)
112 {
113 ROOT::Math::XYZVector pos = extHit->getPosition();
114 m_winX = (float) pos.X();
115 m_winY = (float) pos.Y();
116 m_hitWin = true;
117 }
118
124 void setHapdWindowHit(double x, double y)
125 {
126 m_winX = (float) x;
127 m_winY = (float) y;
128 m_hitWin = true;
129 }
130
131
136 ROOT::Math::XYZVector getPosition() const { return ROOT::Math::XYZVector(m_x, m_y, m_z);}
137
142 ROOT::Math::XYZVector getDirection() const { return ROOT::Math::XYZVector(m_dx, m_dy, m_dz);}
143
148 double getMomentum() const { return double(m_momentum);}
149
154 bool hitsWindow() const { return m_hitWin;}
155
160 ROOT::Math::XYVector windowHitPosition() const {return ROOT::Math::XYVector(m_winX, m_winY);}
161
162
169 void setReconstructedValues(ROOT::Math::XYZVector r, ROOT::Math::XYZVector dir, double p)
170 {
171 m_x = (float) r.X();
172 m_y = (float) r.Y();
173 m_z = (float) r.Z();
174 m_dx = (float) dir.X();
175 m_dy = (float) dir.Y();
176 m_dz = (float) dir.Z();
177 m_momentum = (float) p;
178 }
179
184 {
185 m_photons.emplace_back(photon);
186 }
187
192 const std::vector<ARICHPhoton>& getPhotons() const { return m_photons; }
193
194 private:
195
196 float m_x = 0;
197 float m_y = 0;
198 float m_z = 0;
199 float m_dx = 0;
200 float m_dy = 0;
201 float m_dz = 0;
204 bool m_hitWin = 0;
205 float m_winX = 0;
206 float m_winY = 0;
209 std::vector<ARICHPhoton> m_photons;
213 };
215} // namespace Belle2
216
217#endif // ARICHTRACK_H
Datastore class that holds information on track parameters at the entrance in aerogel.
Definition: ARICHAeroHit.h:27
ROOT::Math::XYZVector getMomentum() const
Get track momentum (at entrance in 1. aerogel plane)
Definition: ARICHAeroHit.h:70
ROOT::Math::XYZVector getPosition() const
Get track position (at entrance in 1. aerogel plane)
Definition: ARICHAeroHit.h:67
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:35
ARICHTrack(const ExtHit *extHit)
Constructor from ExtHit.
Definition: ARICHTrack.h:90
ClassDef(ARICHTrack, 2)
the class title
ARICHTrack()
Empty constructor for ROOT IO.
Definition: ARICHTrack.h:41
void setReconstructedValues(ROOT::Math::XYZVector r, ROOT::Math::XYZVector dir, double p)
Sets the reconstructed value of track parameters.
Definition: ARICHTrack.h:169
ARICHTrack(const ARICHAeroHit *aeroHit)
Constructor from ARICHAeroHit.
Definition: ARICHTrack.h:69
ARICHTrack(ROOT::Math::XYZVector position, ROOT::Math::XYZVector momentum)
Useful constructor.
Definition: ARICHTrack.h:49
float m_dy
Reconstructed direction.
Definition: ARICHTrack.h:200
float m_dx
Reconstructed direction.
Definition: ARICHTrack.h:199
bool hitsWindow() const
Returns true if track hits HAPD window.
Definition: ARICHTrack.h:154
ROOT::Math::XYZVector getDirection() const
returns track direction vector
Definition: ARICHTrack.h:142
void setHapdWindowHit(const ExtHit *extHit)
Set information about hit on HAPD window.
Definition: ARICHTrack.h:111
void setHapdWindowHit(double x, double y)
Set information about hit on HAPD window.
Definition: ARICHTrack.h:124
float m_momentum
Reconstructed momentum.
Definition: ARICHTrack.h:202
const std::vector< ARICHPhoton > & getPhotons() const
Returns vector of ARICHPhoton's associated with track.
Definition: ARICHTrack.h:192
float m_winY
y position of track extrapolated to HAPD plane
Definition: ARICHTrack.h:206
float m_winX
x position of track extrapolated to HAPD plane
Definition: ARICHTrack.h:205
float m_y
Reconstructed position.
Definition: ARICHTrack.h:197
float m_dz
Reconstructed direction.
Definition: ARICHTrack.h:201
void addPhoton(ARICHPhoton photon)
Add ARICHPhoton to collection of photons.
Definition: ARICHTrack.h:183
ROOT::Math::XYZVector getPosition() const
returns track position vector
Definition: ARICHTrack.h:136
std::vector< ARICHPhoton > m_photons
collection of ARICHPhotons associated with the track
Definition: ARICHTrack.h:209
bool m_hitWin
true if track hits HAPD window
Definition: ARICHTrack.h:204
float m_z
Reconstructed position.
Definition: ARICHTrack.h:198
float m_x
Reconstructed position.
Definition: ARICHTrack.h:196
ROOT::Math::XYVector windowHitPosition() const
Get HAPD window hit position.
Definition: ARICHTrack.h:160
double getMomentum() const
returns track momentum
Definition: ARICHTrack.h:148
Store one Ext hit as a ROOT object.
Definition: ExtHit.h:31
ROOT::Math::XYZVector getMomentum() const
Get momentum at this extrapolation hit.
Definition: ExtHit.h:151
ROOT::Math::XYZVector getPosition() const
Get position of this extrapolation hit.
Definition: ExtHit.h:144
Defines interface for accessing relations of objects in StoreArray.
Abstract base class for different kinds of events.