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 TCanvas* CreateTCanvas(const TString& name, const TString& title,
27 AliMq::Station12Type station, AliMp::PlaneType plane)
29 TString newName(name);
30 TString newTitle(title);
31 TString unique = AliMq::Station12TypeName(station) + AliMp::PlaneTypeName(plane);
34 return new TCanvas(newName.Data(), newTitle.Data());
37 void testGraphics(AliMq::Station12Type station, AliMp::PlaneType plane)
39 AliMpDataProcessor mp;
40 AliMpDataMap* dataMap = mp.CreateDataMap("data");
41 AliMpDataStreams dataStreams(dataMap);
43 AliMpSectorReader r(dataStreams, station, plane);
44 AliMpSector* sector = r.BuildSector();
46 AliMpVPainter* painter = AliMpVPainter::CreatePainter(sector);
48 TCanvas* canvas = new TCanvas();
49 TCanvas* canvas2 = new TCanvas();
51 for (int i=0;i<4;++i) {
56 //first, paint the whole sector
62 //paint each row segments in each row
65 //paint each motifs, in each row segments in each row
67 painter->Draw("RSMP");
68 //paint each pads, in each motifs, in each row segments in each row
70 painter->Draw("RSMT");
72 ///////////////////////////////
73 //now paint each rows, wwith its name
76 //paint each row segments in each row, and its name
79 //paint each motifs, in each row segments in each row
81 painter->Draw("RSMX");
83 painter->Draw("RSMI");
85 ///////////////////////////////
86 //now paint each zones
89 //paint each sub-zones, in each zones
92 //paint each row segments, in each sub-zone, ...
95 // each motifs, in each row segments, ...
97 painter->Draw("ZSSM");
99 ///////////////////////////////
100 //now paint each zones with its name
103 //paint each sub-zones, in each zones with its name
105 painter->Draw("ZST");
106 //paint each row segments, in each sub-zone, ... with its name
108 painter->Draw("ZSST");
109 // each motifs, in each row segments, ... with its name
111 painter->Draw("ZSSMT");
113 // now, draw a specific motif, in a whole canvas, and
114 // print all its pad names
115 Int_t id = sector->GetRow(5)->GetRowSegment(0)->GetMotifPositionId(0);
116 AliMpMotifPosition* motifPos = sector->GetMotifMap()->FindMotifPosition(id);
117 AliMpVPainter* motifPainter = AliMpVPainter::CreatePainter(motifPos);
118 CreateTCanvas("onepad ","One motif ", station, plane);
119 motifPainter->Draw("PT");
121 //////////////////////////////
122 //now paint motifs with their real contours and mani Ids
124 painter->Draw("RSMCI");
127 void testSt12Graphics()
129 AliMq::Station12Type station[2] = { AliMq::kStation1, AliMq::kStation2 };
130 AliMp::PlaneType plane[2] = { AliMp::kBendingPlane, AliMp::kNonBendingPlane };
132 for ( Int_t is = 0; is < 2; is++ ) {
133 for ( Int_t ip = 0; ip < 2; ip++ ) {
135 cout << "Running testGraphics for "
136 << AliMq::Station12TypeName(station[is]) << " "
137 << AliMp::PlaneTypeName(plane[ip]) << " ... " << endl;
139 testGraphics(station[is], plane[ip]);
141 cout << "... end running " << endl << endl;