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