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