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(kFALSE);
35 TEveElement* elPHOS = gsre->FindChild("PHOS");
36 elPHOS->SetRnrState(kTRUE);
37 elPHOS->FindChild("PHOS_4")->SetRnrState(kFALSE);
38 elPHOS->FindChild("PHOS_5")->SetRnrState(kFALSE);
41 if (register_as_global) {
42 gEve->AddGlobalElement(gsre);
48 // -----------------------------------------------------------------
49 TEveGeoShape* geom_gentle_rphi() {
50 // The resulting geometry is NOT added into the global scene!
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);
57 TEveElement* elPHOS = gsre->FindChild("PHOS");
58 elPHOS->SetRnrState(kTRUE);
59 elPHOS->FindChild("PHOS_4")->SetRnrState(kFALSE);
60 elPHOS->FindChild("PHOS_5")->SetRnrState(kFALSE);
65 // -----------------------------------------------------------------
66 TEveGeoShape* geom_gentle_rhoz() {
67 // The resulting geometry is NOT added into the global scene!
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);
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);
87 // Fix visibility, color and transparency
88 gsre->SetRnrSelf(kFALSE);
89 for (TEveElement::List_i i = gsre->BeginChildren(); i != gsre->EndChildren(); ++i) {
91 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
92 lvl1->SetRnrSelf(kFALSE);
93 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); ++j) {
95 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
97 if ( sm == 0 || sm == 1 || sm == 7 || sm == 8 || sm == 9 || sm == 10 || sm == 17 )
98 lvl2->SetRnrSelf(kTRUE);
100 lvl2->SetRnrSelf(kFALSE);
102 lvl2->SetMainColor(3);
103 lvl2->SetMainTransparency(80);
113 void DrawDeep(TEveGeoShape *gsre) {
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);
128 TEveGeoShape* geom_gentle_muon(Bool_t updateScene = kTRUE) {
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);
136 gsre->SetRnrSelf(kFALSE);
141 TGLViewer* v = gEve->GetDefaultGLViewer();