]> git.uio.no Git - u/mrichter/AliRoot.git/blob - AliGeant4/AliRunActionMessenger.cxx
Access function to local momenta renamed.
[u/mrichter/AliRoot.git] / AliGeant4 / AliRunActionMessenger.cxx
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
13 AliRunActionMessenger::AliRunActionMessenger(AliRunAction* runAction)
14   : fRunAction(runAction)
15 {
16 // 
17   fRunActionDirectory = new G4UIdirectory("/aliRunAction/");
18   fRunActionDirectory->SetGuidance("AliRunAction control commands.");
19
20   fVerboseCmd = new G4UIcmdWithAnInteger("/aliRunAction/verbose", this);
21   fVerboseCmd->SetGuidance("Set verbose level for AliRunAction");
22   fVerboseCmd->SetParameterName("VerboseLevel", true);
23   fVerboseCmd->SetDefaultValue(0);
24   fVerboseCmd->SetRange("VerboseLevel >= 0 && VerboseLevel <= 2");
25   fVerboseCmd->AvailableForStates(PreInit, Init, Idle, GeomClosed, EventProc);
26 }
27
28 AliRunActionMessenger::AliRunActionMessenger() {
29 //
30 }
31
32 AliRunActionMessenger::AliRunActionMessenger(const AliRunActionMessenger& right)
33 {
34 //
35   AliGlobals::Exception("AliRunActionMessenger is protected from copying.");
36 }
37
38 AliRunActionMessenger::~AliRunActionMessenger() {
39 //
40   delete fRunActionDirectory;
41   delete fVerboseCmd;
42 }
43
44 // operators
45
46 AliRunActionMessenger& 
47 AliRunActionMessenger::operator=(const AliRunActionMessenger &right)
48 {
49   // check assignement to self
50   if (this == &right) return *this;
51   
52   AliGlobals::Exception("AliRunActionMessenger is protected from assigning.");
53
54   return *this;
55 }
56
57 // public methods
58
59 void AliRunActionMessenger::SetNewValue(G4UIcommand* command, 
60        G4String newValue)
61
62 // Applies command to the associated object.
63 // ---
64
65   if(command == fVerboseCmd) { 
66     fRunAction
67       ->SetVerboseLevel(fVerboseCmd->GetNewIntValue(newValue)); 
68   }   
69 }