]> git.uio.no Git - u/mrichter/AliRoot.git/blob - AliGeant4/AliEventActionMessenger.cxx
private method GetSDConstruction() added; AliSDManager usage replaced with AliSDConst...
[u/mrichter/AliRoot.git] / AliGeant4 / AliEventActionMessenger.cxx
1 // $Id$
2 // Category: event
3 //
4 // See the class description in the header file.
5
6 #include "AliEventActionMessenger.h"
7 #include "AliEventAction.h"
8 #include "AliGlobals.h"
9
10 #include <G4UIdirectory.hh>
11 #include <G4UIcmdWithAString.hh>
12 #include <G4UIcmdWithAnInteger.hh>
13
14 //_____________________________________________________________________________
15 AliEventActionMessenger::AliEventActionMessenger(AliEventAction* eventAction)
16   :fEventAction(eventAction)
17
18 //
19   fEventDirectory = new G4UIdirectory("/aliEvent/");
20   fEventDirectory->SetGuidance("AliEventAction control commands.");
21
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);
29  
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);
36 }
37
38 //_____________________________________________________________________________
39 AliEventActionMessenger::AliEventActionMessenger(){
40 //
41 }
42
43 //_____________________________________________________________________________
44 AliEventActionMessenger::AliEventActionMessenger(
45                                  const AliEventActionMessenger& right) {
46 //                               
47   AliGlobals::Exception("AliEventActionMessenger is protected from copying.");
48 }
49
50 //_____________________________________________________________________________
51 AliEventActionMessenger::~AliEventActionMessenger() {
52 //
53   delete fEventDirectory;
54   delete fDrawTracksCmd;
55   delete fVerboseCmd;
56 }
57
58 // operators
59
60 //_____________________________________________________________________________
61 AliEventActionMessenger& 
62 AliEventActionMessenger::operator=(const AliEventActionMessenger &right)
63 {
64   // check assignement to self
65   if (this == &right) return *this;
66   
67   AliGlobals::Exception("AliEventActionMessenger is protected from assigning.");
68
69   return *this;
70 }
71
72 // public methods
73
74 //_____________________________________________________________________________
75 void AliEventActionMessenger::SetNewValue(G4UIcommand* command, 
76        G4String newValue)
77
78 // Applies command to the associated object.
79 // ---
80
81   if(command == fDrawTracksCmd)
82   { 
83     fEventAction->SetDrawFlag(newValue); 
84   }   
85   else if(command == fVerboseCmd)
86   { 
87     fEventAction
88       ->SetVerboseLevel(fVerboseCmd->GetNewIntValue(newValue)); 
89   }   
90 }