]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/geom_gentle_muon.C
mistake - use AliInfoGeneral, not AliInfo
[u/mrichter/AliRoot.git] / EVE / alice-macros / geom_gentle_muon.C
1 // $Id$
2
3 /**************************************************************************
4  * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
5  * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
6  * full copyright notice.                                                 *
7  **************************************************************************/
8 #if !defined(__CINT__) || defined(__MAKECINT__)
9 #include <TFile.h>
10 #include <TGLViewer.h>
11 #include <TEveManager.h>
12 #include <TEveElement.h>
13 #include <TEveGeoShape.h>
14 #include <TEveGeoShapeExtract.h>
15 #endif
16
17 /// \ingroup evemacros
18 /// \file geom_gentle_muon.C
19 ///
20 /// \author B. Vulpescu, LPC; M. Tadel, CERN
21
22 void DrawDeep(TEveGeoShape *gsre) {
23   
24   for (TEveElement::List_i i = gsre->BeginChildren(); i != gsre->EndChildren(); ++i) {
25     TEveGeoShape* lvl = (TEveGeoShape*) *i;
26     lvl->SetRnrSelf(kFALSE);
27     if (!lvl->HasChildren()) {
28       lvl->SetRnrSelf(kTRUE);
29       lvl->SetMainColor(3);
30       lvl->SetMainTransparency(80);
31     }
32     DrawDeep(lvl);
33   }
34
35 }
36
37 TEveGeoShape* geom_gentle_muon(Bool_t updateScene = kTRUE) {
38
39   TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo_muon.root");
40   TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle MUON");
41   TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
42   gEve->AddGlobalElement(gsre);
43   f.Close();
44
45   gsre->SetRnrSelf(kFALSE);
46
47   DrawDeep(gsre);
48
49   if ( updateScene ) {
50     TGLViewer* v = gEve->GetDefaultGLViewer();
51     v->UpdateScene();
52   }
53
54   return gsre;
55
56 }
57