]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alice-macros/geom_gentle_projector.C
clusterizer,reconstructor + many fixes (Magnus,Stefan)
[u/mrichter/AliRoot.git] / EVE / alice-macros / geom_gentle_projector.C
CommitLineData
ba978640 1#if !defined(__CINT__) || defined(__MAKECINT__)
2#include <TFile.h>
3#include <TGLViewer.h>
4#include <TEveManager.h>
5#include <TEveElement.h>
6#include <TEveGeoShape.h>
7#include <TEveGeoShapeExtract.h>
8
6c49a8e1 9#include <AliEveEventManager.h>
10#include <AliEveMultiView.h>
ba978640 11#endif
12
95fb6e56 13void geom_gentle_projector(Bool_t register_as_global=kTRUE)
14{
ba978640 15 TEveGeoShape* gsre1;
16 TEveGeoShape* gsre2;
17 TEveGeoShape* gsre3;
18
19 {
95fb6e56 20 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo.root");
21 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
ba978640 22 gsre1 = TEveGeoShape::ImportShapeExtract(gse);
95fb6e56 23 f.Close();
24
25 if (register_as_global)
26 {
27 gEve->AddGlobalElement(gsre1);
28 }
29
30 // Fix visibility, color and transparency
31
32 gsre1->SetRnrSelf(kFALSE);
33 TEveElement::List_i i = gsre1->BeginChildren();
34
ba978640 35//ITS
36 {
37 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
38 lvl1->SetRnrSelf(kFALSE);
39 TEveElement::List_i j = lvl1->BeginChildren();
40
41 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
42 lvl2->SetRnrSelf(kFALSE);
43 TEveElement::List_i k = lvl2->BeginChildren();
44
45 TEveGeoShape* its1 = (TEveGeoShape*) *k;
46 its1->SetRnrSelf(kTRUE);
47 its1->SetMainColor(kBlue-6);
48 its1->SetMainTransparency(50);
49 k++;
50
51 TEveGeoShape* its2 = (TEveGeoShape*) *k;
52 its2->SetRnrSelf(kTRUE);
53 its2->SetMainTransparency(50);
54 k++;
55
56 TEveGeoShape* its3 = (TEveGeoShape*) *k;
57 its3->SetRnrSelf(kTRUE);
58 its1->SetMainColor(kGreen-10);
59 its3->SetMainTransparency(50);
60 }
95fb6e56 61//TPC
62
63 i++;
ba978640 64 {
65 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
66 lvl1->SetRnrSelf(kFALSE);
67 TEveElement::List_i j = lvl1->BeginChildren();
68
69 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
70 lvl2->SetRnrSelf(kFALSE);
71 TEveElement::List_i k = lvl2->BeginChildren();
72
73 TEveGeoShape* lvl3 = (TEveGeoShape*) *k;
74 lvl3->SetRnrSelf(kTRUE);
75 lvl3->SetMainTransparency(50);
76 TEveElement::List_i l = lvl3->BeginChildren();
77
78 TEveGeoShape* lvl4 = (TEveGeoShape*) *l;
79 lvl4->SetRnrSelf(kFALSE);
80 TEveElement::List_i m = lvl4->BeginChildren();
81
82 TEveGeoShape* tpc1 = (TEveGeoShape*) *m;
83 tpc1->SetRnrSelf(kTRUE);
84 tpc1->SetMainTransparency(50);
85 m++;
86
87 TEveGeoShape* tpc2 = (TEveGeoShape*) *m;
88 tpc2->SetMainColor(kGray);
89 tpc2->SetMainTransparency(50);
90 m++;
91
92 TEveGeoShape* tpc3 = (TEveGeoShape*) *m;
93 tpc3->SetRnrSelf(kTRUE);
94 tpc3->SetMainTransparency(50);
95 m++;
96 }
95fb6e56 97//TRD+TOF
98
99 i++;
ba978640 100 {
101 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
102 lvl1->SetRnrSelf(kFALSE);
103 TEveElement::List_i j = lvl1->BeginChildren();
104
105 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
106 lvl2->SetRnrSelf(kTRUE);
107 lvl2->SetMainTransparency(50);
108 j++;
109
110 TEveGeoShape* lvl3 = (TEveGeoShape*) *j;
111 lvl3->SetRnrSelf(kTRUE);
112 lvl3->SetMainTransparency(50);
113 j++;
114 }
95fb6e56 115//PHOS
116
117 i++;
ba978640 118 {
119 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
120 lvl1->SetRnrSelf(kFALSE);
121
122 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
123 {
124 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
125 lvl2->SetRnrSelf(kTRUE);
126 lvl2->SetMainTransparency(50);
127 }
128 }
95fb6e56 129//HMPID
130
131 i++;
ba978640 132 {
133 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
134 lvl1->SetRnrSelf(kFALSE);
135
136 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
137 {
138 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
139 lvl2->SetRnrSelf(kTRUE);
140 lvl2->SetMainTransparency(50);
141 }
142 }
143}
95fb6e56 144
ba978640 145{
95fb6e56 146 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rphi_geo.root");
147 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
ba978640 148 gsre2 = TEveGeoShape::ImportShapeExtract(gse);
95fb6e56 149 f.Close();
150
151 // Fix visibility, color and transparency
152
153 gsre2->SetRnrSelf(kFALSE);
154 TEveElement::List_i i = gsre2->BeginChildren();
155
156//ITS
ba978640 157 {
158 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
159 lvl1->SetRnrSelf(kFALSE);
160 TEveElement::List_i j = lvl1->BeginChildren();
161
162 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
163 lvl2->SetRnrSelf(kFALSE);
164 TEveElement::List_i k = lvl2->BeginChildren();
165
166 TEveGeoShape* its1 = (TEveGeoShape*) *k;
167 its1->SetRnrSelf(kTRUE);
168 its1->SetMainColor(kGreen-10);
169 its1->SetMainTransparency(70);
170 k++;
171
172 TEveGeoShape* its2 = (TEveGeoShape*) *k;
173 its2->SetRnrSelf(kTRUE);
174 its2->SetMainTransparency(70);
175 k++;
176
177 TEveGeoShape* its3 = (TEveGeoShape*) *k;
178 its3->SetRnrSelf(kTRUE);
179 its3->SetMainColor(kBlue-6);
180 its3->SetMainTransparency(70);
181 }
182}
95fb6e56 183
ba978640 184{
95fb6e56 185 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rhoz_geo.root");
186 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
ba978640 187 gsre3 = TEveGeoShape::ImportShapeExtract(gse);
95fb6e56 188 f.Close();
189
190 gsre3->SetRnrSelf(kFALSE);
191 TEveElement::List_i i = gsre3->BeginChildren();
192
193//ITS
ba978640 194 {
195 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
196 lvl1->SetRnrSelf(kFALSE);
197 TEveElement::List_i j = lvl1->BeginChildren();
198
199 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
200 lvl2->SetRnrSelf(kFALSE);
201 TEveElement::List_i k = lvl2->BeginChildren();
202
203 TEveGeoShape* its1 = (TEveGeoShape*) *k;
204 its1->SetRnrSelf(kTRUE);
205 its1->SetMainTransparency(70);
206 its1->SetMainColor(kGreen-10);
207 k++;
208
209 TEveGeoShape* its2 = (TEveGeoShape*) *k;
210 its2->SetRnrSelf(kTRUE);
211 its2->SetMainTransparency(70);
212 // its2->SetMainColor(kRed+2);
213 k++;
214
215 TEveGeoShape* its3 = (TEveGeoShape*) *k;
216 its3->SetRnrSelf(kTRUE);
217 its3->SetMainColor(kBlue-6);
218 its3->SetMainTransparency(70);
219 }
220}
221
95fb6e56 222
223 TEveElement* top = gEve->GetCurrentEvent();
224
225 AliEveMultiView *mv = AliEveMultiView::Instance();
226
ba978640 227 mv->InitGeomGentle(gsre1, gsre2, gsre3, 0);
95fb6e56 228
229 gEve->FullRedraw3D(kTRUE, kTRUE);
230
231}
232