]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/geom_gentle_muon.C
addressing coverity warnings: now checking return value of fscanf
[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
9 /// \ingroup evemacros
10 /// \file geom_gentle_muon.C
11 ///
12 /// \author B. Vulpescu, LPC; M. Tadel, CERN
13
14 void DrawDeep(TEveGeoShape *gsre) {
15   
16   for (TEveElement::List_i i = gsre->BeginChildren(); i != gsre->EndChildren(); ++i) {
17     TEveGeoShape* lvl = (TEveGeoShape*) *i;
18     lvl->SetRnrSelf(kFALSE);
19     if (!lvl->HasChildren()) {
20       lvl->SetRnrSelf(kTRUE);
21       lvl->SetMainColor(3);
22       lvl->SetMainTransparency(80);
23     }
24     DrawDeep(lvl);
25   }
26
27 }
28
29 TEveGeoShape* geom_gentle_muon(Bool_t updateScene = kTRUE) {
30
31   TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo_muon.root");
32   TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle MUON");
33   TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
34   gEve->AddGlobalElement(gsre);
35   f.Close();
36
37   gsre->SetRnrSelf(kFALSE);
38
39   DrawDeep(gsre);
40
41   if ( updateScene ) {
42     TGLViewer* v = gEve->GetDefaultGLViewer();
43     v->UpdateScene();
44   }
45
46   return gsre;
47
48 }
49