ROOT logo
// $Id$
// $MpId: testReadMotifType.C,v 1.12 2005/09/26 16:05:25 ivana Exp $
//
// Test macro for reading motif type data.

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

#include "AliMpStation12Type.h"
#include "AliMpPlaneType.h"
#include "AliMpDataProcessor.h"
#include "AliMpDataMap.h"
#include "AliMpDataStreams.h"
#include "AliMpMotifReader.h"
#include "AliMpVMotif.h"
#include "AliMpMotifType.h"
#include "AliMpMotifMap.h"
#include "AliMpConstants.h"

#include <Riostream.h>
#include <TCanvas.h>
#include <TH2.h>

#endif


void testReadMotifType(AliMq::Station12Type station, AliMp::PlaneType plane)
{
  AliMpDataProcessor mp;
  AliMpDataMap* dataMap = mp.CreateDataMap("data");
  AliMpDataStreams dataStreams(dataMap);

  AliMpMotifReader r(dataStreams, AliMp::kStation12, station, plane);
  //r.SetVerboseLevel(2);

  TString names;
  TString names2;
  Int_t nv =0;
  if ( station == AliMq::kStation1 ) {
    if ( plane == AliMp::kBendingPlane ) 
      names ="ABCDEFGHI";
    else
      names = "ABCDEFGHIJKLMN";
  }    
  else if ( station == AliMq::kStation2 ) {
    if ( plane == AliMp::kBendingPlane ) {
      names ="ABCDEFGHIJKLMNOPQRSTUVWXY";
      names2 ="abcdefghimnptuv";
      nv = 5;
    }  
    else {
      names = "ABCEFGHIJKLMN";
      names2 ="abcdefgijklmnopqrstuwv";
      nv = 5;
    }  
  }  
    
  for (Int_t i=0;i<names.Length();++i){
     r.BuildMotifType(names[i])->Print("G");
  }
  
  // motifs a1, b1, ..., u1, v1
  for (Int_t i2=0;i2<names2.Length();++i2){
    TString mtName = names2[i2];
    mtName += "1";
    r.BuildMotifType(mtName)->Print("G");
  }
  
  // motifs v2, ..., v5, v6
  TString names4="v";
  for (Int_t i3=2;i3<nv+1;++i3) { 
      TString mtName = "v";
      mtName += i3;
      r.BuildMotifType(mtName)->Print("G");
  }
}

void testSt12ReadMotifType()
{
  AliMq::Station12Type  station[2] = { AliMq::kStation1, AliMq::kStation2 }; 
  AliMp::PlaneType      plane[2]   = { AliMp::kBendingPlane, AliMp::kNonBendingPlane };
  
  for ( Int_t is = 0; is < 2; is++ ) {
    for ( Int_t ip = 0; ip < 2; ip++ ) {
    
      cout << "Running testReadMotifType for " 
           << AliMq::Station12TypeName(station[is]) << "  "
           << AliMp::PlaneTypeName(plane[ip])  << " ... " << endl;
       
      testReadMotifType(station[is], plane[ip]);
    
      cout << "... end running " << endl << endl;
    }  
  }   
}  
  
 testSt12ReadMotifType.C:1
 testSt12ReadMotifType.C:2
 testSt12ReadMotifType.C:3
 testSt12ReadMotifType.C:4
 testSt12ReadMotifType.C:5
 testSt12ReadMotifType.C:6
 testSt12ReadMotifType.C:7
 testSt12ReadMotifType.C:8
 testSt12ReadMotifType.C:9
 testSt12ReadMotifType.C:10
 testSt12ReadMotifType.C:11
 testSt12ReadMotifType.C:12
 testSt12ReadMotifType.C:13
 testSt12ReadMotifType.C:14
 testSt12ReadMotifType.C:15
 testSt12ReadMotifType.C:16
 testSt12ReadMotifType.C:17
 testSt12ReadMotifType.C:18
 testSt12ReadMotifType.C:19
 testSt12ReadMotifType.C:20
 testSt12ReadMotifType.C:21
 testSt12ReadMotifType.C:22
 testSt12ReadMotifType.C:23
 testSt12ReadMotifType.C:24
 testSt12ReadMotifType.C:25
 testSt12ReadMotifType.C:26
 testSt12ReadMotifType.C:27
 testSt12ReadMotifType.C:28
 testSt12ReadMotifType.C:29
 testSt12ReadMotifType.C:30
 testSt12ReadMotifType.C:31
 testSt12ReadMotifType.C:32
 testSt12ReadMotifType.C:33
 testSt12ReadMotifType.C:34
 testSt12ReadMotifType.C:35
 testSt12ReadMotifType.C:36
 testSt12ReadMotifType.C:37
 testSt12ReadMotifType.C:38
 testSt12ReadMotifType.C:39
 testSt12ReadMotifType.C:40
 testSt12ReadMotifType.C:41
 testSt12ReadMotifType.C:42
 testSt12ReadMotifType.C:43
 testSt12ReadMotifType.C:44
 testSt12ReadMotifType.C:45
 testSt12ReadMotifType.C:46
 testSt12ReadMotifType.C:47
 testSt12ReadMotifType.C:48
 testSt12ReadMotifType.C:49
 testSt12ReadMotifType.C:50
 testSt12ReadMotifType.C:51
 testSt12ReadMotifType.C:52
 testSt12ReadMotifType.C:53
 testSt12ReadMotifType.C:54
 testSt12ReadMotifType.C:55
 testSt12ReadMotifType.C:56
 testSt12ReadMotifType.C:57
 testSt12ReadMotifType.C:58
 testSt12ReadMotifType.C:59
 testSt12ReadMotifType.C:60
 testSt12ReadMotifType.C:61
 testSt12ReadMotifType.C:62
 testSt12ReadMotifType.C:63
 testSt12ReadMotifType.C:64
 testSt12ReadMotifType.C:65
 testSt12ReadMotifType.C:66
 testSt12ReadMotifType.C:67
 testSt12ReadMotifType.C:68
 testSt12ReadMotifType.C:69
 testSt12ReadMotifType.C:70
 testSt12ReadMotifType.C:71
 testSt12ReadMotifType.C:72
 testSt12ReadMotifType.C:73
 testSt12ReadMotifType.C:74
 testSt12ReadMotifType.C:75
 testSt12ReadMotifType.C:76
 testSt12ReadMotifType.C:77
 testSt12ReadMotifType.C:78
 testSt12ReadMotifType.C:79
 testSt12ReadMotifType.C:80
 testSt12ReadMotifType.C:81
 testSt12ReadMotifType.C:82
 testSt12ReadMotifType.C:83
 testSt12ReadMotifType.C:84
 testSt12ReadMotifType.C:85
 testSt12ReadMotifType.C:86
 testSt12ReadMotifType.C:87
 testSt12ReadMotifType.C:88
 testSt12ReadMotifType.C:89
 testSt12ReadMotifType.C:90
 testSt12ReadMotifType.C:91
 testSt12ReadMotifType.C:92
 testSt12ReadMotifType.C:93
 testSt12ReadMotifType.C:94
 testSt12ReadMotifType.C:95
 testSt12ReadMotifType.C:96