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