]> git.uio.no Git - u/mrichter/AliRoot.git/blame - AliGeant4/macro/g4menu.C
Initial version
[u/mrichter/AliRoot.git] / AliGeant4 / macro / g4menu.C
CommitLineData
0f507a31 1#include <iostream.h>
2
3void g4menu()
4{
5 // load Geant4 libraries
6 gROOT->LoadMacro("g4libs.C");
7 gInterpreter->ProcessLine("g4libs()");
8
9 // load AliRoot core libraries
10 gInterpreter->ProcessLine("steerlibs()");
11
12 // menu
13 TControlBar* menu = new TControlBar("vertical","Alice Geant4 menu");
14
15 menu->AddButton("Geant4", "CreateGeant4()", "Create Geant4 Monte Carlo");
16 menu->AddButton("Geant4UI", "StartGeant4UI()","Go to Geant4 Interactive session");
17 menu->AddButton("Init", "gAlice->Init()", "Initialize AliRun");
18 menu->AddButton("Run", "gAlice->Run()", "Process Alice run");
19 menu->AddButton("Run Lego", "gAlice->RunLego()", "Process special lego run");
20 gROOT->SaveContext();
21 menu->Show();
22}
23
24void CreateGeant4()
25{
26 if (!gMC) {
27 // AliRunConfiguration for Geant4
28 AliRunConfiguration* runConfiguration
29 = new AliRunConfiguration();
30
31 // TGeant4
32 TGeant4* geant4
33 = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration);
34
35 cout << "Geant4 has been created." << endl;
36 }
37 else {
38 cout << "Monte Carlo has been already created." << endl;
39 }
40}
41
42void StartGeant4UI()
43{
44 if (gMC) {
45 // release Root terminal control
46
47 // go into non-raw term mode
48 Getlinem(kCleanUp, 0);
49
50 // add test if gMC is TGeant4
51 TGeant4* g4 = (TGeant4*)gMC;
52
53 g4->StartGeantUI();
54
55 // new Root prompt
56 Getlinem(kInit, ((TRint*)gROOT->GetApplication())->GetPrompt());
57 }
58 else {
59 cout << "Monte Carlo has not been yet created." << endl;
60 }
61}
62