]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/geom_gentle_muon.C
Merge branch 'TPCdev' into master
[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   if (gsre->HasChildren()) {
25     
26     gsre->SetRnrSelf(kFALSE);
27     for (TEveElement::List_i i = gsre->BeginChildren(); i != gsre->EndChildren(); ++i) {
28       TEveGeoShape* lvl = (TEveGeoShape*) *i;
29       DrawDeep(lvl);
30     }
31     
32   } else {
33     
34     gsre->SetRnrSelf(kTRUE);
35     gsre->SetMainColor(3);
36     gsre->SetMainTransparency(80);
37     
38   }
39   
40 }
41
42 TEveGeoShape* geom_gentle_muon(Bool_t updateScene = kTRUE) {
43
44   TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo_muon.root");
45   TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle MUON");
46   TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
47   gEve->AddGlobalElement(gsre);
48   f.Close();
49
50   DrawDeep(gsre);
51
52   if ( updateScene ) {
53     TGLViewer* v = gEve->GetDefaultGLViewer();
54     v->UpdateScene();
55   }
56
57   return gsre;
58
59 }
60