]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/macros/testIndicesLimits.C
- All mapping enums within namespace (AliMp).
[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 void testIndicesLimits(AliMp::StationType station = AliMp::kStation1,
7                        AliMp::PlaneType plane = AliMp::kBendingPlane, 
8                        Bool_t rootInput = false)
9 {
10   AliMpSector *sector = 0;
11   if (!rootInput) {
12     AliMpSectorReader r(station, plane);
13     sector=r.BuildSector();
14   }
15   else  {
16     TString filePath = AliMpFiles::SectorFilePath(station,plane);
17     filePath.ReplaceAll("zones.dat", "sector.root"); 
18
19     TFile f(filePath.Data(), "READ");
20     sector = (AliMpSector*)f.Get("Sector");
21   }  
22
23   // Loop over rows
24   for (Int_t i=0; i<sector->GetNofRows(); i++) {
25     AliMpRow* row = sector->GetRow(i);
26     cout << i
27          << "th row limits: "
28          << row->GetLowIndicesLimit() << "  "
29          << row->GetHighIndicesLimit() << endl;
30     
31     // Loop over row segments
32     for (Int_t j=0; j<row->GetNofRowSegments(); j++) {
33       AliMpVRowSegment* rowSegment = row->GetRowSegment(j);
34       cout << "   "
35            << j
36            << "th row segment limits: "
37            << rowSegment->GetLowIndicesLimit() << "  "
38            << rowSegment->GetHighIndicesLimit() << endl;
39       
40       // Loop over motif positions
41       for (Int_t k=0; k<rowSegment->GetNofMotifs(); k++) {
42         Int_t mposID = rowSegment->GetMotifPositionId(k);
43         AliMpMotifPosition* mPos = 
44           sector->GetMotifMap()->FindMotifPosition(mposID);     
45         if (mPos) {
46           cout << "      "
47                << mPos->GetID()
48                << " motif position limits: "
49                << mPos->GetLowIndicesLimit() << "  "
50                << mPos->GetHighIndicesLimit() << endl;
51         }
52         else {
53           cerr << "Motif position "
54                <<  mposID << " not found in the map" << endl; 
55         }           
56       }
57     }      
58   }   
59   
60   delete sector;
61 }                              
62       
63
64