File indexing completed on 2025-02-23 09:21:14
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 SAXSSensitiveDetectorHit_h
0032 #define SAXSSensitiveDetectorHit_h 1
0033
0034 #include "G4Allocator.hh"
0035 #include "G4LogicalVolume.hh"
0036 #include "G4RotationMatrix.hh"
0037 #include "G4THitsCollection.hh"
0038 #include "G4ThreeVector.hh"
0039 #include "G4Transform3D.hh"
0040 #include "G4VHit.hh"
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052 class SAXSSensitiveDetectorHit : public G4VHit
0053 {
0054 public:
0055 SAXSSensitiveDetectorHit();
0056 SAXSSensitiveDetectorHit(const SAXSSensitiveDetectorHit& right);
0057 virtual ~SAXSSensitiveDetectorHit() { ; }
0058
0059 const SAXSSensitiveDetectorHit& operator=(const SAXSSensitiveDetectorHit& right);
0060
0061 int operator==(const SAXSSensitiveDetectorHit& right) const;
0062
0063 inline void* operator new(size_t);
0064 inline void operator delete(void* aHit);
0065
0066 virtual void Draw();
0067 virtual void Print();
0068
0069 private:
0070 G4int fTrackID;
0071 G4int fTrackIDP;
0072 G4double fTime;
0073 G4ThreeVector fPos;
0074 G4ThreeVector fMom;
0075 G4double fEnergy;
0076 G4int fType;
0077 G4double fWeight;
0078
0079 public:
0080 inline void SetTrackID(G4int z) { fTrackID = z; }
0081 inline G4int GetTrackID() const { return fTrackID; }
0082
0083 inline void SetTrackIDP(G4int z) { fTrackIDP = z; }
0084 inline G4int GetTrackIDP() const { return fTrackIDP; }
0085
0086 inline void SetTime(G4double t) { fTime = t; }
0087 inline G4double GetTime() const { return fTime; }
0088
0089 inline void SetPos(G4ThreeVector xyz) { fPos = xyz; }
0090 inline G4ThreeVector GetPos() const { return fPos; }
0091
0092 inline void SetMom(G4ThreeVector xyz) { fMom = xyz; }
0093 inline G4ThreeVector GetMom() const { return fMom; }
0094
0095 inline void SetEnergy(G4double energy) { fEnergy = energy; }
0096 inline G4double GetEnergy() const { return fEnergy; }
0097
0098 inline void SetType(G4int type) { fType = type; }
0099 inline G4int GetType() const { return fType; }
0100
0101 inline void SetWeight(G4double weight) { fWeight = weight; }
0102 inline G4double GetWeight() const { return fWeight; }
0103 };
0104
0105 using SensitiveDetectorHitsCollection = G4THitsCollection<SAXSSensitiveDetectorHit>;
0106
0107 extern G4ThreadLocal G4Allocator<SAXSSensitiveDetectorHit>* hitAllocator;
0108
0109 inline void* SAXSSensitiveDetectorHit::operator new(size_t)
0110 {
0111 if (!hitAllocator) {
0112 hitAllocator = new G4Allocator<SAXSSensitiveDetectorHit>;
0113 }
0114 return hitAllocator->MallocSingle();
0115 }
0116
0117 inline void SAXSSensitiveDetectorHit::operator delete(void* aHit)
0118 {
0119 if (!hitAllocator) {
0120 hitAllocator = new G4Allocator<SAXSSensitiveDetectorHit>;
0121 }
0122 hitAllocator->FreeSingle((SAXSSensitiveDetectorHit*)aHit);
0123 }
0124
0125
0126
0127 #endif