TF_SD.h

Go to the documentation of this file.
00001 //! \file
00002 //!
00003 //! Header file for the Time_of_Flight sensitive detector class.
00004 //!
00005 //! The TF_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-08-28
00013 //!
00014 //! \ingroup detector
00015 
00016 // *+****1****+****2****+****3****+****4****+****5****+****6****+****7****+****
00017 
00018 // Include this file just once.
00019 
00020 #ifndef TF_SD_H
00021 #define TF_SD_H
00022 
00023 // Include the Time_of_Flight and other user header files referenced here.
00024 
00025 #include "Time_of_Flight.h"
00026 #include "TF_Hit.h"
00027 
00028 // Include the GEANT4 header files referenced here.
00029 
00030 #include "G4VSensitiveDetector.hh"
00031 #include "G4AffineTransform.hh"
00032 
00033 // Declare classes used in this file.
00034 
00035 class G4HCofThisEvent;
00036 class G4Step;
00037 class G4TouchableHistory;
00038 
00039 // *+****1****+****2****+****3****+****4****+****5****+****6****+****7****+****
00040 
00041 //! TF sensitive detector class based on G4VSensitiveDetector.
00042 //!
00043 //! Creates the TF_SD class and provides the member routines for initialising 
00044 //! the hits collection, processing of hits, and end of event action.
00045 
00046 class TF_SD : public G4VSensitiveDetector {
00047 
00048 public:
00049 
00050      //! Constructor.
00051 
00052      TF_SD( G4String name );
00053    
00054      //! Destructor.
00055 
00056      ~TF_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 th is
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 T resolution.
00095 
00096      G4double setTresol( G4double );
00097      G4double getTresol();
00098 
00099      //! Set/Get Y resolution.
00100 
00101      G4double setYresol( G4double );
00102      G4double getYresol();
00103 
00104      //! Data member consists of a pointer to the hits collection.
00105 
00106 private:
00107 
00108      TF_HitsCollection * TF_HC;    //!< Pointer to hits collection.
00109       
00110      G4double TF_threshold;        //!< Energy threshold for valid hit.
00111      G4double TF_Tresol;           //!< time resolution.
00112      G4double TF_Yresol;           //!< y resolution.
00113 
00114      G4bool TF_Transform[N_TF];    //! Boolean if transforms defined.
00115 
00116      //! Pointers to transformations.
00117 
00118      G4AffineTransform TF_WorldtoLocal[N_TF];
00119      G4AffineTransform TF_LocaltoWorld[N_TF];
00120       
00121 };
00122 
00123 #endif