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