ACTARSim
ACTAR TPC Simulation Reference Guide
ActarSimGasGeantHit.hh
Go to the documentation of this file.
1 // - AUTHOR: Hector Alvarez-Pol 04/2006
2 /******************************************************************
3  * Copyright (C) 2005-2016, Hector Alvarez-Pol *
4  * All rights reserved. *
5  * *
6  * License according to GNU LESSER GPL (see lgpl-3.0.txt). *
7  * For the list of contributors see CREDITS. *
8  ******************************************************************/
9 
10 #ifndef ActarSimGasGeantHit_h
11 #define ActarSimGasGeantHit_h 1
12 
13 #include "G4VHit.hh"
14 #include "G4THitsCollection.hh"
15 #include "G4Allocator.hh"
16 #include "G4ThreeVector.hh"
17 #include "G4Step.hh"
18 
19 class ActarSimGasGeantHit : public G4VHit {
20 private:
21  G4int trackID; ///< ID for each track
22  G4int parentID; ///< ID for the parent track
23  //G4Step *bstep;
24  G4double edep; ///< Energy deposited
25  G4double particleCharge; ///< Charge of the particle
26  G4double particleMass; ///< Mass of the particle
27  G4int particleID; ///< Particle ID according to the GDP-coding
28  G4ThreeVector postPos; ///< Position after step
29  G4ThreeVector prePos; ///< Position before step
30  G4String detName; ///< Detector name where energy is deposited
31  G4int detID; ///< Detector ID
32  G4double preToF; ///< Time before step
33  G4double postToF; ///< Time after step
34  G4double stepLength; ///< Length of the step
35  G4double stepEnergy; ///< Particle energy before step
36 
37 public:
42  G4int operator==(const ActarSimGasGeantHit&) const;
43 
44  inline void* operator new(size_t);
45  inline void operator delete(void*);
46 
47  void Draw();
48  void Print();
49  void PrinttoFile();
50 
51  void SetTrackID(G4int track){ trackID = track; }
52  void SetParentID(G4int track){ parentID = track; }
53  //void SetStep(G4Step* astep){bstep=astep;}
54  void SetEdep(G4double de){ edep = de; }
55  void SetParticleCharge(G4double pc){particleCharge=pc;}
56  void SetParticleMass(G4double pm){particleMass=pm;}
57  void SetParticleID(G4int pi){particleID=pi;}
58  void SetPrePos(G4ThreeVector xyz){ prePos = xyz; }
59  void SetPostPos(G4ThreeVector xyz){ postPos = xyz; }
60  void SetPreToF(G4double Time){ preToF = Time; }
61  void SetPostToF(G4double Time){ postToF = Time; }
62  void SetDetName(G4String Name){ detName = Name; }
63  void SetDetID(G4int id){ detID = id; }
64  void SetStepLength(G4double len){ stepLength = len; }
65  void SetStepEnergy(G4double sten){ stepEnergy = sten; }
66 
67  G4int GetTrackID(){ return trackID; }
68  G4int GetParentID(){ return parentID; }
69  //G4Step *GetStep(){return bstep;}
70  G4double GetEdep(){ return edep; }
71  G4double GetParticleCharge(){return particleCharge;}
72  G4double GetParticleMass(){return particleMass;}
73  G4int GetParticleID(){return particleID;}
74  G4ThreeVector GetPrePos(){ return prePos; }
75  G4ThreeVector GetPostPos(){ return postPos; }
76  G4String GetDetName(){ return detName; }
77  G4int GetDetID(){ return detID; }
78  G4double GetPreToF(){ return preToF; }
79  G4double GetPostToF(){ return postToF; }
80  G4double GetStepLength(){ return stepLength; }
81  G4double GetStepEnergy(){ return stepEnergy; }
82 };
83 
84 typedef G4THitsCollection<ActarSimGasGeantHit> ActarSimGasGeantHitsCollection;
85 
86 extern G4Allocator<ActarSimGasGeantHit> ActarSimGasGeantHitAllocator;
87 
88 inline void* ActarSimGasGeantHit::operator new(size_t) {
89  void *aHit;
90  aHit = (void *) ActarSimGasGeantHitAllocator.MallocSingle();
91  return aHit;
92 }
93 
94 inline void ActarSimGasGeantHit::operator delete(void *aHit) {
96 }
97 #endif
void SetParentID(G4int track)
const ActarSimGasGeantHit & operator=(const ActarSimGasGeantHit &)
Operator =.
G4ThreeVector postPos
Position after step.
G4ThreeVector GetPostPos()
G4double particleMass
Mass of the particle.
void Print()
Prints full information about the calGeantHit.
void SetStepLength(G4double len)
void SetPostToF(G4double Time)
void Draw()
Draws the Hit. A clear red point on the Hit position.
void SetEdep(G4double de)
G4THitsCollection< ActarSimGasGeantHit > ActarSimGasGeantHitsCollection
G4int operator==(const ActarSimGasGeantHit &) const
Operator ==.
void SetTrackID(G4int track)
G4double particleCharge
Charge of the particle.
G4int detID
Detector ID.
G4double postToF
Time after step.
G4int parentID
ID for the parent track.
~ActarSimGasGeantHit()
Destructor.
ActarSimGasGeantHit()
Constructor.
G4ThreeVector GetPrePos()
G4int trackID
ID for each track.
G4Allocator< ActarSimGasGeantHit > ActarSimGasGeantHitAllocator
G4ThreeVector prePos
Position before step.
G4double stepLength
Length of the step.
void SetParticleCharge(G4double pc)
void SetDetName(G4String Name)
void SetPrePos(G4ThreeVector xyz)
void SetStepEnergy(G4double sten)
void SetPostPos(G4ThreeVector xyz)
G4int particleID
Particle ID according to the GDP-coding.
void SetParticleMass(G4double pm)
G4double stepEnergy
Particle energy before step.
void SetParticleID(G4int pi)
void SetPreToF(G4double Time)
G4String detName
Detector name where energy is deposited.
G4double edep
Energy deposited.
G4double preToF
Time before step.