BOSS
7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
DataBase/tau_mode.c
Go to the documentation of this file.
1
{
2
gROOT->Reset();
3
4
TFile *
f1
=
new
TFile(
"YYYY/m_root_dir/LumTau_XXXX.root"
);
5
TTree *
data
=event;
6
7
Double_t
time
= 0.0,
dltphi
= 0.0,
costht1
= 0.0,
costht2
= 0.0,
e1
= 0.0,
e2
= 0.0,
etot
= 0.0,
phi1
= 0.0,
phi2
= 0.0;
8
Int_t
nentries
= 0;
9
10
data
->SetBranchAddress(
"time"
,&
time
);
11
data
->SetBranchAddress(
"dltphi"
,&
dltphi
);
12
data
->SetBranchAddress(
"costht1"
,&
costht1
);
13
data
->SetBranchAddress(
"costht2"
,&
costht2
);
14
data
->SetBranchAddress(
"e1"
,&
e1
);
15
data
->SetBranchAddress(
"e2"
,&
e2
);
16
data
->SetBranchAddress(
"etot"
,&
etot
);
17
data
->SetBranchAddress(
"phi1"
,&
phi1
);
18
data
->SetBranchAddress(
"phi2"
,&
phi2
);
19
TH1D *
hdltphi
[10];
20
21
for
(Int_t i=0;i<10;i++)
22
{
23
hdltphi
[i] =
new
TH1D(
" "
,
"dltphi distribution"
,50,-50.,50.);
24
}
25
26
TH1 *
htime
=
new
TH1D(
"htime"
,
"time"
, 80, -10., 10.);
27
Double_t
timemin
= 0.0,
timemax
= 0.0;
28
nentries
= (Int_t)
data
->GetEntries();
29
30
data
->GetEntry(0);
31
timemin
=
time
;
32
data
->GetEntry((
nentries
- 1));
33
timemax
=
time
;
34
35
Double_t
difft
=
timemax
-
timemin
;
36
Double_t
xtime
[11],
lum
[10];
37
for
(Int_t i=0;i<11;i++)
38
{
39
xtime
[i]=
timemin
+(
difft
/10.)*i;
40
}
41
for
(Int_t i=0;i<10;i++)
42
{
43
for
(Int_t j=0;j<
nentries
;j++)
44
{
45
data
->GetEntry(j);
46
bool
lumcut =
e1
>1.2&&
e2
>0.8&&fabs(
costht1
)<0.8&&
47
fabs(
costht2
)<0.8&&fabs(
dltphi
+1.055)>2.&&
48
fabs(
dltphi
+1.055)<25.&&
etot
<4.0;
49
if
(lumcut&&
time
>
xtime
[i]&&
time
<
xtime
[i+1])
50
{
51
hdltphi
[i]->Fill(
dltphi
);
52
}
53
}
54
}
55
56
Int_t
nevt
[10];
57
Double_t
x
[10];
58
for
(Int_t i=0;i<10;i++)
59
{
60
nevt
[i] =
hdltphi
[i]->GetEntries();
61
x
[i]=
xtime
[i+1]-
xtime
[0];
62
lum
[i]=
nevt
[i]/(0.2*2514);
63
}
64
65
const
Int_t
n
= 10;
66
TF1 *
g1
=
new
TF1(
"g1"
,
"[0]*exp(-x/[1])"
,0,10000.);
67
g1
->SetParameters(
lum
[0],1e+4.);
68
g1
->SetLineColor(2);
69
TGraph*
gr
=
new
TGraph(
n
,
x
,
lum
);
70
gr
->SetLineColor(2);
71
gr
->SetLineWidth(2);
72
gr
->SetMarkerColor(4);
73
gr
->SetMarkerStyle(21);
74
gr
->SetTitle(
"BbLum_000XXXX"
);
75
gr
->GetXaxis()->SetTitle(
"Time"
);
76
gr
->GetYaxis()->SetTitle(
"Luminosity"
);
77
gr
->Fit(
"g1"
,
"R"
);
78
// gr->Draw("ap");
79
80
std::ofstream
m_outputFile
;
81
m_outputFile
.open(
"YYYY/m_txt_dir/LumTau_XXXX.txt"
, ios_base::app);
82
m_outputFile
<<XXXX<<
" "
<<
difft
<<
" "
<<
g1
->GetParameter(0)<<
" "
<<(
g1
->GetParameter(0) *
exp
(- 1.0 *
difft
/ (
g1
->GetParameter(1))))<<
" "
<<
g1
->GetParameter(1)<<endl;
83
m_outputFile
.close();
84
85
gROOT->ProcessLine(
".q"
);
86
}
timemax
Double_t timemax
Definition:
DataBase/tau_mode.c:27
n
const Int_t n
Definition:
DataBase/tau_mode.c:65
m_outputFile
std::ofstream m_outputFile
Definition:
DataBase/tau_mode.c:80
phi2
Double_t phi2
Definition:
DataBase/tau_mode.c:7
data
TTree * data
Definition:
DataBase/tau_mode.c:5
lum
Double_t lum[10]
Definition:
DataBase/tau_mode.c:36
f1
TFile * f1
Definition:
DataBase/tau_mode.c:4
costht2
Double_t costht2
Definition:
DataBase/tau_mode.c:7
etot
Double_t etot
Definition:
DataBase/tau_mode.c:7
hdltphi
TH1D * hdltphi[10]
Definition:
DataBase/tau_mode.c:19
g1
TF1 * g1
Definition:
DataBase/tau_mode.c:66
x
Double_t x[10]
Definition:
DataBase/tau_mode.c:57
dltphi
Double_t dltphi
Definition:
DataBase/tau_mode.c:7
phi1
Double_t phi1
Definition:
DataBase/tau_mode.c:7
timemin
Double_t timemin
Definition:
DataBase/tau_mode.c:27
htime
TH1 * htime
Definition:
DataBase/tau_mode.c:26
costht1
Double_t costht1
Definition:
DataBase/tau_mode.c:7
nevt
Int_t nevt[10]
Definition:
DataBase/tau_mode.c:56
gr
TGraph * gr
Definition:
DataBase/tau_mode.c:69
time
Double_t time
Definition:
DataBase/tau_mode.c:7
e1
Double_t e1
Definition:
DataBase/tau_mode.c:7
xtime
Double_t xtime[11]
Definition:
DataBase/tau_mode.c:36
nentries
Int_t nentries
Definition:
DataBase/tau_mode.c:8
difft
Double_t difft
Definition:
DataBase/tau_mode.c:35
e2
Double_t e2
Definition:
DataBase/tau_mode.c:7
exp
EvtComplex exp(const EvtComplex &c)
Definition:
EvtComplex.hh:252
source
LumTauAlg
LumTauAlg-00-00-08
share
DataBase
tau_mode.c
Generated by
1.9.6