]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - macros/g4menu.C
Removing obsolete configuration options in TPC
[u/mrichter/AliRoot.git] / macros / g4menu.C
index 0f8eb4f2a42137c651176f97fab26e11192a049d..fe7f07a1b4decc3ecba30bbfd2eaebf5cab90a1d 100644 (file)
@@ -31,6 +31,8 @@ void g4menu()
   menu->AddButton("Run",      "gAlice->Run()",  "Process Alice run");
   menu->AddButton("Geant4",   "CreateGeant4()", "Create Geant4 only (without initializing AliRun)");
   menu->AddButton("Geant4UI", "StartGeant4UI()","Go to Geant4 Interactive session");
+  menu->AddButton("XML",      "GenerateXML()","Generate XML (AGDD) file with geometry description");
+  menu->AddButton("Quit",     "Quit()", "Quit aliroot");
   gROOT->SaveContext();
   menu->Show();
 }
@@ -73,4 +75,33 @@ void StartGeant4UI()
   else {  
     cout << "Monte Carlo has not been yet created." << endl;
   }       
+} 
+
+void GenerateXML()
+{
+  if (gMC) {
+    // release Root terminal control
+
+    // go into non-raw term mode
+    //Getlinem(kCleanUp, 0);
+    
+    // add test if gMC is TGeant4
+    TGeant4* g4 = (TGeant4*)gMC;
+    
+    g4->ProcessGeantCommand("/xml/generateAGDD");
+
+    // new Root prompt
+    //Getlinem(kInit, ((TRint*)gROOT->GetApplication())->GetPrompt());  
+  }
+  else {  
+    cout << "Monte Carlo has not been yet created." << endl;
+  } 
+}        
+
+void Quit()
+{
+  delete gAlice->GetRunLoader();
+  delete gAlice;
+  
+  exit(0);
 }