SM_SD.h

Go to the documentation of this file.
00001 //! \file
00002 //!
00003 //! Header file for the Symmetric_Moeller sensitive detector class.
00004 //!
00005 //! The SM_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 Y. Ma based on the sample provided by Olympus simulation package
00011 //! \version 1.0
00012 //! \date 2010-10-11
00013 //!
00014 //! \ingroup detector
00015 
00016 // *+****1****+****2****+****3****+****4****+****5****+****6****+****7****+****
00017 
00018 // Include this file just once.
00019 
00020 #ifndef SM_SD_H
00021 #define SM_SD_H
00022 
00023 // Include the Gem_Tracker and other user header files referenced here.
00024 
00025 #include "Symmetric_Moeller.h"
00026 #include "SM_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 //! SM sensitive detector class based on G4VSensitiveDetector.
00042 //!
00043 //! Creates the SM_SD class and provides the member routines for initialising 
00044 //! the hits collection, processing of hits, and end of event action.
00045 
00046 class SM_SD : public G4VSensitiveDetector {
00047 
00048 public:
00049 
00050      //! Constructor.
00051 
00052      SM_SD( G4String name );
00053    
00054      //! Destructor.
00055 
00056      ~SM_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 * aStep, G4TouchableHistory * ROhist );
00071 
00072      //! End of event routine.
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 energy resolution of PMT.
00095 
00096      G4double setEresol( G4double );
00097      G4double getEresol();
00098 
00099      //! Data member consists of a pointer to the hits collection.
00100 
00101 private:
00102 
00103      SM_HitsCollection * SM_HC;    //!< Pointer to hits collection.
00104       
00105      G4double SM_threshold;        //!< Energy threshold for valid hit.
00106      G4double SM_Eresol;             //!< E resolution.
00107 
00108      G4bool SM_Transform[N_SM];    //! Boolean if transforms defined.
00109 
00110      //! Pointers to transformations.
00111 
00112      G4AffineTransform SM_WorldtoLocal[N_SM];
00113      G4AffineTransform SM_LocaltoWorld[N_SM];
00114       
00115 };
00116 
00117 #endif