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 "AliMpSlat.h"
#include "AliMpSt345Reader.h"

#include <Riostream.h>
#include "slats.h"

#endif

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

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

  Int_t ok(0);
  
  for ( Int_t i = 0; i < NSLATS; ++i )
  {
    TString slat(slatTypeNames[i]);
    
    cout << "Trying to read " << slat << endl;
    AliMpSlat* b = r.ReadSlat(slat.Data(),AliMp::kBendingPlane);
    AliMpSlat* nb = r.ReadSlat(slat.Data(),AliMp::kNonBendingPlane);
    if ( !b ) cout << " Missing BENDING !" << endl;
    if ( !nb ) cout << " Missing NONBENDING !" << endl;
    if ( b && nb )
    {
      if ( b->GetSize() != nb->GetSize() ) 
      {
        cout << "NOT THE SAME NUMBER OF PCBS !" << endl;
      }
      if ( b->DX() != nb->DX() )
      {
        cout << "NOT THE SAME X-SIZE !" << endl;
      }
      cout << "Bending    : ";
      b->Print();
      cout << "NonBending : ";
      nb->Print();
      ++ok;
    }
  }
  
  if ( ok == NSLATS ) 
  {
    cout << "Successfully read " << ok << " slats" << endl;
  }
  else
  {
    cout << "Failed to read " << (NSLATS-ok) << " slats out of " << NSLATS << endl;
  }
}
 testSt345ReadSlat.C:1
 testSt345ReadSlat.C:2
 testSt345ReadSlat.C:3
 testSt345ReadSlat.C:4
 testSt345ReadSlat.C:5
 testSt345ReadSlat.C:6
 testSt345ReadSlat.C:7
 testSt345ReadSlat.C:8
 testSt345ReadSlat.C:9
 testSt345ReadSlat.C:10
 testSt345ReadSlat.C:11
 testSt345ReadSlat.C:12
 testSt345ReadSlat.C:13
 testSt345ReadSlat.C:14
 testSt345ReadSlat.C:15
 testSt345ReadSlat.C:16
 testSt345ReadSlat.C:17
 testSt345ReadSlat.C:18
 testSt345ReadSlat.C:19
 testSt345ReadSlat.C:20
 testSt345ReadSlat.C:21
 testSt345ReadSlat.C:22
 testSt345ReadSlat.C:23
 testSt345ReadSlat.C:24
 testSt345ReadSlat.C:25
 testSt345ReadSlat.C:26
 testSt345ReadSlat.C:27
 testSt345ReadSlat.C:28
 testSt345ReadSlat.C:29
 testSt345ReadSlat.C:30
 testSt345ReadSlat.C:31
 testSt345ReadSlat.C:32
 testSt345ReadSlat.C:33
 testSt345ReadSlat.C:34
 testSt345ReadSlat.C:35
 testSt345ReadSlat.C:36
 testSt345ReadSlat.C:37
 testSt345ReadSlat.C:38
 testSt345ReadSlat.C:39
 testSt345ReadSlat.C:40
 testSt345ReadSlat.C:41
 testSt345ReadSlat.C:42
 testSt345ReadSlat.C:43
 testSt345ReadSlat.C:44
 testSt345ReadSlat.C:45
 testSt345ReadSlat.C:46
 testSt345ReadSlat.C:47
 testSt345ReadSlat.C:48
 testSt345ReadSlat.C:49
 testSt345ReadSlat.C:50
 testSt345ReadSlat.C:51
 testSt345ReadSlat.C:52
 testSt345ReadSlat.C:53
 testSt345ReadSlat.C:54
 testSt345ReadSlat.C:55
 testSt345ReadSlat.C:56
 testSt345ReadSlat.C:57
 testSt345ReadSlat.C:58
 testSt345ReadSlat.C:59
 testSt345ReadSlat.C:60
 testSt345ReadSlat.C:61
 testSt345ReadSlat.C:62
 testSt345ReadSlat.C:63
 testSt345ReadSlat.C:64
 testSt345ReadSlat.C:65
 testSt345ReadSlat.C:66
 testSt345ReadSlat.C:67