Rev 25 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
25 | f9daq | 1 | #include "include/RTUtil.h" |
2 | |||
3 | //########################################################################################## |
||
4 | void RTSetStyle(TStyle *style) |
||
5 | { |
||
6 | style->SetStatBorderSize(1); |
||
7 | style->SetFrameBorderMode(0); |
||
8 | style->SetCanvasBorderMode(0); |
||
9 | style->SetPadBorderMode(0); |
||
10 | style->SetPadColor(0); |
||
11 | style->SetCanvasColor(0); |
||
12 | style->SetHistFillColor(18); |
||
13 | style->SetStatColor(0); |
||
14 | style->SetPalette(1, 0); |
||
15 | |||
54 | f9daq | 16 | style->SetPadTopMargin(0.10); |
17 | style->SetPadBottomMargin(0.10); |
||
18 | style->SetPadLeftMargin(0.10); |
||
19 | style->SetPadRightMargin(0.12); |
||
25 | f9daq | 20 | |
21 | style->SetTitleOffset(1.3, "y"); |
||
22 | } |
||
23 | //########################################################################################## |
||
24 | RTCanvas::RTCanvas() |
||
25 | { |
||
26 | RTCanvas((char*)"can", (char*)" ", 0, 0, 640, 480); |
||
27 | } |
||
28 | //------------------------------------------------------------------------------------------ |
||
29 | RTCanvas::RTCanvas(char *w_title, char *c_title, int x_min, int y_min, int x_size, int y_size) |
||
30 | { |
||
31 | can = (TCanvas*)gROOT->FindObject(w_title); |
||
32 | if(!can) can = new TCanvas(w_title, w_title, x_min, y_min, x_size, y_size); |
||
33 | else can->cd(0); |
||
34 | |||
35 | title = new TPaveLabel(0.01,0.96,0.81,0.99, c_title, "NDC"); |
||
36 | title->Draw(); |
||
37 | |||
38 | TDatime now; |
||
39 | date = new TPaveLabel(0.83,0.96,0.99,0.99, now.AsString(), "NDC"); |
||
40 | date->Draw(); |
||
41 | |||
42 | pad = new TPad("Graphs","Graphs",0.005,0.005,0.996,0.95); |
||
43 | pad->Draw(); |
||
44 | pad->cd(0); |
||
45 | } |
||
46 | //------------------------------------------------------------------------------------------ |
||
47 | void RTCanvas::Divide(int nx, int ny) |
||
48 | { |
||
49 | pad->Divide(nx, ny, 0.003, 0.005); |
||
50 | } |
||
51 | //------------------------------------------------------------------------------------------ |
||
52 | TPad* RTCanvas::cd(int i) |
||
53 | { |
||
54 | return (TPad*)(pad->cd(i)); |
||
55 | } |
||
56 | //------------------------------------------------------------------------------------------ |
||
57 | void RTCanvas::SaveAs(const char *filename) |
||
58 | { |
||
59 | can->SaveAs(filename); |
||
60 | } |
||
61 | //########################################################################################## |
||
62 | |||
63 | |||
64 |