File indexing completed on 2026-04-27 07:34:06
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 PAR04HIT_HH
0030 #define PAR04HIT_HH
0031
0032 #include "G4Allocator.hh" // for G4Allocator
0033 #include "G4RotationMatrix.hh" // for G4RotationMatrix
0034 #include "G4THitsCollection.hh" // for G4THitsCollection
0035 #include "G4ThreeVector.hh" // for G4ThreeVector
0036 #include "G4VHit.hh" // for G4VHit
0037
0038 #include <G4Types.hh> // for G4int, G4double
0039 #include <map> // for map
0040 #include <stddef.h> // for size_t
0041 #include <tls.hh> // for G4ThreadLocal
0042 #include <vector> // for vector
0043 class G4AttDef;
0044 class G4AttValue;
0045 class G4LogicalVolume;
0046 class G4String;
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060 class Par04Hit : public G4VHit
0061 {
0062 public:
0063 Par04Hit();
0064 Par04Hit(const Par04Hit& aRight);
0065 virtual ~Par04Hit();
0066
0067 const Par04Hit& operator=(const Par04Hit& aRight);
0068 int operator==(const Par04Hit& aRight) const;
0069
0070 inline void* operator new(size_t);
0071 inline void operator delete(void* aHit);
0072
0073
0074 virtual void Draw() final;
0075
0076 virtual const std::map<G4String, G4AttDef>* GetAttDefs() const final;
0077
0078 virtual std::vector<G4AttValue>* CreateAttValues() const final;
0079
0080 virtual void Print() final;
0081
0082 inline void SetPos(G4ThreeVector aXYZ) { fPos = aXYZ; }
0083
0084 inline G4ThreeVector GetPos() const { return fPos; }
0085
0086 inline void SetRot(G4RotationMatrix aXYZ) { fRot = aXYZ; }
0087
0088 inline G4RotationMatrix GetRot() const { return fRot; }
0089
0090 inline void SetEdep(G4double aEdep) { fEdep = aEdep; }
0091
0092 inline void AddEdep(G4double aEdep) { fEdep += aEdep; }
0093
0094 inline G4double GetEdep() const { return fEdep; }
0095
0096 inline void SetNdep(G4int aNdep) { fNdep = aNdep; }
0097
0098 inline void AddNdep(G4int aNdep = 1) { fNdep += aNdep; }
0099
0100 inline G4int GetNdep() const { return fNdep; }
0101
0102 inline void SetZid(G4int aZ) { fZId = aZ; }
0103
0104 inline G4int GetZid() const { return fZId; }
0105
0106 inline void SetRhoId(G4int aRho) { fRhoId = aRho; }
0107
0108 inline G4int GetRhoId() const { return fRhoId; }
0109
0110 inline void SetPhiId(G4int aPhi) { fPhiId = aPhi; }
0111
0112 inline G4int GetPhiId() const { return fPhiId; }
0113
0114 inline void SetTime(G4double aTime) { fTime = aTime; }
0115
0116 inline G4double GetTime() const { return fTime; }
0117
0118 inline void SetType(G4int aType) { fType = aType; }
0119
0120 inline G4int GetType() const { return fType; }
0121
0122 inline void SetLogV(G4LogicalVolume* aLogVol) { fLogVol = aLogVol; }
0123
0124 inline const G4LogicalVolume* GetLogVol() { return fLogVol; }
0125
0126 public:
0127
0128 G4double fEdep = 0;
0129
0130 G4int fNdep = 0;
0131
0132 G4int fZId = -1;
0133
0134 G4int fRhoId = -1;
0135
0136 G4int fPhiId = -1;
0137
0138 G4ThreeVector fPos = {-1, -1, -1};
0139
0140 G4RotationMatrix fRot;
0141
0142 G4double fTime = -1;
0143
0144 G4int fType = -1;
0145
0146 G4LogicalVolume* fLogVol = nullptr;
0147 };
0148
0149 typedef G4THitsCollection<Par04Hit> Par04HitsCollection;
0150
0151 extern G4ThreadLocal G4Allocator<Par04Hit>* Par04HitAllocator;
0152
0153 inline void* Par04Hit::operator new(size_t)
0154 {
0155 if (!Par04HitAllocator) Par04HitAllocator = new G4Allocator<Par04Hit>;
0156 return (void*)Par04HitAllocator->MallocSingle();
0157 }
0158
0159 inline void Par04Hit::operator delete(void* aHit)
0160 {
0161 Par04HitAllocator->FreeSingle((Par04Hit*)aHit);
0162 }
0163
0164 #endif