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 AliEventActionMessenger::AliEventActionMessenger(AliEventAction* eventAction)
15 :fEventAction(eventAction)
18 fEventDirectory = new G4UIdirectory("/aliEvent/");
19 fEventDirectory->SetGuidance("AliEventAction control commands.");
21 fDrawTracksCmd = new G4UIcmdWithAString("/aliEvent/drawTracks", this);
22 fDrawTracksCmd->SetGuidance("Draw the tracks in the event");
23 fDrawTracksCmd->SetGuidance(" Choice : NONE, CHARGED(default), ALL");
24 fDrawTracksCmd->SetParameterName("Choice", true);
25 fDrawTracksCmd->SetDefaultValue("CHARGED");
26 fDrawTracksCmd->SetCandidates("NONE CHARGED ALL");
27 fDrawTracksCmd->AvailableForStates(Idle);
29 fVerboseCmd = new G4UIcmdWithAnInteger("/aliEvent/verbose", this);
30 fVerboseCmd->SetGuidance("Set verbose level for AliEventAction");
31 fVerboseCmd->SetParameterName("VerboseLevel", true);
32 fVerboseCmd->SetDefaultValue(0);
33 fVerboseCmd->SetRange("VerboseLevel >= 0 && VerboseLevel <= 2");
34 fVerboseCmd->AvailableForStates(Idle);
37 AliEventActionMessenger::AliEventActionMessenger(){
41 AliEventActionMessenger::AliEventActionMessenger(
42 const AliEventActionMessenger& right) {
44 AliGlobals::Exception("AliEventActionMessenger is protected from copying.");
47 AliEventActionMessenger::~AliEventActionMessenger() {
49 delete fEventDirectory;
50 delete fDrawTracksCmd;
56 AliEventActionMessenger&
57 AliEventActionMessenger::operator=(const AliEventActionMessenger &right)
59 // check assignement to self
60 if (this == &right) return *this;
62 AliGlobals::Exception("AliEventActionMessenger is protected from assigning.");
69 void AliEventActionMessenger::SetNewValue(G4UIcommand* command,
72 // Applies command to the associated object.
75 if(command == fDrawTracksCmd)
77 fEventAction->SetDrawFlag(newValue);
79 else if(command == fVerboseCmd)
82 ->SetVerboseLevel(fVerboseCmd->GetNewIntValue(newValue));