Belle II Software  release-08-01-10
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 
15 namespace Belle2 {
23 
28  class BeamBackHit : public TObject {
29  public:
30 
34  m_momentumY(0.), m_momentumZ(0.), m_t(0.), m_E_start(0.),
36  {}
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 
176  int m_subDet;
177 
180 
182  int m_PDG;
183 
186 
188  float m_positionX;
189 
191  float m_positionY;
192 
194  float m_positionZ;
195 
197  float m_momentumX;
198 
200  float m_momentumY;
201 
203  float m_momentumZ;
204 
206  float m_t;
207 
209  float m_E_start;
210 
212  float m_E_end;
213 
216 
219 
222 
225 
226  };
227 
229 } // end namespace Belle2
R E
internal precision of FFTW codelets
Class BeamBackHit - Stores hits from beam backgound simulation.
Definition: BeamBackHit.h:28
void setMomentum(ROOT::Math::XYZVector momentum)
Set momentum of the particle hit.
Definition: BeamBackHit.h:145
float m_t
Time at which the hit occured.
Definition: BeamBackHit.h:206
float m_E_end
Energy of the particle when leaving the volume.
Definition: BeamBackHit.h:212
float m_energyDeposit
Energy deposited in sensitive volume.
Definition: BeamBackHit.h:215
float m_momentumZ
Momentum of the hit (Z coordinate).
Definition: BeamBackHit.h:203
void shiftInTime(double time)
shift in time for beambkgmixer
Definition: BeamBackHit.h:171
int m_PDG
The PDG code of the particle that hit the sensitive area.
Definition: BeamBackHit.h:182
int m_trackID
The trackID of the hit.
Definition: BeamBackHit.h:185
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.
Definition: BeamBackHit.h:218
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
Definition: BeamBackHit.h:122
void setPDG(int PDG)
Set the lund code of the particle that hit the sensitive area.
Definition: BeamBackHit.h:131
double getEnergy() const
Get energy of the particle.
Definition: BeamBackHit.h:110
float m_neutronWeight
The effective neutron weight.
Definition: BeamBackHit.h:221
void setTrackID(int trackID)
set the trackID of the track
Definition: BeamBackHit.h:134
float m_positionY
Global position of the hit (Y coordinate).
Definition: BeamBackHit.h:191
ClassDef(BeamBackHit, 2)
Class version.
void setPosition(ROOT::Math::XYZVector position)
Set global position of the particle hit.
Definition: BeamBackHit.h:137
float m_positionZ
Global position of the hit (Z coordinate).
Definition: BeamBackHit.h:194
int getTrackID() const
the traci ID of the particle
Definition: BeamBackHit.h:92
double getEnergyDeposit() const
Get particle energy deposit in sensitive volume.
Definition: BeamBackHit.h:116
void setEnergy(double E)
Set energy of the particle.
Definition: BeamBackHit.h:156
double getEnergyAtExit() const
Get energy of the particle.
Definition: BeamBackHit.h:113
float m_E_start
Energy of particle at entrance into the volume.
Definition: BeamBackHit.h:209
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).
Definition: BeamBackHit.h:200
double getTrackLength() const
the length of the track in the volume
Definition: BeamBackHit.h:119
void setEnergyDeposit(double eDep)
Set particle energy deposit in volume.
Definition: BeamBackHit.h:162
void setSubDet(int subDet)
Set the subdetector group in which the hit occured.
Definition: BeamBackHit.h:125
ROOT::Math::XYZVector getMomentum() const
Get momentum of the particle hit.
Definition: BeamBackHit.h:101
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.
Definition: BeamBackHit.h:153
float m_positionX
Global position of the hit (X coordinate).
Definition: BeamBackHit.h:188
int m_subDet
The name of the subdetector.
Definition: BeamBackHit.h:176
void setNeutronWeight(double w)
set the neutron weight
Definition: BeamBackHit.h:168
float m_momentumX
Momentum of the hit (X coordinate).
Definition: BeamBackHit.h:197
void setIdentifier(int iden)
Set the subdetector component identifier.
Definition: BeamBackHit.h:128
BeamBackHit()
Default constructor.
Definition: BeamBackHit.h:32
int m_identifier
The identifier of subdetector component.
Definition: BeamBackHit.h:179
void setEnergyAtExit(double E)
Set energy of track at exit point of volume.
Definition: BeamBackHit.h:159
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
Definition: BeamBackHit.h:165
double getTime() const
Get the time at which the hit occured.
Definition: BeamBackHit.h:107
Abstract base class for different kinds of events.