]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alice-macros/geom_gentle_green.C
Modified macros to be compilable by ACLiC
[u/mrichter/AliRoot.git] / EVE / alice-macros / geom_gentle_green.C
CommitLineData
ba978640 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>
a13d7c88 7
ba978640 8#include <EVE/EveBase/AliEveEventManager.h>
9#include <EVE/EveBase/AliEveMultiView.h>
10#endif
a13d7c88 11
ba978640 12void geom_gentle_green(Bool_t register_as_global=kTRUE)
13{
14 TEveGeoShape* gsre1;
15 TEveGeoShape* gsre2;
16 TEveGeoShape* gsre3;
a13d7c88 17
ba978640 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();
a13d7c88 22
ba978640 23 if (register_as_global)
a13d7c88 24 {
ba978640 25 gEve->AddGlobalElement(gsre1);
a13d7c88 26 }
27
ba978640 28 // Fix visibility, color and transparency
a13d7c88 29
ba978640 30 gsre1->SetRnrSelf(kFALSE);
31 TEveElement::List_i i = gsre1->BeginChildren();
a13d7c88 32
ba978640 33 //ITS
a13d7c88 34 {
ba978640 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);
a13d7c88 59 }
ba978640 60 //TPC
a13d7c88 61
ba978640 62 i++;
a13d7c88 63 {
ba978640 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++;
a13d7c88 99 }
ba978640 100 //TRD+TOF
a13d7c88 101
ba978640 102 i++;
a13d7c88 103 {
ba978640 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);
a13d7c88 118 }
ba978640 119 //PHOS
a13d7c88 120
ba978640 121 i++;
a13d7c88 122 {
ba978640 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 }
a13d7c88 133 }
ba978640 134 //HMPID
a13d7c88 135
ba978640 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();
a13d7c88 155
ba978640 156 // Fix visibility, color and transparency
a13d7c88 157
ba978640 158 gsre2->SetRnrSelf(kFALSE);
159 TEveElement::List_i i = gsre2->BeginChildren();
a13d7c88 160
ba978640 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
a13d7c88 190
ba978640 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
a13d7c88 205
ba978640 206 i++;
207 i++;
208 {
209 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
210 lvl1->SetRnrSelf(kFALSE);
a13d7c88 211
ba978640 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);
a13d7c88 218
ba978640 219 }
220 }
221 //HMPID
a13d7c88 222
ba978640 223 i++;
a13d7c88 224 {
ba978640 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 }
a13d7c88 235 }
ba978640 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();
a13d7c88 242
ba978640 243 // Fix visibility, color and transparency
a13d7c88 244
ba978640 245 gsre3->SetRnrSelf(kFALSE);
246 TEveElement::List_i i = gsre3->BeginChildren();
a13d7c88 247
ba978640 248 //ITS
a13d7c88 249 {
ba978640 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);
a13d7c88 271 }
ba978640 272 //TPC
a13d7c88 273
ba978640 274 i++;
275 {
276 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
277 lvl1->SetRnrSelf(kFALSE);
a13d7c88 278
ba978640 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);
a13d7c88 285
ba978640 286 }
287 }
288 //PHOS
a13d7c88 289
ba978640 290 i++;
291 i++;
a13d7c88 292 {
ba978640 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 }
a13d7c88 303 }
ba978640 304 //HMPID
a13d7c88 305
ba978640 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 }
a13d7c88 319
ba978640 320 }
321
a13d7c88 322//fix all the viewers
323
324 TEveElement* top = gEve->GetCurrentEvent();
325
326 AliEveMultiView *mv = AliEveMultiView::Instance();
ba978640 327
328 mv->InitGeomGentle(gsre1, gsre2, gsre3, 0);
a13d7c88 329
330 gEve->FullRedraw3D(kTRUE, kTRUE);
331
332}