ROOT logo
// $Id$

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

#include "AliMpStation12Type.h"
#include "AliMpPlaneType.h"
#include "AliMpDataProcessor.h"
#include "AliMpDataMap.h"
#include "AliMpDataStreams.h"
#include "AliMpSlatMotifMap.h"
#include "AliMpSt345Reader.h"
#include "AliMpPCB.h"
#include "AliMpMotifPosition.h"

#include <Riostream.h>

#endif

void testSt345ReadPCB()
{
  AliMpDataProcessor mp;
  AliMpDataMap* dataMap = mp.CreateDataMap("data");
  AliMpDataStreams dataStreams(dataMap);

  AliMpSlatMotifMap* motifMap = new AliMpSlatMotifMap();
  AliMpSt345Reader r(dataStreams, motifMap);

  const char* pcbToTest[] = { "B1", "B2", "B3+", "B3-", "N1", "N2+", "N2-", 
  "N3", "R1B", "R1N", "R2B", "R2N", "R3B", "R3N", "S2B-", "S2B+", "S2N" };
  
  Int_t N = sizeof(pcbToTest)/sizeof(const char*);
  Int_t ok(0);
  
  for ( Int_t i = 0; i < N; ++i )
  {
    AliMpPCB* pcb = r.ReadPCB(pcbToTest[i]);
    if (pcb)
    {
      ++ok;
      pcb->Print();
      for ( Int_t j = 0; j < pcb->GetSize(); ++j )
      {
        AliMpMotifPosition* pos = pcb->GetMotifPosition(j);
        cout << "    " << j << " ";
        pos->Print();
      }
    }
    else
    {
      cout << "Cannot read " << pcbToTest[i] << endl;
    }
  }  
  if ( ok == N ) 
  {
    cout << "Successfully read " << ok << " PCBs" << endl;
  }
  else
  {
    cout << "Failed to read " << (N-ok) << " PCBs out of " << N << endl;
  }
}
 testSt345ReadPCB.C:1
 testSt345ReadPCB.C:2
 testSt345ReadPCB.C:3
 testSt345ReadPCB.C:4
 testSt345ReadPCB.C:5
 testSt345ReadPCB.C:6
 testSt345ReadPCB.C:7
 testSt345ReadPCB.C:8
 testSt345ReadPCB.C:9
 testSt345ReadPCB.C:10
 testSt345ReadPCB.C:11
 testSt345ReadPCB.C:12
 testSt345ReadPCB.C:13
 testSt345ReadPCB.C:14
 testSt345ReadPCB.C:15
 testSt345ReadPCB.C:16
 testSt345ReadPCB.C:17
 testSt345ReadPCB.C:18
 testSt345ReadPCB.C:19
 testSt345ReadPCB.C:20
 testSt345ReadPCB.C:21
 testSt345ReadPCB.C:22
 testSt345ReadPCB.C:23
 testSt345ReadPCB.C:24
 testSt345ReadPCB.C:25
 testSt345ReadPCB.C:26
 testSt345ReadPCB.C:27
 testSt345ReadPCB.C:28
 testSt345ReadPCB.C:29
 testSt345ReadPCB.C:30
 testSt345ReadPCB.C:31
 testSt345ReadPCB.C:32
 testSt345ReadPCB.C:33
 testSt345ReadPCB.C:34
 testSt345ReadPCB.C:35
 testSt345ReadPCB.C:36
 testSt345ReadPCB.C:37
 testSt345ReadPCB.C:38
 testSt345ReadPCB.C:39
 testSt345ReadPCB.C:40
 testSt345ReadPCB.C:41
 testSt345ReadPCB.C:42
 testSt345ReadPCB.C:43
 testSt345ReadPCB.C:44
 testSt345ReadPCB.C:45
 testSt345ReadPCB.C:46
 testSt345ReadPCB.C:47
 testSt345ReadPCB.C:48
 testSt345ReadPCB.C:49
 testSt345ReadPCB.C:50
 testSt345ReadPCB.C:51
 testSt345ReadPCB.C:52
 testSt345ReadPCB.C:53
 testSt345ReadPCB.C:54
 testSt345ReadPCB.C:55
 testSt345ReadPCB.C:56
 testSt345ReadPCB.C:57
 testSt345ReadPCB.C:58
 testSt345ReadPCB.C:59
 testSt345ReadPCB.C:60
 testSt345ReadPCB.C:61
 testSt345ReadPCB.C:62