]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/tof_digits_strips.C
Fix aclic compilation.
[u/mrichter/AliRoot.git] / EVE / alice-macros / tof_digits_strips.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 void tof_digits_strips()
11 {
12   TClonesArray *array = 0x0;
13
14   Int_t nDigitsInVolume[3] = {-1, -1, -1};
15   Int_t nStrips=19;
16   TGeoManager *localGeoManager = (TGeoManager*)gEve->GetGeometry("./geometry.root");//"$REVESYS/alice-data/alice_fullgeo.root");
17   if (!localGeoManager) {
18     printf("ERROR: no TGeo\n");
19   }
20
21   AliRunLoader* rl =  AliEveEventManager::AssertRunLoader();
22   rl->LoadDigits("TOF");
23   TTree* dt = rl->GetTreeD("TOF", false);
24
25   AliEveTOFDigitsInfo* di = new AliEveTOFDigitsInfo();
26   di->SetTree(dt);
27   di->LoadDigits();
28   di->Dump();
29
30   AliTOFGeometry* g = di->fGeom;
31
32   gStyle->SetPalette(1, 0);
33   gEve->DisableRedraw();
34
35   TString sPlate;
36   TString bsPlate="Plate";
37   TString sStrip;
38   TString bsStrip="Strip";
39   TString sPadZ;
40   TString bsPadZ="PadZ";
41   TString sPadX;
42   TString bsPadX="PadX";
43
44   Char_t sectorName[100];
45   Char_t sectorTitle[200];
46
47   TEveElementList* ll = new TEveElementList("TOF");
48   ll->SetTitle("TOF detector");
49   ll->SetMainColor((Color_t)2);
50   gEve->AddElement(ll);
51
52   for(Int_t iSector=0; iSector<g->NSectors(); iSector++) {
53
54     sprintf(sectorName,"Sector%2i",iSector);
55     TEveElementList* l = new TEveElementList(sectorName);
56     l->SetTitle(sectorTitle);
57     l->SetMainColor((Color_t)2);
58     gEve->AddElement(l, ll);
59
60
61     for(Int_t iPlate=0; iPlate<g->NPlates(); iPlate++) {
62       if(iPlate==2) nStrips=15;
63       else nStrips=19;
64
65       sPlate=bsPlate;
66       sPlate+=iPlate;
67       TEveElementList* relPlate = new TEveElementList(sPlate.Data());
68       relPlate->SetMainColor((Color_t)2);
69       gEve->AddElement(relPlaete, l);
70
71
72       for(Int_t iStrip=0; iStrip<nStrips; iStrip++) {
73
74         array = di->GetDigits(iSector,iPlate, iStrip);
75
76         AliEveTOFStrip* m = new AliEveTOFStrip(localGeoManager,iSector,iPlate,iStrip,array);
77         gEve->AddElement(m, relPlate);
78
79       }
80     }
81   }
82
83   gEve->EnableRedraw();
84
85
86 }