]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/macros/testSectorPadIterators.C
- All mapping enums within namespace (AliMp).
[u/mrichter/AliRoot.git] / MUON / mapping / macros / testSectorPadIterators.C
1 // $Id$
2 // $MpId: testSectorPadIterators.C,v 1.11 2006/03/15 13:07:07 ivana Exp $
3 //
4 // Test macro for reading  sector, and iterate over it
5
6 void testSectorPadIterators(AliMp::StationType station = AliMp::kStation1,
7                             AliMp::PlaneType plane = AliMp::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     num++;
36     TMarker* marker = new TMarker( (Double_t)indices.GetFirst() /xmax,
37                                    (Double_t)indices.GetSecond()/ymax,
38                                    2);
39     marker->Draw();
40   }
41   
42   delete sector;
43 }