Belle II Software development
BeamBackHit.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 <Math/Vector3D.h>
12#include <TObject.h>
13#include <TString.h>
14
15namespace Belle2 {
20
21
23
27
28 class BeamBackHit : public TObject {
29 public:
30
37
52 BeamBackHit(int subDet, int iden, int PDG, int trackID,
53 const ROOT::Math::XYZVector& position,
54 const ROOT::Math::XYZVector& momentum,
55 double t, double E_start, double E_end, double eDep,
56 double trackLength, double nWeight):
57 m_subDet(subDet), m_identifier(iden), m_PDG(PDG), m_trackID(trackID),
58 m_t(t), m_E_start(E_start), m_E_end(E_end), m_energyDeposit(eDep),
59 m_trackLength(trackLength), m_neutronWeight(nWeight)
60 {
61 setPosition(position);
62 setMomentum(momentum);
63 }
64
66 TString getSubDetName() const
67 {
68 switch (m_subDet) {
69 case 0: return "IR";
70 case 1: return "PDX";
71 case 2: return "SVD";
72 case 3: return "CDC";
73 case 4: return "ARICH";
74 case 5: return "TOP";
75 case 6: return "ECL";
76 case 7: return "EKLM";
77 case 8: return "BKLM";
78 }
79 return "";
80 }
81
83 int getIdentifier() const { return m_identifier; }
84
86 int getSubDet() const {return m_subDet; }
87
89 int getPDG() const { return m_PDG; }
90
92 int getTrackID() const { return m_trackID;}
93
95 ROOT::Math::XYZVector getPosition() const
96 {
97 return ROOT::Math::XYZVector(m_positionX, m_positionY, m_positionZ);
98 }
99
101 ROOT::Math::XYZVector getMomentum() const
102 {
103 return ROOT::Math::XYZVector(m_momentumX, m_momentumY, m_momentumZ);
104 }
105
107 double getTime() const { return m_t; }
108
110 double getEnergy() const { return m_E_start; }
111
113 double getEnergyAtExit() const { return m_E_end; }
114
116 double getEnergyDeposit() const { return m_energyDeposit; }
117
119 double getTrackLength() const { return m_trackLength; }
120
122 double getNeutronWeight() const {return m_neutronWeight;}
123
125 void setSubDet(int subDet) { m_subDet = subDet; }
126
128 void setIdentifier(int iden) { m_identifier = iden; }
129
131 void setPDG(int PDG) { m_PDG = PDG; }
132
134 void setTrackID(int trackID) {m_trackID = trackID;}
135
137 void setPosition(ROOT::Math::XYZVector position)
138 {
139 m_positionX = position.X();
140 m_positionY = position.Y();
141 m_positionZ = position.Z();
142 }
143
145 void setMomentum(ROOT::Math::XYZVector momentum)
146 {
147 m_momentumX = momentum.X();
148 m_momentumY = momentum.Y();
149 m_momentumZ = momentum.Z();
150 }
151
153 void setTime(double t) { m_t = t; }
154
156 void setEnergy(double E) { m_E_start = E; }
157
159 void setEnergyAtExit(double E) {m_E_end = E;}
160
162 void setEnergyDeposit(double eDep) { m_energyDeposit = eDep; }
163
165 void setTrackLength(double l) {m_trackLength = l;}
166
168 void setNeutronWeight(double w) {m_neutronWeight = w;}
169
171 void shiftInTime(double time) { m_t += time; }
172
173 private:
174
177
180
182 int m_PDG;
183
186
189
192
195
198
201
204
206 float m_t;
207
210
212 float m_E_end;
213
216
219
222
225
226 };
227
229} // end namespace Belle2
R E
internal precision of FFTW codelets
void setMomentum(ROOT::Math::XYZVector momentum)
Set momentum of the particle hit.
float m_t
Time at which the hit occured.
float m_E_end
Energy of the particle when leaving the volume.
float m_energyDeposit
Energy deposited in sensitive volume.
float m_momentumZ
Momentum of the hit (Z coordinate).
void shiftInTime(double time)
shift in time for beambkgmixer
int m_PDG
The PDG code of the particle that hit the sensitive area.
int m_trackID
The trackID of the hit.
TString getSubDetName() const
Get the subdetector name in which the hit occured.
Definition BeamBackHit.h:66
float m_trackLength
Length of the track in the volume.
BeamBackHit(int subDet, int iden, int PDG, int trackID, const ROOT::Math::XYZVector &position, const ROOT::Math::XYZVector &momentum, double t, double E_start, double E_end, double eDep, double trackLength, double nWeight)
Full constructor.
Definition BeamBackHit.h:52
double getNeutronWeight() const
get the effective neutron weigth
void setPDG(int PDG)
Set the lund code of the particle that hit the sensitive area.
double getEnergy() const
Get energy of the particle.
float m_neutronWeight
The effective neutron weight.
void setTrackID(int trackID)
set the trackID of the track
float m_positionY
Global position of the hit (Y coordinate).
ClassDef(BeamBackHit, 2)
Class version.
void setPosition(ROOT::Math::XYZVector position)
Set global position of the particle hit.
float m_positionZ
Global position of the hit (Z coordinate).
int getTrackID() const
the traci ID of the particle
Definition BeamBackHit.h:92
double getEnergyDeposit() const
Get particle energy deposit in sensitive volume.
void setEnergy(double E)
Set energy of the particle.
double getEnergyAtExit() const
Get energy of the particle.
float m_E_start
Energy of particle at entrance into the volume.
int getPDG() const
Get the lund code of the particle that hit the sensitive area.
Definition BeamBackHit.h:89
float m_momentumY
Momentum of the hit (Y coordinate).
double getTrackLength() const
the length of the track in the volume
void setEnergyDeposit(double eDep)
Set particle energy deposit in volume.
void setSubDet(int subDet)
Set the subdetector group in which the hit occured.
ROOT::Math::XYZVector getMomentum() const
Get momentum of the particle hit.
ROOT::Math::XYZVector getPosition() const
Get global position of the particle hit.
Definition BeamBackHit.h:95
void setTime(double t)
Set the time at which the hit occured.
float m_positionX
Global position of the hit (X coordinate).
int m_subDet
The name of the subdetector.
void setNeutronWeight(double w)
set the neutron weight
float m_momentumX
Momentum of the hit (X coordinate).
void setIdentifier(int iden)
Set the subdetector component identifier.
BeamBackHit()
Default constructor.
Definition BeamBackHit.h:32
int m_identifier
The identifier of subdetector component.
void setEnergyAtExit(double E)
Set energy of track at exit point of volume.
int getIdentifier() const
Get the identifier of subdetector component in which hit occured.
Definition BeamBackHit.h:83
int getSubDet() const
Det the index of subdetector in which hit occured.
Definition BeamBackHit.h:86
void setTrackLength(double l)
set the length of the track in the volume
double getTime() const
Get the time at which the hit occured.
Abstract base class for different kinds of events.