]>
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); | |
676fb573 | 33 | } |
34 | ||
78ca1e9c | 35 | //_____________________________________________________________________________ |
676fb573 | 36 | AliEventActionMessenger::AliEventActionMessenger(){ |
37 | // | |
38 | } | |
39 | ||
78ca1e9c | 40 | //_____________________________________________________________________________ |
676fb573 | 41 | AliEventActionMessenger::AliEventActionMessenger( |
42 | const AliEventActionMessenger& right) { | |
43 | // | |
44 | AliGlobals::Exception("AliEventActionMessenger is protected from copying."); | |
45 | } | |
46 | ||
78ca1e9c | 47 | //_____________________________________________________________________________ |
676fb573 | 48 | AliEventActionMessenger::~AliEventActionMessenger() { |
49 | // | |
50 | delete fEventDirectory; | |
51 | delete fDrawTracksCmd; | |
676fb573 | 52 | } |
53 | ||
54 | // operators | |
55 | ||
78ca1e9c | 56 | //_____________________________________________________________________________ |
676fb573 | 57 | AliEventActionMessenger& |
58 | AliEventActionMessenger::operator=(const AliEventActionMessenger &right) | |
59 | { | |
60 | // check assignement to self | |
61 | if (this == &right) return *this; | |
62 | ||
63 | AliGlobals::Exception("AliEventActionMessenger is protected from assigning."); | |
64 | ||
65 | return *this; | |
66 | } | |
67 | ||
68 | // public methods | |
69 | ||
78ca1e9c | 70 | //_____________________________________________________________________________ |
676fb573 | 71 | void AliEventActionMessenger::SetNewValue(G4UIcommand* command, |
72 | G4String newValue) | |
73 | { | |
74 | // Applies command to the associated object. | |
75 | // --- | |
76 | ||
77 | if(command == fDrawTracksCmd) | |
78 | { | |
79 | fEventAction->SetDrawFlag(newValue); | |
80 | } | |
676fb573 | 81 | } |