66e0997c |
1 | // $Id$ |
2 | // |
3 | // Test macro for reading sector, and iterate over it |
4 | |
5 | void testNeighboursPadIterator(AliMpStationType station = kStation1, |
6 | AliMpPlaneType plane = kBendingPlane, |
7 | Int_t i=50, Int_t j=50) |
8 | { |
9 | if (!gInterpreter->IsLoaded("mlibs.C")){ |
10 | gROOT->LoadMacro("mlibs.C"); |
11 | gInterpreter->ProcessLine("mlibs()"); |
12 | } |
13 | |
14 | AliMpReader r(station, plane); |
15 | AliMpSector* sect = r.BuildSector(); |
16 | AliMpSectorSegmentation segm(sect); |
17 | |
18 | TCanvas *can = new TCanvas("canv"); |
19 | |
20 | const Double_t xmax=75; |
21 | const Double_t ymax=120; |
22 | |
23 | Int_t num=0; |
24 | |
25 | AliMpPad pad = segm.PadByIndices(AliMpIntPair(i,j)); |
26 | AliMpNeighboursPadIterator it = AliMpNeighboursPadIterator(&segm, pad,kFALSE); |
27 | |
28 | for (it.First(); ! it.IsDone(); it.Next()) { |
29 | AliMpIntPair indices = it.CurrentItem().GetIndices(); |
30 | cout<<"Iterator number "<< num++ << " at "<< indices <<endl; |
31 | TMarker* marker = new TMarker( (Double_t)indices.GetFirst() /xmax, |
32 | (Double_t)indices.GetSecond()/ymax, |
33 | 2); |
34 | marker->Draw(); |
35 | } |
36 | |
37 | delete sect; |
38 | } |