k4SimGeant4
Loading...
Searching...
No Matches
Geant4PreDigiTrackHit.h
Go to the documentation of this file.
1#ifndef DETSENSITIVE_GEANT4PREDIGITRACKHIT_H
2#define DETSENSITIVE_GEANT4PREDIGITRACKHIT_H
3
4#include "G4Allocator.hh"
5#include "G4THitsCollection.hh"
6#include "G4VHit.hh"
7
8// CLHEP
9#include "CLHEP/Vector/ThreeVector.h"
10
11namespace k4 {
12
25class Geant4PreDigiTrackHit : public G4VHit {
26public:
30 Geant4PreDigiTrackHit(unsigned int aTrackId, int aPdgId, double aEnergyDeposit, double aTime);
31 // Destructor
32 virtual ~Geant4PreDigiTrackHit();
33
35 G4int operator==(const Geant4PreDigiTrackHit&) const;
37 inline void* operator new(size_t);
39 inline void operator delete(void*);
40
42 virtual void Draw() {};
44 virtual void Print() {};
45
46 // these members are public, following the example of G4VHit:
47
49 CLHEP::Hep3Vector prePos;
51 CLHEP::Hep3Vector postPos;
53 unsigned long cellID;
55 unsigned int trackId;
57 int pdgId;
61 double time;
62};
63
64// types and functions for G4 memory allocation, inspired by the G4VHit classes in Geant4 examples
65
66typedef G4THitsCollection<Geant4PreDigiTrackHit> Geant4PreDigiTrackHitsCollection;
67
68extern G4ThreadLocal G4Allocator<Geant4PreDigiTrackHit>* Geant4PreDigiTrackHitAllocator;
69
70inline void* Geant4PreDigiTrackHit::operator new(size_t) {
71 if (!Geant4PreDigiTrackHitAllocator) Geant4PreDigiTrackHitAllocator = new G4Allocator<Geant4PreDigiTrackHit>;
72 return (void*)Geant4PreDigiTrackHitAllocator->MallocSingle();
73}
74
75inline void Geant4PreDigiTrackHit::operator delete(void* hit) {
77}
78
79} // namespace k4
80
81#endif
Data structure to hold the geant4 output in the Tracker.
Definition Geant4PreDigiTrackHit.h:25
CLHEP::Hep3Vector prePos
the pre-step position of the step in which energy was deposited
Definition Geant4PreDigiTrackHit.h:49
virtual ~Geant4PreDigiTrackHit()
Definition Geant4PreDigiTrackHit.cpp:9
Geant4PreDigiTrackHit()
Default constructor.
Definition Geant4PreDigiTrackHit.cpp:11
unsigned long cellID
the DD4hep cellID of the volume in which the energy was deposited
Definition Geant4PreDigiTrackHit.h:53
int pdgId
the particle data group identification code for the particle
Definition Geant4PreDigiTrackHit.h:57
CLHEP::Hep3Vector postPos
the post-step position of the step in which energy was deposited
Definition Geant4PreDigiTrackHit.h:51
double energyDeposit
the energy deposited in the material during the step
Definition Geant4PreDigiTrackHit.h:59
G4int operator==(const Geant4PreDigiTrackHit &) const
comparison operator
Definition Geant4PreDigiTrackHit.cpp:18
double time
the time coordinate of the energy deposit
Definition Geant4PreDigiTrackHit.h:61
virtual void Draw()
method from base class, unused
Definition Geant4PreDigiTrackHit.h:42
virtual void Print()
method from base class, unused
Definition Geant4PreDigiTrackHit.h:44
unsigned int trackId
the g4 trackId of the particle that deposited the energy
Definition Geant4PreDigiTrackHit.h:55
Definition Geant4CaloHit.h:11
G4ThreadLocal G4Allocator< Geant4PreDigiTrackHit > * Geant4PreDigiTrackHitAllocator
Definition Geant4PreDigiTrackHit.cpp:7
G4THitsCollection< Geant4PreDigiTrackHit > Geant4PreDigiTrackHitsCollection
Definition Geant4PreDigiTrackHit.h:66