Warning, file /geant4/examples/advanced/CaTS/include/CalorimeterHit.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
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044 #pragma once
0045
0046 #include "G4VHit.hh"
0047 #include "G4THitsCollection.hh"
0048 #include "G4Allocator.hh"
0049 #include "G4ThreeVector.hh"
0050
0051 class CalorimeterHit : public G4VHit
0052 {
0053 public:
0054 CalorimeterHit();
0055 ~CalorimeterHit() = default;
0056 CalorimeterHit(const CalorimeterHit&);
0057 const CalorimeterHit& operator=(const CalorimeterHit&);
0058 G4bool operator==(const CalorimeterHit&) const;
0059 inline void* operator new(size_t);
0060 inline void operator delete(void*);
0061 void Draw() final;
0062 inline void Print() final
0063 {
0064 G4cout << "CalorimeterHit id: " << fid << " Edep: " << fEdep
0065 << " em_Edep: " << fem_Edep << " time: " << ftime
0066 << " X: " << fposition.getX() << " Y: " << fposition.getY()
0067 << " Z: " << fposition.getZ() << G4endl;
0068 }
0069 CalorimeterHit(unsigned int i, G4double e, G4double em, G4double t,
0070 G4ThreeVector p);
0071 inline void SetPosition(G4ThreeVector position) { fposition = position; };
0072 inline G4ThreeVector GetPosition() const { return fposition; };
0073 inline void SetTime(G4double time) { ftime = time; };
0074 inline G4double GetTime() const { return ftime; };
0075 inline void SetId(unsigned int id) { fid = id; };
0076 inline unsigned int GetId() const { return fid; };
0077 inline void SetEdep(G4double Edep) { fEdep = Edep; };
0078 inline G4double GetEdep() const { return fEdep; };
0079 inline void Setem_Edep(G4double em_Edep) { fem_Edep = em_Edep; };
0080 inline G4double Getem_Edep() const { return fem_Edep; };
0081
0082 private:
0083 unsigned int fid{ 0 };
0084 G4double fEdep{ 0 };
0085 G4double fem_Edep{ 0 };
0086 G4double ftime{ 0 };
0087 G4ThreeVector fposition{ 0, 0, 0 };
0088 };
0089
0090 using CalorimeterHitsCollection = G4THitsCollection<CalorimeterHit>;
0091 extern G4ThreadLocal G4Allocator<CalorimeterHit>* CalorimeterHitAllocator;
0092
0093 inline void* CalorimeterHit::operator new(size_t)
0094 {
0095 if(!CalorimeterHitAllocator)
0096 {
0097 CalorimeterHitAllocator = new G4Allocator<CalorimeterHit>;
0098 }
0099 return (void*) CalorimeterHitAllocator->MallocSingle();
0100 }
0101
0102 inline void CalorimeterHit::operator delete(void* aHit)
0103 {
0104 CalorimeterHitAllocator->FreeSingle((CalorimeterHit*) aHit);
0105 }