]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/tof_digits_strips.C
To visualize the TOF strips in the geometry configuration with holes in front of...
[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
38   Char_t sectorName[100];
39   Char_t sectorTitle[200];
40
41   TEveElementList* ll = new TEveElementList("TOF");
42   ll->SetTitle("TOF detector");
43   ll->SetMainColor((Color_t)2);
44   gEve->AddElement(ll);
45
46   for(Int_t iSector=0; iSector<g->NSectors(); iSector++) {
47
48     sprintf(sectorName,"Sector%2i",iSector);
49     TEveElementList* l = new TEveElementList(sectorName);
50     l->SetTitle(sectorTitle);
51     l->SetMainColor((Color_t)2);
52     gEve->AddElement(l, ll);
53
54
55     for(Int_t iPlate=0; iPlate<g->NPlates(); iPlate++) {
56       if ((iSector==13 || iSector==14 || iSector==15) &&
57           (iPlate==2) )continue; // staging TOF geometry with holes
58
59       if(iPlate==2) nStrips=15;
60       else nStrips=19;
61
62       sPlate=bsPlate;
63       sPlate+=iPlate;
64       TEveElementList* relPlate = new TEveElementList(sPlate.Data());
65       relPlate->SetMainColor((Color_t)2);
66       gEve->AddElement(relPlate, l);
67
68
69       for(Int_t iStrip=0; iStrip<nStrips; iStrip++) {
70
71         array = di->GetDigits(iSector,iPlate, iStrip);
72
73         AliEveTOFStrip* m = new AliEveTOFStrip(localGeoManager,iSector,iPlate,iStrip,array);
74         gEve->AddElement(m, relPlate);
75
76       }
77     }
78   }
79
80   gEve->EnableRedraw();
81
82
83 }