1 // $Id: geom_gentle.C 30976 2009-02-11 15:55:45Z mtadel $
2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
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 **************************************************************************/
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"
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);
29 TEveElement* elTRD = gsre->FindChild("TRD+TOF");
30 elTRD->SetRnrState(kFALSE);
32 TEveElement* elHMPID = gsre->FindChild("HMPID");
33 elHMPID->SetRnrState(kTRUE);
35 TEveElement* elPHOS = gsre->FindChild("PHOS");
36 elPHOS->SetRnrState(kTRUE);
37 elPHOS->FindChild("PHOS_4")->SetRnrState(kFALSE);
38 elPHOS->FindChild("PHOS_5")->SetRnrState(kFALSE);
40 if (register_as_global) {
41 gEve->AddGlobalElement(gsre);
47 // -----------------------------------------------------------------
48 TEveGeoShape* geom_gentle_rphi() {
49 // The resulting geometry is NOT added into the global scene!
51 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rphi_geo.root");
52 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
53 TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
56 TEveElement* elPHOS = gsre->FindChild("PHOS");
57 elPHOS->SetRnrState(kTRUE);
58 elPHOS->FindChild("PHOS_4")->SetRnrState(kFALSE);
59 elPHOS->FindChild("PHOS_5")->SetRnrState(kFALSE);
64 // -----------------------------------------------------------------
65 TEveGeoShape* geom_gentle_rhoz() {
66 // The resulting geometry is NOT added into the global scene!
68 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rhoz_geo.root");
69 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
70 TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
76 // -----------------------------------------------------------------
77 TEveGeoShape* geom_gentle_trd() {
78 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo_trd.root");
79 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle TRD");
80 TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
81 gEve->AddGlobalElement(gsre);
86 // Fix visibility, color and transparency
87 gsre->SetRnrSelf(kFALSE);
88 for (TEveElement::List_i i = gsre->BeginChildren(); i != gsre->EndChildren(); ++i) {
90 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
91 lvl1->SetRnrSelf(kFALSE);
92 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); ++j) {
94 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
96 if ( sm == 0 || sm == 1 || sm == 7 || sm == 8 || sm == 9 || sm == 10 || sm == 17 )
97 lvl2->SetRnrSelf(kTRUE);
99 lvl2->SetRnrSelf(kFALSE);
101 lvl2->SetMainColor(3);
102 lvl2->SetMainTransparency(80);
112 void DrawDeep(TEveGeoShape *gsre) {
114 for (TEveElement::List_i i = gsre->BeginChildren(); i != gsre->EndChildren(); ++i) {
115 TEveGeoShape* lvl = (TEveGeoShape*) *i;
116 lvl->SetRnrSelf(kFALSE);
117 if (!lvl->HasChildren()) {
118 lvl->SetRnrSelf(kTRUE);
119 lvl->SetMainColor(3);
120 lvl->SetMainTransparency(50);
127 TEveGeoShape* geom_gentle_muon(Bool_t updateScene = kTRUE) {
129 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo_muon.root");
130 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle MUON");
131 TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
132 gEve->AddGlobalElement(gsre);
135 gsre->SetRnrSelf(kFALSE);
140 TGLViewer* v = gEve->GetDefaultGLViewer();