2 #include "TGeoManager.h"
4 #include "TEveGeoNode.h"
5 #include "TEveGeoShape.h"
6 #include "TEveManager.h"
11 #include "AliEveHltGeometry.h"
12 ClassImp(AliEveHltGeometry)
16 ///_______________________________________________________________________
17 AliEveHltGeometry::AliEveHltGeometry() {
23 ///_______________________________________________________________________
24 AliEveHltGeometry::~AliEveHltGeometry() {
25 // see header file for class documentation
29 ///______________________________________________________________________
30 TEveGeoShape * AliEveHltGeometry::CreateGentleGeometry( Bool_t register_as_global) {
31 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo.root");
32 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
33 TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
36 TEveElement* elTRD = gsre->FindChild("TRD+TOF");
37 elTRD->SetRnrState(kFALSE);
39 TEveElement* elHMPID = gsre->FindChild("HMPID");
40 elHMPID->SetRnrState(kFALSE);
42 TEveElement* elPHOS = gsre->FindChild("PHOS");
43 elPHOS->SetRnrState(kTRUE);
44 elPHOS->FindChild("PHOS_4")->SetRnrState(kFALSE);
45 elPHOS->FindChild("PHOS_5")->SetRnrState(kFALSE);
48 if (register_as_global) {
49 gEve->AddGlobalElement(gsre);
55 ///______________________________________________________________________
56 TEveGeoTopNode * AliEveHltGeometry::CreateEmcalGeometry(TGeoManager * manager) {
57 if(gGeoManager) cout << "have the manager"<<endl;
58 else cout << "we don't "<<endl;
59 TGeoVolume * volume = manager->GetTopVolume();
60 if(!volume) cout << "no volume"<<endl;
61 TGeoNode * gEMCALNode = manager->GetTopVolume()->FindNode("XEN1_1");
63 TEveGeoTopNode* emcal_re = new TEveGeoTopNode(gGeoManager, gEMCALNode);
64 emcal_re->SetVisLevel(1);
66 for(Int_t i = 4; i < 11; i++) {
67 emcal_re->FindChild(Form("SMOD_%d", i))->SetRnrState(kFALSE);
69 emcal_re->FindChild("SM10_1")->SetRnrState(kFALSE);
70 emcal_re->FindChild("SM10_2")->SetRnrState(kFALSE);
73 gEve->AddGlobalElement(emcal_re);
79 // -----------------------------------------------------------------
80 TEveGeoShape* AliEveHltGeometry::geom_gentle_rphi() {
81 // The resulting geometry is NOT added into the global scene!
83 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rphi_geo.root");
84 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
85 TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
88 TEveElement* elPHOS = gsre->FindChild("PHOS");
89 elPHOS->SetRnrState(kTRUE);
90 elPHOS->FindChild("PHOS_4")->SetRnrState(kFALSE);
91 elPHOS->FindChild("PHOS_5")->SetRnrState(kFALSE);
96 // -----------------------------------------------------------------
97 TEveGeoShape* AliEveHltGeometry::geom_gentle_rhoz() {
98 // The resulting geometry is NOT added into the global scene!
100 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rhoz_geo.root");
101 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
102 TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
108 // -----------------------------------------------------------------
109 TEveGeoShape* AliEveHltGeometry::geom_gentle_trd() {
110 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo_trd.root");
111 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle TRD");
112 TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
113 gEve->AddGlobalElement(gsre);
118 // Fix visibility, color and transparency
119 gsre->SetRnrSelf(kFALSE);
120 for (TEveElement::List_i i = gsre->BeginChildren(); i != gsre->EndChildren(); ++i) {
122 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
123 lvl1->SetRnrSelf(kFALSE);
124 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); ++j) {
126 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
128 if ( sm == 0 || sm == 1 || sm == 7 || sm == 8 || sm == 9 || sm == 10 || sm == 17 )
129 lvl2->SetRnrSelf(kTRUE);
131 lvl2->SetRnrSelf(kFALSE);
133 lvl2->SetMainColor(3);
134 lvl2->SetMainTransparency(80);
144 ///______________________________________________________________________
145 TEveGeoShape* AliEveHltGeometry::geom_gentle_muon(Bool_t updateScene) {
147 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo_muon.root");
148 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle MUON");
149 TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
150 gEve->AddGlobalElement(gsre);
153 gsre->SetRnrSelf(kFALSE);
158 TGLViewer* v = gEve->GetDefaultGLViewer();
165 ///______________________________________________________________________
166 void AliEveHltGeometry::DrawDeep(TEveGeoShape *gsre) {
168 for (TEveElement::List_i i = gsre->BeginChildren(); i != gsre->EndChildren(); ++i) {
169 TEveGeoShape* lvl = (TEveGeoShape*) *i;
170 lvl->SetRnrSelf(kFALSE);
171 if (!lvl->HasChildren()) {
172 lvl->SetRnrSelf(kTRUE);
173 lvl->SetMainColor(3);
174 lvl->SetMainTransparency(50);