]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TGeant4/TG4Messenger.cxx
methods VolId(), VolName(), NofVolumes(), VolId2Mate() moved to TG4SDManager; GetG3Se...
[u/mrichter/AliRoot.git] / TGeant4 / TG4Messenger.cxx
index 79cd3214494f254f423dbbb42442bd9e5718ce1a..818dfc0e0f9582f29136e3e2fa28b08f14327bbc 100644 (file)
@@ -9,36 +9,82 @@
 #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.");
   fProcessActivationCmd->AvailableForStates(Idle);
 }
 
+//_____________________________________________________________________________
 TG4Messenger::TG4Messenger(){
 //
 } 
 
+//_____________________________________________________________________________
 TG4Messenger::TG4Messenger(const TG4Messenger& right) {
 // 
   TG4Globals::Exception("TG4Messenger is protected from copying.");
 }
 
+//_____________________________________________________________________________
 TG4Messenger::~TG4Messenger() {
 //
+  delete fSetEMCmd;
+  delete fSetOpticalCmd;
+  delete fSetHadronCmd;
+  delete fSetSpecialCutsCmd;
+  delete fSetSpecialControlsCmd;
   delete fProcessActivationCmd;
 }
 
 // operators
 
+//_____________________________________________________________________________
 TG4Messenger& TG4Messenger::operator=(const TG4Messenger& right)
 {
   // check assignement to self
@@ -51,11 +97,33 @@ TG4Messenger& TG4Messenger::operator=(const TG4Messenger& right)
           
 // public methods
 
+//_____________________________________________________________________________
 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();
   }