]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/tof_digits.C
- synchronized the overlay macro to the changes of the drawing one
[u/mrichter/AliRoot.git] / EVE / alice-macros / tof_digits.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
11 void tof_digits()
12 {  
13   TClonesArray *array = 0x0;
14
15   TGeoManager *localGeoManager = gEve->GetGeometry("./geometry.root");//  gGeoManager = gEve->GetDefaultGeometry();
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->GetTOFgeometry();
30  
31   gStyle->SetPalette(1, 0);
32   gEve->DisableRedraw();
33
34   TEveElementList* ll = new TEveElementList("TOF");
35   ll->SetTitle("TOF detector");
36   ll->SetMainColor(2);
37   gEve->AddElement(ll);
38
39   for(Int_t iSector=0; iSector<g->NSectors(); iSector++) {
40     
41     array = di->GetDigits(iSector);
42    
43     AliEveTOFSector* m = new AliEveTOFSector(localGeoManager,iSector,array);
44
45     gEve->AddElement(m, ll);
46
47   }
48
49   gEve->EnableRedraw();
50 }