switching on all sectors of TRD in ED
[u/mrichter/AliRoot.git] / EVE / alice-macros / geom_gentle_trd.C
CommitLineData
20dae051 1// $Id$
503bfbc8 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
ba978640 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
503bfbc8 19TEveGeoShape* geom_gentle_trd()
20{
81515106 21 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo_trd.root");
e97e7a75 22 //TFile f("/local/cdb/GRP/Geometry/Data/Run0_999999999_v1_s0.root");
503bfbc8 23 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle TRD");
24 TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
25 gEve->AddGlobalElement(gsre);
26 f.Close();
27
e97e7a75 28 const Int_t smInstalled[]={0, 1, 2, 3,4,5, 6, 7, 8, 9, 10, 11,12,13,14, 15, 16, 17};
b2bfbf8e 29 const Int_t nInstalled = static_cast<Int_t>(sizeof(smInstalled)/sizeof(Int_t));
e2673345 30 Int_t sm = 0;
503bfbc8 31 // Fix visibility, color and transparency
32 gsre->SetRnrSelf(kFALSE);
33 for (TEveElement::List_i i = gsre->BeginChildren(); i != gsre->EndChildren(); ++i)
34 {
35 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
36 lvl1->SetRnrSelf(kFALSE);
37 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); ++j)
38 {
39 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
b2bfbf8e 40 lvl2->SetRnrSelf(kFALSE);
41 for(Int_t ism(nInstalled); ism--;){
42 if ( sm == smInstalled[ism] ){
43 lvl2->SetRnrSelf(kTRUE);
44 break;
45 }
46 }
e2673345 47 lvl2->SetMainColor(3);
503bfbc8 48 lvl2->SetMainTransparency(80);
e2673345 49
50 ++sm;
503bfbc8 51 }
503bfbc8 52 }
53
54 return gsre;
55}