2 // $MpId: testSectorAreaIterator.C,v 1.4 2005/09/26 16:05:25 ivana Exp $
4 // Test macro for iterating over the whole sector
8 class AliMpVPadIterator;
10 void MarkPads(AliMpVPadIterator& it, Double_t xmax, Double_t ymax,
13 // Marks pads according their position.
14 // Fills histogram with pad indices.
15 // Measures time that takes processing of full quadrant
20 TH2C* histo = new TH2C("pads", "pads", 201, 0, 200, 251, 0, 250);
25 for (it.First(); ! it.IsDone(); it.Next()){
27 if (print) cout << endl
29 << " " << it.CurrentItem() << endl;
31 // mark pads positions
32 TVector2 posi = it.CurrentItem().Position();
33 TMarker* marker = new TMarker( posi.X()/xmax, posi.Y()/ymax, 2);
36 // fill pads indices in the histogram
37 histo->Fill(it.CurrentItem().GetIndices().GetFirst(),
38 it.CurrentItem().GetIndices().GetSecond());
41 TCanvas *canv2 = new TCanvas("canv2");
43 //histo->SetMinimum(1.5);
50 void testSectorAreaIterator(AliMpStationType station = kStation1,
51 AliMpPlaneType plane = kBendingPlane,
52 Bool_t rootInput = false)
54 AliMpSector *sector = 0;
56 AliMpSectorReader r(station, plane);
57 sector=r.BuildSector();
60 TString filePath = AliMpFiles::Instance()->SectorFilePath(station,plane);
61 filePath.ReplaceAll("zones.dat", "sector.root");
63 TFile f(filePath.Data(), "READ");
64 sector = (AliMpSector*)f.Get("Sector");
67 AliMpSectorSegmentation segmentation(sector);
70 if ( station == kStation1 )
71 area = AliMpArea(TVector2(450.,450.),TVector2(450.,450.));
73 area = AliMpArea(TVector2(600.,600.),TVector2(600.,600.));
74 AliMpVPadIterator* iter = segmentation.CreateIterator(area);
76 TCanvas* graph = new TCanvas("Graph");
77 AliMpVPainter::CreatePainter(sector)->Draw("ZSSMP");
79 TCanvas *canv = new TCanvas("canv");
80 canv->Range(-1,-1,1,1);
81 MarkPads(*iter, TMath::Abs(area.Position().X())+area.Dimensions().X(),
82 TMath::Abs(area.Position().Y())+area.Dimensions().Y(), kTRUE);