1c7dba9691cc2c9c35f7628adb99290e4ccae99f
[u/mrichter/AliRoot.git] / MUON / mapping / macros / testPadDimensions.C
1 // $Id$
2 // $MpId: testPadDimensions.C,v 1.4 2005/08/24 08:53:27 ivana Exp $
3 //
4 // Test macro for testing retrieving of pad dimensions from
5 // the map in AliMpSectorSegmentation.
6
7 void testPadDimensions(AliMpStationType station = kStation1,
8                        AliMpPlaneType plane = kBendingPlane) 
9 {
10   AliMpSectorReader r(station, plane);
11   AliMpSector* sector=r.BuildSector();
12   AliMpSectorSegmentation segmentation(sector);  
13   segmentation.PrintZones(); 
14   
15   TVector2 previousDimensions;
16   for (Int_t i=1; i<segmentation.MaxPadIndexX()+1;i++) 
17     for (Int_t j=1;j<segmentation.MaxPadIndexY()+1;++j) {
18
19       AliMpIntPair indices(i,j);
20       if (segmentation.HasPad(indices)) {
21
22         // Check pad dimensions
23         AliMpPad pad = segmentation.PadByIndices(indices);
24         TVector2 dimensions = segmentation.PadDimensions(segmentation.Zone(pad));
25         
26         if ( dimensions.X() != previousDimensions.X() || 
27              dimensions.Y() != previousDimensions.Y() ) {
28
29           // Print dimensions
30           cout << "Pad: " << indices;
31           cout << "  dimensions: (" << dimensions.X() << ", " << dimensions.Y() << ")" 
32                << endl;
33           
34           previousDimensions = dimensions;
35         }            
36      }
37    }
38 }