Belle II Software development
ECLSimHit.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 <G4ThreeVector.hh>
12#include <simulation/dataobjects/SimHitBase.h>
13
14namespace Belle2 {
29 class ECLSimHit : public SimHitBase {
30 public:
33 m_HadronEdep{0} {;}
34
37 int CellId,
38 int TrackId,
39 int Pdg,
40 double FlightTime,
41 double Edep,
42 G4ThreeVector Momentum,
43 G4ThreeVector Position,
44 double Hadronedep
45 ): SimHitBase(), m_CellId(CellId), m_TrackId(TrackId), m_Pdg(Pdg), m_FlightTime(FlightTime), m_Edep(Edep), m_HadronEdep(Hadronedep)
46 {
47 m_Position[0] = Position.x(); m_Position[1] = Position.y(), m_Position[2] = Position.z();
48 m_Momentum[0] = Momentum.x(); m_Momentum[1] = Momentum.y(), m_Momentum[2] = Momentum.z();
49 }
50
53 void setCellId(int CellId) { m_CellId = CellId; }
54
57 void setTrackId(int TrackId) { m_TrackId = TrackId; }
58
61 void setPDGCode(int Pdg) { m_Pdg = Pdg; }
62
65 void setFlightTime(double FlightTime) { m_FlightTime = static_cast<double>(FlightTime); }
66
69 void setEnergyDep(double Edep) { m_Edep = static_cast<double>(Edep); }
70
73 void setMomentum(const G4ThreeVector& Momentum) { m_Momentum[0] = Momentum.x(); m_Momentum[1] = Momentum.y(), m_Momentum[2] = Momentum.z(); }
74
77 //KM void setPosIn(G4ThreeVector Position) { m_Position = Position; }
78
81 void setPosition(const G4ThreeVector& Position) { m_Position[0] = Position.x(); m_Position[1] = Position.y(), m_Position[2] = Position.z(); }
82
86 int getCellId() const { return m_CellId; }
87
91 int getTrackId() const { return m_TrackId; }
92
96 int getPDGCode() const { return m_Pdg; }
97
101 double getFlightTime() const { return m_FlightTime; }
102
106 double getEnergyDep() const { return m_Edep; }
107
111 double getHadronEnergyDep() const { return m_HadronEdep; }
112
116 G4ThreeVector getMomentum() const { return G4ThreeVector(m_Momentum[0], m_Momentum[1], m_Momentum[2]); }
117
121 G4ThreeVector getPosIn() const { return getPosition(); }
122
126 G4ThreeVector getPosition() const { return G4ThreeVector(m_Position[0], m_Position[1], m_Position[2]); }
127
131 void shiftInTime(float delta) override { m_FlightTime += delta; }
132
133
134 private:
137 int m_Pdg;
139 double m_Edep;
140 double m_Momentum[3];
141 double m_Position[3];
147 };
149} // end namespace Belle2
150
ClassECLSimHit - Geant4 simulated hit for the ECL.
Definition: ECLSimHit.h:29
int getPDGCode() const
Get Particle PDG (can be one of secondaries)
Definition: ECLSimHit.h:96
void setEnergyDep(double Edep)
Set Deposit energy.
Definition: ECLSimHit.h:69
int getTrackId() const
Get Track ID.
Definition: ECLSimHit.h:91
ECLSimHit(int CellId, int TrackId, int Pdg, double FlightTime, double Edep, G4ThreeVector Momentum, G4ThreeVector Position, double Hadronedep)
Useful Constructor.
Definition: ECLSimHit.h:36
void setMomentum(const G4ThreeVector &Momentum)
Set Momentum.
Definition: ECLSimHit.h:73
int getCellId() const
Get Cell ID.
Definition: ECLSimHit.h:86
ClassDefOverride(ECLSimHit, 6)
the class title
int m_CellId
Cell ID.
Definition: ECLSimHit.h:135
double getFlightTime() const
Get Flight time from IP.
Definition: ECLSimHit.h:101
ECLSimHit()
default constructor for ROOT
Definition: ECLSimHit.h:32
void setPDGCode(int Pdg)
Set Particle PDG (can be one of secondaries)
Definition: ECLSimHit.h:61
void setCellId(int CellId)
Set Cell ID.
Definition: ECLSimHit.h:53
double getEnergyDep() const
Get Deposit energy.
Definition: ECLSimHit.h:106
G4ThreeVector getPosition() const
Get Position.
Definition: ECLSimHit.h:126
G4ThreeVector getMomentum() const
Get Momentum.
Definition: ECLSimHit.h:116
double m_Edep
Deposit energy.
Definition: ECLSimHit.h:139
double getHadronEnergyDep() const
Get Hadron Deposit energy.
Definition: ECLSimHit.h:111
double m_Momentum[3]
Momentum.
Definition: ECLSimHit.h:140
double m_Position[3]
Position.
Definition: ECLSimHit.h:141
void setTrackId(int TrackId)
Set Track ID.
Definition: ECLSimHit.h:57
void setFlightTime(double FlightTime)
Set Flight time from IP.
Definition: ECLSimHit.h:65
double m_HadronEdep
Hadron Energy Deposit.
Definition: ECLSimHit.h:142
double m_FlightTime
Flight time from IP.
Definition: ECLSimHit.h:138
void shiftInTime(float delta) override
Shift the SimHit in time (needed for beam background mixing)
Definition: ECLSimHit.h:131
void setPosition(const G4ThreeVector &Position)
Set Position.
Definition: ECLSimHit.h:81
int m_TrackId
Track ID.
Definition: ECLSimHit.h:136
G4ThreeVector getPosIn() const
Get Position.
Definition: ECLSimHit.h:121
int m_Pdg
Particle PDG (can be one of secondaries)
Definition: ECLSimHit.h:137
Class SimHitBase - A common base for subdetector SimHits.
Definition: SimHitBase.h:28
Abstract base class for different kinds of events.