]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/macros/testSectorPadIterators.C
Updated for modifs in AliMpFiles
[u/mrichter/AliRoot.git] / MUON / mapping / macros / testSectorPadIterators.C
1 // $Id$
2 // $MpId: testSectorPadIterators.C,v 1.9 2005/10/28 15:36:08 ivana Exp $
3 //
4 // Test macro for reading  sector, and iterate over it
5
6 void testSectorPadIterators(AliMpStationType station = kStation1,
7                             AliMpPlaneType plane = kBendingPlane,
8                             Bool_t rootInput = false)
9 {
10   AliMpSector *sector = 0;
11   if (!rootInput) {
12     AliMpSectorReader r(station, plane);
13     sector=r.BuildSector();
14   }
15   else  {
16     TString filePath = AliMpFiles::SectorFilePath(station,plane);
17     filePath.ReplaceAll("zones.dat", "sector.root"); 
18
19     TFile f(filePath.Data(), "READ");
20     sector = (AliMpSector*)f.Get("Sector");
21   }  
22   
23   Int_t num=0;
24   
25   TCanvas *can = new TCanvas("canv");
26
27   const Double_t xmax=150;
28   const Double_t ymax=250;
29
30   AliMpSectorPadIterator it = AliMpSectorPadIterator(sector);
31
32   for (it.First(); ! it.IsDone(); it.Next()) {
33     AliMpIntPair indices = it.CurrentItem().GetIndices();
34     cout<<"Iterator number "<< num++ << " at "<< indices <<endl;
35     TMarker* marker = new TMarker( (Double_t)indices.GetFirst() /xmax,
36                                    (Double_t)indices.GetSecond()/ymax,
37                                    2);
38     marker->Draw();
39   }
40   
41   delete sector;
42 }