]>
Commit | Line | Data |
---|---|---|
676fb573 | 1 | // $Id$ |
2 | // Category: event | |
3 | // | |
7005154f | 4 | // Author: I. Hrivnacova |
5 | // | |
6 | // Class AliEventActionMessenger | |
7 | // ----------------------------- | |
676fb573 | 8 | // See the class description in the header file. |
9 | ||
10 | #include "AliEventActionMessenger.h" | |
11 | #include "AliEventAction.h" | |
12 | #include "AliGlobals.h" | |
13 | ||
14 | #include <G4UIdirectory.hh> | |
15 | #include <G4UIcmdWithAString.hh> | |
16 | #include <G4UIcmdWithAnInteger.hh> | |
17 | ||
78ca1e9c | 18 | //_____________________________________________________________________________ |
676fb573 | 19 | AliEventActionMessenger::AliEventActionMessenger(AliEventAction* eventAction) |
20 | :fEventAction(eventAction) | |
21 | { | |
22 | // | |
23 | fEventDirectory = new G4UIdirectory("/aliEvent/"); | |
24 | fEventDirectory->SetGuidance("AliEventAction control commands."); | |
25 | ||
26 | fDrawTracksCmd = new G4UIcmdWithAString("/aliEvent/drawTracks", this); | |
27 | fDrawTracksCmd->SetGuidance("Draw the tracks in the event"); | |
28 | fDrawTracksCmd->SetGuidance(" Choice : NONE, CHARGED(default), ALL"); | |
29 | fDrawTracksCmd->SetParameterName("Choice", true); | |
30 | fDrawTracksCmd->SetDefaultValue("CHARGED"); | |
31 | fDrawTracksCmd->SetCandidates("NONE CHARGED ALL"); | |
32 | fDrawTracksCmd->AvailableForStates(Idle); | |
33 | ||
34 | fVerboseCmd = new G4UIcmdWithAnInteger("/aliEvent/verbose", this); | |
35 | fVerboseCmd->SetGuidance("Set verbose level for AliEventAction"); | |
36 | fVerboseCmd->SetParameterName("VerboseLevel", true); | |
37 | fVerboseCmd->SetDefaultValue(0); | |
38 | fVerboseCmd->SetRange("VerboseLevel >= 0 && VerboseLevel <= 2"); | |
39 | fVerboseCmd->AvailableForStates(Idle); | |
40 | } | |
41 | ||
78ca1e9c | 42 | //_____________________________________________________________________________ |
676fb573 | 43 | AliEventActionMessenger::AliEventActionMessenger(){ |
44 | // | |
45 | } | |
46 | ||
78ca1e9c | 47 | //_____________________________________________________________________________ |
676fb573 | 48 | AliEventActionMessenger::AliEventActionMessenger( |
49 | const AliEventActionMessenger& right) { | |
50 | // | |
51 | AliGlobals::Exception("AliEventActionMessenger is protected from copying."); | |
52 | } | |
53 | ||
78ca1e9c | 54 | //_____________________________________________________________________________ |
676fb573 | 55 | AliEventActionMessenger::~AliEventActionMessenger() { |
56 | // | |
57 | delete fEventDirectory; | |
58 | delete fDrawTracksCmd; | |
59 | delete fVerboseCmd; | |
60 | } | |
61 | ||
62 | // operators | |
63 | ||
78ca1e9c | 64 | //_____________________________________________________________________________ |
676fb573 | 65 | AliEventActionMessenger& |
66 | AliEventActionMessenger::operator=(const AliEventActionMessenger &right) | |
67 | { | |
68 | // check assignement to self | |
69 | if (this == &right) return *this; | |
70 | ||
71 | AliGlobals::Exception("AliEventActionMessenger is protected from assigning."); | |
72 | ||
73 | return *this; | |
74 | } | |
75 | ||
76 | // public methods | |
77 | ||
78ca1e9c | 78 | //_____________________________________________________________________________ |
676fb573 | 79 | void AliEventActionMessenger::SetNewValue(G4UIcommand* command, |
80 | G4String newValue) | |
81 | { | |
82 | // Applies command to the associated object. | |
83 | // --- | |
84 | ||
85 | if(command == fDrawTracksCmd) | |
86 | { | |
87 | fEventAction->SetDrawFlag(newValue); | |
88 | } | |
89 | else if(command == fVerboseCmd) | |
90 | { | |
91 | fEventAction | |
92 | ->SetVerboseLevel(fVerboseCmd->GetNewIntValue(newValue)); | |
93 | } | |
94 | } |