]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/macros/testReadMotifTypeSlat.C
New class - the factory for building mapping segmentations
[u/mrichter/AliRoot.git] / MUON / mapping / macros / testReadMotifTypeSlat.C
1 // $Id$
2 // $MpId: testReadMotifTypeSlat.C,v 1.1 2005/09/19 19:02:53 ivana Exp $
3
4 #if !defined(__CINT__) || defined(__MAKECINT__)
5 #include "AliMpMotifReader.h"
6 #include "Riostream.h"
7 #include "AliMpMotifType.h"
8 #endif
9
10 Int_t test(AliMpMotifReader& r, const char letter, Int_t from, Int_t to)
11 {
12   char m[256];
13   Int_t n = 0;
14   for ( Int_t i = from; i <= to; ++i ) 
15   {
16     sprintf(m,"%c%d",letter,i);
17     AliMpMotifType* motifType = r.BuildMotifType(m);
18     if ( motifType ) 
19     {
20       motifType->Print("G");
21       ++n;
22     }
23     else
24     {
25       cout << "Cannot read motifType " << m << endl;
26     }
27   }
28   return n;
29 }
30
31 void testReadMotifTypeSlat()
32 {
33   AliMpMotifReader r(kStation345,kNonBendingPlane); 
34   // note that second parameter is not used for station345.
35
36   Int_t n = 0;
37   
38   n += test(r,'I',1,1);
39   n += test(r,'L',1,20);
40   n += test(r,'O',1,19);
41   n += test(r,'P',1,4);
42   n += test(r,'Q',1,4);
43   n += test(r,'R',1,42);
44   n += test(r,'Z',1,5);
45   
46   cout << "==== " << n << " motifTypes successfully read in" << endl;
47 }  
48