TF_Hit.h

Go to the documentation of this file.
00001 //! \file
00002 //!
00003 //! Header file for the Time_of_Flight Hit class.
00004 //!
00005 //! The TF_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-30
00011 //!
00012 //! \ingroup detector
00013 
00014 // *+****1****+****2****+****3****+****4****+****5****+****6****+****7****+****
00015 
00016 // Include this file just once.
00017 
00018 #ifndef TF_HIT_H
00019 #define TF_HIT_H
00020 
00021 // Include the GEANT4 header files referenced here.
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 //! Time of Flight Hit class based on G4VHit.
00031 //!
00032 //! Provides routines for setting and accessing the various stored information
00033 //! on each hit in this detector.
00034 
00035 class TF_Hit : public G4VHit {
00036    
00037 public:
00038    
00039      //! Constructor.
00040    
00041      TF_Hit();
00042    
00043      //! Copy constructor.
00044 
00045      TF_Hit( const TF_Hit & hit );
00046 
00047      //! Assignment constructor.
00048 
00049      const TF_Hit & operator = ( const TF_Hit & hit );
00050    
00051      //! Destructor.
00052    
00053      ~TF_Hit();
00054    
00055      // Member functions.
00056    
00057      //! Test equivalance.
00058 
00059      G4int operator == ( const TF_Hit & hit ) const;
00060 
00061      //! Allocate space for new hit.
00062 
00063      void * operator new( size_t );
00064      
00065      //! Free 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      //! Routine to print the hit information.
00074 
00075      void Print();
00076 
00077      // Data members.
00078 
00079 private:
00080 
00081      //! TF_SD is declared as a friend class so it can access the hit data
00082      //! members directly without having numerous set/get member functions.
00083 
00084      friend class TF_SD;
00085 
00086      G4int copyno;         //!< Copy number identifying the sub-detector hit.
00087      G4int trackid;        //!< Track ID which created this hit.
00088      G4double edep;        //!< Total energy deposited by this hit.
00089      G4double ttime;       //!< Global true time (relative to event).
00090      G4double time;        //!< Smeared Global time.
00091      G4ThreeVector tworld; //!< Position in true world coordinates.
00092      G4ThreeVector tlocal; //!< Position in true local coordinates.
00093      G4ThreeVector world;  //!< Smeared position in world coordinates.
00094      G4ThreeVector local;  //!< Smeared position in local coordinates.
00095    
00096 };
00097 
00098 typedef G4THitsCollection<TF_Hit> TF_HitsCollection;
00099 
00100 #endif