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