]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alice-macros/geom_gentle_transparent.C
doxy: install THtml converter
[u/mrichter/AliRoot.git] / EVE / alice-macros / geom_gentle_transparent.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_transparent(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 // Fix visibility, color and transparency
31
32 gsre1->SetRnrSelf(kFALSE);
33 TEveElement::List_i i = gsre1->BeginChildren();
34
35//ITS
ba978640 36 {
37 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
38 lvl1->SetRnrSelf(kFALSE);
39 TEveElement::List_i j = lvl1->BeginChildren();
40
41 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
42 lvl2->SetRnrSelf(kFALSE);
43 TEveElement::List_i k = lvl2->BeginChildren();
44
45 TEveGeoShape* its1 = (TEveGeoShape*) *k;
46 its1->SetRnrSelf(kTRUE);
47 its1->SetMainTransparency(80);
48 k++;
49
50 TEveGeoShape* its2 = (TEveGeoShape*) *k;
51 its2->SetRnrSelf(kTRUE);
52 its2->SetMainTransparency(80);
53 k++;
54
55 TEveGeoShape* its3 = (TEveGeoShape*) *k;
56 its3->SetRnrSelf(kTRUE);
57 its3->SetMainTransparency(80);
58 }
3aff0c2e 59//TPC
60
61 i++;
ba978640 62 {
63 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
64 lvl1->SetRnrSelf(kFALSE);
65 TEveElement::List_i j = lvl1->BeginChildren();
66
67 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
68 lvl2->SetRnrSelf(kFALSE);
69 TEveElement::List_i k = lvl2->BeginChildren();
70
71 TEveGeoShape* lvl3 = (TEveGeoShape*) *k;
72 lvl3->SetRnrSelf(kTRUE);
73 lvl3->SetMainTransparency(80);
74 TEveElement::List_i l = lvl3->BeginChildren();
75
76 TEveGeoShape* lvl4 = (TEveGeoShape*) *l;
77 lvl4->SetRnrSelf(kFALSE);
78 TEveElement::List_i m = lvl4->BeginChildren();
79
80 TEveGeoShape* tpc1 = (TEveGeoShape*) *m;
81 tpc1->SetRnrSelf(kTRUE);
82 tpc1->SetMainTransparency(80);
83 m++;
84
85 TEveGeoShape* tpc2 = (TEveGeoShape*) *m;
86 tpc2->SetMainColor(kGray);
87 tpc2->SetMainTransparency(80);
88 m++;
89
90 TEveGeoShape* tpc3 = (TEveGeoShape*) *m;
91 tpc3->SetRnrSelf(kTRUE);
92 tpc3->SetMainTransparency(80);
93 m++;
94 }
3aff0c2e 95//TRD+TOF
96
97 i++;
ba978640 98 {
99 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
100 lvl1->SetRnrSelf(kFALSE);
101 TEveElement::List_i j = lvl1->BeginChildren();
102
103 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
104 lvl2->SetRnrSelf(kTRUE);
105 lvl2->SetMainTransparency(80);
106 j++;
107
108 TEveGeoShape* lvl3 = (TEveGeoShape*) *j;
109 lvl3->SetRnrSelf(kTRUE);
110 lvl3->SetMainTransparency(80);
111 j++;
112 }
3aff0c2e 113//PHOS
114
115 i++;
ba978640 116 {
117 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
118 lvl1->SetRnrSelf(kFALSE);
119
120 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
121 {
122 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
123 lvl2->SetRnrSelf(kTRUE);
124 lvl2->SetMainTransparency(80);
125 }
126 }
3aff0c2e 127//HMPID
128
129 i++;
ba978640 130 {
3aff0c2e 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(80);
139 }
ba978640 140 }
141}
3aff0c2e 142
ba978640 143{
3aff0c2e 144 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rphi_geo.root");
145 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
ba978640 146 gsre2 = TEveGeoShape::ImportShapeExtract(gse);
3aff0c2e 147 f.Close();
ba978640 148}
3aff0c2e 149
ba978640 150{
3aff0c2e 151 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rhoz_geo.root");
152 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
ba978640 153 gsre3 = TEveGeoShape::ImportShapeExtract(gse);
3aff0c2e 154 f.Close();
ba978640 155}
3aff0c2e 156
157 TEveElement* top = gEve->GetCurrentEvent();
158
159 AliEveMultiView *mv = AliEveMultiView::Instance();
160
ba978640 161 mv->InitGeomGentle(gsre1, gsre2, gsre3, 0);
3aff0c2e 162
163 gEve->FullRedraw3D(kTRUE, kTRUE);
164
165}
166