]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TGeant4/TG4Messenger.cxx
Initial version
[u/mrichter/AliRoot.git] / TGeant4 / TG4Messenger.cxx
CommitLineData
2817d3e2 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
13TG4Messenger::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
26TG4Messenger::TG4Messenger(){
27//
28}
29
30TG4Messenger::TG4Messenger(const TG4Messenger& right) {
31//
32 TG4Globals::Exception("TG4Messenger is protected from copying.");
33}
34
35TG4Messenger::~TG4Messenger() {
36//
37 delete fProcessActivationCmd;
38}
39
40// operators
41
42TG4Messenger& 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
54void 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}