]> git.uio.no Git - u/mrichter/AliRoot.git/blob - AliGeant4/AliSteppingActionMessenger.cxx
Add ResetDecayTable() and SsetDecayTable() methods.
[u/mrichter/AliRoot.git] / AliGeant4 / AliSteppingActionMessenger.cxx
1 // $Id$
2 // Category: event
3 //
4 // See the class description in the header file.
5
6 #include "AliSteppingActionMessenger.h"
7 #include "AliSteppingAction.h"
8 #include "AliGlobals.h"
9
10 #include <G4UIcmdWithAnInteger.hh>
11
12 AliSteppingActionMessenger::AliSteppingActionMessenger(
13                               AliSteppingAction* trackingAction)
14   :fSteppingAction(trackingAction)
15 {
16 // 
17   fLoopVerboseCmd = new G4UIcmdWithAnInteger("/aliTracking/loopVerbose", this);
18   fLoopVerboseCmd
19     ->SetGuidance("Set tracking verbose level for detected looping tracks.");
20   fLoopVerboseCmd->SetParameterName("LoopVerboseLevel", true);
21   fLoopVerboseCmd->SetDefaultValue(1);
22   fLoopVerboseCmd->SetRange("LoopVerboseLevel >= 0 && LoopVerboseLevel <= 5");
23   fLoopVerboseCmd->AvailableForStates(Idle);
24
25   fMaxNofStepsCmd = new G4UIcmdWithAnInteger("/aliTracking/maxNofSteps", this);
26   fMaxNofStepsCmd
27     ->SetGuidance("Set tracking verbose level for detected looping tracks.");
28   fMaxNofStepsCmd->SetParameterName("MaxNofSteps", false);
29   fMaxNofStepsCmd->SetRange("MaxNofSteps >= 0");
30   fMaxNofStepsCmd->AvailableForStates(Idle);
31 }
32
33 AliSteppingActionMessenger::AliSteppingActionMessenger() {
34 //
35 }
36
37 AliSteppingActionMessenger::AliSteppingActionMessenger(
38                                  const AliSteppingActionMessenger& right) {
39 //                               
40   AliGlobals::Exception(
41     "AliSteppingActionMessenger is protected from copying.");
42 }
43
44 AliSteppingActionMessenger::~AliSteppingActionMessenger() {
45 //
46   delete fLoopVerboseCmd;
47   delete fMaxNofStepsCmd;
48 }
49
50 // operators
51
52 AliSteppingActionMessenger& 
53 AliSteppingActionMessenger::operator=(const AliSteppingActionMessenger &right)
54 {
55   // check assignement to self
56   if (this == &right) return *this;
57   
58   AliGlobals::Exception(
59     "AliSteppingActionMessenger is protected from assigning.");
60
61   return *this;
62 }
63
64 // public methods
65
66 void AliSteppingActionMessenger::SetNewValue(G4UIcommand* command, 
67        G4String newValue)
68
69 // Applies command to the associated object.
70 // ---
71
72   if(command == fLoopVerboseCmd) { 
73     fSteppingAction
74       ->SetLoopVerboseLevel(fLoopVerboseCmd->GetNewIntValue(newValue)); 
75   }   
76   else if(command == fMaxNofStepsCmd) { 
77     fSteppingAction
78       ->SetMaxNofSteps(fMaxNofStepsCmd->GetNewIntValue(newValue)); 
79   }   
80 }