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