Updated for modifs in AliMpFiles
[u/mrichter/AliRoot.git] / MUON / mapping / macros / testSectorPadIterators.C
CommitLineData
66e0997c 1// $Id$
57ff4119 2// $MpId: testSectorPadIterators.C,v 1.9 2005/10/28 15:36:08 ivana Exp $
66e0997c 3//
4// Test macro for reading sector, and iterate over it
5
6void testSectorPadIterators(AliMpStationType station = kStation1,
334be4b7 7 AliMpPlaneType plane = kBendingPlane,
8 Bool_t rootInput = false)
66e0997c 9{
334be4b7 10 AliMpSector *sector = 0;
11 if (!rootInput) {
12 AliMpSectorReader r(station, plane);
13 sector=r.BuildSector();
14 }
15 else {
57ff4119 16 TString filePath = AliMpFiles::SectorFilePath(station,plane);
334be4b7 17 filePath.ReplaceAll("zones.dat", "sector.root");
18
19 TFile f(filePath.Data(), "READ");
20 sector = (AliMpSector*)f.Get("Sector");
21 }
66e0997c 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
334be4b7 30 AliMpSectorPadIterator it = AliMpSectorPadIterator(sector);
66e0997c 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
334be4b7 41 delete sector;
66e0997c 42}