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);
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);
42 //_____________________________________________________________________________
43 AliEventActionMessenger::AliEventActionMessenger(){
47 //_____________________________________________________________________________
48 AliEventActionMessenger::AliEventActionMessenger(
49 const AliEventActionMessenger& right) {
51 AliGlobals::Exception("AliEventActionMessenger is protected from copying.");
54 //_____________________________________________________________________________
55 AliEventActionMessenger::~AliEventActionMessenger() {
57 delete fEventDirectory;
58 delete fDrawTracksCmd;
64 //_____________________________________________________________________________
65 AliEventActionMessenger&
66 AliEventActionMessenger::operator=(const AliEventActionMessenger &right)
68 // check assignement to self
69 if (this == &right) return *this;
71 AliGlobals::Exception("AliEventActionMessenger is protected from assigning.");
78 //_____________________________________________________________________________
79 void AliEventActionMessenger::SetNewValue(G4UIcommand* command,
82 // Applies command to the associated object.
85 if(command == fDrawTracksCmd)
87 fEventAction->SetDrawFlag(newValue);
89 else if(command == fVerboseCmd)
92 ->SetVerboseLevel(fVerboseCmd->GetNewIntValue(newValue));