00001 #ifndef IG_G4_DEMO_IG_G4DEMO_HIT_H 00002 # define IG_G4_DEMO_IG_G4DEMO_HIT_H 00003 00004 //<<<<<< INCLUDES >>>>>> 00005 00006 # include "VisExamples/VisG4ExN02/interface/config.h" 00007 # include <G4ThreeVector.hh> 00008 # include <G4THitsCollection.hh> 00009 # include <G4Allocator.hh> 00010 # include <G4VHit.hh> 00011 00012 //<<<<<< PUBLIC DEFINES >>>>>> 00013 //<<<<<< PUBLIC CONSTANTS >>>>>> 00014 //<<<<<< PUBLIC TYPES >>>>>> 00015 //<<<<<< PUBLIC VARIABLES >>>>>> 00016 //<<<<<< PUBLIC FUNCTIONS >>>>>> 00017 //<<<<<< CLASS DECLARATIONS >>>>>> 00018 00019 class IG_G4_DEMO_API VisG4ExampleHit : public G4VHit 00020 { 00021 public: 00022 VisG4ExampleHit (void); 00023 // implicit copy constructor 00024 // implicit assignment operator 00025 // implicit destructor 00026 00027 inline void * operator new (size_t sz); 00028 inline void operator delete (void *p); 00029 00030 virtual void Draw (void); 00031 virtual void Print (void); 00032 00033 int trackId (void) const; 00034 void setTrackId (int n); 00035 00036 int chamber (void) const; 00037 void setChamber (int n); 00038 00039 double energy (void) const; 00040 void setEnergy (double energy); 00041 00042 G4ThreeVector position (void) const; 00043 void setPosition (G4ThreeVector pos); 00044 00045 private: 00046 int m_trackId; 00047 int m_chamber; 00048 double m_energy; 00049 G4ThreeVector m_position; 00050 }; 00051 00055 00056 typedef G4THitsCollection<VisG4ExampleHit> VisG4ExampleHitsCollection; 00057 extern G4Allocator<VisG4ExampleHit> VisG4ExampleHitAllocator; 00058 00059 //<<<<<< INLINE PUBLIC FUNCTIONS >>>>>> 00060 //<<<<<< INLINE MEMBER FUNCTIONS >>>>>> 00061 00062 inline int 00063 VisG4ExampleHit::trackId (void) const 00064 { return m_trackId; } 00065 00066 inline void 00067 VisG4ExampleHit::setTrackId (int n) 00068 { m_trackId = n; } 00069 00071 inline int 00072 VisG4ExampleHit::chamber (void) const 00073 { return m_chamber; } 00074 00075 inline void 00076 VisG4ExampleHit::setChamber (int n) 00077 { m_chamber = n; } 00078 00080 inline double 00081 VisG4ExampleHit::energy (void) const 00082 { return m_energy; } 00083 00084 inline void 00085 VisG4ExampleHit::setEnergy (double energy) 00086 { m_energy = energy; } 00087 00089 inline G4ThreeVector 00090 VisG4ExampleHit::position (void) const 00091 { return m_position; } 00092 00093 inline void 00094 VisG4ExampleHit::setPosition (G4ThreeVector pos) 00095 { m_position = pos; } 00096 00098 00099 inline void * 00100 VisG4ExampleHit::operator new (size_t) 00101 { return VisG4ExampleHitAllocator.MallocSingle (); } 00102 00103 inline void 00104 VisG4ExampleHit::operator delete (void *hit) 00105 { VisG4ExampleHitAllocator.FreeSingle ((VisG4ExampleHit *) hit); } 00106 00107 #endif // IG_G4_DEMO_IG_G4DEMO_HIT_H