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