]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alice-macros/geom_gentle_muon.C
Update master to aliroot
[u/mrichter/AliRoot.git] / EVE / alice-macros / geom_gentle_muon.C
CommitLineData
25b4bdb2 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 **************************************************************************/
ba978640 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
25b4bdb2 16
17/// \ingroup evemacros
18/// \file geom_gentle_muon.C
19///
20/// \author B. Vulpescu, LPC; M. Tadel, CERN
21
20dae051 22void DrawDeep(TEveGeoShape *gsre) {
23
2c21985b 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);
20dae051 30 }
2c21985b 31
32 } else {
33
34 gsre->SetRnrSelf(kTRUE);
35 gsre->SetMainColor(3);
36 gsre->SetMainTransparency(80);
37
20dae051 38 }
2c21985b 39
20dae051 40}
41
ae8fef5f 42TEveGeoShape* geom_gentle_muon(Bool_t updateScene = kTRUE) {
20dae051 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);
2c21985b 47 gEve->AddGlobalElement(gsre);
20dae051 48 f.Close();
49
20dae051 50 DrawDeep(gsre);
51
ae8fef5f 52 if ( updateScene ) {
53 TGLViewer* v = gEve->GetDefaultGLViewer();
54 v->UpdateScene();
55 }
56
20dae051 57 return gsre;
58
59}
60