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