DET_Messenger.h

Go to the documentation of this file.
00001 //! \file
00002 //!
00003 //! Header file for DET_Messenger class.
00004 //!
00005 //! Declares the singleton messenger class and its member routines which
00006 //! control the parameters of main detector within the OLYMPUS
00007 //! Monte Carlo.  This allow the user to control the parameters and/or
00008 //! running from command files or interactively.
00009 //!
00010 //! \author D.K. Hasell
00011 //! \version 1.0
00012 //! \date 2010-11-05
00013 //!
00014 //! \ingroup control
00015 
00016 // Ensure header file is included only once.
00017 
00018 #ifndef DET_MESSENGER_H
00019 #define DET_MESSENGER_H
00020 
00021 // Include the GEANT4 header files referenced in this file.
00022 
00023 #include "G4UImessenger.hh"
00024 #include "G4UIcommand.hh"
00025 #include "G4UIdirectory.hh"
00026 
00027 // Declare the classes referenced here.
00028 
00029 class Detector;
00030 
00031 //! Declare the Messenger class based on G4UImessenger.
00032 
00033 class DET_Messenger : public G4UImessenger {
00034 
00035 public:
00036 
00037      //! Routine to return a pointer to the single instance of DET_Messenger.
00038 
00039      static DET_Messenger * Instance();
00040 
00041      //! Routine to set a pointer to the DET_SD class and define the user
00042      //! functions available.
00043 
00044      void setDETptr( Detector * det );
00045 
00046      //! Routines to set new values and get current values.
00047 
00048      void SetNewValue( G4UIcommand * command, G4String newValues );
00049 
00050      //! Routine to get current value (not used).
00051 
00052      G4String GetCurrentValue( G4UIcommand * command );
00053 
00054 //! These routines are kept private to preserve singleton class.
00055 
00056 private:
00057 
00058      //! Constructor.
00059 
00060      DET_Messenger();
00061 
00062      //! Copy constructor.
00063 
00064      DET_Messenger( DET_Messenger const & ) {}
00065 
00066      //! Assignment operator.
00067 
00068      DET_Messenger & operator = ( DET_Messenger const & );
00069 
00070 //! Data members of DET_Messenger class.
00071 
00072 private:
00073 
00074      static DET_Messenger * m_pInstance;//!< Instance of DET_Messenger class.
00075 
00076      G4UIdirectory * OLYMPUSdir;        //!< Pointer to OLYMPUS UI structure.
00077 
00078      Detector * pDET;                   //!< Pointer to Detector class.
00079      G4UIdirectory * DETdir;            //!< Pointer to DET UI structure.
00080 
00081 };
00082 
00083 #endif