Belle II Software  release-06-00-14
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 <TObject.h>
12 #include <TVector3.h>
13 #include <TString.h>
14 
15 namespace Belle2 {
23 
28  class BeamBackHit : public TObject {
29  public:
30 
33  m_position(0., 0., 0.), m_momentum(0., 0., 0.), m_t(0.), m_E_start(0.),
35  {}
36 
51  BeamBackHit(int subDet, int iden, int PDG, int trackID, TVector3 position,
52  TVector3 momentum, double t, double E_start, double E_end,
53  double eDep, double trackLength, double nWeight):
54  m_subDet(subDet), m_identifier(iden), m_PDG(PDG), m_trackID(trackID),
55  m_position(position), m_momentum(momentum), m_t(t), m_E_start(E_start),
56  m_E_end(E_end), m_energyDeposit(eDep), m_trackLength(trackLength),
57  m_neutronWeight(nWeight)
58  {}
59 
61  TString getSubDetName() const
62  {
63  switch (m_subDet) {
64  case 0: return "IR";
65  case 1: return "PDX";
66  case 2: return "SVD";
67  case 3: return "CDC";
68  case 4: return "ARICH";
69  case 5: return "TOP";
70  case 6: return "ECL";
71  case 7: return "EKLM";
72  case 8: return "BKLM";
73  }
74  return "";
75  }
76 
78  int getIdentifier() const { return m_identifier; }
79 
81  int getSubDet() const {return m_subDet; }
82 
84  int getPDG() const { return m_PDG; }
85 
87  int getTrackID() const { return m_trackID;}
88 
90  const TVector3& getPosition() const { return m_position; }
91 
93  const TVector3& getMomentum() const { return m_momentum; }
94 
96  double getTime() const { return m_t; }
97 
99  double getEnergy() const { return m_E_start; }
100 
102  double getEnergyAtExit() const { return m_E_end; }
103 
105  double getEnergyDeposit() const { return m_energyDeposit; }
106 
108  double getTrackLength() const { return m_trackLength; }
109 
111  double getNeutronWeight() const {return m_neutronWeight;}
112 
114  void setSubDet(int subDet) { m_subDet = subDet; }
115 
117  void setIdentifier(int iden) { m_identifier = iden; }
118 
120  void setPDG(int PDG) { m_PDG = PDG; }
121 
123  void setTrackID(int trackID) {m_trackID = trackID;}
124 
126  void setPosition(TVector3 position) { m_position = position; }
127 
129  void setMomentum(TVector3 momentum) { m_momentum = momentum; }
130 
132  void setTime(double t) { m_t = t; }
133 
135  void setEnergy(double E) { m_E_start = E; }
136 
138  void setEnergyAtExit(double E) {m_E_end = E;}
139 
141  void setEnergyDeposit(double eDep) { m_energyDeposit = eDep; }
142 
144  void setTrackLength(double l) {m_trackLength = l;}
145 
147  void setNeutronWeight(double w) {m_neutronWeight = w;}
148 
150  void shiftInTime(double time) { m_t += time; }
151 
152  private:
153  int m_subDet;
155  int m_PDG;
156  int m_trackID;
157  TVector3 m_position;
158  TVector3 m_momentum;
159  double m_t;
160  double m_E_start;
161  double m_E_end;
163  double m_trackLength;
168  };
169 
171 } // end namespace Belle2
Class BeamBackHit - Stores hits from beam backgound simulation.
Definition: BeamBackHit.h:28
double m_energyDeposit
energy deposited in sensitive volume
Definition: BeamBackHit.h:162
double m_E_start
energy of particle at entrance into the volume
Definition: BeamBackHit.h:160
TVector3 m_momentum
momentum of the hit
Definition: BeamBackHit.h:158
BeamBackHit(int subDet, int iden, int PDG, int trackID, TVector3 position, TVector3 momentum, double t, double E_start, double E_end, double eDep, double trackLength, double nWeight)
Full constructor.
Definition: BeamBackHit.h:51
void shiftInTime(double time)
shift in time for beambkgmixer
Definition: BeamBackHit.h:150
int m_PDG
The PDG code of the particle that hit the sensitive area.
Definition: BeamBackHit.h:155
int m_trackID
the trackID of the hit
Definition: BeamBackHit.h:156
TVector3 m_position
global position of the hit
Definition: BeamBackHit.h:157
TString getSubDetName() const
Get the subdetector name in which the hit occured.
Definition: BeamBackHit.h:61
double m_t
time at which the hit occured
Definition: BeamBackHit.h:159
double getNeutronWeight() const
get the effective neutron weigth
Definition: BeamBackHit.h:111
const TVector3 & getPosition() const
Get global position of the particle hit.
Definition: BeamBackHit.h:90
void setPDG(int PDG)
Set the lund code of the particle that hit the sensitive area.
Definition: BeamBackHit.h:120
double getEnergy() const
Get energy of the particle.
Definition: BeamBackHit.h:99
void setTrackID(int trackID)
set the trackID of the track
Definition: BeamBackHit.h:123
ClassDef(BeamBackHit, 1)
the class title
void setPosition(TVector3 position)
Set global position of the particle hit.
Definition: BeamBackHit.h:126
const TVector3 & getMomentum() const
Get momentum of the particle hit.
Definition: BeamBackHit.h:93
double m_E_end
energy of the particle when leaving the volume
Definition: BeamBackHit.h:161
int getTrackID() const
the traci ID of the particle
Definition: BeamBackHit.h:87
double m_neutronWeight
the effective neutron weight
Definition: BeamBackHit.h:164
double getEnergyDeposit() const
Get particle energy deposit in sensitive volume.
Definition: BeamBackHit.h:105
void setMomentum(TVector3 momentum)
Set momentum of the particle hit.
Definition: BeamBackHit.h:129
void setEnergy(double E)
Set energy of the particle.
Definition: BeamBackHit.h:135
double getEnergyAtExit() const
Get energy of the particle.
Definition: BeamBackHit.h:102
double m_trackLength
length of the track in the volume
Definition: BeamBackHit.h:163
int getPDG() const
Get the lund code of the particle that hit the sensitive area.
Definition: BeamBackHit.h:84
double getTrackLength() const
the length of the track in the volume
Definition: BeamBackHit.h:108
void setEnergyDeposit(double eDep)
Set particle energy deposit in volume.
Definition: BeamBackHit.h:141
void setSubDet(int subDet)
Set the subdetector group in which the hit occured.
Definition: BeamBackHit.h:114
void setTime(double t)
Set the time at which the hit occured.
Definition: BeamBackHit.h:132
int m_subDet
The name of the subdetector.
Definition: BeamBackHit.h:153
void setNeutronWeight(double w)
set the neutron weight
Definition: BeamBackHit.h:147
void setIdentifier(int iden)
Set the subdetector component identifier.
Definition: BeamBackHit.h:117
BeamBackHit()
Default constructor.
Definition: BeamBackHit.h:32
int m_identifier
The identifier of subdetector component.
Definition: BeamBackHit.h:154
void setEnergyAtExit(double E)
Set energy of track at exit point of volume.
Definition: BeamBackHit.h:138
int getIdentifier() const
Get the identifier of subdetector component in which hit occured.
Definition: BeamBackHit.h:78
int getSubDet() const
Det the index of subdetector in which hit occured.
Definition: BeamBackHit.h:81
void setTrackLength(double l)
set the length of the track in the volume
Definition: BeamBackHit.h:144
double getTime() const
Get the time at which the hit occured.
Definition: BeamBackHit.h:96
Abstract base class for different kinds of events.