RunAction.h

Go to the documentation of this file.
00001 //! \file
00002 //!
00003 //! Header file for the RunAction class.
00004 //!
00005 //! Declares the RunAction class and the member routines which
00006 //! control the actions taken during the run.
00007 //!
00008 //! \author D.K. Hasell
00009 //! \version 1.0
00010 //! \date 2010-10-14
00011 //!
00012 //! \ingroup control
00013 
00014 // Ensure header file only included once.
00015 
00016 #ifndef RUNACTION_H
00017 #define RUNACTION_H
00018 
00019 // Include the GEANT4 header files referenced in this file.
00020 
00021 #include "G4UserRunAction.hh"
00022 
00023 // Declare the classes referenced here.
00024 
00025 class G4Timer;
00026 class G4Run;
00027 class TFile;
00028 class TTree;
00029 
00030 //! RunAction class based on G4UserRunAction.
00031 
00032 class RunAction : public G4UserRunAction {
00033 
00034 public:
00035 
00036      //! Constructor.
00037 
00038      RunAction();
00039 
00040      //! Destructor.
00041 
00042      ~RunAction();
00043 
00044      // Member functions.
00045 
00046      //! Routine to perform various actions at the start of a run.
00047 
00048      void BeginOfRunAction( const G4Run * run );
00049 
00050      //! Routine to perform various actions at the end of a run.
00051 
00052      void EndOfRunAction( const G4Run * run );
00053 
00054 private:
00055 
00056      // Declare EventAction class as a friend so it can get TTree pointer.
00057 
00058      friend class EventAction;
00059 
00060      static G4Timer * Timer;      //!< Timer to record duration of run.
00061 
00062      static TFile * File;       //!< Pointer to file for MC data.
00063 
00064      static TTree * Tree;       //!< Pointer to TTree for MC data.
00065 
00066 };
00067 
00068 #endif