]>
Commit | Line | Data |
---|---|---|
9e78371d | 1 | // $Id: geom_gentle.C 30976 2009-02-11 15:55:45Z mtadel $ |
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 | ||
1d8ae8b6 | 10 | #if !defined(__CINT__) || defined(__MAKECINT__) |
11 | #include "TEveGeoShapeExtract.h" | |
12 | #include "TEveGeoNode.h" | |
13 | #include "TEveManager.h" | |
14 | #include "TEveEventManager.h" | |
15 | #include "TEveElement.h" | |
16 | #include "TGLViewer.h" | |
17 | ||
18 | #include "TFile.h" | |
19 | #include "TStyle.h" | |
20 | #endif | |
21 | ||
9e78371d | 22 | // ----------------------------------------------------------------- |
23 | TEveGeoShape* geom_gentle_hlt(Bool_t register_as_global=kTRUE) { | |
24 | TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo.root"); | |
25 | TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle"); | |
26 | TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse); | |
27 | f.Close(); | |
28 | ||
29 | TEveElement* elTRD = gsre->FindChild("TRD+TOF"); | |
30 | elTRD->SetRnrState(kFALSE); | |
31 | ||
32 | TEveElement* elHMPID = gsre->FindChild("HMPID"); | |
294dbb61 | 33 | elHMPID->SetRnrState(kFALSE); |
d20d2124 | 34 | |
35 | TEveElement* elPHOS = gsre->FindChild("PHOS"); | |
36 | elPHOS->SetRnrState(kTRUE); | |
37 | elPHOS->FindChild("PHOS_4")->SetRnrState(kFALSE); | |
38 | elPHOS->FindChild("PHOS_5")->SetRnrState(kFALSE); | |
9e78371d | 39 | |
294dbb61 | 40 | |
9e78371d | 41 | if (register_as_global) { |
42 | gEve->AddGlobalElement(gsre); | |
43 | } | |
44 | ||
45 | return gsre; | |
46 | } | |
47 | ||
48 | // ----------------------------------------------------------------- | |
49 | TEveGeoShape* geom_gentle_rphi() { | |
50 | // The resulting geometry is NOT added into the global scene! | |
51 | ||
52 | TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rphi_geo.root"); | |
53 | TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle"); | |
54 | TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse); | |
55 | f.Close(); | |
56 | ||
d20d2124 | 57 | TEveElement* elPHOS = gsre->FindChild("PHOS"); |
58 | elPHOS->SetRnrState(kTRUE); | |
59 | elPHOS->FindChild("PHOS_4")->SetRnrState(kFALSE); | |
60 | elPHOS->FindChild("PHOS_5")->SetRnrState(kFALSE); | |
61 | ||
9e78371d | 62 | return gsre; |
63 | } | |
64 | ||
65 | // ----------------------------------------------------------------- | |
66 | TEveGeoShape* geom_gentle_rhoz() { | |
67 | // The resulting geometry is NOT added into the global scene! | |
68 | ||
69 | TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rhoz_geo.root"); | |
70 | TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle"); | |
71 | TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse); | |
72 | f.Close(); | |
73 | ||
74 | return gsre; | |
75 | } | |
76 | ||
77 | // ----------------------------------------------------------------- | |
78 | TEveGeoShape* geom_gentle_trd() { | |
79 | TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo_trd.root"); | |
80 | TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle TRD"); | |
81 | TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse); | |
82 | gEve->AddGlobalElement(gsre); | |
83 | f.Close(); | |
84 | ||
85 | Int_t sm = 0; | |
86 | ||
87 | // Fix visibility, color and transparency | |
88 | gsre->SetRnrSelf(kFALSE); | |
89 | for (TEveElement::List_i i = gsre->BeginChildren(); i != gsre->EndChildren(); ++i) { | |
90 | ||
91 | TEveGeoShape* lvl1 = (TEveGeoShape*) *i; | |
92 | lvl1->SetRnrSelf(kFALSE); | |
93 | for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); ++j) { | |
94 | ||
95 | TEveGeoShape* lvl2 = (TEveGeoShape*) *j; | |
96 | ||
97 | if ( sm == 0 || sm == 1 || sm == 7 || sm == 8 || sm == 9 || sm == 10 || sm == 17 ) | |
98 | lvl2->SetRnrSelf(kTRUE); | |
99 | else | |
100 | lvl2->SetRnrSelf(kFALSE); | |
101 | ||
102 | lvl2->SetMainColor(3); | |
103 | lvl2->SetMainTransparency(80); | |
104 | ||
105 | ++sm; | |
106 | } | |
107 | ||
108 | } | |
109 | ||
110 | return gsre; | |
111 | } | |
1d8ae8b6 | 112 | |
113 | void DrawDeep(TEveGeoShape *gsre) { | |
114 | ||
115 | for (TEveElement::List_i i = gsre->BeginChildren(); i != gsre->EndChildren(); ++i) { | |
116 | TEveGeoShape* lvl = (TEveGeoShape*) *i; | |
117 | lvl->SetRnrSelf(kFALSE); | |
118 | if (!lvl->HasChildren()) { | |
119 | lvl->SetRnrSelf(kTRUE); | |
120 | lvl->SetMainColor(3); | |
121 | lvl->SetMainTransparency(50); | |
122 | } | |
123 | DrawDeep(lvl); | |
124 | } | |
125 | ||
126 | } | |
127 | ||
128 | TEveGeoShape* geom_gentle_muon(Bool_t updateScene = kTRUE) { | |
129 | ||
130 | TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo_muon.root"); | |
131 | TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle MUON"); | |
132 | TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse); | |
133 | gEve->AddGlobalElement(gsre); | |
134 | f.Close(); | |
135 | ||
136 | gsre->SetRnrSelf(kFALSE); | |
137 | ||
138 | DrawDeep(gsre); | |
139 | ||
140 | if ( updateScene ) { | |
141 | TGLViewer* v = gEve->GetDefaultGLViewer(); | |
142 | v->UpdateScene(); | |
143 | } | |
144 | ||
145 | return gsre; | |
146 | ||
147 | } |