]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/macros/testSt12ReadMotifType.C
Update master to aliroot
[u/mrichter/AliRoot.git] / MUON / mapping / macros / testSt12ReadMotifType.C
1 // $Id$
2 // $MpId: testReadMotifType.C,v 1.12 2005/09/26 16:05:25 ivana Exp $
3 //
4 // Test macro for reading motif type data.
5
6 #if !defined(__CINT__) || defined(__MAKECINT__)
7
8 #include "AliMpStation12Type.h"
9 #include "AliMpPlaneType.h"
10 #include "AliMpDataProcessor.h"
11 #include "AliMpDataMap.h"
12 #include "AliMpDataStreams.h"
13 #include "AliMpMotifReader.h"
14 #include "AliMpVMotif.h"
15 #include "AliMpMotifType.h"
16 #include "AliMpMotifMap.h"
17 #include "AliMpConstants.h"
18
19 #include <Riostream.h>
20 #include <TCanvas.h>
21 #include <TH2.h>
22
23 #endif
24
25
26 void testReadMotifType(AliMq::Station12Type station, AliMp::PlaneType plane)
27 {
28   AliMpDataProcessor mp;
29   AliMpDataMap* dataMap = mp.CreateDataMap("data");
30   AliMpDataStreams dataStreams(dataMap);
31
32   AliMpMotifReader r(dataStreams, AliMp::kStation12, station, plane);
33   //r.SetVerboseLevel(2);
34
35   TString names;
36   TString names2;
37   Int_t nv =0;
38   if ( station == AliMq::kStation1 ) {
39     if ( plane == AliMp::kBendingPlane ) 
40       names ="ABCDEFGHI";
41     else
42       names = "ABCDEFGHIJKLMN";
43   }    
44   else if ( station == AliMq::kStation2 ) {
45     if ( plane == AliMp::kBendingPlane ) {
46       names ="ABCDEFGHIJKLMNOPQRSTUVWXY";
47       names2 ="abcdefghimnptuv";
48       nv = 5;
49     }  
50     else {
51       names = "ABCEFGHIJKLMN";
52       names2 ="abcdefgijklmnopqrstuwv";
53       nv = 5;
54     }  
55   }  
56     
57   for (Int_t i=0;i<names.Length();++i){
58      r.BuildMotifType(names[i])->Print("G");
59   }
60   
61   // motifs a1, b1, ..., u1, v1
62   for (Int_t i2=0;i2<names2.Length();++i2){
63     TString mtName = names2[i2];
64     mtName += "1";
65     r.BuildMotifType(mtName)->Print("G");
66   }
67   
68   // motifs v2, ..., v5, v6
69   TString names4="v";
70   for (Int_t i3=2;i3<nv+1;++i3) { 
71       TString mtName = "v";
72       mtName += i3;
73       r.BuildMotifType(mtName)->Print("G");
74   }
75 }
76
77 void testSt12ReadMotifType()
78 {
79   AliMq::Station12Type  station[2] = { AliMq::kStation1, AliMq::kStation2 }; 
80   AliMp::PlaneType      plane[2]   = { AliMp::kBendingPlane, AliMp::kNonBendingPlane };
81   
82   for ( Int_t is = 0; is < 2; is++ ) {
83     for ( Int_t ip = 0; ip < 2; ip++ ) {
84     
85       cout << "Running testReadMotifType for " 
86            << AliMq::Station12TypeName(station[is]) << "  "
87            << AliMp::PlaneTypeName(plane[ip])  << " ... " << endl;
88        
89       testReadMotifType(station[is], plane[ip]);
90     
91       cout << "... end running " << endl << endl;
92     }  
93   }   
94 }  
95