]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/geom_gentle.C
Solve bug #89021 - macros do not neet to do gEve->GetDefaultGeometry() but AliEveEven...
[u/mrichter/AliRoot.git] / EVE / alice-macros / geom_gentle.C
1 // $Id$
2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
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  **************************************************************************/
9
10 #if !defined(__CINT__) || defined(__MAKECINT__)
11 #include <TFile.h>
12 #include <TEveManager.h>
13 #include <TEveGeoNode.h>
14 #include <TEveElement.h>
15 #include <TEveGeoShape.h>
16 #include <TEveGeoShapeExtract.h>
17 #endif
18
19 TEveGeoShape* geom_gentle(Bool_t register_as_global=kTRUE)
20 {
21   TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo.root");
22   TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
23   TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
24   f.Close();
25
26   TEveElement* elPHOS = gsre->FindChild("PHOS");
27   elPHOS->SetRnrState(kTRUE);
28   elPHOS->FindChild("PHOS_4")->SetRnrState(kFALSE);
29   elPHOS->FindChild("PHOS_5")->SetRnrState(kFALSE);
30
31   if (register_as_global)
32   {
33     gEve->AddGlobalElement(gsre);
34   }
35
36   return gsre;
37 }
38
39 TEveGeoShape* geom_gentle_rphi()
40 {
41   // The resulting geometry is NOT added into the global scene!
42
43   TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rphi_geo.root");
44   TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
45   TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
46   f.Close();
47
48   TEveElement* elPHOS = gsre->FindChild("PHOS");
49   elPHOS->SetRnrState(kTRUE);
50   elPHOS->FindChild("PHOS_4")->SetRnrState(kFALSE);
51   elPHOS->FindChild("PHOS_5")->SetRnrState(kFALSE);
52
53   return gsre;
54 }
55
56 TEveGeoShape* geom_gentle_rhoz()
57 {
58   // The resulting geometry is NOT added into the global scene!
59
60   TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rhoz_geo.root");
61   TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
62   TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
63   f.Close();
64
65   return gsre;
66 }