4 // See the class description in the header file.
6 #include "AliEventActionMessenger.h"
7 #include "AliEventAction.h"
8 #include "AliGlobals.h"
10 #include <G4UIdirectory.hh>
11 #include <G4UIcmdWithAString.hh>
12 #include <G4UIcmdWithAnInteger.hh>
14 //_____________________________________________________________________________
15 AliEventActionMessenger::AliEventActionMessenger(AliEventAction* eventAction)
16 :fEventAction(eventAction)
19 fEventDirectory = new G4UIdirectory("/aliEvent/");
20 fEventDirectory->SetGuidance("AliEventAction control commands.");
22 fDrawTracksCmd = new G4UIcmdWithAString("/aliEvent/drawTracks", this);
23 fDrawTracksCmd->SetGuidance("Draw the tracks in the event");
24 fDrawTracksCmd->SetGuidance(" Choice : NONE, CHARGED(default), ALL");
25 fDrawTracksCmd->SetParameterName("Choice", true);
26 fDrawTracksCmd->SetDefaultValue("CHARGED");
27 fDrawTracksCmd->SetCandidates("NONE CHARGED ALL");
28 fDrawTracksCmd->AvailableForStates(Idle);
30 fVerboseCmd = new G4UIcmdWithAnInteger("/aliEvent/verbose", this);
31 fVerboseCmd->SetGuidance("Set verbose level for AliEventAction");
32 fVerboseCmd->SetParameterName("VerboseLevel", true);
33 fVerboseCmd->SetDefaultValue(0);
34 fVerboseCmd->SetRange("VerboseLevel >= 0 && VerboseLevel <= 2");
35 fVerboseCmd->AvailableForStates(Idle);
38 //_____________________________________________________________________________
39 AliEventActionMessenger::AliEventActionMessenger(){
43 //_____________________________________________________________________________
44 AliEventActionMessenger::AliEventActionMessenger(
45 const AliEventActionMessenger& right) {
47 AliGlobals::Exception("AliEventActionMessenger is protected from copying.");
50 //_____________________________________________________________________________
51 AliEventActionMessenger::~AliEventActionMessenger() {
53 delete fEventDirectory;
54 delete fDrawTracksCmd;
60 //_____________________________________________________________________________
61 AliEventActionMessenger&
62 AliEventActionMessenger::operator=(const AliEventActionMessenger &right)
64 // check assignement to self
65 if (this == &right) return *this;
67 AliGlobals::Exception("AliEventActionMessenger is protected from assigning.");
74 //_____________________________________________________________________________
75 void AliEventActionMessenger::SetNewValue(G4UIcommand* command,
78 // Applies command to the associated object.
81 if(command == fDrawTracksCmd)
83 fEventAction->SetDrawFlag(newValue);
85 else if(command == fVerboseCmd)
88 ->SetVerboseLevel(fVerboseCmd->GetNewIntValue(newValue));