ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/HFmon2012/macros/plotR.C
Revision: 1.1
Committed: Mon Aug 13 14:57:42 2012 UTC (12 years, 8 months ago) by yilmaz
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Log Message:
update analysis

File Contents

# User Rev Content
1 yilmaz 1.1
2    
3    
4     void plotR(){
5    
6    
7    
8     string hists[10] = {Form("%d_%d_%d",3,0,3),
9     Form("%d_%d_%d",3,1,3),
10     Form("%d_%d_%d",3,2,3),
11     Form("%d_%d_%d",3,3,3),
12     Form("%d_%d_%d",3,4,3),
13     Form("%d_%d_%d",3,5,3)
14    
15     };
16    
17    
18     string labels0[10] = {
19     " =0.1",
20     " = 0.15",
21     " = 0.2",
22     " = 0.25",
23     " = 0.4",
24     " = 0.5"
25     };
26    
27     string labels1[10] = {
28     " =0.1",
29     " = 0.15",
30     " = 0.2",
31     " = 0.25",
32     " = 0.4",
33     " = 0.5"
34     };
35    
36     string* label = labels0;
37    
38    
39     int N = 6;
40    
41     int color[21] = {1,2,5,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
42    
43     TFile* inf = new TFile("resultsB.root");
44    
45     TH2D* h[15];
46     TProfile* p[15];
47     TH2D* hw[15];
48     TProfile* pw[15];
49    
50     for(int i = 0; i < N; ++i){
51    
52     h[i] = (TH2D*)inf->Get(Form("%s%s","h_",hists[i].data()));
53     p[i] = (TProfile*)inf->Get(Form("%s%s","p_",hists[i].data()));
54    
55     hw[i] = (TH2D*)inf->Get(Form("%s%s","hw_",hists[i].data()));
56     pw[i] = (TProfile*)inf->Get(Form("%s%s","pw_",hists[i].data()));
57    
58     h[i]->SetTitle(";TS - Phase/25ns + Arbitrary Constant; S2/S1");
59     p[i]->SetTitle(";TS - Phase/25ns + Arbitrary Constant; S2/S1");
60     hw[i]->SetTitle(";TS - Phase/25ns + Arbitrary Constant; S2/S1");
61     pw[i]->SetTitle(";TS - Phase/25ns + Arbitrary Constant; S2/S1");
62    
63     hw[i]->SetMarkerColor(color[i+1]);
64    
65     pw[i]->SetMarkerColor(color[i]);
66     pw[i]->SetLineColor(color[i]);
67    
68     pw[i]->SetMarkerStyle(20);
69     pw[i]->SetMarkerSize(0.8);
70    
71     h[i]->SetMarkerColor(color[i]);
72    
73     p[i]->SetMarkerColor(color[i]);
74     p[i]->SetLineColor(color[i]);
75    
76     p[i]->SetMarkerStyle(24);
77     p[i]->SetMarkerSize(0.8);
78    
79     h[i]->SetAxisRange(0,2.5);
80     p[i]->SetAxisRange(0,2.5);
81     hw[i]->SetAxisRange(0,2.5);
82     pw[i]->SetAxisRange(0,2.5);
83    
84    
85     }
86    
87     TLegend* leg = new TLegend(0.5,0.5,0.7,0.9);
88     leg->SetFillColor(0);
89     leg->SetBorderSize(0);
90     leg->SetFillStyle(0);
91     leg->SetTextFont(43);
92     leg->SetTextSize(13);
93     leg->AddEntry(p[0],"Pulse width / 25 ns","");
94    
95     for(int i = 0; i < N; ++i){
96     leg->AddEntry(p[i],label[i].data(),"p");
97     }
98    
99     TCanvas* c1 = new TCanvas("c1","c1",500,500);
100    
101     h[0]->Draw();
102     for(int i = 0; i < N; ++i){
103     h[i]->Draw("same");
104     }
105     leg->Draw();
106    
107     TCanvas* c2 = new TCanvas("c2","c2",500,500);
108    
109     p[0]->Draw();
110     for(int i = 0; i < N; ++i){
111     p[i]->Draw("same");
112     }
113     leg->Draw();
114    
115    
116    
117    
118     TCanvas* c3 = new TCanvas("c3","c3",500,500);
119    
120     h[0]->Draw();
121     hw[0]->Draw("same");
122     h[4]->Draw("same");
123     hw[4]->Draw("same");
124    
125    
126     TCanvas* c4 = new TCanvas("c4","c4",500,500);
127    
128     p[0]->Draw("");
129     pw[0]->Draw("same");
130     p[4]->Draw("same");
131     pw[4]->Draw("same");
132    
133    
134    
135    
136    
137    
138    
139    
140     }
141    
142    
143    
144    
145    
146    
147    
148    
149    
150