]>
Commit | Line | Data |
---|---|---|
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 | **************************************************************************/ |
16718cdc | 9 | |
02000333 | 10 | void tof_digits_strips(Int_t selectedSector=-1) |
61d93123 | 11 | { |
12 | TClonesArray *array = 0x0; | |
13 | ||
14 | Int_t nDigitsInVolume[3] = {-1, -1, -1}; | |
15 | Int_t nStrips=19; | |
84aff7a4 | 16 | TGeoManager *localGeoManager = (TGeoManager*)gEve->GetGeometry("./geometry.root");//"$REVESYS/alice-data/alice_fullgeo.root"); |
61d93123 | 17 | if (!localGeoManager) { |
18 | printf("ERROR: no TGeo\n"); | |
19 | } | |
20 | ||
d810d0de | 21 | AliRunLoader* rl = AliEveEventManager::AssertRunLoader(); |
61d93123 | 22 | rl->LoadDigits("TOF"); |
23 | TTree* dt = rl->GetTreeD("TOF", false); | |
24 | ||
d810d0de | 25 | AliEveTOFDigitsInfo* di = new AliEveTOFDigitsInfo(); |
61d93123 | 26 | di->SetTree(dt); |
27 | di->LoadDigits(); | |
28 | di->Dump(); | |
29 | ||
9537e66c | 30 | AliTOFGeometry* g = di->GetTOFgeometry(); |
61d93123 | 31 | |
32 | gStyle->SetPalette(1, 0); | |
84aff7a4 | 33 | gEve->DisableRedraw(); |
61d93123 | 34 | |
35 | TString sPlate; | |
36 | TString bsPlate="Plate"; | |
be35e353 | 37 | |
61d93123 | 38 | Char_t sectorName[100]; |
39 | Char_t sectorTitle[200]; | |
40 | ||
84aff7a4 | 41 | TEveElementList* ll = new TEveElementList("TOF"); |
61d93123 | 42 | ll->SetTitle("TOF detector"); |
fbc350a3 | 43 | ll->SetMainColor(2); |
84aff7a4 | 44 | gEve->AddElement(ll); |
61d93123 | 45 | |
46 | for(Int_t iSector=0; iSector<g->NSectors(); iSector++) { | |
02000333 | 47 | if (selectedSector!=-1 && iSector!=selectedSector) continue; |
61d93123 | 48 | sprintf(sectorName,"Sector%2i",iSector); |
84aff7a4 | 49 | TEveElementList* l = new TEveElementList(sectorName); |
61d93123 | 50 | l->SetTitle(sectorTitle); |
fbc350a3 | 51 | l->SetMainColor(2); |
84aff7a4 | 52 | gEve->AddElement(l, ll); |
61d93123 | 53 | |
54 | ||
55 | for(Int_t iPlate=0; iPlate<g->NPlates(); iPlate++) { | |
be35e353 | 56 | if ((iSector==13 || iSector==14 || iSector==15) && |
57 | (iPlate==2) )continue; // staging TOF geometry with holes | |
58 | ||
61d93123 | 59 | if(iPlate==2) nStrips=15; |
60 | else nStrips=19; | |
61 | ||
62 | sPlate=bsPlate; | |
63 | sPlate+=iPlate; | |
84aff7a4 | 64 | TEveElementList* relPlate = new TEveElementList(sPlate.Data()); |
fbc350a3 | 65 | relPlate->SetMainColor(2); |
455b87be | 66 | gEve->AddElement(relPlate, l); |
61d93123 | 67 | |
68 | ||
69 | for(Int_t iStrip=0; iStrip<nStrips; iStrip++) { | |
70 | ||
71 | array = di->GetDigits(iSector,iPlate, iStrip); | |
72 | ||
02000333 | 73 | AliEveTOFStrip* m = new AliEveTOFStrip(localGeoManager, |
74 | iSector,iPlate,iStrip,array); | |
84aff7a4 | 75 | gEve->AddElement(m, relPlate); |
61d93123 | 76 | |
77 | } | |
78 | } | |
79 | } | |
80 | ||
84aff7a4 | 81 | gEve->EnableRedraw(); |
61d93123 | 82 | |
83 | ||
84 | } |