23 #include "G4Allocator.hh"
24 #include "G4OpticalPhoton.hh"
27 using namespace DD4hep;
28 using namespace DD4hep::Simulation;
31 SimpleRun::SimpleRun()
32 : runID(-1), numEvents(0) {
43 : runID(-1), eventID(-1) {
58 : cellID(0), flag(0), g4ID(0), extension() {
72 const G4ThreeVector& pre = h.
prePosG4();
73 const G4ThreeVector& post = h.
postPosG4();
74 float pos[] = {float((pre.x()+post.x())/2.0),float((pre.y()+post.y())/2.0),float((pre.z()+post.z())/2.0) };
84 const G4ThreeVector& pre = h.
prePosG4();
85 const G4ThreeVector& post = h.
postPosG4();
86 float pos[] = {float((pre.x()+post.x())/2.0),float((pre.y()+post.y())/2.0),float((pre.z()+post.z())/2.0) };
93 :
Geant4HitData(), position(), momentum(), length(0.0), truth(), energyDeposit(0.0) {
99 :
Geant4HitData(), position(), momentum(), length(0.0), truth(track_id, pdg_id, deposit, time_stamp), energyDeposit(deposit) {
121 position.SetXYZ(0, 0, 0);
122 momentum.SetXYZ(0, 0, 0);
130 G4Track* trk = step->GetTrack();
131 G4ThreeVector pos = pnt->GetPosition();
132 G4ThreeVector mom = pnt->GetMomentum();
134 truth.trackID = trk->GetTrackID();
135 truth.pdgID = trk->GetDefinition()->GetPDGEncoding();
136 truth.deposit = step->GetTotalEnergyDeposit();
137 truth.time = trk->GetGlobalTime();
138 position.SetXYZ(pos.x(), pos.y(), pos.z());
139 momentum.SetXYZ(mom.x(), mom.y(), mom.z());
152 :
Geant4HitData(), position(pos), truth(), energyDeposit(0) {
DDG4 tracker hit class used by the generic DDG4 tracker sensitive detector.
double length
Length of the track segment contributing to this hit.
Direction momentum
Hit direction.
static void decrement(T *)
Decrement count according to type information.
virtual ~SimpleRun()
Default destructor.
const G4ThreeVector & postPosG4() const
Returns the post-step position as a G4ThreeVector.
virtual ~DataExtension()
Default destructor.
Helper class to ease the extraction of information from a G4Step object.
Contribution truth
Monte Carlo / Geant4 information.
not persisten. ROOT cannot handle
Hit & clear()
Clear hit content.
virtual ~Hit()
Default destructor.
Hit & storePoint(const G4Step *step, const G4StepPoint *point)
Store Geant4 point and step information into tracker hit structure.
Position position
Hit position.
Hit & operator=(const Hit &c)
Assignment operator.
static Contribution extractContribution(const G4Step *step)
Extract the MC contribution for a given hit from the step information.
G4ParticleDefinition * trackDef() const
ROOT::Math::XYZVector Position
virtual ~Geant4HitData()
Default destructor.
static void increment(T *)
Increment count according to type information.
Hit()
Default constructor (for ROOT)
double totalEnergy() const
Returns total energy deposit.
void doApplyBirksLaw(void)
Set applyBirksLaw to ture.
Geant4HitData()
Default constructor.
SimpleEvent()
Default constructor.
const G4ThreeVector & prePosG4() const
Returns the pre-step position as a G4ThreeVector.
Hit()
Default constructor.
virtual ~SimpleEvent()
Default destructor.
virtual ~Hit()
Default destructor.
Base class for geant4 hit structures used by the default DDG4 sensitive detector implementations.