ROOT logo
// $Id$
// $MpId: testDE.C,v 1.1 2006/03/14 09:06:54 ivana Exp $
//
// Test AliMpDEIterator & AliMpSegFactory classes

#if !defined(__CINT__) || defined(__MAKECINT__)

#include "AliMpDEIterator.h"
#include "AliMpSegmentation.h"
#include "AliMpVSegmentation.h"
#include "AliMpCDB.h"
#include "AliMpIntPair.h"
#include "AliMpPad.h"

#include <Riostream.h>

#endif

void testDE() 
{
  AliMpCDB::LoadMpSegmentation2();

  AliMpDEIterator it;
  for ( it.First(); ! it.IsDone(); it.Next() ) {
    cout << "In detection element: " << it.CurrentDEId() << endl;

    // Create/get segmentation via factory
    const AliMpVSegmentation* kSegmentation 
      = AliMpSegmentation::Instance()
          ->GetMpSegmentation(it.CurrentDEId(), AliMp::kCath0);
      
    // Print number of pads
   cout << "   number of pads: " << kSegmentation->NofPads() << endl;   
      
    // Find pad by indices in this DE
    Int_t ix = kSegmentation->MaxPadIndexX()/2;
    Int_t iy = kSegmentation->MaxPadIndexY()/2;
    AliMpPad pad = kSegmentation->PadByIndices(ix, iy, false);
    
    cout << "   found pad: " << pad << endl << endl;
  }
}
 testDE.C:1
 testDE.C:2
 testDE.C:3
 testDE.C:4
 testDE.C:5
 testDE.C:6
 testDE.C:7
 testDE.C:8
 testDE.C:9
 testDE.C:10
 testDE.C:11
 testDE.C:12
 testDE.C:13
 testDE.C:14
 testDE.C:15
 testDE.C:16
 testDE.C:17
 testDE.C:18
 testDE.C:19
 testDE.C:20
 testDE.C:21
 testDE.C:22
 testDE.C:23
 testDE.C:24
 testDE.C:25
 testDE.C:26
 testDE.C:27
 testDE.C:28
 testDE.C:29
 testDE.C:30
 testDE.C:31
 testDE.C:32
 testDE.C:33
 testDE.C:34
 testDE.C:35
 testDE.C:36
 testDE.C:37
 testDE.C:38
 testDE.C:39
 testDE.C:40
 testDE.C:41
 testDE.C:42
 testDE.C:43