File indexing completed on 2025-12-17 09:28:40
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 #ifndef ExGflashHit_h
0031 #define ExGflashHit_h 1
0032
0033 #include "G4Allocator.hh"
0034 #include "G4RotationMatrix.hh"
0035 #include "G4THitsCollection.hh"
0036 #include "G4ThreeVector.hh"
0037 #include "G4VHit.hh"
0038
0039 class G4LogicalVolume;
0040
0041 class ExGflashHit : public G4VHit
0042 {
0043 public:
0044 ExGflashHit();
0045 ~ExGflashHit() override;
0046 ExGflashHit(const ExGflashHit& right);
0047 ExGflashHit& operator=(const ExGflashHit& right);
0048 G4bool operator==(const ExGflashHit& right) const;
0049
0050 inline void* operator new(size_t);
0051 inline void operator delete(void* aHit);
0052 void* operator new(size_t, void* p) { return p; }
0053
0054 #ifndef G4NOT_ISO_DELETES
0055 void operator delete(void*, void*) {}
0056 #endif
0057
0058 void Draw() override;
0059 void Print() override;
0060
0061 private:
0062 G4double fEdep;
0063 G4ThreeVector fPos;
0064
0065 public:
0066 void SetEdep(G4double de) { fEdep = de; };
0067 void AddEdep(G4double de) { fEdep += de; };
0068 G4double GetEdep() { return fEdep; };
0069 void SetPos(G4ThreeVector xyz) { fPos = xyz; };
0070 G4ThreeVector GetPos() { return fPos; };
0071 };
0072
0073 using ExGflashHitsCollection = G4THitsCollection<ExGflashHit>;
0074
0075 extern G4ThreadLocal G4Allocator<ExGflashHit>* ExGflashHitAllocator;
0076
0077 inline void* ExGflashHit::operator new(size_t)
0078 {
0079 if (ExGflashHitAllocator == nullptr) ExGflashHitAllocator = new G4Allocator<ExGflashHit>;
0080 return (void*)ExGflashHitAllocator->MallocSingle();
0081 }
0082
0083 inline void ExGflashHit::operator delete(void* aHit)
0084 {
0085 ExGflashHitAllocator->FreeSingle((ExGflashHit*)aHit);
0086 }
0087
0088 #endif