]>
Commit | Line | Data |
---|---|---|
66e0997c | 1 | // $Id$ |
57ff4119 | 2 | // $MpId: testGraphics.C,v 1.13 2005/10/28 15:36:08 ivana Exp $ |
66e0997c | 3 | // |
4 | // Test macro for drawing sector data. | |
5 | ||
f05d3eb1 | 6 | #if !defined(__CINT__) || defined(__MAKECINT__) |
7 | ||
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 "AliMpMotifMap.h" | |
18 | #include "AliMpMotifPosition.h" | |
19 | #include "AliMpVPainter.h" | |
20 | ||
21 | #include <Riostream.h> | |
22 | #include <TCanvas.h> | |
23 | ||
24 | #endif | |
25 | ||
26 | void testGraphics(AliMq::Station12Type station, AliMp::PlaneType plane) | |
66e0997c | 27 | { |
f05d3eb1 | 28 | AliMpDataProcessor mp; |
29 | AliMpDataMap* dataMap = mp.CreateDataMap("data"); | |
30 | AliMpDataStreams dataStreams(dataMap); | |
334be4b7 | 31 | |
f05d3eb1 | 32 | AliMpSectorReader r(dataStreams, station, plane); |
33 | AliMpSector* sector = r.BuildSector(); | |
334be4b7 | 34 | |
f05d3eb1 | 35 | AliMpVPainter* painter = AliMpVPainter::CreatePainter(sector); |
66e0997c | 36 | |
db8a279f | 37 | TCanvas* canvas = new TCanvas(); |
38 | TCanvas* canvas2 = new TCanvas(); | |
66e0997c | 39 | TCanvas* c[4]; |
40 | for (int i=0;i<4;++i) { | |
41 | c[i] = new TCanvas(); | |
42 | c[i]->Divide(2,2); | |
43 | } | |
44 | ||
f05d3eb1 | 45 | //first, paint the whole sector |
66e0997c | 46 | canvas->cd(); |
47 | painter->Draw(""); | |
48 | //now paint each rows | |
49 | c[0]->cd(1); | |
50 | painter->Draw("R"); | |
51 | //paint each row segments in each row | |
52 | c[0]->cd(2); | |
53 | painter->Draw("RS"); | |
54 | //paint each motifs, in each row segments in each row | |
55 | c[0]->cd(3); | |
56 | painter->Draw("RSMP"); | |
57 | //paint each pads, in each motifs, in each row segments in each row | |
58 | c[0]->cd(4); | |
59 | painter->Draw("RSMT"); | |
60 | ||
61 | /////////////////////////////// | |
62 | //now paint each rows, wwith its name | |
63 | c[1]->cd(1); | |
64 | painter->Draw("RT"); | |
65 | //paint each row segments in each row, and its name | |
66 | c[1]->cd(2); | |
67 | painter->Draw("RST"); | |
68 | //paint each motifs, in each row segments in each row | |
69 | c[1]->cd(3); | |
70 | painter->Draw("RSMX"); | |
71 | c[1]->cd(4); | |
72 | painter->Draw("RSMI"); | |
73 | ||
74 | /////////////////////////////// | |
75 | //now paint each zones | |
76 | c[2]->cd(1); | |
77 | painter->Draw("Z"); | |
78 | //paint each sub-zones, in each zones | |
79 | c[2]->cd(2); | |
80 | painter->Draw("ZS"); | |
81 | //paint each row segments, in each sub-zone, ... | |
82 | c[2]->cd(3); | |
83 | painter->Draw("ZSS"); | |
84 | // each motifs, in each row segments, ... | |
85 | c[2]->cd(4); | |
86 | painter->Draw("ZSSM"); | |
87 | ||
88 | /////////////////////////////// | |
89 | //now paint each zones with its name | |
90 | c[3]->cd(1); | |
91 | painter->Draw("ZT"); | |
92 | //paint each sub-zones, in each zones with its name | |
93 | c[3]->cd(2); | |
94 | painter->Draw("ZST"); | |
95 | //paint each row segments, in each sub-zone, ... with its name | |
96 | c[3]->cd(3); | |
97 | painter->Draw("ZSST"); | |
98 | // each motifs, in each row segments, ... with its name | |
99 | c[3]->cd(4); | |
100 | painter->Draw("ZSSMT"); | |
f05d3eb1 | 101 | |
66e0997c | 102 | // now, draw a specific motif, in a whole canvas, and |
103 | // print all its pad names | |
104 | Int_t id = sector->GetRow(5)->GetRowSegment(0)->GetMotifPositionId(0); | |
105 | AliMpMotifPosition* motifPos = sector->GetMotifMap()->FindMotifPosition(id); | |
f05d3eb1 | 106 | AliMpVPainter* motifPainter = AliMpVPainter::CreatePainter(motifPos); |
107 | new TCanvas("onepad","One motif"); | |
66e0997c | 108 | motifPainter->Draw("PT"); |
db8a279f | 109 | |
110 | ////////////////////////////// | |
111 | //now paint motifs with their real contours and mani Ids | |
112 | canvas2->cd(); | |
113 | painter->Draw("RSMCI"); | |
66e0997c | 114 | } |
f05d3eb1 | 115 | |
116 | void testGraphics() | |
117 | { | |
118 | AliMq::Station12Type station[2] = { AliMq::kStation1, AliMq::kStation2 }; | |
119 | AliMp::PlaneType plane[2] = { AliMp::kBendingPlane, AliMp::kNonBendingPlane }; | |
120 | ||
121 | for ( Int_t is = 0; is < 2; is++ ) { | |
122 | for ( Int_t ip = 0; ip < 2; ip++ ) { | |
123 | ||
124 | cout << "Running testGraphics for " | |
125 | << AliMq::Station12TypeName(station[is]) << " " | |
126 | << AliMp::PlaneTypeName(plane[ip]) << " ... " << endl; | |
127 | ||
128 | testGraphics(station[is], plane[ip]); | |
129 | ||
130 | cout << "... end running " << endl << endl; | |
131 | } | |
132 | } | |
133 | } | |
134 |