Rev 54 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 54 | Rev 70 | ||
---|---|---|---|
Line -... | Line 1... | ||
- | 1 | //########################################################################################## |
|
- | 2 | #include "TGaxis.h" |
|
- | 3 | #include "TColor.h" |
|
- | 4 | ||
1 | #include "include/RTUtil.h" |
5 | #include "include/RTUtil.h" |
2 | 6 | ||
3 | //########################################################################################## |
- | |
4 | void RTSetStyle(TStyle *style) |
7 | void RTSetStyle(TStyle *style) |
5 | { |
8 | { |
6 | style->SetStatBorderSize(1); |
9 | style->SetStatBorderSize(1); |
7 | style->SetFrameBorderMode(0); |
10 | style->SetFrameBorderMode(0); |
8 | style->SetCanvasBorderMode(0); |
11 | style->SetCanvasBorderMode(0); |
9 | style->SetPadBorderMode(0); |
12 | style->SetPadBorderMode(0); |
10 | style->SetPadColor(0); |
13 | style->SetPadColor(0); |
11 | style->SetCanvasColor(0); |
14 | style->SetCanvasColor(0); |
12 | style->SetHistFillColor(18); |
15 | style->SetHistFillColor(18); |
13 | style->SetStatColor(0); |
16 | style->SetStatColor(0); |
14 | style->SetPalette(1, 0); |
17 | style->SetPalette(1, 0); |
- | 18 | ||
- | 19 | style->SetMarkerStyle(kFullDotLarge); |
|
- | 20 | //style->SetMarkerSize(7); |
|
- | 21 | ||
- | 22 | style->SetOptStat("ne"); |
|
- | 23 | style->SetOptFit(1); |
|
15 | 24 | ||
16 | style->SetPadTopMargin(0.10); |
25 | style->SetPadTopMargin(0.10); |
17 | style->SetPadBottomMargin(0. |
26 | style->SetPadBottomMargin(0.12); |
18 | style->SetPadLeftMargin(0. |
27 | style->SetPadLeftMargin(0.12); |
19 | style->SetPadRightMargin(0. |
28 | style->SetPadRightMargin(0.15); |
20 | 29 | ||
21 | style->SetTitleOffset(1. |
30 | style->SetTitleOffset(1.5, "y"); |
- | 31 | style->SetPalette(1, 0); |
|
- | 32 | ||
- | 33 | style->SetPaperSize(TStyle::kA4); |
|
- | 34 | ||
- | 35 | TGaxis::SetMaxDigits(4); |
|
22 | } |
36 | } |
23 | //########################################################################################## |
37 | //########################################################################################## |
24 | RTCanvas::RTCanvas() |
38 | RTCanvas::RTCanvas() |
25 | { |
39 | { |
26 | RTCanvas((char*)"can", (char*)" ", 0, 0, 640, 480); |
40 | RTCanvas((char*)"can", (char*)" ", 0, 0, 640, 480); |
27 | } |
41 | } |
28 | //------------------------------------------------------------------------------------------ |
42 | //------------------------------------------------------------------------------------------ |
29 | RTCanvas::RTCanvas(char *w_title, char *c_title, int x_min, int y_min, int x_size, int y_size) |
43 | RTCanvas::RTCanvas(char *w_title, char *c_title, int x_min, int y_min, int x_size, int y_size) |
30 | { |
44 | { |
Line 40... | Line 54... | ||
40 | date->Draw(); |
54 | date->Draw(); |
41 | 55 | ||
42 | pad = new TPad("Graphs","Graphs",0.005,0.005,0.996,0.95); |
56 | pad = new TPad("Graphs","Graphs",0.005,0.005,0.996,0.95); |
43 | pad->Draw(); |
57 | pad->Draw(); |
44 | pad->cd(0); |
58 | pad->cd(0); |
45 | } |
59 | } |
46 | //------------------------------------------------------------------------------------------ |
60 | //------------------------------------------------------------------------------------------ |
47 | void RTCanvas::Divide(int nx, int ny) |
61 | void RTCanvas::Divide(int nx, int ny) |
48 | { |
62 | { |
49 | pad->Divide(nx, ny, 0.003, 0.005); |
63 | pad->Divide(nx, ny, 0.003, 0.005); |
- | 64 | } |
|
- | 65 | //------------------------------------------------------------------------------------------ |
|
- | 66 | void RTCanvas::Divide(int np) |
|
- | 67 | { |
|
- | 68 | if( np==2 ) pad->Divide(1, 2, 0.003, 0.005); |
|
- | 69 | else if( 2<np && np<=4 ) pad->Divide(2, 2, 0.003, 0.005); |
|
- | 70 | else if( 4<np && np<=6 ) pad->Divide(2, 3, 0.003, 0.005); |
|
- | 71 | else if( 6<np && np<=8 ) pad->Divide(2, 4, 0.003, 0.005); |
|
- | 72 | else if( np==9 ) pad->Divide(3, 3, 0.003, 0.005); |
|
- | 73 | else if( 9<np && np<=12) pad->Divide(3, 4, 0.003, 0.005); |
|
- | 74 | else if(12<np && np<=16) pad->Divide(4, 4, 0.003, 0.005); |
|
- | 75 | else if(16<np && np<=25) pad->Divide(5, 5, 0.003, 0.005); |
|
- | 76 | else if(25<np && np<=32) pad->Divide(4, 8, 0.003, 0.005); |
|
50 | } |
77 | } |
51 | //------------------------------------------------------------------------------------------ |
78 | //------------------------------------------------------------------------------------------ |
52 | TPad* RTCanvas::cd(int i) |
79 | TPad* RTCanvas::cd(int i) |
53 | { |
80 | { |
54 | return (TPad*)(pad->cd(i)); |
81 | return (TPad*)(pad->cd(i)); |
55 | } |
82 | } |
56 | //------------------------------------------------------------------------------------------ |
83 | //------------------------------------------------------------------------------------------ |
57 | void RTCanvas::SaveAs(const char *filename) |
84 | void RTCanvas::SaveAs(const char *filename) |
58 | { |
85 | { |
59 | can->SaveAs(filename); |
86 | can->SaveAs(filename); |
- | 87 | } |
|
- | 88 | //------------------------------------------------------------------------------------------ |
|
- | 89 | void RTCanvas::Update() |
|
- | 90 | { |
|
- | 91 | can->Update(); |
|
- | 92 | } |
|
- | 93 | ||
- | 94 | void SetGS() |
|
- | 95 | { |
|
- | 96 | const Int_t Number = 2; |
|
- | 97 | Double_t Red[Number] = {1.0, 0.0}; |
|
- | 98 | Double_t Green[Number] = {1.0, 0.0}; |
|
- | 99 | Double_t Blue[Number] = {1.0, 0.0}; |
|
- | 100 | Double_t Stops[Number] = {0.0, 1.0}; |
|
- | 101 | Int_t nb = 50; |
|
- | 102 | TColor::CreateGradientColorTable(Number, Stops, Red, Green, Blue, nb); |
|
60 | } |
103 | } |
61 | //########################################################################################## |
104 | //########################################################################################## |
62 | 105 | ||
63 | 106 | ||
64 | 107 |