This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / macros / menu.C
CommitLineData
fe4da5cc 1void menu(const char *config="Config.C")
2{
3 TControlBar *menu = new TControlBar("vertical","gAlice menu");
4 menu->AddButton(" Help to run gAlice ","AliceHelp()", "Explains how to use gAlice menus");
5 menu->AddButton("Run", "gAlice->Run()","Process an Alice event");
6 menu->AddButton("Run Lego", "gAlice->RunLego()","Special run to generate the radl/absl lego plots");
7 menu->AddButton("Top view", "DrawTopView()","Draw Top view (cut) of Alice");
8 menu->AddButton("Side view", "DrawSideView()","Draw Side view (cut) of Alice");
9 menu->AddButton("Front view", "DrawFrontView()","Draw Front view (cut) of Alice");
10 menu->AddButton("Menu Trees", ".x DrawTrees.C","Menu to display the Alice Geant trees");
11 menu->AddButton("Menu Pictures", ".x DrawPictures.C","Menu to display detectors in shaded mode");
12 menu->AddButton("Hide ON", "SetHide(1)","Activate drawing option HIDE");
13 menu->AddButton("Hide OFF", "SetHide(0)","DeActivate drawing option HIDE");
14 menu->AddButton("Shading ON", "SetShade(1)","Activate drawing option SHAD");
15 menu->AddButton("Shading OFF", "SetShade(0)","DeActivate drawing option SHAD");
16// menu->AddButton("RayTracing ON", "SetRayTracing(1)","Activate drawing option RAYT");
17// menu->AddButton("RayTracing OFF", "SetRayTracing(0)","DeActivate drawing option RAYT");
18 menu->AddButton("Box Clip ON", "SetBoxClip(1)","Activate clipping box");
19 menu->AddButton("Box Clip OFF", "SetBoxClip(0)","DeActivate clipping box");
20// menu->AddButton("Parallel view", "SetViewType(1)","Set Parallel view");
21// menu->AddButton("Perspective view","SetViewType(0)","Set Perspective view");
22 gROOT->SaveContext();
23
24 gAlice->Init(config);
25 ((TGeant3*)gMC)->InitHIGZ();
26 menu->Show();
27}
28
29void AliceHelp()
30{
31 gSystem->Exec("nedit AliceHelp.C &");
32}
33
34void SetRange()
35{
36 THIGZ *higz = (THIGZ*)gROOT->GetListOfCanvases()->FindObject("higz");
37 if (higz) higz->Range(0,0,20,20);
38}
39
40void DrawTopView()
41{
42 printf("Generating TOP view of Alice. Be patient one minute!\n");
43 SetRange();
44 ((TGeant3*)gMC)->Gdrawc("ALIC",2,0,10,10,0.01,0.01);
45}
46
47void DrawSideView()
48{
49 printf("Generating SIDE view of Alice. Be patient one minute!\n");
50 SetRange();
51 ((TGeant3*)gMC)->Gdrawc("ALIC",1,0,10,10,0.01,0.01);
52}
53
54void DrawFrontView()
55{
56 printf("Generating FRONT view of Alice. Be patient one minute!\n");
57 SetRange();
58 ((TGeant3*)gMC)->Gdrawc("ALIC",3,0,10,10,0.01,0.01);
59}
60
61void SetHide(Int_t opt)
62{
63 if (opt) {
64 printf("Drawing option HIDE is ACTIVE!\n");
65 ((TGeant3*)gMC)->Gdopt("HIDE","ON");
66 } else {
67 printf("Drawing option HIDE is NOT ACTIVE!\n");
68 ((TGeant3*)gMC)->Gdopt("HIDE","OFF");
69 }
70}
71
72void SetShade(Int_t opt)
73{
74 if (opt) {
75 printf("Drawing option SHAD is ACTIVE!\n");
76 ((TGeant3*)gMC)->Gdopt("SHAD","ON");
77 } else {
78 printf("Drawing option SHAD is NOT ACTIVE!\n");
79 ((TGeant3*)gMC)->Gdopt("SHAD","OFF");
80 }
81}
82
83void SetRayTracing(Int_t opt)
84{
85 if (opt) {
86 printf("Drawing option RAYT is ACTIVE!\n");
87 ((TGeant3*)gMC)->Gdopt("RAYT","ON");
88 } else {
89 printf("Drawing option RAYT is NOT ACTIVE!\n");
90 ((TGeant3*)gMC)->Gdopt("RAYT","OFF");
91 }
92}
93
94void SetBoxClip(Int_t opt)
95{
96 if (opt) {
97 printf("Clipping BOX is ACTIVE!\n");
98 ((TGeant3*)gMC)->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
99 } else {
100 printf("Clipping BOX is NOT ACTIVE!\n");
101 ((TGeant3*)gMC)->SetClipBox(".");
102 }
103}
104
105void SetViewType(Int_t opt)
106{
107 if (opt) {
108 printf("Setting PARALLEL view!\n");
109 ((TGeant3*)gMC)->Gdopt("PROJ","PARA");
110 } else {
111 printf("Setting PERSPECTIVE view!\n");
112 ((TGeant3*)gMC)->Gdopt("PROJ","PERS");
113 }
114}