2 // $MpId: testExistingPads.C,v 1.11 2005/09/26 16:05:25 ivana Exp $
4 // Test macro for testing which pad is seen as "existing" by AliMpSector.
6 void testExistingPads(AliMpStationType station = kStation1,
7 AliMpPlaneType plane = kBendingPlane,
8 Bool_t rootInput = false)
10 AliMpSector *sector = 0;
12 AliMpSectorReader r(station, plane);
13 sector=r.BuildSector();
16 TString filePath = AliMpFiles::Instance()->SectorFilePath(station,plane);
17 filePath.ReplaceAll("zones.dat", "sector.root");
19 TFile f(filePath.Data(), "READ");
20 sector = (AliMpSector*)f.Get("Sector");
23 AliMpSectorSegmentation segmentation(sector);
24 AliMpVPainter* painter = AliMpVPainter::CreatePainter(sector);
26 TCanvas* c1 = new TCanvas("view",
27 "AliMpSectorPainter::Draw() output (view per pad)");
28 painter->Draw("ZSSMP");
31 Int_t maxPadIndexX = segmentation.MaxPadIndexX();
32 Int_t maxPadIndexY = segmentation.MaxPadIndexY();
34 // Define histogram limits
35 Int_t nx = (maxPadIndexX/10 + 1)*10;
36 Int_t ny = (maxPadIndexY/10 + 1)*10;
37 TH2C* histo = new TH2C("histo","Existing pads",
38 nx, -0.5, nx-0.5, ny, -0.5, ny-0.5);
40 TCanvas* c2 = new TCanvas("c2","Only existing pads are filled");
42 AliMpSectorSegmentation segmentation(sector);
43 for (Int_t i=0; i<maxPadIndexX+1;i++){
44 for (Int_t j=0;j<maxPadIndexY+1;++j){
46 AliMpIntPair indices(i,j);
47 if (segmentation.HasPad(indices)) histo->Fill(i,j);