]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/macros/testSt12IndicesLimits.C
Replacement of AliMpIntPair object with algoritmic
[u/mrichter/AliRoot.git] / MUON / mapping / macros / testSt12IndicesLimits.C
1 // $Id$
2 // $MpId: testIndicesLimits.C,v 1.5 2005/10/28 15:36:08 ivana Exp $
3 //
4 // Test macro for indices limits.
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 "AliMpSector.h"
14 #include "AliMpSectorReader.h"
15 #include "AliMpSectorSegmentation.h" 
16 #include "AliMpRow.h"
17 #include "AliMpVRowSegment.h"
18 #include "AliMpMotifMap.h"
19 #include "AliMpMotifPosition.h"
20 #include "AliMpMotifType.h"
21 #include "AliMpEncodePair.h"
22
23 #include <Riostream.h>
24 #include <TCanvas.h>
25 #include <TH2.h>
26
27 #endif
28
29 void testIndicesLimits(AliMq::Station12Type station,AliMp::PlaneType plane)
30 {
31   AliMpDataProcessor mp;
32   AliMpDataMap* dataMap = mp.CreateDataMap("data");
33   AliMpDataStreams dataStreams(dataMap);
34
35   AliMpSectorReader r(dataStreams, station, plane);
36
37   AliMpSector *sector=r.BuildSector();
38   AliMpSectorSegmentation segmentation(sector);
39
40   // Loop over rows
41   for (Int_t i=0; i<sector->GetNofRows(); i++) {
42     AliMpRow* row = sector->GetRow(i);
43
44     cout << i << "th row limits: "; 
45     AliMp::PairPut(cout, row->GetLowIndicesLimit())  <<  "  "; 
46     AliMp::PairPut(cout, row->GetHighIndicesLimit()) <<  endl;
47
48     // Loop over row segments
49     for (Int_t j=0; j<row->GetNofRowSegments(); j++) {
50       AliMpVRowSegment* rowSegment = row->GetRowSegment(j);
51       cout << "   "
52            << j
53            << "th row segment limits: ";
54            AliMp::PairPut(cout, rowSegment->GetLowIndicesLimit())  <<  "  "; 
55            AliMp::PairPut(cout, rowSegment->GetHighIndicesLimit()) <<  endl;
56       
57       // Loop over motif positions
58       for (Int_t k=0; k<rowSegment->GetNofMotifs(); k++) {
59         Int_t mposID = rowSegment->GetMotifPositionId(k);
60         AliMpMotifPosition* mPos = 
61           sector->GetMotifMap()->FindMotifPosition(mposID);     
62         if (mPos) {
63          cout << "      "
64               << mPos->GetID()
65               << " motif position limits: ";
66               AliMp::PairPut(cout, mPos->GetLowIndicesLimit())  <<  "  "; 
67               AliMp::PairPut(cout, mPos->GetHighIndicesLimit()) <<  endl;
68         }
69         else {
70           cerr << "Motif position "
71                <<  mposID << " not found in the map" << endl; 
72         }           
73       }
74     }      
75   }   
76   
77   delete sector;
78 }                              
79       
80 void testSt12IndicesLimits()
81 {
82   AliMq::Station12Type  station[2] = { AliMq::kStation1, AliMq::kStation2 }; 
83   AliMp::PlaneType      plane[2]   = { AliMp::kBendingPlane, AliMp::kNonBendingPlane };
84   
85   for ( Int_t is = 0; is < 2; is++ ) {
86     for ( Int_t ip = 0; ip < 2; ip++ ) {
87     
88       cout << "Running testIndicesLimits for " 
89            << AliMq::Station12TypeName(station[is]) << "  "
90            << AliMp::PlaneTypeName(plane[ip])  << " ... " << endl;
91        
92       testIndicesLimits(station[is], plane[ip]);
93     
94       cout << "... end running " << endl << endl;
95     }  
96   }   
97 }  
98   
99  
100
101