00001 //! \file 00002 //! 00003 //! Header file for the MWPC Hit class. 00004 //! 00005 //! The MW_Hit class defines the quantities recorded for each hit in this 00006 //! detector and defines the member functions for handling the hit information. 00007 //! 00008 //! \author D.K. Hasell 00009 //! \version 1.0 00010 //! \date 2010-10-31 00011 //! 00012 //! \ingroup detector 00013 00014 // *+****1****+****2****+****3****+****4****+****5****+****6****+****7****+**** 00015 00016 // Ensure this header file is only included once. 00017 00018 #ifndef MW_HIT_H 00019 #define MW_HIT_H 00020 00021 // Include the GEANT4 header files referenced in this file. 00022 00023 #include "G4VHit.hh" 00024 #include "G4ThreeVector.hh" 00025 #include "G4THitsCollection.hh" 00026 #include "G4Allocator.hh" 00027 00028 // *+****1****+****2****+****3****+****4****+****5****+****6****+****7****+**** 00029 00030 //! MWPC Hit class based on G4VHit. 00031 //! 00032 //! Provides routines for setting and accessing the various quantities 00033 //! stored information for each hit in this detector. 00034 00035 class MW_Hit : public G4VHit { 00036 00037 public: 00038 00039 //! Default constructor. 00040 00041 MW_Hit(); 00042 00043 //! Copy constructor. 00044 00045 MW_Hit( const MW_Hit & hit ); 00046 00047 //! Assignment constructor. 00048 00049 const MW_Hit & operator = ( const MW_Hit & hit ); 00050 00051 //! Destructor. 00052 00053 ~MW_Hit(); 00054 00055 // Member functions. 00056 00057 //! Test equivalence. 00058 00059 G4int operator == ( const MW_Hit & hit ) const; 00060 00061 //! Allocate space for a new hit. 00062 00063 void * operator new( size_t ); 00064 00065 //! Free allocated space. 00066 00067 void operator delete( void * aHit ); 00068 00069 //! Routine to draw the hit in the visualisation window. 00070 00071 void Draw(); 00072 00073 //! Print the hit information. 00074 00075 void Print(); 00076 00077 private: 00078 00079 //! MW_SD is declared as a friend class so it can access the hit data 00080 //! members directly without having numerous set/get member functions. 00081 00082 friend class MW_SD; 00083 00084 G4int copyno; //!< Copy number identifying the sub-detector hit. 00085 G4int trackid; //!< Track ID which created this hit. 00086 G4double edep; //!< Total energy deposited by this hit. 00087 G4double time; //!< Global time (relative to event) for this hit. 00088 G4ThreeVector tworld; //!< Position in true world coordinates. 00089 G4ThreeVector tlocal; //!< Position in true local coordinates. 00090 G4ThreeVector world; //!< Position in smeared world coordinates. 00091 G4ThreeVector local; //!< Position in smeared local coordinates. 00092 00093 }; 00094 00095 //! Typedef for MW_HitsCollection used in MW_SD 00096 00097 typedef G4THitsCollection<MW_Hit> MW_HitsCollection; 00098 00099 #endif