]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/macros/testGraphics.C
Mapping test macros (D. Guez, I. Hrivnacova)
[u/mrichter/AliRoot.git] / MUON / mapping / macros / testGraphics.C
1 // $Id$
2 //
3 // Test macro for drawing sector data.
4
5 void testGraphics(AliMpStationType station = kStation1,
6                   AliMpPlaneType plane = kBendingPlane) 
7 {
8   AliMpReader r(station, plane);
9   AliMpSector *sector=r.BuildSector();
10   AliMpVPainter *painter=AliMpVPainter::CreatePainter(sector);
11
12   TCanvas* canvas = new TCanvas();
13   TCanvas* c[4];
14   for (int i=0;i<4;++i) {
15     c[i] = new TCanvas();
16     c[i]->Divide(2,2);
17   }  
18
19  //first, paint the whole sector
20   canvas->cd();
21   painter->Draw("");
22   //now paint each rows
23   c[0]->cd(1);
24   painter->Draw("R");
25   //paint each row segments in each row
26   c[0]->cd(2);
27   painter->Draw("RS");
28   //paint each motifs, in each row segments in each row
29   c[0]->cd(3);
30   painter->Draw("RSMP");
31   //paint each pads, in each motifs, in each row segments in each row
32   c[0]->cd(4);
33   painter->Draw("RSMT");
34
35   ///////////////////////////////
36   //now paint each rows, wwith its name
37   c[1]->cd(1);
38   painter->Draw("RT");
39   //paint each row segments in each row, and its name
40   c[1]->cd(2);
41   painter->Draw("RST");
42   //paint each motifs, in each row segments in each row
43   c[1]->cd(3);
44   painter->Draw("RSMX");
45   c[1]->cd(4);
46   painter->Draw("RSMI");
47
48   ///////////////////////////////
49   //now paint each zones
50   c[2]->cd(1);
51   painter->Draw("Z");
52   //paint each sub-zones, in each zones
53   c[2]->cd(2);
54   painter->Draw("ZS");
55   //paint each row segments, in each sub-zone, ...
56   c[2]->cd(3);
57   painter->Draw("ZSS");
58   // each motifs, in each row segments, ...
59   c[2]->cd(4);
60   painter->Draw("ZSSM");
61
62   ///////////////////////////////
63   //now paint each zones with its name
64   c[3]->cd(1);
65   painter->Draw("ZT");
66   //paint each sub-zones, in each zones with its name
67   c[3]->cd(2);
68   painter->Draw("ZST");
69   //paint each row segments, in each sub-zone, ... with its name
70   c[3]->cd(3);
71   painter->Draw("ZSST");
72   // each motifs, in each row segments, ... with its name
73   c[3]->cd(4);
74   painter->Draw("ZSSMT");
75   // now, draw a specific motif, in a whole canvas, and
76   // print all its pad names
77   Int_t id = sector->GetRow(5)->GetRowSegment(0)->GetMotifPositionId(0);
78   AliMpMotifPosition* motifPos = sector->GetMotifMap()->FindMotifPosition(id);
79   motifPainter = AliMpVPainter::CreatePainter(motifPos);
80   TCanvas* onepad = new TCanvas("onepad","One motif");
81   motifPainter->Draw("PT");
82 }