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