]> git.uio.no Git - u/mrichter/AliRoot.git/blame - AliGeant4/AliRunActionMessenger.cxx
corections in XML implementation described
[u/mrichter/AliRoot.git] / AliGeant4 / AliRunActionMessenger.cxx
CommitLineData
676fb573 1// $Id$
2// Category: run
3//
4// See the class description in the header file.
5
6#include "AliRunActionMessenger.h"
7#include "AliRunAction.h"
8#include "AliGlobals.h"
9
10#include <G4UIdirectory.hh>
11#include <G4UIcmdWithAnInteger.hh>
12#include <G4UIcmdWithoutParameter.hh>
13
14AliRunActionMessenger::AliRunActionMessenger(AliRunAction* runAction)
15 : fRunAction(runAction)
16{
17//
18 fRunActionDirectory = new G4UIdirectory("/aliRunAction/");
19 fRunActionDirectory->SetGuidance("AliRunAction control commands.");
20
21 fVerboseCmd = new G4UIcmdWithAnInteger("/aliRunAction/verbose", this);
22 fVerboseCmd->SetGuidance("Set verbose level for AliRunAction");
23 fVerboseCmd->SetParameterName("VerboseLevel", true);
24 fVerboseCmd->SetDefaultValue(0);
25 fVerboseCmd->SetRange("VerboseLevel >= 0 && VerboseLevel <= 2");
26 fVerboseCmd->AvailableForStates(PreInit, Init, Idle, GeomClosed, EventProc);
27}
28
29AliRunActionMessenger::AliRunActionMessenger() {
30//
31}
32
33AliRunActionMessenger::AliRunActionMessenger(const AliRunActionMessenger& right)
34{
35//
36 AliGlobals::Exception("AliRunActionMessenger is protected from copying.");
37}
38
39AliRunActionMessenger::~AliRunActionMessenger() {
40//
41 delete fRunActionDirectory;
42 delete fVerboseCmd;
43}
44
45// operators
46
47AliRunActionMessenger&
48AliRunActionMessenger::operator=(const AliRunActionMessenger &right)
49{
50 // check assignement to self
51 if (this == &right) return *this;
52
53 AliGlobals::Exception("AliRunActionMessenger is protected from assigning.");
54
55 return *this;
56}
57
58// public methods
59
60void AliRunActionMessenger::SetNewValue(G4UIcommand* command,
61 G4String newValue)
62{
63// Applies command to the associated object.
64// ---
65
66 if(command == fVerboseCmd) {
67 fRunAction
68 ->SetVerboseLevel(fVerboseCmd->GetNewIntValue(newValue));
69 }
70}