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