]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/mapping/macros/testPadDimensions.C
Mapping test macros (D. Guez, I. Hrivnacova)
[u/mrichter/AliRoot.git] / MUON / mapping / macros / testPadDimensions.C
diff --git a/MUON/mapping/macros/testPadDimensions.C b/MUON/mapping/macros/testPadDimensions.C
new file mode 100644 (file)
index 0000000..064c016
--- /dev/null
@@ -0,0 +1,36 @@
+// $Id$
+//
+// Test macro for testing retrieving of pad dimensions from
+// the map in AliMpSectorSegmentation.
+
+void testPadDimensions(AliMpStationType station = kStation1,
+                       AliMpPlaneType plane = kBendingPlane) 
+{
+  AliMpReader r(station, plane);
+  AliMpSector* sector=r.BuildSector();
+  AliMpSectorSegmentation segmentation(sector);  
+
+  TVector2 previousDimensions;
+  for (Int_t i=0; i<150;i++) 
+    for (Int_t j=0;j<200;++j) {
+
+      AliMpIntPair indices(i,j);
+      if (segmentation.HasPad(indices)) {
+
+        // Check pad dimensions
+       AliMpPad pad = segmentation.PadByIndices(indices);
+       TVector2 dimensions = segmentation.PadDimensions(segmentation.Zone(pad));
+       
+       if ( dimensions.X() != previousDimensions.X() || 
+            dimensions.Y() != previousDimensions.Y() ) {
+
+          // Print dimensions
+         cout << "Pad: " << indices;
+         cout << "  dimensions: (" << dimensions.X() << ", " << dimensions.Y() << ")" 
+              << endl;
+          
+         previousDimensions = dimensions;
+        }           
+     }
+   }
+}