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