]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/geom_gentle_transparent.C
Geometry for MFT (Brigitte)
[u/mrichter/AliRoot.git] / EVE / alice-macros / geom_gentle_transparent.C
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
9 #include <AliEveEventManager.h>
10 #include <AliEveMultiView.h>
11 #endif
12
13 void geom_gentle_transparent(Bool_t register_as_global=kTRUE)
14 {
15   TEveGeoShape* gsre1;
16   TEveGeoShape* gsre2;
17   TEveGeoShape* gsre3;
18   
19 {
20   TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo.root");
21   TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
22   gsre1 = TEveGeoShape::ImportShapeExtract(gse);
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
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   }
59 //TPC
60
61   i++;
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   }
95 //TRD+TOF
96
97   i++;
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   }
113 //PHOS
114
115   i++;
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   }
127 //HMPID
128
129   i++;
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(80);
139     }
140   }
141 }
142
143 {
144   TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rphi_geo.root");
145   TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
146   gsre2 = TEveGeoShape::ImportShapeExtract(gse);
147   f.Close();
148 }
149
150 {
151   TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rhoz_geo.root");
152   TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
153   gsre3 = TEveGeoShape::ImportShapeExtract(gse);
154   f.Close();
155 }
156
157   TEveElement* top = gEve->GetCurrentEvent();
158
159   AliEveMultiView *mv = AliEveMultiView::Instance();
160
161   mv->InitGeomGentle(gsre1, gsre2, gsre3, 0);
162
163   gEve->FullRedraw3D(kTRUE, kTRUE);
164
165 }
166