2 // $MpId: testIndicesLimits.C,v 1.5 2005/10/28 15:36:08 ivana Exp $
4 // Test macro for indices limits.
6 #if !defined(__CINT__) || defined(__MAKECINT__)
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"
17 #include "AliMpVRowSegment.h"
18 #include "AliMpMotifMap.h"
19 #include "AliMpMotifPosition.h"
20 #include "AliMpMotifType.h"
21 #include "AliMpEncodePair.h"
23 #include <Riostream.h>
29 void testIndicesLimits(AliMq::Station12Type station,AliMp::PlaneType plane)
31 AliMpDataProcessor mp;
32 AliMpDataMap* dataMap = mp.CreateDataMap("data");
33 AliMpDataStreams dataStreams(dataMap);
35 AliMpSectorReader r(dataStreams, station, plane);
37 AliMpSector *sector=r.BuildSector();
38 AliMpSectorSegmentation segmentation(sector);
41 for (Int_t i=0; i<sector->GetNofRows(); i++) {
42 AliMpRow* row = sector->GetRow(i);
44 cout << i << "th row limits: ";
45 AliMp::PairPut(cout, row->GetLowIndicesLimit()) << " ";
46 AliMp::PairPut(cout, row->GetHighIndicesLimit()) << endl;
48 // Loop over row segments
49 for (Int_t j=0; j<row->GetNofRowSegments(); j++) {
50 AliMpVRowSegment* rowSegment = row->GetRowSegment(j);
53 << "th row segment limits: ";
54 AliMp::PairPut(cout, rowSegment->GetLowIndicesLimit()) << " ";
55 AliMp::PairPut(cout, rowSegment->GetHighIndicesLimit()) << endl;
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);
65 << " motif position limits: ";
66 AliMp::PairPut(cout, mPos->GetLowIndicesLimit()) << " ";
67 AliMp::PairPut(cout, mPos->GetHighIndicesLimit()) << endl;
70 cerr << "Motif position "
71 << mposID << " not found in the map" << endl;
80 void testSt12IndicesLimits()
82 AliMq::Station12Type station[2] = { AliMq::kStation1, AliMq::kStation2 };
83 AliMp::PlaneType plane[2] = { AliMp::kBendingPlane, AliMp::kNonBendingPlane };
85 for ( Int_t is = 0; is < 2; is++ ) {
86 for ( Int_t ip = 0; ip < 2; ip++ ) {
88 cout << "Running testIndicesLimits for "
89 << AliMq::Station12TypeName(station[is]) << " "
90 << AliMp::PlaneTypeName(plane[ip]) << " ... " << endl;
92 testIndicesLimits(station[is], plane[ip]);
94 cout << "... end running " << endl << endl;