16 gStyle->SetOptStat(0);
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");
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;
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");
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;
49 for(
int i=0; i<m_len; i++){
50 n_tree_run->GetEntry(i);
54 gr =
new TGraph(m_len,
x,
y);
55 gr->SetTitle(
"mean dE/dx vs. run (with new constants)");
58 c1->SaveAs(
"figs/mean_vs_run.eps");
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);
66 for(
int i=0; i<m_len; i++){
68 if(
m_debug) cout <<
"i " << i <<
" y[i] " <<
y[i] << endl;
70 gr =
new TGraph(m_len,
x,
y);
71 gr->SetTitle(
"gain constant vs. wire");
74 c1->SaveAs(
"figs/wireg_vs_wire.eps");
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);
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;
87 gr =
new TGraph(m_len,
x,
y);
88 gr->SetTitle(
"dE/dx vs. wire with new constants");
91 c1->SaveAs(
"figs/mean_vs_wire.eps");
93 n_tree_wire->SetBranchAddress(
"fitsigma",
y);
94 n_tree_wire->GetEntry(0);
96 for(
int i=0; i<m_len; i++){
98 if(
m_debug) cout <<
"i " << i <<
" y[i] " <<
y[i] << endl;
100 gr =
new TGraph(m_len,
x,
y);
101 gr->SetTitle(
"dE/dx sigma vs. wire with new constants");
104 c1->SaveAs(
"figs/sigma_vs_wire.eps");
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");
127 gStyle->SetPalette(1,0);
128 o_hist->Draw(
"colz");
129 c1->SaveAs(
"figs/dedx_vs_doca_and_enta_without_cor.eps");
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");
140 n_hist->Draw(
"colz");
141 c1->SaveAs(
"figs/dedx_vs_doca_and_enta_with_cor.eps");
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");
147 on_can->SaveAs(
"figs/dedx_vs_cos_with_without_cor.eps");
149 on_can = (TCanvas*)o_file.Get(
"fitsigma");
150 on_can->SetTitle(
"dE/dx sigma vs. cos, with/without correction");
152 on_can->SaveAs(
"figs/dedx_sigma_vs_cos_with_without_cor.eps");
154 TFile o_file(
"dEdxVsCosNP.root");
155 on_can = (TCanvas*)o_file.Get(
"fitmean");
156 on_can->SetTitle(
"dE/dx vs. cos, electron & positron");
158 on_can->SaveAs(
"figs/dedx_vs_cos_NP.eps");
160 on_can = (TCanvas*)o_file.Get(
"fitsigma");
161 on_can->SetTitle(
"dE/dx sigma vs. cos, electron & positron");
163 on_can->SaveAs(
"figs/dedx_sigma_vs_cos_NP.eps");