]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/macros/testExistingPads.C
Updated for new numbering of motif positions in mapping.
[u/mrichter/AliRoot.git] / MUON / mapping / macros / testExistingPads.C
1 // $Id$
2 //
3 // Test macro for testing which pad is seen as "existing" by AliMpSector.
4
5 void testExistingPads(AliMpStationType station = kStation1,
6                       AliMpPlaneType plane = kBendingPlane) 
7 {
8   AliMpReader r(station, plane);
9   AliMpSector *sector=r.BuildSector();
10   AliMpSectorSegmentation segmentation(sector);
11   AliMpVPainter* painter = AliMpVPainter::CreatePainter(sector);
12
13   TCanvas* c1 = new TCanvas("view",
14                             "AliMpSectorPainter::Draw() output (view per pad)");
15   painter->Draw("ZSSMP");
16   c1->Update();
17
18   Int_t maxPadIndexX = segmentation.MaxPadIndexX();
19   Int_t maxPadIndexY = segmentation.MaxPadIndexY();
20   
21   // Define histogram limits
22   Int_t nx = (maxPadIndexX/10 + 1)*10;
23   Int_t ny = (maxPadIndexY/10 + 1)*10;
24   TH2C* histo = new TH2C("histo","Existing pads", 
25                           nx, -0.5, nx-0.5, ny, -0.5, ny-0.5);
26
27   TCanvas* c2 = new TCanvas("c2","Only existing pads are filled");
28
29   AliMpSectorSegmentation segmentation(sector);
30   for (Int_t i=0; i<maxPadIndexX+1;i++){
31     for (Int_t j=0;j<maxPadIndexY+1;++j){
32
33       AliMpIntPair indices(i,j);
34       if (segmentation.HasPad(indices)) histo->Fill(i,j);
35     }
36   }
37
38   c2->cd();
39   histo->Draw("box");
40 }