BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
FirstRung/draw_plots.cxx File Reference

Go to the source code of this file.

Functions

void draw_plots ()
 

Variables

const int run_begin = minrun
 
const int run_end = maxrun
 
const int max_len = 10000
 
bool m_debug = false
 

Function Documentation

◆ draw_plots()

void draw_plots ( )

Definition at line 16 of file FirstRung/draw_plots.cxx.

16 {
17 const TString old_path = "/afs/ihep.ac.cn/bes3/offline/CalibConst/dedx/6.6.3/";
18 const TString file_name = Form("DedxConst_%d-%d_663.root", run_begin, run_end);
19 const TString str_eps = Form("figs/gain_vs_run_%d-%d.eps", run_begin, run_end);
20 const TString str_eps2 = Form("figs/resol_vs_run_%d-%d.eps", run_begin, run_end);
21 const TString str_eps3 = Form("figs/rel_resol_vs_run_%d-%d.eps", run_begin, run_end);
22
23 gStyle->SetOptStat(0);
24 Double_t x[max_len], y[max_len], yy[max_len], yyy[max_len];
25 // gain constant vs. run
26 TFile o_file(old_path + file_name);
27 TTree *o_tree_run = (TTree*)o_file.Get("runcalib");
28 Int_t o_run, n_run;
29 Double_t o_gain, o_resol, o_wireg, n_mean, n_wireg;
30 o_tree_run->SetBranchAddress("runno", &o_run);
31 o_tree_run->SetBranchAddress("rungain", &o_gain);
32 o_tree_run->SetBranchAddress("runresol", &o_resol);
33 Int_t m_len = o_tree_run->GetEntries();
34 for(int i=0; i<m_len; i++){
35 o_tree_run->GetEntry(i);
36 x[i] = o_run;
37 y[i] = o_gain;
38 if(m_debug) cout << "x " << x[i] << " y " << y[i] << endl;
39 }
40 TGraph *gr = new TGraph(m_len, x, y);
41 gr->SetTitle("gain constant vs. run");
42 TCanvas *c1 = new TCanvas("c1", "c1", 10, 10, 800, 642);
43 gr->Draw("a*");
44 c1->SaveAs(str_eps);
45
46 c1->Clear();
47 for(int i=0; i<m_len; i++){
48 o_tree_run->GetEntry(i);
49 yy[i] = o_resol;
50 if(y[i]) yyy[i] = 100.*(yy[i]/y[i]/550.);
51 if(m_debug) cout << "x " << x[i] << " y " << yy[i] << endl;
52 }
53 gr = new TGraph(m_len, x, yy);
54 gr->SetTitle("resolution vs. run");
55 gr->Draw("a*");
56 c1->SaveAs(str_eps2);
57
58 c1->Clear();
59 gr = new TGraph(m_len, x, yyy);
60 gr->SetTitle("relative resolution vs. run (%)");
61 gr->Draw("a*");
62 c1->SaveAs(str_eps3);
63
64}
TString old_path
const int run_end
const int run_begin
bool m_debug
const int max_len
double y[1000]
double x[1000]

Variable Documentation

◆ m_debug

bool m_debug = false

Definition at line 14 of file FirstRung/draw_plots.cxx.

Referenced by draw_plots().

◆ max_len

const int max_len = 10000

Definition at line 13 of file FirstRung/draw_plots.cxx.

Referenced by draw_plots().

◆ run_begin

const int run_begin = minrun

Definition at line 11 of file FirstRung/draw_plots.cxx.

Referenced by draw_plots().

◆ run_end

const int run_end = maxrun

Definition at line 12 of file FirstRung/draw_plots.cxx.

Referenced by draw_plots().