merged commands from removed TG4PhysicsListMessenger (/g4mc/setXX, XX=EM, Optical,..)
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 Feb 2001 14:35:21 +0000 (14:35 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 Feb 2001 14:35:21 +0000 (14:35 +0000)
TGeant4/TG4Messenger.cxx
TGeant4/TG4Messenger.h

index 79cd3214494f254f423dbbb42442bd9e5718ce1a..2e7d3e3cec587f4732d24f3b37ad302d80abdb4d 100644 (file)
@@ -9,14 +9,50 @@
 #include "TG4PhysicsManager.h"
 
 #include <G4UIcmdWithoutParameter.hh>
+#include <G4UIcmdWithABool.hh>
 
 TG4Messenger::TG4Messenger(TG4GeometryManager* geometryManager, 
-       TG4PhysicsManager* physicsManager, TG4StepManager* stepManager)
+                           TG4PhysicsManager* physicsManager, 
+                          TG4StepManager* stepManager)
   : fGeometryManager(geometryManager),
     fPhysicsManager(physicsManager),
     fStepManager(stepManager)
 { 
 //
+  fSetEMCmd
+     = new G4UIcmdWithABool("/g4mc/setEM", this);
+  fSetEMCmd->SetGuidance("Set electromagnetic processes.");
+  fSetEMCmd->SetParameterName("EMControl", false);
+  fSetEMCmd->AvailableForStates(PreInit);
+
+  fSetOpticalCmd
+     = new G4UIcmdWithABool("/g4mc/setOptical", this);
+  fSetOpticalCmd->SetGuidance("Set Cerenkov and optical processes.");
+  fSetOpticalCmd->SetParameterName("OpticalControl", false);
+  fSetOpticalCmd->AvailableForStates(PreInit);
+
+  fSetHadronCmd
+     = new G4UIcmdWithABool("/g4mc/setHadron", this);
+  fSetHadronCmd->SetGuidance("Set hadron processes.");
+  fSetHadronCmd->SetParameterName("HadronControl", false);
+  fSetHadronCmd->AvailableForStates(PreInit);
+
+  fSetSpecialCutsCmd
+     = new G4UIcmdWithABool("/g4mc/setSpecialCuts", this);
+  fSetSpecialCutsCmd->SetGuidance("Set special cuts process.");
+  fSetSpecialCutsCmd
+    ->SetGuidance("!! Support for this option is under development.");
+  fSetSpecialCutsCmd->SetParameterName("SpecialCutsControl", false);
+  fSetSpecialCutsCmd->AvailableForStates(PreInit);
+
+  fSetSpecialControlsCmd
+     = new G4UIcmdWithABool("/g4mc/setSpecialControls", this);
+  fSetSpecialControlsCmd->SetGuidance("Set special controls process.");
+  fSetSpecialControlsCmd
+    ->SetGuidance("!! Support for this option is under development.");
+  fSetSpecialControlsCmd->SetParameterName("SpecialFlagsControl", false);
+  fSetSpecialControlsCmd->AvailableForStates(PreInit);
+
   fProcessActivationCmd
      = new G4UIcmdWithoutParameter("/g4mc/setProcessActivation", this);
   fProcessActivationCmd->SetGuidance("Activate/inactivate physics processes.");
@@ -34,6 +70,11 @@ TG4Messenger::TG4Messenger(const TG4Messenger& right) {
 
 TG4Messenger::~TG4Messenger() {
 //
+  delete fSetEMCmd;
+  delete fSetOpticalCmd;
+  delete fSetHadronCmd;
+  delete fSetSpecialCutsCmd;
+  delete fSetSpecialControlsCmd;
   delete fProcessActivationCmd;
 }
 
@@ -56,6 +97,27 @@ void TG4Messenger::SetNewValue(G4UIcommand* command, G4String newValue)
 // Applies command to the associated object.
 // ---
 
+  if (command == fSetEMCmd) {
+    fPhysicsManager
+      ->SetEMPhysics(fSetOpticalCmd->GetNewBoolValue(newValue)); 
+  }    
+  else if (command == fSetOpticalCmd) {
+    fPhysicsManager
+      ->SetOpticalPhysics(fSetOpticalCmd->GetNewBoolValue(newValue)); 
+  }    
+  else if (command == fSetHadronCmd) {
+    fPhysicsManager
+      ->SetHadronPhysics(fSetHadronCmd->GetNewBoolValue(newValue)); 
+  }    
+  else if (command == fSetSpecialCutsCmd) {
+    fPhysicsManager
+      ->SetSpecialCutsPhysics(fSetSpecialCutsCmd->GetNewBoolValue(newValue)); 
+  }    
+  else if (command == fSetSpecialControlsCmd) {
+    fPhysicsManager
+      ->SetSpecialControlsPhysics(
+          fSetSpecialControlsCmd->GetNewBoolValue(newValue)); 
+  }    
   if (command == fProcessActivationCmd) {
     fPhysicsManager->SetProcessActivation();
   }  
index 8f5b0ec627eb798ff8ee2374f7a6fed5d5c171c4..6edba466d24c07cab644e8071e01519808b328a2 100644 (file)
@@ -15,12 +15,14 @@ class TG4PhysicsManager;
 class TG4StepManager;
 
 class G4UIcmdWithoutParameter;
+class G4UIcmdWithABool;
 
 class TG4Messenger: public G4UImessenger
 {
   public:
     TG4Messenger(TG4GeometryManager* geometryManager, 
-       TG4PhysicsManager* physicsManager, TG4StepManager* stepManager);
+                 TG4PhysicsManager* physicsManager, 
+                TG4StepManager* stepManager);
     // --> protected   
     // TG4Messenger();
     // TG4Messenger(const TG4Messenger& right);
@@ -41,8 +43,14 @@ class TG4Messenger: public G4UImessenger
     TG4GeometryManager*       fGeometryManager; //geometry manager
     TG4PhysicsManager*        fPhysicsManager;  //physics manager
     TG4StepManager*           fStepManager;     //step manager
-    G4UIcmdWithoutParameter*  fProcessActivationCmd; //command 
-                                                //setProcessActivation    
+    
+    G4UIcmdWithABool*  fSetEMCmd;             //setEM command   
+    G4UIcmdWithABool*  fSetOpticalCmd;        //setOptical command   
+    G4UIcmdWithABool*  fSetHadronCmd;         //setHadron command   
+    G4UIcmdWithABool*  fSetSpecialCutsCmd;    //setSpecialCuts command   
+    G4UIcmdWithABool*  fSetSpecialControlsCmd;//setSpecialControls command   
+    G4UIcmdWithoutParameter*  fProcessActivationCmd; //.
+                                              //setProcessActivation command    
 };
 
 #endif //TG4_MESSENGER_H