]> git.uio.no Git - u/mrichter/AliRoot.git/blob - AliGeant4/AliEventActionMessenger.cxx
Changes to read also Altro like data.
[u/mrichter/AliRoot.git] / AliGeant4 / AliEventActionMessenger.cxx
1 // $Id$
2 // Category: event
3 //
4 // Author: I. Hrivnacova
5 //
6 // Class AliEventActionMessenger
7 // -----------------------------
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
18 //_____________________________________________________________________________
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);
33 }
34
35 //_____________________________________________________________________________
36 AliEventActionMessenger::AliEventActionMessenger(){
37 //
38 }
39
40 //_____________________________________________________________________________
41 AliEventActionMessenger::AliEventActionMessenger(
42                                  const AliEventActionMessenger& right) {
43 //                               
44   AliGlobals::Exception("AliEventActionMessenger is protected from copying.");
45 }
46
47 //_____________________________________________________________________________
48 AliEventActionMessenger::~AliEventActionMessenger() {
49 //
50   delete fEventDirectory;
51   delete fDrawTracksCmd;
52 }
53
54 // operators
55
56 //_____________________________________________________________________________
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
70 //_____________________________________________________________________________
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   }   
81 }