]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alice-macros/tof_digits_strips.C
Fixes for reading ITS raw-data.
[u/mrichter/AliRoot.git] / EVE / alice-macros / tof_digits_strips.C
CommitLineData
d810d0de 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 *
51346b82 7 * full copyright notice. *
d810d0de 8 **************************************************************************/
61d93123 9void tof_digits_strips()
10{
11 TClonesArray *array = 0x0;
12
13 Int_t nDigitsInVolume[3] = {-1, -1, -1};
14 Int_t nStrips=19;
84aff7a4 15 TGeoManager *localGeoManager = (TGeoManager*)gEve->GetGeometry("./geometry.root");//"$REVESYS/alice-data/alice_fullgeo.root");
61d93123 16 if (!localGeoManager) {
17 printf("ERROR: no TGeo\n");
18 }
19
d810d0de 20 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
61d93123 21 rl->LoadDigits("TOF");
22 TTree* dt = rl->GetTreeD("TOF", false);
23
d810d0de 24 AliEveTOFDigitsInfo* di = new AliEveTOFDigitsInfo();
61d93123 25 di->SetTree(dt);
26 di->LoadDigits();
27 di->Dump();
28
29 AliTOFGeometry* g = di->fGeom;
30
31 gStyle->SetPalette(1, 0);
84aff7a4 32 gEve->DisableRedraw();
61d93123 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";
51346b82 42
61d93123 43 Char_t sectorName[100];
44 Char_t sectorTitle[200];
45
84aff7a4 46 TEveElementList* ll = new TEveElementList("TOF");
61d93123 47 ll->SetTitle("TOF detector");
48 ll->SetMainColor((Color_t)2);
84aff7a4 49 gEve->AddElement(ll);
61d93123 50
51 for(Int_t iSector=0; iSector<g->NSectors(); iSector++) {
52
53 sprintf(sectorName,"Sector%2i",iSector);
84aff7a4 54 TEveElementList* l = new TEveElementList(sectorName);
61d93123 55 l->SetTitle(sectorTitle);
56 l->SetMainColor((Color_t)2);
84aff7a4 57 gEve->AddElement(l, ll);
61d93123 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;
84aff7a4 66 TEveElementList* relPlate = new TEveElementList(sPlate.Data());
61d93123 67 relPlate->SetMainColor((Color_t)2);
84aff7a4 68 gEve->AddElement(relPlaete, l);
61d93123 69
70
71 for(Int_t iStrip=0; iStrip<nStrips; iStrip++) {
72
73 array = di->GetDigits(iSector,iPlate, iStrip);
74
d810d0de 75 AliEveTOFStrip* m = new AliEveTOFStrip(localGeoManager,iSector,iPlate,iStrip,array);
84aff7a4 76 gEve->AddElement(m, relPlate);
61d93123 77
78 }
79 }
80 }
81
84aff7a4 82 gEve->EnableRedraw();
61d93123 83
84
85}