File indexing completed on 2025-02-23 09:21:07
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 ExN04CalorimeterHit_h
0032 #define ExN04CalorimeterHit_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 class ExN04CalorimeterHit : public G4VHit
0043 {
0044 public:
0045 ExN04CalorimeterHit();
0046 ExN04CalorimeterHit(G4LogicalVolume* logVol, G4int z, G4int phi);
0047 ExN04CalorimeterHit(const ExN04CalorimeterHit& right);
0048
0049 virtual ~ExN04CalorimeterHit();
0050
0051 const ExN04CalorimeterHit& operator=(const ExN04CalorimeterHit& right);
0052 G4bool operator==(const ExN04CalorimeterHit& right) const;
0053
0054 inline void* operator new(size_t);
0055 inline void operator delete(void* aHit);
0056
0057 virtual void Draw();
0058 virtual void Print();
0059
0060 void SetCellID(G4int z, G4int phi);
0061 G4int GetZ();
0062 G4int GetPhi();
0063 void SetEdep(G4double de);
0064 void AddEdep(G4double de);
0065 G4double GetEdep();
0066 void SetPos(G4ThreeVector xyz);
0067 G4ThreeVector GetPos();
0068 void SetRot(G4RotationMatrix rmat);
0069 G4RotationMatrix GetRot();
0070 const G4LogicalVolume* GetLogV();
0071
0072 private:
0073 G4int fZCellID;
0074 G4int fPhiCellID;
0075 G4double fedep;
0076 G4ThreeVector fpos;
0077 G4RotationMatrix frot;
0078 const G4LogicalVolume* fpLogV;
0079 };
0080
0081
0082 inline void ExN04CalorimeterHit::SetCellID(G4int z, G4int phi)
0083 {
0084 fZCellID = z;
0085 fPhiCellID = phi;
0086 }
0087
0088 inline G4int ExN04CalorimeterHit::GetZ()
0089 {
0090 return fZCellID;
0091 }
0092
0093 inline G4int ExN04CalorimeterHit::GetPhi()
0094 {
0095 return fPhiCellID;
0096 }
0097
0098 inline void ExN04CalorimeterHit::SetEdep(G4double de)
0099 {
0100 fedep = de;
0101 }
0102
0103 inline void ExN04CalorimeterHit::AddEdep(G4double de)
0104 {
0105 fedep += de;
0106 }
0107
0108 inline G4double ExN04CalorimeterHit::GetEdep()
0109 {
0110 return fedep;
0111 }
0112
0113 inline void ExN04CalorimeterHit::SetPos(G4ThreeVector xyz)
0114 {
0115 fpos = xyz;
0116 }
0117
0118 inline G4ThreeVector ExN04CalorimeterHit::GetPos()
0119 {
0120 return fpos;
0121 }
0122
0123 inline void ExN04CalorimeterHit::SetRot(G4RotationMatrix rmat)
0124 {
0125 frot = rmat;
0126 }
0127
0128 inline G4RotationMatrix ExN04CalorimeterHit::GetRot()
0129 {
0130 return frot;
0131 }
0132
0133 inline const G4LogicalVolume* ExN04CalorimeterHit::GetLogV()
0134 {
0135 return fpLogV;
0136 }
0137
0138
0139 typedef G4THitsCollection<ExN04CalorimeterHit> ExN04CalorimeterHitsCollection;
0140
0141 extern G4Allocator<ExN04CalorimeterHit> ExN04CalorimeterHitAllocator;
0142
0143 inline void* ExN04CalorimeterHit::operator new(size_t)
0144 {
0145 void* aHit;
0146 aHit = (void*)ExN04CalorimeterHitAllocator.MallocSingle();
0147 return aHit;
0148 }
0149
0150 inline void ExN04CalorimeterHit::operator delete(void* aHit)
0151 {
0152 ExN04CalorimeterHitAllocator.FreeSingle((ExN04CalorimeterHit*)aHit);
0153 }
0154
0155 #endif