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