]>
Commit | Line | Data |
---|---|---|
66e0997c | 1 | // $Id$ |
0f54a452 | 2 | // $MpId: testReadSector.C,v 1.16 2006/01/11 10:00:50 ivana Exp $ |
66e0997c | 3 | // |
4 | // Test macro for reading sector data. | |
5 | ||
f05d3eb1 | 6 | #if !defined(__CINT__) || defined(__MAKECINT__) |
e8c253a0 | 7 | |
f05d3eb1 | 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 "AliMpRow.h" | |
16 | #include "AliMpVRowSegment.h" | |
17 | #include "AliMpVMotif.h" | |
18 | #include "AliMpMotifMap.h" | |
19 | #include "AliMpConstants.h" | |
334be4b7 | 20 | |
f05d3eb1 | 21 | #include <Riostream.h> |
22 | #include <TCanvas.h> | |
23 | #include <TH2.h> | |
334be4b7 | 24 | |
f05d3eb1 | 25 | #endif |
334be4b7 | 26 | |
f05d3eb1 | 27 | void testReadSector(AliMq::Station12Type station, AliMp::PlaneType plane) |
28 | { | |
29 | AliMpDataProcessor mp; | |
30 | AliMpDataMap* dataMap = mp.CreateDataMap("data"); | |
31 | AliMpDataStreams dataStreams(dataMap); | |
66e0997c | 32 | |
f05d3eb1 | 33 | AliMpSectorReader r(dataStreams, station, plane); |
34 | AliMpSector* sector = r.BuildSector(); | |
66e0997c | 35 | // Sector geometry |
36 | sector->PrintGeometry(); | |
37 | ||
38 | cout << endl; | |
39 | ||
40 | // Find row test | |
6e97fbb8 | 41 | /* |
cddd101e | 42 | if (plane == AliMp::kBendingPlane) |
a387ee7c | 43 | cout << "0th row low border " << sector->FindRow(TVector2(0., 0.))->GetID() << endl; |
cddd101e | 44 | if (plane == AliMp::kNonBendingPlane) |
a387ee7c | 45 | cout << "0th row low border " << sector->FindRow(TVector2(0., 0.215))->GetID() << endl; |
0f54a452 | 46 | cout << "in 0th row " << sector->FindRow(TVector2(0., 2.5))->GetID() << endl; |
47 | cout << "0th row up border " << sector->FindRow(TVector2(0., 6.72))->GetID() << endl; | |
48 | cout << "in 4th row " << sector->FindRow(TVector2(0., 30.))->GetID() << endl; | |
cddd101e | 49 | if (plane == AliMp::kBendingPlane) |
0f54a452 | 50 | cout << "12th row up border " << sector->FindRow(TVector2(0., 89.46))->GetID() << endl; |
cddd101e | 51 | if (plane == AliMp::kNonBendingPlane) |
0f54a452 | 52 | cout << "12th row up border " << sector->FindRow(TVector2(0., 84.84))->GetID() << endl; |
66e0997c | 53 | cout << endl; |
6e97fbb8 | 54 | */ |
55 | ||
66e0997c | 56 | // Find motif position test |
6e97fbb8 | 57 | /* |
e8c253a0 | 58 | Int_t ids[15] = { 19, 14, 9, 32, 36, 136, 187, 212, 207, 220, 1, 131, 239, 243, 250 }; |
59 | for (Int_t i=0; i<15 ; i++) { | |
60 | Int_t id = ids[i]; | |
8a3e2481 | 61 | id |= AliMpConstants::ManuMask(plane); |
e8c253a0 | 62 | cout << "Motif pos " << std::setw(3) << id; |
63 | if (!sector->FindRowSegment(id)) { | |
64 | cout << " not found." << endl; | |
65 | } | |
66 | else { | |
67 | cout << " found in : " | |
68 | << sector->FindRow(id)->GetID() << " row, " | |
69 | << " motif id: " | |
70 | << sector->FindRowSegment(id)->GetMotif(0)->GetID().Data() | |
71 | << endl; | |
72 | } | |
66e0997c | 73 | } |
66e0997c | 74 | cout << endl; |
6e97fbb8 | 75 | */ |
66e0997c | 76 | // Find motif by coordinates test |
6e97fbb8 | 77 | /* |
66e0997c | 78 | for (Int_t i=0; i<2 ; i++) { |
0f54a452 | 79 | TVector2 pos(0.5, 18.6 - i*2.); // i=0 in motif 1001, |
66e0997c | 80 | // i=1 outside (below) motif 1001 |
f05d3eb1 | 81 | AliMpVMotif* motif = sector->FindMotif(pos); |
66e0997c | 82 | cout << "In the position " << pos.X() << " " << pos.Y(); |
83 | ||
84 | if (motif) | |
85 | cout << " found motif " << motif->GetID() << endl; | |
86 | else | |
87 | cout << " motif not found " << endl; | |
88 | } | |
6e97fbb8 | 89 | */ |
66e0997c | 90 | // Find special motif test |
6e97fbb8 | 91 | /* |
cddd101e | 92 | if (plane == AliMp::kNonBendingPlane) { |
e8c253a0 | 93 | |
94 | Int_t ids[6] = { 20, 46, 47, 74, 75, 76 }; | |
66e0997c | 95 | for (Int_t i=0; i<6 ; i++) { |
e8c253a0 | 96 | |
97 | Int_t id = ids[i]; | |
66e0997c | 98 | cout << "Motif pos " << id; |
99 | if (!sector->FindRowSegment(id)) { | |
100 | cout << " not found." << endl; | |
101 | } | |
102 | else { | |
103 | cout << " found in : " | |
104 | << sector->FindRow(id)->GetID() << " row, " | |
105 | << " position : " | |
106 | << sector->FindPosition(id).X() << " " << sector->FindPosition(id).Y() | |
107 | << endl; | |
108 | } | |
e8c253a0 | 109 | } |
110 | } | |
66e0997c | 111 | cout << endl; |
6e97fbb8 | 112 | */ |
66e0997c | 113 | // Motif map |
114 | sector->GetMotifMap()->Print(); | |
115 | ||
116 | delete sector; | |
117 | } | |
f05d3eb1 | 118 | |
6aa39548 | 119 | void testSt12ReadSector() |
f05d3eb1 | 120 | { |
121 | AliMq::Station12Type station[2] = { AliMq::kStation1, AliMq::kStation2 }; | |
122 | AliMp::PlaneType plane[2] = { AliMp::kBendingPlane, AliMp::kNonBendingPlane }; | |
123 | ||
124 | for ( Int_t is = 0; is < 2; is++ ) { | |
125 | for ( Int_t ip = 0; ip < 2; ip++ ) { | |
126 | ||
127 | cout << "Running testReadSector for " | |
128 | << AliMq::Station12TypeName(station[is]) << " " | |
129 | << AliMp::PlaneTypeName(plane[ip]) << " ... " << endl; | |
130 | ||
131 | testReadSector(station[is], plane[ip]); | |
132 | ||
133 | cout << "... end running " << endl << endl; | |
134 | } | |
135 | } | |
136 | } | |
137 | ||
66e0997c | 138 |