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