File indexing completed on 2025-02-23 09:22:21
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #ifndef LXePMTHit_h
0032 #define LXePMTHit_h 1
0033
0034 #include "G4Allocator.hh"
0035 #include "G4LogicalVolume.hh"
0036 #include "G4THitsCollection.hh"
0037 #include "G4VHit.hh"
0038 #include "G4VPhysicalVolume.hh"
0039
0040 class LXePMTHit : public G4VHit
0041 {
0042 public:
0043 LXePMTHit() = default;
0044 LXePMTHit(const LXePMTHit& right);
0045 ~LXePMTHit() override = default;
0046
0047 const LXePMTHit& operator=(const LXePMTHit& right);
0048 G4bool operator==(const LXePMTHit& right) const;
0049
0050 inline void* operator new(size_t);
0051 inline void operator delete(void* aHit);
0052
0053 void Draw() override;
0054 void Print() override;
0055
0056 inline void SetDrawit(G4bool b) { fDrawit = b; }
0057 inline G4bool GetDrawit() { return fDrawit; }
0058
0059 inline void IncPhotonCount() { ++fPhotons; }
0060 inline G4int GetPhotonCount() { return fPhotons; }
0061
0062 inline void SetPMTNumber(G4int n) { fPmtNumber = n; }
0063 inline G4int GetPMTNumber() { return fPmtNumber; }
0064
0065 inline void SetPMTPhysVol(G4VPhysicalVolume* physVol) { fPhysVol = physVol; }
0066 inline G4VPhysicalVolume* GetPMTPhysVol() { return fPhysVol; }
0067
0068 inline void SetPMTPos(G4double x, G4double y, G4double z) { fPos = G4ThreeVector(x, y, z); }
0069
0070 inline G4ThreeVector GetPMTPos() { return fPos; }
0071
0072 private:
0073 G4int fPmtNumber = -1;
0074 G4int fPhotons = 0;
0075 G4ThreeVector fPos;
0076 G4VPhysicalVolume* fPhysVol = nullptr;
0077 G4bool fDrawit = false;
0078 };
0079
0080 typedef G4THitsCollection<LXePMTHit> LXePMTHitsCollection;
0081
0082 extern G4ThreadLocal G4Allocator<LXePMTHit>* LXePMTHitAllocator;
0083
0084 inline void* LXePMTHit::operator new(size_t)
0085 {
0086 if (!LXePMTHitAllocator) LXePMTHitAllocator = new G4Allocator<LXePMTHit>;
0087 return (void*)LXePMTHitAllocator->MallocSingle();
0088 }
0089
0090 inline void LXePMTHit::operator delete(void* aHit)
0091 {
0092 LXePMTHitAllocator->FreeSingle((LXePMTHit*)aHit);
0093 }
0094
0095 #endif