4 // See the class description in the header file.
6 #include "TG4Messenger.h"
7 #include "TG4GeometryManager.h"
8 #include "TG4StepManager.h"
9 #include "TG4PhysicsManager.h"
11 #include <G4UIcmdWithoutParameter.hh>
13 TG4Messenger::TG4Messenger(TG4GeometryManager* geometryManager,
14 TG4PhysicsManager* physicsManager, TG4StepManager* stepManager)
15 : fGeometryManager(geometryManager),
16 fPhysicsManager(physicsManager),
17 fStepManager(stepManager)
21 = new G4UIcmdWithoutParameter("/g4mc/setProcessActivation", this);
22 fProcessActivationCmd->SetGuidance("Activate/inactivate physics processes.");
23 fProcessActivationCmd->AvailableForStates(Idle);
26 TG4Messenger::TG4Messenger(){
30 TG4Messenger::TG4Messenger(const TG4Messenger& right) {
32 TG4Globals::Exception("TG4Messenger is protected from copying.");
35 TG4Messenger::~TG4Messenger() {
37 delete fProcessActivationCmd;
42 TG4Messenger& TG4Messenger::operator=(const TG4Messenger& right)
44 // check assignement to self
45 if (this == &right) return *this;
47 TG4Globals::Exception("TG4Messenger is protected from assigning.");
54 void TG4Messenger::SetNewValue(G4UIcommand* command, G4String newValue)
56 // Applies command to the associated object.
59 if (command == fProcessActivationCmd) {
60 fPhysicsManager->SetProcessActivation();