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