Updated for modifs in AliMpFiles
[u/mrichter/AliRoot.git] / MUON / mapping / macros / testIndicesLimits.C
CommitLineData
72d8f376 1// $Id$
57ff4119 2// $MpId: testIndicesLimits.C,v 1.5 2005/10/28 15:36:08 ivana Exp $
72d8f376 3//
e8c253a0 4// Test macro for indices limits.
72d8f376 5
6void testIndicesLimits(AliMpStationType station = kStation1,
334be4b7 7 AliMpPlaneType plane = kBendingPlane,
8 Bool_t rootInput = false)
72d8f376 9{
334be4b7 10 AliMpSector *sector = 0;
11 if (!rootInput) {
12 AliMpSectorReader r(station, plane);
13 sector=r.BuildSector();
14 }
15 else {
57ff4119 16 TString filePath = AliMpFiles::SectorFilePath(station,plane);
334be4b7 17 filePath.ReplaceAll("zones.dat", "sector.root");
18
19 TFile f(filePath.Data(), "READ");
20 sector = (AliMpSector*)f.Get("Sector");
21 }
72d8f376 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