19 #include "G4Allocator.hh"
20 #include "G4ParticleDefinition.hh"
21 #include "G4ChargedGeantino.hh"
22 #include "G4OpticalPhoton.hh"
23 #include "G4Geantino.hh"
29 using namespace DD4hep::Simulation;
36 bool Geant4Hit::isGeantino(G4Track* track) {
38 G4ParticleDefinition* def = track->GetDefinition();
39 if (def == G4ChargedGeantino::Definition())
41 if (def == G4Geantino::Definition()) {
49 G4Track* trk = step->GetTrack();
50 double energy_deposit =
51 (trk->GetDefinition() == G4OpticalPhoton::OpticalPhotonDefinition()) ?
52 trk->GetTotalEnergy() : step->GetTotalEnergyDeposit();
53 Contribution contrib(trk->GetTrackID(), trk->GetDefinition()->GetPDGEncoding(), energy_deposit, trk->GetGlobalTime());
58 Geant4TrackerHit::Geant4TrackerHit()
59 :
Geant4Hit(), position(), momentum(), length(0.0), truth(), energyDeposit(0.0) {
64 :
Geant4Hit(), position(), momentum(), length(0.0), truth(track_id, pdg_id, deposit, time_stamp), energyDeposit(deposit) {
91 G4Track* trk = step->GetTrack();
92 G4ThreeVector pos = pnt->GetPosition();
93 G4ThreeVector mom = pnt->GetMomentum();
96 truth.
pdgID = trk->GetDefinition()->GetPDGEncoding();
100 position.SetXYZ(pos.x(), pos.y(), pos.z());
101 momentum.SetXYZ(mom.x(), mom.y(), mom.z());
107 void* Geant4TrackerHit::operator
new(size_t) {
115 void Geant4TrackerHit::operator
delete(
void *p) {
121 :
Geant4Hit(), position(pos), truth(), energyDeposit(0) {
125 void* Geant4CalorimeterHit::operator
new(size_t) {
133 void Geant4CalorimeterHit::operator
delete(
void *p) {
int pdgID
Particle ID from the PDG table.
Position position
Hit position.
Geant4TrackerHit & clear()
Clear hit content.
G4ThreadLocal G4Allocator< Geant4CalorimeterHit > * CalorimeterHitAllocator
Direction momentum
Hit direction.
double deposit
Total energy deposit in this hit.
G4ThreadLocal G4Allocator< Geant4TrackerHit > * TrackerHitAllocator
Deprecated: Geant4 calorimeter hit class for deprecated sensitive detectors.
Geant4TrackerHit & operator=(const Geant4TrackerHit &c)
Assignment operator.
Geant4TrackerHit & storePoint(G4Step *step, G4StepPoint *point)
Store Geant4 point and step information into tracker hit structure.
Contribution truth
Monte Carlo / Geant4 information.
ROOT::Math::XYZVector Position
int trackID
Geant 4 Track identifier.
Deprecated: Geant4 tracker hit class for deprecated sensitive detectors.
double length
Length of the track segment contributing to this hit.
double time
Timestamp when this energy was deposited.
Deprecated: basic geant4 hit class for deprecated sensitive detectors.
Geant4CalorimeterHit(const Position &cell_pos)
Standard constructor.
Geant4TrackerHit()
Default constructor.