00001 //! \file 00002 //! 00003 //! Header file for the Wire_Chamber sensitive detector class. 00004 //! 00005 //! The WC_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 // Ensure this header file is only included once. 00019 00020 #ifndef WC_SD_H 00021 #define WC_SD_H 00022 00023 // Include the Wire_Chamber and other user header files referenced here. 00024 00025 #include "Wire_Chamber.h" 00026 #include "WC_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 //! WC sensitive detector class based on G4VSensitiveDetector. 00042 //! 00043 //! Creates the WC_SD class and provides the member routines for initialising 00044 //! the hits collection, processing of hits, and end of event action. 00045 00046 class WC_SD : public G4VSensitiveDetector { 00047 00048 public: 00049 00050 //! Constructor. 00051 00052 WC_SD( G4String name ); 00053 00054 //! Destructor. 00055 00056 ~WC_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 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 member consists of a pointer to the hits collection. 00105 00106 private: 00107 00108 WC_HitsCollection * WC_HC; //!< Pointer to hits collection. 00109 00110 G4double WC_threshold; //!< Energy threshold for valid hit. 00111 00112 G4double WC_Xresol; //!< x resolution. 00113 G4double WC_Yresol; //!< y resolution. 00114 00115 G4bool WC_Transform[N_WC]; //! Boolean if transforms defined. 00116 00117 //! Pointers to transformations. 00118 00119 G4AffineTransform WC_WorldtoLocal[N_WC]; 00120 G4AffineTransform WC_LocaltoWorld[N_WC]; 00121 }; 00122 00123 #endif 00124