GT_SD.h

Go to the documentation of this file.
00001 //! \file
00002 //!
00003 //! Header file for the Gem_Tracker sensitive detector class.
00004 //!
00005 //! The GT_SD class defines the member functions for processing the hit
00006 //! information whenever a hit is simulated in the detector.  These
00007 //! routines initialise the hit collection, process hits, and perform
00008 //! the end of event action which writes out the hit information.
00009 //!
00010 //! \author D.K. Hasell
00011 //! \version 1.0
00012 //! \date 2010-10-15
00013 //!
00014 //! \ingroup detector
00015 
00016 // *+****1****+****2****+****3****+****4****+****5****+****6****+****7****+****
00017 
00018 // Ensure this header file is only included once.
00019 
00020 #ifndef GT_SD_H
00021 #define GT_SD_H
00022 
00023 // Include the Gem_Tracker and other user header files referenced here.
00024 
00025 #include "Gem_Tracker.h"
00026 #include "GT_Hit.h"
00027 
00028 // Include the GEANT4 header files referenced in this file.
00029 
00030 #include "G4VSensitiveDetector.hh"
00031 #include "G4AffineTransform.hh"
00032 
00033 // Declare the classes referenced in this file.
00034 
00035 class G4HCofThisEvent;
00036 class G4Step;
00037 class G4TouchableHistory;
00038 
00039 // *+****1****+****2****+****3****+****4****+****5****+****6****+****7****+****
00040 
00041 //! GT sensitive detector class based on G4VSensitiveDetector.
00042 //!
00043 //! Creates the GT_SD class and provides the member routines for initialising 
00044 //! the hits collection, processing of hits, and end of event action.
00045 
00046 class GT_SD : public G4VSensitiveDetector {
00047 
00048 public:
00049 
00050      //! Constructor.
00051 
00052      GT_SD( G4String name );
00053    
00054      //! Destructor.
00055 
00056      ~GT_SD();
00057      
00058      // Member functions.
00059 
00060      //! Initialise the hits collection.
00061 
00062      void Initialize( G4HCofThisEvent * HCE );
00063 
00064      //! Routine to process each hit.
00065      //!
00066      //! Stores all the hit information in the data members of the hit class.
00067      //! ROHist is only given if a readout geometry is associated with this
00068      //! detector.
00069 
00070      G4bool ProcessHits( G4Step * step, G4TouchableHistory * ROhist );
00071 
00072      //! Routine to process hit information at the end of each event.
00073 
00074      void EndOfEvent( G4HCofThisEvent * HCE );
00075 
00076      //! In the event of an aborted event clear hit collections not assigned
00077      //! to the usual hit collection..
00078 
00079      void clear();
00080 
00081      //! Draw all hits.
00082 
00083      void DrawAll();
00084 
00085      //! Print all hits.
00086 
00087      void PrintAll();
00088 
00089      //! Set/Get energy threshold.
00090 
00091      G4double setThreshold( G4double );
00092      G4double getThreshold();
00093 
00094      //! Set/Get X resolution.
00095 
00096      G4double setXresol( G4double );
00097      G4double getXresol();
00098 
00099      //! Set/Get Y resolution.
00100 
00101      G4double setYresol( G4double );
00102      G4double getYresol();
00103 
00104      //! Data members.
00105 
00106 private:
00107 
00108      GT_HitsCollection * GT_HC;    //!< Pointer to hits collection.
00109 
00110      G4double GT_threshold;        //!< Energy threshold for valid hit.
00111 
00112      G4double GT_Xresol;           //!< x resolution.
00113      G4double GT_Yresol;           //!< y resolution.
00114 
00115      G4bool GT_Transform[N_GT];    //! Boolean if transforms defined.
00116 
00117      //! Pointers to transformations.
00118 
00119      G4AffineTransform GT_WorldtoLocal[N_GT];
00120      G4AffineTransform GT_LocaltoWorld[N_GT];
00121 };
00122 
00123 #endif