GT_Hit.h

Go to the documentation of this file.
00001 //! \file
00002 //!
00003 //! Header file for the Gem_Tracker Hit class.
00004 //!
00005 //! The GT_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-15
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 GT_HIT_H
00019 #define GT_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 
00027 // *+****1****+****2****+****3****+****4****+****5****+****6****+****7****+****
00028 
00029 //! Gem_Tracker Hit class based on G4VHit.
00030 //!
00031 //! Provides routines for setting and accessing the various quantities
00032 //! stored information for each hit in this detector.
00033 
00034 class GT_Hit : public G4VHit {
00035    
00036 public:
00037    
00038      //! Default constructor.
00039    
00040      GT_Hit();
00041 
00042      //! Copy constructor.
00043    
00044      GT_Hit( const GT_Hit & hit );
00045    
00046      //! Assignment constructor.
00047 
00048      const GT_Hit & operator = ( const GT_Hit & hit );
00049    
00050      //! Destructor.
00051    
00052      ~GT_Hit();
00053    
00054      // Member functions.
00055    
00056      //! Test equivalence.
00057 
00058      G4int operator == ( const GT_Hit & hit ) const;
00059 
00060      //! Allocate space for a new hit.
00061 
00062      void * operator new( size_t );
00063 
00064      //! Free allocated space.
00065 
00066      void operator delete( void * aHit );
00067 
00068      //! Routine to draw the hit in the visualisation window.
00069 
00070      void Draw();
00071 
00072      //! Print the hit information.
00073 
00074      void Print();
00075    
00076 private:
00077 
00078      //! GT_SD is declared as a friend class so it can access the hit data
00079      //! members directly without having numerous set/get member functions.
00080 
00081      friend class GT_SD;
00082 
00083      G4int copyno;         //!< Copy number identifying the sub-detector hit.
00084      G4int trackid;        //!< Track ID which created this hit.
00085      G4double edep;        //!< Total energy deposited by this hit.
00086      G4double time;        //!< Global time (relative to event) for this hit.
00087      G4ThreeVector tworld; //!< Position in true world coordinates.
00088      G4ThreeVector tlocal; //!< Position in true local coordinates.
00089      G4ThreeVector world;  //!< Position in smeared world coordinates.
00090      G4ThreeVector local;  //!< Position in smeared local coordinates.
00091    
00092 };
00093 
00094 //! Typedef for GT_HitsCollection used in GT_SD 
00095 
00096 typedef G4THitsCollection<GT_Hit> GT_HitsCollection;
00097 
00098 #endif