DET_Messenger.cc

Go to the documentation of this file.
00001 //! \file
00002 //!
00003 //! Source file for DET_Messenger class for the user interface.
00004 //!
00005 //! Defines 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 // Include user header files referenced in this file.
00017 
00018 #include "DET_Messenger.h"
00019 #include "Detector.h"
00020 
00021 // Include the GEANT4 header files referenced in this file.
00022 
00023 #include "G4UIdirectory.hh"
00024 
00025 // Initialise the static data pointer for the Messenger class.
00026 
00027 DET_Messenger * DET_Messenger::m_pInstance = 0;
00028 
00029 // Use the standard namespace.
00030 
00031 using namespace std;
00032 
00033 // *+****1****+****2****+****3****+****4****+****5****+****6****+****7****+****
00034 
00035 // Define the routine to return pointer to the instance of Messenger.
00036 
00037 DET_Messenger * DET_Messenger::Instance() {
00038    if( m_pInstance == 0 ) {
00039       m_pInstance = new DET_Messenger();
00040    }
00041    return m_pInstance;
00042 }
00043 
00044 // Constructor of GT_Messenger class.
00045 
00046 DET_Messenger::DET_Messenger() {
00047 
00048    OLYMPUSdir = new G4UIdirectory( "/Olympus/" );
00049    OLYMPUSdir->SetGuidance( "OLYMPUS Monte Carlo user commands." );
00050 
00051 }
00052 
00053 // Following intentially commented out to avoid warning message.
00054 
00055 //Messenger & Messenger::operator = ( Messenger const & mess ) {}
00056 
00057 void DET_Messenger::setDETptr( Detector * det ) {
00058 
00059    pDET = det;
00060 
00061    DETdir = new G4UIdirectory( "/Olympus/DET/" );
00062    DETdir->SetGuidance( "OLYMPUS Detector user commands." );
00063 
00064 }
00065 
00066 // Set new value.
00067 
00068 void DET_Messenger::SetNewValue( G4UIcommand * command, G4String newValue ) {}
00069 
00070 // Get current value.
00071 
00072 G4String DET_Messenger::GetCurrentValue( G4UIcommand * command ) {
00073    G4String cv;
00074    return cv;
00075 }