BOSS
7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
draw_separation.cxx
Go to the documentation of this file.
1
void
draw_separation
(){
2
3
int
step = 3;
4
if
(step == 1){
5
TFile *
f
=
new
TFile(
"pion.root"
);
6
TTree *
t
= (TTree*)
f
->Get(
"n103"
);
7
8
TFile *f_save =
new
TFile(
"figs/histo.root"
,
"recreate"
);
9
TH2F *vec_h[5];
10
for
(
int
i=0; i<5; i++){
11
vec_h[i] =
new
TH2F(Form(
"h%d"
,i), Form(
"h%d"
,i), 100, 0., 1.5, 100, 0., 20.);
12
}
13
14
for
(
int
j=0; j<5; j++){
15
cout << j <<
" th project"
<< endl;
16
t
->Project(Form(
"h%d"
,j), Form(
"abs(expectid[2]-expectid[%d])/sqrt(sigmaid[2]*sigmaid[2] + sigmaid[%d]*sigmaid[%d]):ptrk"
, j, j, j));
17
}
18
19
f_save->cd();
20
for
(
int
k=0; k<5; k++) vec_h[k]->
Write
();
21
f_save->Close();
22
}
23
24
else
if
(step == 2){
25
TFile *
f
=
new
TFile(
"figs/histo.root"
,
"update"
);
26
TProfile *vec_p[5];
27
for
(
int
i=0; i<5; i++){
28
TH2F *h_temp = (TH2F*)gDirectory->Get(Form(
"h%d"
,i));
29
vec_p[i] = h_temp->ProfileX();
30
vec_p[i]->Write();
31
delete
h_temp;
32
}
33
f
->Close();
34
}
35
36
else
if
(step == 3){
37
TFile *
f
=
new
TFile(
"figs/histo.root"
,
"update"
);
38
TProfile *vec_p[5];
39
for
(
int
i=0; i<5; i++){
40
vec_p[i] = (TProfile*)
f
->Get(Form(
"h%d_pfx"
,i));
41
}
42
TCanvas *c1 =
new
TCanvas(
"c1"
,
"separation power"
, 10, 10, 800, 642);
43
vec_p[3]->Draw();
44
vec_p[0]->Draw(
"same"
);
45
vec_p[4]->Draw(
"same"
);
46
c1->SaveAs(
"figs/sepa.C"
);
47
f
->Close();
48
}
49
50
}
Write
curve Write()
f
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
t
TTree * t
Definition:
binning.cxx:23
draw_separation
void draw_separation()
Definition:
draw_separation.cxx:1
source
Mdc
DedxCalibAlg
DedxCalibAlg-00-02-01
share
template
Simulation
hadron_track
pion
draw_separation.cxx
Generated by
1.9.6