New test macro
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 14 Mar 2006 09:55:16 +0000 (09:55 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 14 Mar 2006 09:55:16 +0000 (09:55 +0000)
MUON/mapping/macros/testDE.C [new file with mode: 0644]

diff --git a/MUON/mapping/macros/testDE.C b/MUON/mapping/macros/testDE.C
new file mode 100644 (file)
index 0000000..29472e4
--- /dev/null
@@ -0,0 +1,31 @@
+// $Id$
+// $MpId: testDE.C,v 1.1 2006/03/14 09:06:54 ivana Exp $
+//
+// Test AliMpDEIterator & AliMpSegFactory classes
+
+void testDE() 
+{
+  AliMpSegFactory factory; 
+
+  AliMpDEIterator it;
+  for ( it.First(); ! it.IsDone(); it.Next() ) {
+    cout << "In detection element: " << it.CurrentDE() << endl;
+
+    // Create/get segmentation via factory
+    AliMpVSegmentation* segmentation 
+      = factory.CreateMpSegmentation(it.CurrentDE(), 0);
+      
+    // Print number of pads
+   cout << "   number of pads: " << segmentation->NofPads() << endl;   
+      
+    // Find pad by indices in this DE
+    AliMpIntPair indices(segmentation->MaxPadIndexX()/2 , 
+                         segmentation->MaxPadIndexY()/2);
+    AliMpPad pad = segmentation->PadByIndices(indices, false);
+    
+    cout << "   found pad: " << pad << endl << endl;
+  }
+
+  // Delete all created segmentations
+  factory.DeleteSegmentations();
+}