2 // $MpId: testGraphics.C,v 1.13 2005/10/28 15:36:08 ivana Exp $
4 // Test macro for drawing 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 "AliMpMotifMap.h"
18 #include "AliMpMotifPosition.h"
19 #include "AliMpVPainter.h"
21 #include <Riostream.h>
26 void testGraphics(AliMq::Station12Type station, AliMp::PlaneType plane)
28 AliMpDataProcessor mp;
29 AliMpDataMap* dataMap = mp.CreateDataMap("data");
30 AliMpDataStreams dataStreams(dataMap);
32 AliMpSectorReader r(dataStreams, station, plane);
33 AliMpSector* sector = r.BuildSector();
35 AliMpVPainter* painter = AliMpVPainter::CreatePainter(sector);
37 TCanvas* canvas = new TCanvas();
38 TCanvas* canvas2 = new TCanvas();
40 for (int i=0;i<4;++i) {
45 //first, paint the whole sector
51 //paint each row segments in each row
54 //paint each motifs, in each row segments in each row
56 painter->Draw("RSMP");
57 //paint each pads, in each motifs, in each row segments in each row
59 painter->Draw("RSMT");
61 ///////////////////////////////
62 //now paint each rows, wwith its name
65 //paint each row segments in each row, and its name
68 //paint each motifs, in each row segments in each row
70 painter->Draw("RSMX");
72 painter->Draw("RSMI");
74 ///////////////////////////////
75 //now paint each zones
78 //paint each sub-zones, in each zones
81 //paint each row segments, in each sub-zone, ...
84 // each motifs, in each row segments, ...
86 painter->Draw("ZSSM");
88 ///////////////////////////////
89 //now paint each zones with its name
92 //paint each sub-zones, in each zones with its name
95 //paint each row segments, in each sub-zone, ... with its name
97 painter->Draw("ZSST");
98 // each motifs, in each row segments, ... with its name
100 painter->Draw("ZSSMT");
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);
106 AliMpVPainter* motifPainter = AliMpVPainter::CreatePainter(motifPos);
107 new TCanvas("onepad","One motif");
108 motifPainter->Draw("PT");
110 //////////////////////////////
111 //now paint motifs with their real contours and mani Ids
113 painter->Draw("RSMCI");
118 AliMq::Station12Type station[2] = { AliMq::kStation1, AliMq::kStation2 };
119 AliMp::PlaneType plane[2] = { AliMp::kBendingPlane, AliMp::kNonBendingPlane };
121 for ( Int_t is = 0; is < 2; is++ ) {
122 for ( Int_t ip = 0; ip < 2; ip++ ) {
124 cout << "Running testGraphics for "
125 << AliMq::Station12TypeName(station[is]) << " "
126 << AliMp::PlaneTypeName(plane[ip]) << " ... " << endl;
128 testGraphics(station[is], plane[ip]);
130 cout << "... end running " << endl << endl;