]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TGeant4/TG4Messenger.cxx
class/type TG3* renamed to TG4G3*
[u/mrichter/AliRoot.git] / TGeant4 / TG4Messenger.cxx
1 // $Id$
2 // Category: run
3 //
4 // See the class description in the header file.
5
6 #include "TG4Messenger.h"
7 #include "TG4GeometryManager.h"
8 #include "TG4StepManager.h"
9 #include "TG4PhysicsManager.h"
10
11 #include <G4UIcmdWithoutParameter.hh>
12
13 TG4Messenger::TG4Messenger(TG4GeometryManager* geometryManager, 
14        TG4PhysicsManager* physicsManager, TG4StepManager* stepManager)
15   : fGeometryManager(geometryManager),
16     fPhysicsManager(physicsManager),
17     fStepManager(stepManager)
18
19 //
20   fProcessActivationCmd
21      = new G4UIcmdWithoutParameter("/g4mc/setProcessActivation", this);
22   fProcessActivationCmd->SetGuidance("Activate/inactivate physics processes.");
23   fProcessActivationCmd->AvailableForStates(Idle);
24 }
25
26 TG4Messenger::TG4Messenger(){
27 //
28
29
30 TG4Messenger::TG4Messenger(const TG4Messenger& right) {
31 // 
32   TG4Globals::Exception("TG4Messenger is protected from copying.");
33 }
34
35 TG4Messenger::~TG4Messenger() {
36 //
37   delete fProcessActivationCmd;
38 }
39
40 // operators
41
42 TG4Messenger& TG4Messenger::operator=(const TG4Messenger& right)
43 {
44   // check assignement to self
45   if (this == &right) return *this;
46
47   TG4Globals::Exception("TG4Messenger is protected from assigning.");
48     
49   return *this;  
50 }    
51           
52 // public methods
53
54 void TG4Messenger::SetNewValue(G4UIcommand* command, G4String newValue)
55
56 // Applies command to the associated object.
57 // ---
58
59   if (command == fProcessActivationCmd) {
60     fPhysicsManager->SetProcessActivation();
61   }  
62 }