]>
Commit | Line | Data |
---|---|---|
3aff0c2e | 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 | ||
ba978640 | 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 | ||
6c49a8e1 | 18 | #include <AliEveEventManager.h> |
19 | #include <AliEveMultiView.h> | |
ba978640 | 20 | #endif |
21 | ||
3aff0c2e | 22 | void geom_gentle_transparentdark(Bool_t register_as_global=kTRUE) |
23 | { | |
ba978640 | 24 | TEveGeoShape* gsre1; |
25 | TEveGeoShape* gsre2; | |
26 | TEveGeoShape* gsre3; | |
3aff0c2e | 27 | |
ba978640 | 28 | { |
3aff0c2e | 29 | TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo.root"); |
30 | TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle"); | |
ba978640 | 31 | gsre1 = TEveGeoShape::ImportShapeExtract(gse); |
3aff0c2e | 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 | |
ba978640 | 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 | } | |
3aff0c2e | 73 | //TPC |
74 | ||
75 | i++; | |
ba978640 | 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 | } | |
3aff0c2e | 113 | //TRD+TOF |
114 | ||
115 | i++; | |
ba978640 | 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 | } | |
3aff0c2e | 132 | //PHOS |
133 | ||
134 | i++; | |
ba978640 | 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 | } | |
3aff0c2e | 148 | //HMPID |
149 | ||
150 | i++; | |
ba978640 | 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 | } | |
3aff0c2e | 165 | |
166 | //====================================== | |
167 | ||
168 | // The resulting geometry is NOT added into the global scene! | |
ba978640 | 169 | { |
3aff0c2e | 170 | TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rphi_geo.root"); |
171 | TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle"); | |
ba978640 | 172 | gsre2 = TEveGeoShape::ImportShapeExtract(gse); |
3aff0c2e | 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 | |
ba978640 | 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 | } | |
3aff0c2e | 208 | //TPC |
209 | ||
210 | i++; | |
ba978640 | 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 | } | |
3aff0c2e | 224 | //PHOS |
225 | ||
226 | i++; | |
a13d7c88 | 227 | i++; |
ba978640 | 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 | } | |
3aff0c2e | 242 | //HMPID |
243 | ||
244 | i++; | |
ba978640 | 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 | } | |
3aff0c2e | 259 | //====================================== |
260 | ||
261 | // The resulting geometry is NOT added into the global scene! | |
ba978640 | 262 | { |
3aff0c2e | 263 | TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rhoz_geo.root"); |
264 | TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle"); | |
ba978640 | 265 | gsre3 = TEveGeoShape::ImportShapeExtract(gse); |
3aff0c2e | 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 | |
ba978640 | 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 | } | |
3aff0c2e | 297 | //TPC |
298 | ||
299 | i++; | |
ba978640 | 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 | } | |
3aff0c2e | 314 | //PHOS |
315 | ||
316 | i++; | |
a13d7c88 | 317 | i++; |
ba978640 | 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 | } | |
3aff0c2e | 331 | //HMPID |
332 | ||
333 | i++; | |
ba978640 | 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 | } | |
3aff0c2e | 348 | |
3aff0c2e | 349 | TEveElement* top = gEve->GetCurrentEvent(); |
350 | ||
351 | AliEveMultiView *mv = AliEveMultiView::Instance(); | |
352 | ||
ba978640 | 353 | mv->InitGeomGentle(gsre1, gsre2, gsre3, 0); |
3aff0c2e | 354 | |
355 | gEve->FullRedraw3D(kTRUE, kTRUE); | |
356 | ||
357 | } |