]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/geom_gentle_bright.C
Update master to aliroot
[u/mrichter/AliRoot.git] / EVE / alice-macros / geom_gentle_bright.C
1 #if !defined(__CINT__) || defined(__MAKECINT__)
2 #include <TFile.h>
3 #include <TEveManager.h>
4 #include <TEveElement.h>
5 #include <TEveGeoShape.h>
6 #include <TEveGeoShapeExtract.h>
7
8 #include <AliEveEventManager.h>
9 #include <AliEveMultiView.h>
10 #endif
11
12
13 void geom_gentle_bright(Bool_t register_as_global=kTRUE)
14 {
15   TEveGeoShape *gsre1;
16   TEveGeoShape *gsre2;
17   TEveGeoShape *gsre3;
18   
19   
20 { TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo.root");
21   TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
22   gsre1 = TEveGeoShape::ImportShapeExtract(gse);
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
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(kOrange+10);
48 //  its1->SetMainTransparency(60);
49   k++;
50
51   TEveGeoShape* its2 = (TEveGeoShape*) *k;
52   its2->SetRnrSelf(kTRUE);
53   its2->SetMainColor(kOrange-3);
54 //  its2->SetMainTransparency(60);
55   k++;
56
57   TEveGeoShape* its3 = (TEveGeoShape*) *k;
58   its3->SetRnrSelf(kTRUE);
59   its3->SetMainColor(kYellow);
60 //  its3->SetMainTransparency(60);
61   }
62 //TPC
63
64   i++;
65   {
66   TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
67   lvl1->SetRnrSelf(kFALSE);
68   TEveElement::List_i j = lvl1->BeginChildren();
69
70   TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
71   lvl2->SetRnrSelf(kFALSE);
72   TEveElement::List_i k = lvl2->BeginChildren();
73
74   TEveGeoShape* lvl3 = (TEveGeoShape*) *k;
75   lvl3->SetRnrSelf(kTRUE);
76   lvl3->SetMainColor(kCyan);
77 //  lvl3->SetMainTransparency(70);
78   TEveElement::List_i l = lvl3->BeginChildren();
79
80   TEveGeoShape* lvl4 = (TEveGeoShape*) *l;
81   lvl4->SetRnrSelf(kFALSE);
82   TEveElement::List_i m = lvl4->BeginChildren();
83
84   TEveGeoShape* tpc1 = (TEveGeoShape*) *m;
85   tpc1->SetRnrSelf(kTRUE);
86 //  tpc1->SetMainColor(1);
87 //  tpc1->SetMainTransparency(70);
88   m++;
89
90   TEveGeoShape* tpc2 = (TEveGeoShape*) *m;
91   tpc2->SetRnrSelf(kTRUE);
92 //  tpc2->SetMainColor(1);
93 //  tpc2->SetMainTransparency(70);
94   m++;
95
96   TEveGeoShape* tpc3 = (TEveGeoShape*) *m;
97   tpc3->SetRnrSelf(kTRUE);
98 //  tpc3->SetMainColor(1);
99 //  tpc3->SetMainTransparency(70);
100   m++;
101   }
102   
103 //TRD+TOF
104
105   i++;
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(kAzure-7);
114 //  trd1->SetMainTransparency(80);
115   j++;
116
117   TEveGeoShape* tof1 = (TEveGeoShape*) *j;
118   tof1->SetRnrSelf(kTRUE);
119   tof1->SetMainColor(kMagenta+3);
120 //  tof1->SetMainTransparency(80);
121   }
122 //PHOS
123
124   i++;
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(kRed);
134 //      lvl2->SetMainTransparency(20);
135     }
136   }
137 //HMPID
138
139   i++;
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(kBlue);
149 //      lvl2->SetMainTransparency(20);
150     }
151   }
152 }
153
154 { TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rphi_geo.root");
155   TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
156   gsre2 = TEveGeoShape::ImportShapeExtract(gse);
157   f.Close();
158
159   // Fix visibility, color and transparency
160
161   gsre2->SetRnrSelf(kFALSE);
162   TEveElement::List_i i = gsre2->BeginChildren();
163   
164 //ITS
165   {
166   TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
167   lvl1->SetRnrSelf(kFALSE);
168   TEveElement::List_i j = lvl1->BeginChildren();
169
170   TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
171   lvl2->SetRnrSelf(kFALSE);
172   TEveElement::List_i k = lvl2->BeginChildren();
173
174   TEveGeoShape* its1 = (TEveGeoShape*) *k;
175   its1->SetRnrSelf(kTRUE);
176   its1->SetMainColor(1);
177   its1->SetMainTransparency(80);
178
179   k++;
180
181   TEveGeoShape* its2 = (TEveGeoShape*) *k;
182   its2->SetRnrSelf(kTRUE);
183   its2->SetMainColor(1);
184   its2->SetMainTransparency(80);
185   k++;
186
187   TEveGeoShape* its3 = (TEveGeoShape*) *k;
188   its3->SetRnrSelf(kTRUE);
189   its3->SetMainColor(1);
190   its3->SetMainTransparency(80);
191   }
192 //TPC
193
194   i++;
195   {
196   TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
197   lvl1->SetRnrSelf(kFALSE);
198
199   for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
200     {
201       TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
202       lvl2->SetRnrSelf(kTRUE);
203       lvl2->SetMainColor(1);
204       lvl2->SetMainTransparency(80);
205     }
206   }
207 //PHOS
208
209   i++;
210   i++;
211   {
212   TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
213   lvl1->SetRnrSelf(kFALSE);
214
215   for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
216     {
217       TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
218       lvl2->SetRnrSelf(kTRUE);
219       lvl2->SetMainColor(1);
220       lvl2->SetMainTransparency(80);
221
222     }
223   }
224 //HMPID
225
226   i++;
227   {
228   TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
229   lvl1->SetRnrSelf(kFALSE);
230
231   for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
232     {
233       TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
234       lvl2->SetRnrSelf(kTRUE);
235       lvl2->SetMainColor(1);
236       lvl2->SetMainTransparency(80);
237     }
238   }
239 }
240
241 { TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rhoz_geo.root");
242   TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
243   gsre3 = TEveGeoShape::ImportShapeExtract(gse);
244   f.Close();
245
246   // Fix visibility, color and transparency
247
248   gsre3->SetRnrSelf(kFALSE);
249   TEveElement::List_i i = gsre3->BeginChildren();
250   
251 //ITS
252   {
253   TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
254   lvl1->SetRnrSelf(kFALSE);
255   TEveElement::List_i j = lvl1->BeginChildren();
256
257   TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
258   lvl2->SetRnrSelf(kFALSE);
259   TEveElement::List_i k = lvl2->BeginChildren();
260
261   TEveGeoShape* its1 = (TEveGeoShape*) *k;
262   its1->SetRnrSelf(kTRUE);
263   its1->SetMainColor(1);
264   k++;
265
266   TEveGeoShape* its2 = (TEveGeoShape*) *k;
267   its2->SetRnrSelf(kTRUE);
268   its2->SetMainColor(1);
269   k++;
270
271   TEveGeoShape* its3 = (TEveGeoShape*) *k;
272   its3->SetRnrSelf(kTRUE);
273   its3->SetMainColor(1);
274   }
275 //TPC
276
277   i++;
278   {
279   TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
280   lvl1->SetRnrSelf(kFALSE);
281
282   for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
283     {
284       TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
285       lvl2->SetRnrSelf(kTRUE);
286       lvl2->SetMainColor(1);
287       lvl2->SetMainTransparency(80);
288
289     }
290   }
291 //PHOS
292
293   i++;
294   i++;
295   {
296   TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
297   lvl1->SetRnrSelf(kFALSE);
298
299   for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
300     {
301       TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
302       lvl2->SetRnrSelf(kTRUE);
303       lvl2->SetMainColor(1);
304       lvl2->SetMainTransparency(80);
305     }
306   }
307 //HMPID
308
309   i++;
310
311   {
312   TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
313   lvl1->SetRnrSelf(kFALSE);
314
315   for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
316     {
317       TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
318       lvl2->SetRnrSelf(kTRUE);
319       lvl2->SetMainColor(1);
320       lvl2->SetMainTransparency(80);
321     }
322   }
323 }
324 //fix all the viewers
325
326   TEveElement* top = gEve->GetCurrentEvent();
327
328   AliEveMultiView *mv = AliEveMultiView::Instance();
329
330   mv->InitGeomGentle(gsre1, gsre2, gsre3, 0);
331
332   gEve->FullRedraw3D(kTRUE, kTRUE);
333
334 }