/aliRun/setConfig command added
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 23 Jan 2001 15:51:19 +0000 (15:51 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 23 Jan 2001 15:51:19 +0000 (15:51 +0000)
AliGeant4/AliRunMessenger.cxx

index 50af6b1..b5a82ce 100644 (file)
@@ -11,6 +11,8 @@
 #include <G4UIdirectory.hh>
 #include <G4UIcmdWithAnInteger.hh>
 #include <G4UIcmdWithoutParameter.hh>
+#include <G4UIcmdWithAString.hh>
+
 
 AliRunMessenger::AliRunMessenger()
 {
@@ -18,6 +20,12 @@ AliRunMessenger::AliRunMessenger()
   fRunDirectory = new G4UIdirectory("/aliRun/");
   fRunDirectory->SetGuidance("AliRun control commands.");
 
+  fConfigCmd = new G4UIcmdWithAString("/aliRun/setConfig", this);
+  fConfigCmd->SetGuidance("Set configuration macro name");
+  fConfigCmd->SetParameterName("ConfigName", true);
+  fConfigCmd->SetDefaultValue("Config");
+  fConfigCmd->AvailableForStates(PreInit);
+
   fInitializeCmd = new G4UIcmdWithoutParameter("/aliRun/initialize", this);
   fInitializeCmd->SetGuidance("Initialize AliRun");
   fInitializeCmd->AvailableForStates(PreInit);
@@ -42,6 +50,7 @@ AliRunMessenger::AliRunMessenger(const AliRunMessenger& right) {
 AliRunMessenger::~AliRunMessenger() {
 //
   delete fRunDirectory;
+  delete fConfigCmd;
   delete fInitializeCmd;
   delete fBeamOnCmd;
   delete fLegoCmd;
@@ -73,8 +82,11 @@ void AliRunMessenger::SetNewValue(G4UIcommand* command,
       "AliRunMessenger: gAlice has not been instantiated yet.");
   }      
 
-  if(command == fInitializeCmd) { 
-    gAlice->Init(AliFiles::Config()); 
+  if(command == fConfigCmd) { 
+    AliFiles::Instance()->SetMacroName(newValue); 
+  }   
+  else if(command == fInitializeCmd) { 
+    gAlice->Init(AliFiles::Instance()->GetRootMacroPath()); 
   }   
   else if(command == fBeamOnCmd) { 
     gAlice->Run(fBeamOnCmd->GetNewIntValue(newValue));