WC_Hit.h

Go to the documentation of this file.
00001 //! \file
00002 //!
00003 //! Header file for the Wire_Chamber Hit class.
00004 //!
00005 //! The WC_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-08-28
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 WC_HIT_H
00019 #define WC_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 
00027 // *+****1****+****2****+****3****+****4****+****5****+****6****+****7****+****
00028 
00029 //! Wire_Chamber Hit class based of G4VHit.
00030 //!
00031 //! Provides routines for setting and accessing the various stored information
00032 //! on each hit in this detector.
00033 
00034 class WC_Hit : public G4VHit {
00035 
00036 public:
00037 
00038      //! Constructor.
00039 
00040      WC_Hit();
00041 
00042      //! Copy constructor.
00043 
00044      WC_Hit( const WC_Hit & hit );
00045 
00046      //! Assignment constructor.
00047 
00048      const WC_Hit & operator = ( const WC_Hit & hit );
00049 
00050      //! Destructor.
00051 
00052      ~WC_Hit();
00053 
00054      // Member functions.
00055 
00056      //! Test equivalance.
00057 
00058      G4int operator == ( const WC_Hit & hit ) const;
00059 
00060      //! Allocate space for new hit.
00061 
00062      void * operator new( size_t );
00063 
00064      //! Free 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      //! Routine to print the hit information.
00073 
00074      void Print();
00075 
00076 private:
00077 
00078      //! WC_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 WC_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 world coordinates.
00090      G4ThreeVector local;  //!< Position in local coordinates.
00091 
00092 };
00093 
00094 //! Typedef for GT_HitsCollection used in GT_SD 
00095 
00096 typedef G4THitsCollection<WC_Hit> WC_HitsCollection;
00097 
00098 #endif