File indexing completed on 2026-03-30 07:50:59
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 #ifndef LXePMTHit_h
0030 #define LXePMTHit_h 1
0031
0032 #include "G4Allocator.hh"
0033 #include "G4LogicalVolume.hh"
0034 #include "G4THitsCollection.hh"
0035 #include "G4VHit.hh"
0036 #include "G4VPhysicalVolume.hh"
0037
0038 class LXePMTHit : public G4VHit
0039 {
0040 public:
0041 LXePMTHit() = default;
0042 LXePMTHit(const LXePMTHit& right);
0043 ~LXePMTHit() override = default;
0044
0045 const LXePMTHit& operator=(const LXePMTHit& right);
0046 G4bool operator==(const LXePMTHit& right) const;
0047
0048 inline void* operator new(size_t);
0049 inline void operator delete(void* aHit);
0050
0051 void Draw() override;
0052 void Print() override;
0053
0054 inline void SetDrawit(G4bool b) { fDrawit = b; }
0055 inline G4bool GetDrawit() { return fDrawit; }
0056
0057 inline void IncPhotonCount() { ++fPhotons; }
0058 inline G4int GetPhotonCount() { return fPhotons; }
0059
0060 inline void SetPMTNumber(G4int n) { fPmtNumber = n; }
0061 inline G4int GetPMTNumber() { return fPmtNumber; }
0062
0063 inline void SetPMTPhysVol(G4VPhysicalVolume* physVol) { fPhysVol = physVol; }
0064 inline G4VPhysicalVolume* GetPMTPhysVol() { return fPhysVol; }
0065
0066 inline void SetPMTPos(G4double x, G4double y, G4double z) { fPos = G4ThreeVector(x, y, z); }
0067
0068 inline G4ThreeVector GetPMTPos() { return fPos; }
0069
0070 private:
0071 G4int fPmtNumber = -1;
0072 G4int fPhotons = 0;
0073 G4ThreeVector fPos;
0074 G4VPhysicalVolume* fPhysVol = nullptr;
0075 G4bool fDrawit = false;
0076 };
0077
0078 typedef G4THitsCollection<LXePMTHit> LXePMTHitsCollection;
0079
0080 extern G4ThreadLocal G4Allocator<LXePMTHit>* LXePMTHitAllocator;
0081
0082 inline void* LXePMTHit::operator new(size_t)
0083 {
0084 if (!LXePMTHitAllocator) LXePMTHitAllocator = new G4Allocator<LXePMTHit>;
0085 return (void*)LXePMTHitAllocator->MallocSingle();
0086 }
0087
0088 inline void LXePMTHit::operator delete(void* aHit)
0089 {
0090 LXePMTHitAllocator->FreeSingle((LXePMTHit*)aHit);
0091 }
0092
0093 #endif