]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/geom_gentle_trd.C
Make macros compilable with ACLiC
[u/mrichter/AliRoot.git] / EVE / alice-macros / geom_gentle_trd.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 TEveGeoShape* geom_gentle_trd()
11 {
12   TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo_trd.root");
13   TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle TRD");
14   TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
15   gEve->AddGlobalElement(gsre);
16   f.Close();
17
18   const Int_t smInstalled[]={0, 1, 7, 8, 9, 10, 11, 15, 16, 17};
19   const Int_t nInstalled = static_cast<Int_t>(sizeof(smInstalled)/sizeof(Int_t));
20   Int_t sm = 0;
21   // Fix visibility, color and transparency
22   gsre->SetRnrSelf(kFALSE);
23   for (TEveElement::List_i i = gsre->BeginChildren(); i != gsre->EndChildren(); ++i)
24   {
25     TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
26     lvl1->SetRnrSelf(kFALSE);
27     for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); ++j)
28     {
29       TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
30       lvl2->SetRnrSelf(kFALSE);
31       for(Int_t ism(nInstalled); ism--;){
32         if ( sm == smInstalled[ism] ){
33           lvl2->SetRnrSelf(kTRUE);
34           break; 
35         }
36       }
37       lvl2->SetMainColor(3);
38       lvl2->SetMainTransparency(80);
39
40       ++sm;
41     }
42   }
43
44   return gsre;
45 }