4 // Author: I. Hrivnacova
6 // Class AliEventActionMessenger
7 // -----------------------------
8 // See the class description in the header file.
10 #include "AliEventActionMessenger.h"
11 #include "AliEventAction.h"
12 #include "AliGlobals.h"
14 #include <G4UIdirectory.hh>
15 #include <G4UIcmdWithAString.hh>
16 #include <G4UIcmdWithAnInteger.hh>
18 //_____________________________________________________________________________
19 AliEventActionMessenger::AliEventActionMessenger(AliEventAction* eventAction)
20 :fEventAction(eventAction)
23 fEventDirectory = new G4UIdirectory("/aliEvent/");
24 fEventDirectory->SetGuidance("AliEventAction control commands.");
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);
35 //_____________________________________________________________________________
36 AliEventActionMessenger::AliEventActionMessenger(){
40 //_____________________________________________________________________________
41 AliEventActionMessenger::AliEventActionMessenger(
42 const AliEventActionMessenger& right) {
44 AliGlobals::Exception("AliEventActionMessenger is protected from copying.");
47 //_____________________________________________________________________________
48 AliEventActionMessenger::~AliEventActionMessenger() {
50 delete fEventDirectory;
51 delete fDrawTracksCmd;
56 //_____________________________________________________________________________
57 AliEventActionMessenger&
58 AliEventActionMessenger::operator=(const AliEventActionMessenger &right)
60 // check assignement to self
61 if (this == &right) return *this;
63 AliGlobals::Exception("AliEventActionMessenger is protected from assigning.");
70 //_____________________________________________________________________________
71 void AliEventActionMessenger::SetNewValue(G4UIcommand* command,
74 // Applies command to the associated object.
77 if(command == fDrawTracksCmd)
79 fEventAction->SetDrawFlag(newValue);