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