]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/macros/testDE.C
New test macro
[u/mrichter/AliRoot.git] / MUON / mapping / macros / testDE.C
1 // $Id$
2 // $MpId: testDE.C,v 1.1 2006/03/14 09:06:54 ivana Exp $
3 //
4 // Test AliMpDEIterator & AliMpSegFactory classes
5
6 void testDE() 
7 {
8   AliMpSegFactory factory; 
9
10   AliMpDEIterator it;
11   for ( it.First(); ! it.IsDone(); it.Next() ) {
12     cout << "In detection element: " << it.CurrentDE() << endl;
13
14     // Create/get segmentation via factory
15     AliMpVSegmentation* segmentation 
16       = factory.CreateMpSegmentation(it.CurrentDE(), 0);
17       
18     // Print number of pads
19    cout << "   number of pads: " << segmentation->NofPads() << endl;   
20       
21     // Find pad by indices in this DE
22     AliMpIntPair indices(segmentation->MaxPadIndexX()/2 , 
23                          segmentation->MaxPadIndexY()/2);
24     AliMpPad pad = segmentation->PadByIndices(indices, false);
25     
26     cout << "   found pad: " << pad << endl << endl;
27   }
28
29   // Delete all created segmentations
30   factory.DeleteSegmentations();
31 }