2 // $MpId: testReadSector.C,v 1.16 2006/01/11 10:00:50 ivana Exp $
4 // Test macro for reading sector data.
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"
16 #include "AliMpVRowSegment.h"
17 #include "AliMpVMotif.h"
18 #include "AliMpMotifMap.h"
19 #include "AliMpConstants.h"
21 #include <Riostream.h>
27 void testReadSector(AliMq::Station12Type station, AliMp::PlaneType plane)
29 AliMpDataProcessor mp;
30 AliMpDataMap* dataMap = mp.CreateDataMap("data");
31 AliMpDataStreams dataStreams(dataMap);
33 AliMpSectorReader r(dataStreams, station, plane);
34 AliMpSector* sector = r.BuildSector();
36 sector->PrintGeometry();
41 if (plane == AliMp::kBendingPlane)
42 cout << "0th row low border " << sector->FindRow(TVector2(0., 0.))->GetID() << endl;
43 if (plane == AliMp::kNonBendingPlane)
44 cout << "0th row low border " << sector->FindRow(TVector2(0., 0.215))->GetID() << endl;
45 cout << "in 0th row " << sector->FindRow(TVector2(0., 2.5))->GetID() << endl;
46 cout << "0th row up border " << sector->FindRow(TVector2(0., 6.72))->GetID() << endl;
47 cout << "in 4th row " << sector->FindRow(TVector2(0., 30.))->GetID() << endl;
48 if (plane == AliMp::kBendingPlane)
49 cout << "12th row up border " << sector->FindRow(TVector2(0., 89.46))->GetID() << endl;
50 if (plane == AliMp::kNonBendingPlane)
51 cout << "12th row up border " << sector->FindRow(TVector2(0., 84.84))->GetID() << endl;
54 // Find motif position test
55 Int_t ids[15] = { 19, 14, 9, 32, 36, 136, 187, 212, 207, 220, 1, 131, 239, 243, 250 };
56 for (Int_t i=0; i<15 ; i++) {
58 id |= AliMpConstants::ManuMask(plane);
59 cout << "Motif pos " << std::setw(3) << id;
60 if (!sector->FindRowSegment(id)) {
61 cout << " not found." << endl;
64 cout << " found in : "
65 << sector->FindRow(id)->GetID() << " row, "
67 << sector->FindRowSegment(id)->GetMotif(0)->GetID().Data()
73 // Find motif by coordinates test
74 for (Int_t i=0; i<2 ; i++) {
75 TVector2 pos(0.5, 18.6 - i*2.); // i=0 in motif 1001,
76 // i=1 outside (below) motif 1001
77 AliMpVMotif* motif = sector->FindMotif(pos);
78 cout << "In the position " << pos.X() << " " << pos.Y();
81 cout << " found motif " << motif->GetID() << endl;
83 cout << " motif not found " << endl;
86 // Find special motif test
87 if (plane == AliMp::kNonBendingPlane) {
89 Int_t ids[6] = { 20, 46, 47, 74, 75, 76 };
90 for (Int_t i=0; i<6 ; i++) {
93 cout << "Motif pos " << id;
94 if (!sector->FindRowSegment(id)) {
95 cout << " not found." << endl;
98 cout << " found in : "
99 << sector->FindRow(id)->GetID() << " row, "
101 << sector->FindPosition(id).X() << " " << sector->FindPosition(id).Y()
109 sector->GetMotifMap()->Print();
114 void testReadSector()
116 AliMq::Station12Type station[2] = { AliMq::kStation1, AliMq::kStation2 };
117 AliMp::PlaneType plane[2] = { AliMp::kBendingPlane, AliMp::kNonBendingPlane };
119 for ( Int_t is = 0; is < 2; is++ ) {
120 for ( Int_t ip = 0; ip < 2; ip++ ) {
122 cout << "Running testReadSector for "
123 << AliMq::Station12TypeName(station[is]) << " "
124 << AliMp::PlaneTypeName(plane[ip]) << " ... " << endl;
126 testReadSector(station[is], plane[ip]);
128 cout << "... end running " << endl << endl;