LM_Hit.h

Go to the documentation of this file.
00001 //! \file
00002 //!
00003 //! Header file for the Luminosity_Monitor Hit class.
00004 //!
00005 //! The LM_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 // Include this file just once.
00017 
00018 #ifndef LM_HIT_H
00019 #define LM_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 //! Luminosity Monitor 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 LM_Hit : public G4VHit {
00036    
00037 public:
00038    
00039      //! Constructor.
00040    
00041      LM_Hit();
00042    
00043      //! Copy constructor.
00044 
00045      LM_Hit( const LM_Hit & hit );
00046 
00047      //! Assignment constructor.
00048 
00049      const LM_Hit & operator = ( const LM_Hit & hit );
00050    
00051      //! Destructor.
00052    
00053      ~LM_Hit();
00054    
00055      // Member functions.
00056    
00057      //! Test equivalance.
00058 
00059      G4int operator == ( const LM_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 for the hit.
00078 
00079 private:
00080 
00081      //! LM_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 LM_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 time;        //!< Global time (relative to event) for this hit.
00090      G4ThreeVector tworld; //!< Position in true world coordinates.
00091      G4ThreeVector tlocal; //!< Position in true local coordinates.
00092      G4ThreeVector world;  //!< Position in world coordinates.
00093      G4ThreeVector local;  //!< Position in local coordinates.
00094    
00095 };
00096 
00097 //! Typedef for GT_HitsCollection used in GT_SD 
00098 
00099 typedef G4THitsCollection<LM_Hit> LM_HitsCollection;
00100 
00101 #endif