]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/macros/testDE.C
Replacement of TVector2 object with two doubles
[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 #if !defined(__CINT__) || defined(__MAKECINT__)
7
8 #include "AliMpDEIterator.h"
9 #include "AliMpSegmentation.h"
10 #include "AliMpVSegmentation.h"
11 #include "AliMpCDB.h"
12 #include "AliMpIntPair.h"
13 #include "AliMpPad.h"
14
15 #include <Riostream.h>
16
17 #endif
18
19 void testDE() 
20 {
21   AliMpCDB::LoadMpSegmentation2();
22
23   AliMpDEIterator it;
24   for ( it.First(); ! it.IsDone(); it.Next() ) {
25     cout << "In detection element: " << it.CurrentDEId() << endl;
26
27     // Create/get segmentation via factory
28     const AliMpVSegmentation* kSegmentation 
29       = AliMpSegmentation::Instance()
30           ->GetMpSegmentation(it.CurrentDEId(), AliMp::kCath0);
31       
32     // Print number of pads
33    cout << "   number of pads: " << kSegmentation->NofPads() << endl;   
34       
35     // Find pad by indices in this DE
36     Int_t ix = kSegmentation->MaxPadIndexX()/2;
37     Int_t iy = kSegmentation->MaxPadIndexY()/2;
38     AliMpPad pad = kSegmentation->PadByIndices(ix, iy, false);
39     
40     cout << "   found pad: " << pad << endl << endl;
41   }
42 }