15 {
16 gStyle->SetOptStat(0);
18
19 TFile o_file(
old_path +
"rungain.root");
20 TTree *o_tree_run = (TTree*)o_file.Get("runcalib");
21 TTree *o_tree_wire = (TTree*)o_file.Get("wiregcalib");
22 Int_t o_run, n_run;
23 Double_t o_gain, o_wireg, n_mean, n_wireg;
24 o_tree_run->SetBranchAddress("runno", &o_run);
25 o_tree_run->SetBranchAddress("rungain", &o_gain);
26 Int_t m_len = o_tree_run->GetEntries();
27 for(int i=0; i<m_len; i++){
28 o_tree_run->GetEntry(i);
31 if(
m_debug) cout <<
"x " <<
x[i] <<
" y " <<
y[i] << endl;
32 }
33 TGraph *
gr =
new TGraph(m_len, x,
y);
34 gr->SetTitle(
"gain constant vs. run");
35 TCanvas *c1 = new TCanvas("c1", "c1", 10, 10, 800, 642);
37 c1->SaveAs("figs/gain_vs_run.eps");
38
39
40 TFile n_file("../rungain.root");
41 TTree *n_tree_run = (TTree*)n_file.Get("runcalib");
42 n_tree_run->SetBranchAddress("runno", &n_run);
43 n_tree_run->SetBranchAddress("runmean", &n_mean);
44 if(m_len != n_tree_run->GetEntries()){
45 cout << "the num of enetries are different!" << endl;
46 cout << "old " << m_len << " new " << n_tree_run->GetEntries() << endl;
47 return 1;
48 }
49 for(int i=0; i<m_len; i++){
50 n_tree_run->GetEntry(i);
53 }
54 gr =
new TGraph(m_len, x,
y);
55 gr->SetTitle(
"mean dE/dx vs. run (with new constants)");
56 c1->Clear();
58 c1->SaveAs("figs/mean_vs_run.eps");
59
60
61 TFile o_file("../../WireGain/wiregain.root");
62 TTree *o_tree_wire = (TTree*)o_file.Get("wiregcalib");
63 o_tree_wire->SetBranchAddress(
"wireg",
y);
64 o_tree_wire->GetEntry(0);
65 m_len = 6796;
66 for(int i=0; i<m_len; i++){
68 if(
m_debug) cout <<
"i " << i <<
" y[i] " <<
y[i] << endl;
69 }
70 gr =
new TGraph(m_len, x,
y);
71 gr->SetTitle(
"gain constant vs. wire");
72 c1->Clear();
74 c1->SaveAs("figs/wireg_vs_wire.eps");
75
76
77 TFile n_file("wiregain.root");
78 TTree *n_tree_wire = (TTree*)n_file.Get("wiregcalib");
79 n_tree_wire->SetBranchAddress(
"fitmean",
y);
80 n_tree_wire->GetEntry(0);
81 m_len = 6796;
82 for(int i=0; i<m_len; i++){
84 if(
y[i]<480)
y[i]=
y[i-1];
85 if(
m_debug) cout <<
"i " << i <<
" y[i] " <<
y[i] << endl;
86 }
87 gr =
new TGraph(m_len, x,
y);
88 gr->SetTitle(
"dE/dx vs. wire with new constants");
89 c1->Clear();
91 c1->SaveAs("figs/mean_vs_wire.eps");
92
93 n_tree_wire->SetBranchAddress(
"fitsigma",
y);
94 n_tree_wire->GetEntry(0);
95 m_len = 6796;
96 for(int i=0; i<m_len; i++){
98 if(
m_debug) cout <<
"i " << i <<
" y[i] " <<
y[i] << endl;
99 }
100 gr =
new TGraph(m_len, x,
y);
101 gr->SetTitle(
"dE/dx sigma vs. wire with new constants");
102 c1->Clear();
104 c1->SaveAs("figs/sigma_vs_wire.eps");
105
106
107
108
109
110
111
112
113 TFile o_file("../../DocaEangle/docaeangle.root");
114 TH2F *o_hist = (TH2F*)o_file.Get("dEdxVsDocaEAng");
115 o_hist->SetTitle("dE/dx vs. doca and enta, without new constants");
116 c1->Clear();
117
118
119
120
121
122
123
124
125
126
127 gStyle->SetPalette(1,0);
128 o_hist->Draw("colz");
129 c1->SaveAs("figs/dedx_vs_doca_and_enta_without_cor.eps");
130
131 TFile n_file("docaeangle.root");
132 TH2F *n_hist = (TH2F*)n_file.Get("dEdxVsDocaEAng");
133 n_hist->SetTitle("dE/dx vs. doca and enta, with new constants");
134 c1->Clear();
135
136
137
138
139
140 n_hist->Draw("colz");
141 c1->SaveAs("figs/dedx_vs_doca_and_enta_with_cor.eps");
142
143 TFile o_file("dEdxVsCostheta.root");
144 TCanvas *on_can = (TCanvas*)o_file.Get("fitmean");
145 on_can->SetTitle("dE/dx vs. cos, with/without correction");
146 on_can->Draw();
147 on_can->SaveAs("figs/dedx_vs_cos_with_without_cor.eps");
148
149 on_can = (TCanvas*)o_file.Get("fitsigma");
150 on_can->SetTitle("dE/dx sigma vs. cos, with/without correction");
151 on_can->Draw();
152 on_can->SaveAs("figs/dedx_sigma_vs_cos_with_without_cor.eps");
153
154 TFile o_file("dEdxVsCosNP.root");
155 on_can = (TCanvas*)o_file.Get("fitmean");
156 on_can->SetTitle("dE/dx vs. cos, electron & positron");
157 on_can->Draw();
158 on_can->SaveAs("figs/dedx_vs_cos_NP.eps");
159
160 on_can = (TCanvas*)o_file.Get("fitsigma");
161 on_can->SetTitle("dE/dx sigma vs. cos, electron & positron");
162 on_can->Draw();
163 on_can->SaveAs("figs/dedx_sigma_vs_cos_NP.eps");
164
165}