Belle II Software development
ExtHit.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#include <framework/datastore/RelationsObject.h>
12#include <framework/gearbox/Const.h>
13#include <Math/Vector3D.h>
14#include <Math/Point3D.h>
15#include <TMatrixDSym.h>
16#include <G4ThreeVector.hh>
17#include <G4ErrorSymMatrix.hh>
18
19namespace Belle2 {
26 enum ExtHitStatus { EXT_FIRST = -1, EXT_ENTER, EXT_EXIT, EXT_STOP, EXT_ESCAPE,
27 EXT_ECLCROSS, EXT_ECLDL, EXT_ECLNEAR
28 };
29
31 class ExtHit : public RelationsObject {
32
33 public:
34
36 ExtHit();
37
48 ExtHit(int pdgCode, Const::EDetector detector, int element, ExtHitStatus status, bool backwardPropagation, double t,
49 const ROOT::Math::XYZPoint& r, const ROOT::Math::XYZVector& p, const TMatrixDSym& e);
50
61 ExtHit(int pdgCode, Const::EDetector detector, int element, ExtHitStatus status, bool backwardPropagation, double t,
62 const G4ThreeVector& r, const G4ThreeVector& p, const G4ErrorSymMatrix& e);
63
65 ExtHit(const ExtHit&);
66
68 ExtHit& operator=(const ExtHit&);
69
71 virtual ~ExtHit() {}
72
74 void setPDGCode(int pdgCode) { m_PdgCode = pdgCode; }
75
77 void setDetectorID(Const::EDetector detectorID) { m_DetectorID = detectorID; }
78
80 void setCopyID(int copyID) { m_CopyID = copyID; }
81
83 void setBackwardPropagation(bool backwardPropagation) { m_BackwardPropagation = backwardPropagation; }
84
86 void setStatus(ExtHitStatus extHitStatus) { m_Status = extHitStatus; }
87
89 void setTOF(double tof) { m_TOF = tof; }
90
92 void setPosition(const ROOT::Math::XYZVector& position)
93 {
94 m_Position[0] = position.x();
95 m_Position[1] = position.y();
96 m_Position[2] = position.z();
97 }
98
100 void setMomentum(const ROOT::Math::XYZVector& momentum)
101 {
102 m_Momentum[0] = momentum.x();
103 m_Momentum[1] = momentum.y();
104 m_Momentum[2] = momentum.z();
105 }
106
108 void setCovariance(double covArray[21])
109 {
110 for (int k = 0; k < 21; ++k) {
111 m_Covariance[k] = covArray[k];
112 }
113 }
114
117 int getPdgCode() const { return m_PdgCode; }
118
122
125 int getCopyID() const { return m_CopyID; }
126
129 ExtHitStatus getStatus() const { return m_Status; }
130
133
136 double getTOF() const { return m_TOF; }
137
140 double getLength() const { return m_TOF; }
141
144 ROOT::Math::XYZVector getPosition() const
145 {
146 return ROOT::Math::XYZVector(m_Position[0], m_Position[1], m_Position[2]);
147 }
148
151 ROOT::Math::XYZVector getMomentum() const
152 {
153 return ROOT::Math::XYZVector(m_Momentum[0], m_Momentum[1], m_Momentum[2]);
154 }
155
158 TMatrixDSym getCovariance() const;
159
166 void update(ExtHitStatus status, double t,
167 const G4ThreeVector& r, const G4ThreeVector& p, const G4ErrorSymMatrix& e);
168
170 double getErrorTheta() const;
171
173 double getErrorPhi() const;
174
175 private:
176
178 double getPolarCovariance(int i) const;
179
182
185
188
191
194
196 float m_TOF;
197
199 float m_Position[3];
200
202 float m_Momentum[3];
203
205 float m_Covariance[21];
206
209
210 };
212}
EDetector
Enum for identifying the detector components (detector and subdetector).
Definition: Const.h:42
Store one Ext hit as a ROOT object.
Definition: ExtHit.h:31
ExtHit & operator=(const ExtHit &)
Assignment operator.
Definition: ExtHit.cc:110
int m_CopyID
copy ID
Definition: ExtHit.h:187
double getErrorPhi() const
Get the uncertainty in the azimuthal angle phi (radians)
Definition: ExtHit.cc:169
void setBackwardPropagation(bool backwardPropagation)
Set the direction of track propagation.
Definition: ExtHit.h:83
double getErrorTheta() const
Get the uncertainty in the azimuthal angle phi (radians)
Definition: ExtHit.cc:163
void setCovariance(double covArray[21])
Set phase-space covariance at this extrapolation hit.
Definition: ExtHit.h:108
int getPdgCode() const
Get PDG code of this extrapolation's hypothesis.
Definition: ExtHit.h:117
double getPolarCovariance(int i) const
Get diagonal elemment of the 3x3 position-covariance matrix in polar coordinates (r,...
Definition: ExtHit.cc:174
void setTOF(double tof)
Set time of flight from the point of closest approach near the origin to this hit.
Definition: ExtHit.h:89
float m_Momentum[3]
momentum (GeV/c)
Definition: ExtHit.h:202
TMatrixDSym getCovariance() const
Get phase-space covariance at this extrapolation hit.
Definition: ExtHit.cc:130
ExtHitStatus getStatus() const
Get state of extrapolation at this hit.
Definition: ExtHit.h:129
int m_PdgCode
PDG code.
Definition: ExtHit.h:181
void setCopyID(int copyID)
Set detector-element ID of sensitive element within detector.
Definition: ExtHit.h:80
void update(ExtHitStatus status, double t, const G4ThreeVector &r, const G4ThreeVector &p, const G4ErrorSymMatrix &e)
Update the parameters of this extrapolation hit.
Definition: ExtHit.cc:143
void setPDGCode(int pdgCode)
Set PDG code of this extrapolation's hypothesis.
Definition: ExtHit.h:74
float m_Covariance[21]
phase-space covariance (symmetric 6x6 linearized to 6*(6+1)/2: position & momentum in cm & GeV/c)
Definition: ExtHit.h:205
bool m_BackwardPropagation
Direction of track propagation.
Definition: ExtHit.h:193
int getCopyID() const
Get detector-element ID of sensitive element within detector.
Definition: ExtHit.h:125
Const::EDetector m_DetectorID
detector ID
Definition: ExtHit.h:184
void setPosition(const ROOT::Math::XYZVector &position)
Set position of this extrapolation hit.
Definition: ExtHit.h:92
float m_TOF
time of flight (ns)
Definition: ExtHit.h:196
ExtHit()
Empty constructor for ROOT IO (needed to make the class storable)
Definition: ExtHit.cc:19
float m_Position[3]
position (cm)
Definition: ExtHit.h:199
virtual ~ExtHit()
Destructor.
Definition: ExtHit.h:71
Const::EDetector getDetectorID() const
Get detector ID of this extrapolation hit.
Definition: ExtHit.h:121
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
void setMomentum(const ROOT::Math::XYZVector &momentum)
Set momentum at this extrapolation hit.
Definition: ExtHit.h:100
void setDetectorID(Const::EDetector detectorID)
Set detector ID of this extrapolation hit.
Definition: ExtHit.h:77
ExtHitStatus m_Status
extrapolation state
Definition: ExtHit.h:190
bool isBackwardPropagated() const
Get the direction of track propagation.
Definition: ExtHit.h:132
void setStatus(ExtHitStatus extHitStatus)
Set state of extrapolation at this hit.
Definition: ExtHit.h:86
ClassDef(ExtHit, 8)
Needed to make the ROOT object storable.
double getLength() const
Get path length from start of extrapolation to closest approach to ECL cluster (for EXT_ECLDL only)
Definition: ExtHit.h:140
double getTOF() const
Get time of flight from the point of closest approach near the origin to this hit.
Definition: ExtHit.h:136
Defines interface for accessing relations of objects in StoreArray.
ExtHitStatus
Define state of extrapolation for each recorded hit.
Definition: ExtHit.h:26
Abstract base class for different kinds of events.