Updated for modifs in AliMpFiles
[u/mrichter/AliRoot.git] / MUON / mapping / macros / testGraphics.C
CommitLineData
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
6void testGraphics(AliMpStationType station = kStation1,
334be4b7 7 AliMpPlaneType plane = kBendingPlane,
8 Bool_t rootInput = false)
66e0997c 9{
334be4b7 10 AliMpSector *sector = 0;
11 if (!rootInput) {
12 AliMpSectorReader r(station, plane);
13 sector=r.BuildSector();
14 }
15 else {
57ff4119 16 TString filePath = AliMpFiles::SectorFilePath(station,plane);
334be4b7 17 filePath.ReplaceAll("zones.dat", "sector.root");
18
19 TFile f(filePath.Data(), "READ");
20 sector = (AliMpSector*)f.Get("Sector");
21 }
22
66e0997c 23 AliMpVPainter *painter=AliMpVPainter::CreatePainter(sector);
24
25 TCanvas* canvas = new TCanvas();
26 TCanvas* c[4];
27 for (int i=0;i<4;++i) {
28 c[i] = new TCanvas();
29 c[i]->Divide(2,2);
30 }
31
32 //first, paint the whole sector
33 canvas->cd();
34 painter->Draw("");
35 //now paint each rows
36 c[0]->cd(1);
37 painter->Draw("R");
38 //paint each row segments in each row
39 c[0]->cd(2);
40 painter->Draw("RS");
41 //paint each motifs, in each row segments in each row
42 c[0]->cd(3);
43 painter->Draw("RSMP");
44 //paint each pads, in each motifs, in each row segments in each row
45 c[0]->cd(4);
46 painter->Draw("RSMT");
47
48 ///////////////////////////////
49 //now paint each rows, wwith its name
50 c[1]->cd(1);
51 painter->Draw("RT");
52 //paint each row segments in each row, and its name
53 c[1]->cd(2);
54 painter->Draw("RST");
55 //paint each motifs, in each row segments in each row
56 c[1]->cd(3);
57 painter->Draw("RSMX");
58 c[1]->cd(4);
59 painter->Draw("RSMI");
60
61 ///////////////////////////////
62 //now paint each zones
63 c[2]->cd(1);
64 painter->Draw("Z");
65 //paint each sub-zones, in each zones
66 c[2]->cd(2);
67 painter->Draw("ZS");
68 //paint each row segments, in each sub-zone, ...
69 c[2]->cd(3);
70 painter->Draw("ZSS");
71 // each motifs, in each row segments, ...
72 c[2]->cd(4);
73 painter->Draw("ZSSM");
74
75 ///////////////////////////////
76 //now paint each zones with its name
77 c[3]->cd(1);
78 painter->Draw("ZT");
79 //paint each sub-zones, in each zones with its name
80 c[3]->cd(2);
81 painter->Draw("ZST");
82 //paint each row segments, in each sub-zone, ... with its name
83 c[3]->cd(3);
84 painter->Draw("ZSST");
85 // each motifs, in each row segments, ... with its name
86 c[3]->cd(4);
87 painter->Draw("ZSSMT");
88 // now, draw a specific motif, in a whole canvas, and
89 // print all its pad names
90 Int_t id = sector->GetRow(5)->GetRowSegment(0)->GetMotifPositionId(0);
91 AliMpMotifPosition* motifPos = sector->GetMotifMap()->FindMotifPosition(id);
92 motifPainter = AliMpVPainter::CreatePainter(motifPos);
93 TCanvas* onepad = new TCanvas("onepad","One motif");
94 motifPainter->Draw("PT");
95}