CMS 3D CMS Logo

HFShowerG4Hit.h
Go to the documentation of this file.
1 #ifndef SimG4CMS_ShowerLibraryProducer_HFShowerG4Hit_h
2 #define SimG4CMS_ShowerLibraryProducer_HFShowerG4Hit_h
3 
6 
7 #include "G4VHit.hh"
8 #include "G4THitsCollection.hh"
9 #include "G4Allocator.hh"
10 #include "G4ThreeVector.hh"
11 #include "G4LogicalVolume.hh"
12 
13 #include <vector>
14 
15 class HFShowerG4Hit : public G4VHit {
16 public:
17  HFShowerG4Hit();
18  HFShowerG4Hit(G4int hitId, G4int tkID, double edep, double time);
19  ~HFShowerG4Hit() override;
20  HFShowerG4Hit(const HFShowerG4Hit& right);
21  const HFShowerG4Hit& operator=(const HFShowerG4Hit& right);
22  G4int operator==(const HFShowerG4Hit& right) const;
23 
24  inline void* operator new(size_t);
25  inline void operator delete(void* aHit);
26 
27 private:
28  G4int theHitId;
29  G4int theTrackId;
30  G4double theEdep;
31  G4double theTime;
32  G4ThreeVector localPos;
33  G4ThreeVector globalPos;
34  G4ThreeVector momDir;
35 
36 public:
37  inline void setHitId(G4int hitId) { theHitId = hitId; }
38  inline void setTrackId(G4int trackId) { theTrackId = trackId; }
39  inline void setEnergy(G4double edep) { theEdep = edep; }
40  inline void updateEnergy(G4double edep) { theEdep += edep; }
41  inline void setTime(G4double t) { theTime = t; }
42  inline void setLocalPos(const G4ThreeVector& xyz) { localPos = xyz; }
43  inline void setGlobalPos(const G4ThreeVector& xyz) { globalPos = xyz; }
44  inline void setPrimMomDir(const G4ThreeVector& xyz) { momDir = xyz; }
45 
46  inline G4int hitId() const { return theHitId; }
47  inline G4int trackId() const { return theTrackId; }
48  inline G4double edep() const { return theEdep; };
49  inline G4double time() const { return theTime; }
50  inline G4ThreeVector localPosition() const { return localPos; }
51  inline G4ThreeVector globalPosition() const { return globalPos; }
52  inline G4ThreeVector primaryMomDir() const { return momDir; }
53 };
54 
55 typedef G4THitsCollection<HFShowerG4Hit> HFShowerG4HitsCollection;
56 
57 extern G4ThreadLocal G4Allocator<HFShowerG4Hit>* fHFShowerG4HitAllocator;
58 
59 inline void* HFShowerG4Hit::operator new(size_t) {
61  fHFShowerG4HitAllocator = new G4Allocator<HFShowerG4Hit>;
62  return (void*)fHFShowerG4HitAllocator->MallocSingle();
63 }
64 
65 inline void HFShowerG4Hit::operator delete(void* aHit) { fHFShowerG4HitAllocator->FreeSingle((HFShowerG4Hit*)aHit); }
66 #endif
HFShowerG4Hit::setPrimMomDir
void setPrimMomDir(const G4ThreeVector &xyz)
Definition: HFShowerG4Hit.h:44
HFShowerG4Hit::primaryMomDir
G4ThreeVector primaryMomDir() const
Definition: HFShowerG4Hit.h:52
HFShowerG4Hit::localPosition
G4ThreeVector localPosition() const
Definition: HFShowerG4Hit.h:50
HFShowerG4HitsCollection
G4THitsCollection< HFShowerG4Hit > HFShowerG4HitsCollection
Definition: HFShowerG4Hit.h:55
fHFShowerG4HitAllocator
G4ThreadLocal G4Allocator< HFShowerG4Hit > * fHFShowerG4HitAllocator
Definition: HFShowerG4Hit.cc:5
HFShowerG4Hit::setLocalPos
void setLocalPos(const G4ThreeVector &xyz)
Definition: HFShowerG4Hit.h:42
HFShowerG4Hit::theHitId
G4int theHitId
Definition: HFShowerG4Hit.h:28
HFShowerG4Hit::HFShowerG4Hit
HFShowerG4Hit()
Definition: HFShowerG4Hit.cc:7
HFShowerG4Hit::theTime
G4double theTime
Definition: HFShowerG4Hit.h:31
HFShowerG4Hit::momDir
G4ThreeVector momDir
Definition: HFShowerG4Hit.h:34
Utilities.operator
operator
Definition: Utilities.py:24
HFShowerG4Hit
Definition: HFShowerG4Hit.h:15
HFShowerG4Hit::hitId
G4int hitId() const
Definition: HFShowerG4Hit.h:46
HFShowerG4Hit::time
G4double time() const
Definition: HFShowerG4Hit.h:49
HFShowerG4Hit::setEnergy
void setEnergy(G4double edep)
Definition: HFShowerG4Hit.h:39
OrderedSet.t
t
Definition: OrderedSet.py:90
HFShowerG4Hit::localPos
G4ThreeVector localPos
Definition: HFShowerG4Hit.h:32
HFShowerG4Hit::theEdep
G4double theEdep
Definition: HFShowerG4Hit.h:30
HFShowerG4Hit::setGlobalPos
void setGlobalPos(const G4ThreeVector &xyz)
Definition: HFShowerG4Hit.h:43
HFShowerG4Hit::~HFShowerG4Hit
~HFShowerG4Hit() override
Definition: HFShowerG4Hit.cc:12
HFShowerG4Hit::globalPos
G4ThreeVector globalPos
Definition: HFShowerG4Hit.h:33
HFShowerG4Hit::setTrackId
void setTrackId(G4int trackId)
Definition: HFShowerG4Hit.h:38
HFShowerG4Hit::setTime
void setTime(G4double t)
Definition: HFShowerG4Hit.h:41
HFShowerG4Hit::theTrackId
G4int theTrackId
Definition: HFShowerG4Hit.h:29
HFShowerG4Hit::operator==
G4int operator==(const HFShowerG4Hit &right) const
Definition: HFShowerG4Hit.cc:35
HFShowerG4Hit::globalPosition
G4ThreeVector globalPosition() const
Definition: HFShowerG4Hit.h:51
HFShowerG4Hit::setHitId
void setHitId(G4int hitId)
Definition: HFShowerG4Hit.h:37
Point3D.h
HFShowerPhoton.h
HFShowerG4Hit::trackId
G4int trackId() const
Definition: HFShowerG4Hit.h:47
HFShowerG4Hit::operator=
const HFShowerG4Hit & operator=(const HFShowerG4Hit &right)
Definition: HFShowerG4Hit.cc:24
HFShowerG4Hit::updateEnergy
void updateEnergy(G4double edep)
Definition: HFShowerG4Hit.h:40
HFShowerG4Hit::edep
G4double edep() const
Definition: HFShowerG4Hit.h:48