]>
Commit | Line | Data |
---|---|---|
676fb573 | 1 | // $Id$ |
2 | // Category: event | |
3 | // | |
4 | // See the class description in the header file. | |
5 | ||
6 | #include "AliTrackingActionMessenger.h" | |
7 | #include "AliTrackingAction.h" | |
8 | #include "AliGlobals.h" | |
9 | ||
10 | #include <G4UIdirectory.hh> | |
11 | #include <G4UIcmdWithAnInteger.hh> | |
12 | ||
13 | AliTrackingActionMessenger::AliTrackingActionMessenger( | |
14 | AliTrackingAction* trackingAction) | |
15 | :fTrackingAction(trackingAction) | |
16 | { | |
17 | // | |
18 | fTrackingDirectory = new G4UIdirectory("/aliTracking/"); | |
19 | fTrackingDirectory->SetGuidance("AliTrackingAction control commands."); | |
20 | ||
21 | fVerboseCmd = new G4UIcmdWithAnInteger("/aliTracking/verbose", this); | |
22 | fVerboseCmd->SetGuidance("Set verbose level for AliTrackingAction"); | |
23 | fVerboseCmd->SetParameterName("VerboseLevel", true); | |
24 | fVerboseCmd->SetDefaultValue(2); | |
25 | fVerboseCmd->SetRange("VerboseLevel >= 0 && VerboseLevel <= 3"); | |
26 | fVerboseCmd->AvailableForStates(Idle); | |
27 | } | |
28 | ||
29 | AliTrackingActionMessenger::AliTrackingActionMessenger() { | |
30 | // | |
31 | } | |
32 | ||
33 | AliTrackingActionMessenger::AliTrackingActionMessenger( | |
34 | const AliTrackingActionMessenger& right) { | |
35 | // | |
36 | AliGlobals::Exception( | |
37 | "AliTrackingActionMessenger is protected from copying."); | |
38 | } | |
39 | ||
40 | AliTrackingActionMessenger::~AliTrackingActionMessenger() { | |
41 | // | |
42 | delete fTrackingDirectory; | |
43 | delete fVerboseCmd; | |
44 | } | |
45 | ||
46 | // operators | |
47 | ||
48 | AliTrackingActionMessenger& | |
49 | AliTrackingActionMessenger::operator=(const AliTrackingActionMessenger &right) | |
50 | { | |
51 | // check assignement to self | |
52 | if (this == &right) return *this; | |
53 | ||
54 | AliGlobals::Exception( | |
55 | "AliTrackingActionMessenger is protected from assigning."); | |
56 | ||
57 | return *this; | |
58 | } | |
59 | ||
60 | // public methods | |
61 | ||
62 | void AliTrackingActionMessenger::SetNewValue(G4UIcommand* command, | |
63 | G4String newValue) | |
64 | { | |
65 | // Applies command to the associated object. | |
66 | // --- | |
67 | ||
68 | if(command == fVerboseCmd) | |
69 | { | |
70 | fTrackingAction | |
71 | ->SetVerboseLevel(fVerboseCmd->GetNewIntValue(newValue)); | |
72 | }; | |
73 | } |