]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alice-macros/geom_gentle_transparentlight.C
changes for Vertex and Tracks classes
[u/mrichter/AliRoot.git] / EVE / alice-macros / geom_gentle_transparentlight.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
13
3aff0c2e 14void geom_gentle_transparentlight(Bool_t register_as_global=kTRUE)
15{
ba978640 16 TEveGeoShape* gsre1;
17 TEveGeoShape* gsre2;
18 TEveGeoShape* gsre3;
19
20{
3aff0c2e 21 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo.root");
22 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
ba978640 23 gsre1 = TEveGeoShape::ImportShapeExtract(gse);
3aff0c2e 24 f.Close();
25
26 if (register_as_global)
27 {
28 gEve->AddGlobalElement(gsre1);
29 }
30
31 // Fix visibility, color and transparency
32
33 gsre1->SetRnrSelf(kFALSE);
34 TEveElement::List_i i = gsre1->BeginChildren();
35
36//ITS
ba978640 37 {
38 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
39 lvl1->SetRnrSelf(kFALSE);
40 TEveElement::List_i j = lvl1->BeginChildren();
41
42 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
43 lvl2->SetRnrSelf(kFALSE);
44 TEveElement::List_i k = lvl2->BeginChildren();
45
46 TEveGeoShape* its1 = (TEveGeoShape*) *k;
47 its1->SetRnrSelf(kTRUE);
48 its1->SetMainColor(1);
49 its1->SetMainTransparency(80);
50 k++;
51
52 TEveGeoShape* its2 = (TEveGeoShape*) *k;
53 its2->SetRnrSelf(kTRUE);
54 its2->SetMainColor(1);
55 its2->SetMainTransparency(80);
56 k++;
57
58 TEveGeoShape* its3 = (TEveGeoShape*) *k;
59 its3->SetRnrSelf(kTRUE);
60 its3->SetMainColor(1);
61 its3->SetMainTransparency(80);
62 }
3aff0c2e 63//TPC
64
65 i++;
ba978640 66 {
67 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
68 lvl1->SetRnrSelf(kFALSE);
69 TEveElement::List_i j = lvl1->BeginChildren();
70
71 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
72 lvl2->SetRnrSelf(kFALSE);
73 TEveElement::List_i k = lvl2->BeginChildren();
74
75 TEveGeoShape* lvl3 = (TEveGeoShape*) *k;
76 lvl3->SetRnrSelf(kFALSE);
77 lvl3->SetMainColor(1);
78 lvl3->SetMainTransparency(80);
79 TEveElement::List_i l = lvl3->BeginChildren();
80
81 TEveGeoShape* lvl4 = (TEveGeoShape*) *l;
82 lvl4->SetRnrSelf(kFALSE);
83 TEveElement::List_i m = lvl4->BeginChildren();
84
85 TEveGeoShape* tpc1 = (TEveGeoShape*) *m;
86 tpc1->SetRnrSelf(kTRUE);
87 tpc1->SetMainColor(1);
88 tpc1->SetMainTransparency(80);
89 m++;
90
91 TEveGeoShape* tpc2 = (TEveGeoShape*) *m;
92 tpc2->SetRnrSelf(kTRUE);
93 tpc2->SetMainColor(1);
94 tpc2->SetMainTransparency(80);
95 m++;
96
97 TEveGeoShape* tpc3 = (TEveGeoShape*) *m;
98 tpc3->SetRnrSelf(kTRUE);
99 tpc3->SetMainColor(1);
100 tpc3->SetMainTransparency(80);
101 m++;
102 }
3aff0c2e 103//TRD+TOF
104
105 i++;
ba978640 106 {
107 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
108 lvl1->SetRnrSelf(kFALSE);
109 TEveElement::List_i j = lvl1->BeginChildren();
110
111 TEveGeoShape* trd1 = (TEveGeoShape*) *j;
112 trd1->SetRnrSelf(kTRUE);
113 trd1->SetMainColor(1);
114 trd1->SetMainTransparency(80);
115 j++;
116
117 TEveGeoShape* tof1 = (TEveGeoShape*) *j;
118 tof1->SetRnrSelf(kTRUE);
119 tof1->SetMainColor(1);
120 tof1->SetMainTransparency(80);
121 }
3aff0c2e 122//PHOS
123
124 i++;
ba978640 125 {
126 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
127 lvl1->SetRnrSelf(kFALSE);
128
129 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); ++j)
130 {
131 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
132 lvl2->SetRnrSelf(kTRUE);
133 lvl2->SetMainColor(1);
134 lvl2->SetMainTransparency(80);
135 }
136 }
3aff0c2e 137//HMPID
138
139 i++;
ba978640 140 {
141 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
142 lvl1->SetRnrSelf(kFALSE);
143
144 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); ++j)
145 {
146 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
147 lvl2->SetRnrSelf(kTRUE);
148 lvl2->SetMainColor(1);
149 lvl2->SetMainTransparency(80);
150 }
151 }
152
153}
3aff0c2e 154
ba978640 155{
3aff0c2e 156 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rphi_geo.root");
157 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
ba978640 158 gsre2 = TEveGeoShape::ImportShapeExtract(gse);
3aff0c2e 159 f.Close();
160
161 // Fix visibility, color and transparency
162
163 gsre2->SetRnrSelf(kFALSE);
164 TEveElement::List_i i = gsre2->BeginChildren();
165
166//ITS
ba978640 167 {
168 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
169 lvl1->SetRnrSelf(kFALSE);
170 TEveElement::List_i j = lvl1->BeginChildren();
171
172 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
173 lvl2->SetRnrSelf(kFALSE);
174 TEveElement::List_i k = lvl2->BeginChildren();
175
176 TEveGeoShape* its1 = (TEveGeoShape*) *k;
177 its1->SetRnrSelf(kTRUE);
178 its1->SetMainColor(1);
179 its1->SetMainTransparency(80);
180
181 k++;
182
183 TEveGeoShape* its2 = (TEveGeoShape*) *k;
184 its2->SetRnrSelf(kTRUE);
185 its2->SetMainColor(1);
186 its2->SetMainTransparency(80);
187 k++;
188
189 TEveGeoShape* its3 = (TEveGeoShape*) *k;
190 its3->SetRnrSelf(kTRUE);
191 its3->SetMainColor(1);
192 its3->SetMainTransparency(80);
193 }
3aff0c2e 194//TPC
195
196 i++;
ba978640 197 {
3aff0c2e 198 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
199 lvl1->SetRnrSelf(kFALSE);
200
201 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
202 {
203 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
204 lvl2->SetRnrSelf(kTRUE);
205 lvl2->SetMainColor(1);
206 lvl2->SetMainTransparency(80);
207 }
ba978640 208 }
3aff0c2e 209
210//PHOS
211
212 i++;
a13d7c88 213 i++;
ba978640 214 {
3aff0c2e 215 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
216 lvl1->SetRnrSelf(kFALSE);
217
218 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
219 {
220 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
221 lvl2->SetRnrSelf(kTRUE);
222 lvl2->SetMainColor(1);
223 lvl2->SetMainTransparency(80);
224
225 }
ba978640 226 }
3aff0c2e 227
228//HMPID
229
230 i++;
ba978640 231 {
3aff0c2e 232 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
233 lvl1->SetRnrSelf(kFALSE);
234
235 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
236 {
237 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
238 lvl2->SetRnrSelf(kTRUE);
239 lvl2->SetMainColor(1);
240 lvl2->SetMainTransparency(80);
241 }
ba978640 242 }
243
244}
3aff0c2e 245
ba978640 246{
3aff0c2e 247 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rhoz_geo.root");
248 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
ba978640 249 gsre3 = TEveGeoShape::ImportShapeExtract(gse);
3aff0c2e 250 f.Close();
251
252 // Fix visibility, color and transparency
253
254 gsre3->SetRnrSelf(kFALSE);
255 TEveElement::List_i i = gsre3->BeginChildren();
256
257//ITS
ba978640 258 {
259 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
260 lvl1->SetRnrSelf(kFALSE);
261 TEveElement::List_i j = lvl1->BeginChildren();
262
263 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
264 lvl2->SetRnrSelf(kFALSE);
265 TEveElement::List_i k = lvl2->BeginChildren();
266
267 TEveGeoShape* its1 = (TEveGeoShape*) *k;
268 its1->SetRnrSelf(kTRUE);
269 its1->SetMainColor(1);
270 k++;
271
272 TEveGeoShape* its2 = (TEveGeoShape*) *k;
273 its2->SetRnrSelf(kTRUE);
274 its2->SetMainColor(1);
275 k++;
276
277 TEveGeoShape* its3 = (TEveGeoShape*) *k;
278 its3->SetRnrSelf(kTRUE);
279 its3->SetMainColor(1);
280 }
3aff0c2e 281//TPC
282
283 i++;
3aff0c2e 284
ba978640 285 {
286 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
287 lvl1->SetRnrSelf(kFALSE);
3aff0c2e 288
ba978640 289 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
290 {
291 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
292 lvl2->SetRnrSelf(kTRUE);
293 lvl2->SetMainColor(1);
294 lvl2->SetMainTransparency(80);
3aff0c2e 295
ba978640 296 }
297 }
3aff0c2e 298//PHOS
299
300 i++;
a13d7c88 301 i++;
ba978640 302 {
303 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
304 lvl1->SetRnrSelf(kFALSE);
305
306 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
307 {
308 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
309 lvl2->SetRnrSelf(kTRUE);
310 lvl2->SetMainColor(1);
311 lvl2->SetMainTransparency(80);
312 }
313 }
3aff0c2e 314
315//HMPID
316
317 i++;
ba978640 318 {
3aff0c2e 319 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
320 lvl1->SetRnrSelf(kFALSE);
321
322 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
323 {
324 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
325 lvl2->SetRnrSelf(kTRUE);
326 lvl2->SetMainColor(1);
327 lvl2->SetMainTransparency(80);
328 }
ba978640 329 }
330}
3aff0c2e 331
332//fix all the viewers
333
334 TEveElement* top = gEve->GetCurrentEvent();
335
336 AliEveMultiView *mv = AliEveMultiView::Instance();
337
ba978640 338 mv->InitGeomGentle(gsre1, gsre2, gsre3, 0);
3aff0c2e 339
340 gEve->FullRedraw3D(kTRUE, kTRUE);
341
342}