File indexing completed on 2025-02-23 09:22:42
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 RE01CalorimeterHit_h
0032 #define RE01CalorimeterHit_h 1
0033
0034 #include "RE01TrackInformation.hh"
0035
0036 #include "G4Allocator.hh"
0037 #include "G4LogicalVolume.hh"
0038 #include "G4RotationMatrix.hh"
0039 #include "G4THitsCollection.hh"
0040 #include "G4ThreeVector.hh"
0041 #include "G4Transform3D.hh"
0042 #include "G4Types.hh"
0043 #include "G4VHit.hh"
0044
0045 class G4AttDef;
0046 class G4AttValue;
0047
0048 class RE01CalorimeterHit : public G4VHit
0049 {
0050 public:
0051 RE01CalorimeterHit(G4LogicalVolume* logVol, G4int z, G4int phi);
0052 virtual ~RE01CalorimeterHit();
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 virtual const std::map<G4String, G4AttDef>* GetAttDefs() const;
0060 virtual std::vector<G4AttValue>* CreateAttValues() const;
0061
0062 inline G4int GetZ() { return fZCellID; }
0063 inline G4int GetPhi() { return fPhiCellID; }
0064 inline void SetEdep(G4double de)
0065 {
0066 fEdep = de;
0067 fEdepByATrack = de;
0068 }
0069 inline void AddEdep(G4double de)
0070 {
0071 fEdep += de;
0072 fEdepByATrack += de;
0073 }
0074 inline G4double GetEdep() { return fEdep; }
0075 inline G4double GetEdepByATrack() { return fEdepByATrack; }
0076 inline void ClearEdepByATrack()
0077 {
0078 fEdepByATrack = 0.;
0079 fTrackInfo = RE01TrackInformation();
0080 }
0081 inline void SetPos(G4ThreeVector xyz) { fPos = xyz; }
0082 inline void SetRot(G4RotationMatrix rmat) { fRot = rmat; }
0083 inline void SetTrackInformation(const G4Track* aTrack)
0084 {
0085 RE01TrackInformation* anInfo = (RE01TrackInformation*)(aTrack->GetUserInformation());
0086 fTrackInfo = *anInfo;
0087 }
0088 inline RE01TrackInformation* GetTrackInformation() { return &fTrackInfo; }
0089
0090 private:
0091 G4int fZCellID;
0092 G4int fPhiCellID;
0093 G4double fEdep;
0094 G4ThreeVector fPos;
0095 G4RotationMatrix fRot;
0096 const G4LogicalVolume* fPLogV;
0097 G4double fEdepByATrack;
0098 RE01TrackInformation fTrackInfo;
0099 };
0100
0101 typedef G4THitsCollection<RE01CalorimeterHit> RE01CalorimeterHitsCollection;
0102
0103 extern G4ThreadLocal G4Allocator<RE01CalorimeterHit>* RE01CalorimeterHitAllocator;
0104
0105 inline void* RE01CalorimeterHit::operator new(size_t)
0106 {
0107 if (!RE01CalorimeterHitAllocator)
0108 RE01CalorimeterHitAllocator = new G4Allocator<RE01CalorimeterHit>;
0109 return (void*)RE01CalorimeterHitAllocator->MallocSingle();
0110 }
0111
0112 inline void RE01CalorimeterHit::operator delete(void* aHit)
0113 {
0114 RE01CalorimeterHitAllocator->FreeSingle((RE01CalorimeterHit*)aHit);
0115 }
0116
0117 #endif