Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
reconstruction_benchmarks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIC
benchmarks
reconstruction_benchmarks
Merge requests
!10
Electron data set
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Electron data set
jihee.kim/reconstruction_benchmarks:electron
into
master
Overview
0
Commits
17
Pipelines
0
Changes
8
Merged
Jihee Kim
requested to merge
jihee.kim/reconstruction_benchmarks:electron
into
master
4 years ago
Overview
0
Commits
17
Pipelines
0
Changes
8
Expand
Energy range as an input
A script to read input ROOT file
A script for energy resolution
Edited
4 years ago
by
Jihee Kim
0
0
Merge request reports
Compare
master
version 17
371cd218
4 years ago
version 16
56580d7b
4 years ago
version 15
54511067
4 years ago
version 14
afc8f1ea
4 years ago
version 13
611ccd4c
4 years ago
version 12
29d31e19
4 years ago
version 11
f5227904
4 years ago
version 10
569c71c2
4 years ago
version 9
782fd5d4
4 years ago
version 8
ae42d90d
4 years ago
version 7
d342fffe
4 years ago
version 6
787ae1ca
4 years ago
version 5
5a76c249
4 years ago
version 4
b7a0c854
4 years ago
version 3
fb9fadff
4 years ago
version 2
6551f328
4 years ago
version 1
191495c6
4 years ago
master (base)
and
latest version
latest version
203270c6
17 commits,
4 years ago
version 17
371cd218
16 commits,
4 years ago
version 16
56580d7b
15 commits,
4 years ago
version 15
54511067
14 commits,
4 years ago
version 14
afc8f1ea
13 commits,
4 years ago
version 13
611ccd4c
12 commits,
4 years ago
version 12
29d31e19
12 commits,
4 years ago
version 11
f5227904
11 commits,
4 years ago
version 10
569c71c2
10 commits,
4 years ago
version 9
782fd5d4
9 commits,
4 years ago
version 8
ae42d90d
8 commits,
4 years ago
version 7
d342fffe
7 commits,
4 years ago
version 6
787ae1ca
6 commits,
4 years ago
version 5
5a76c249
5 commits,
4 years ago
version 4
b7a0c854
4 commits,
4 years ago
version 3
fb9fadff
3 commits,
4 years ago
version 2
6551f328
2 commits,
4 years ago
version 1
191495c6
1 commit,
4 years ago
8 files
+
313
−
35
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
8
Search (e.g. *.vue) (Ctrl+P)
ecal/scripts/cal_eng_res.C
0 → 100644
+
84
−
0
Options
int
cal_eng_res
(
const
char
*
input_fname
=
"sim_output/read_eng_output.root"
)
{
// Setting Figures
gROOT
->
SetStyle
(
"Plain"
);
gStyle
->
SetLineWidth
(
3
);
gStyle
->
SetOptStat
(
"nem"
);
gStyle
->
SetOptFit
(
1
);
gStyle
->
SetPadTickX
(
1
);
gStyle
->
SetPadTickY
(
1
);
gStyle
->
SetPadGridX
(
1
);
gStyle
->
SetPadGridY
(
1
);
gStyle
->
SetPadLeftMargin
(
0
.
14
);
// Read ROOT File
TFile
*
f
=
new
TFile
(
input_fname
,
"r"
);
TTree
*
tEngRes
=
(
TTree
*
)
f
->
Get
(
"tEngRes"
);
// Variables from ROOT tree
Int_t
ievent
;
Double_t
tot_clust_eng
;
// total cluster energy [GeV]
Int_t
ncluster
;
// number of clusters per event
Double_t
mc_eng
;
// thrown energy [GeV]
Double_t
sim_tru_eng
;
// total truth simulated energy [GeV]
Double_t
sim_eng
;
// total simulated energy [GeV]
// Read Branches
tEngRes
->
SetBranchAddress
(
"ievent"
,
&
ievent
);
tEngRes
->
SetBranchAddress
(
"tot_clust_eng"
,
&
tot_clust_eng
);
tEngRes
->
SetBranchAddress
(
"ncluster"
,
&
ncluster
);
tEngRes
->
SetBranchAddress
(
"mc_eng"
,
&
mc_eng
);
tEngRes
->
SetBranchAddress
(
"sim_tru_eng"
,
&
sim_tru_eng
);
tEngRes
->
SetBranchAddress
(
"sim_eng"
,
&
sim_eng
);
// Setting for Canvas
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
"c1"
,
700
,
500
);
TCanvas
*
c2
=
new
TCanvas
(
"c2"
,
"c2"
,
700
,
500
);
// Declare Histrograms
TH1D
*
h1
=
new
TH1D
(
"hEnergyRes"
,
"Energy Resolution"
,
100
,
-
0
.
3
,
0
.
3
);
TH1D
*
h2
=
new
TH1D
(
"hEnergyResCUT"
,
"Energy Resolution with CUT"
,
100
,
-
0
.
3
,
0
.
3
);
// Variables that used in calculations
Double_t
diff_energy
;
Double_t
eng_res
;
Int_t
nentries
=
tEngRes
->
GetEntries
();
for
(
Int_t
ievent
=
0
;
ievent
<
nentries
;
ievent
++
)
{
tEngRes
->
GetEntry
(
ievent
);
if
(
ncluster
==
1
)
{
diff_energy
=
tot_clust_eng
-
mc_eng
;
eng_res
=
(
diff_energy
/
mc_eng
);
cout
<<
tot_clust_eng
<<
"
\t
"
<<
mc_eng
<<
"
\t
"
<<
eng_res
<<
endl
;
h1
->
Fill
(
eng_res
,
1
.
0
);
if
(
tot_clust_eng
>
0
.
5
)
h2
->
Fill
(
eng_res
,
1
.
0
);
}
}
// Drawing and Saving Figures
c1
->
cd
();
h1
->
SetLineColor
(
kBlue
);
h1
->
SetLineWidth
(
2
);
h1
->
GetXaxis
()
->
SetTitle
(
"#DeltaE/E"
);
h1
->
GetYaxis
()
->
SetTitle
(
"events"
);
h1
->
GetYaxis
()
->
SetTitleOffset
(
1
.
4
);
h1
->
Fit
(
"gaus"
);
h1
->
Draw
();
c1
->
SaveAs
(
"results/hEngRes.png"
);
c2
->
cd
();
h2
->
SetLineColor
(
kBlue
);
h2
->
SetLineWidth
(
2
);
h2
->
GetXaxis
()
->
SetTitle
(
"#DeltaE/E"
);
h2
->
GetYaxis
()
->
SetTitle
(
"events"
);
h2
->
GetYaxis
()
->
SetTitleOffset
(
1
.
4
);
h2
->
Fit
(
"gaus"
);
h2
->
Draw
();
c2
->
SaveAs
(
"results/hEngRes_CUT.png"
);
return
0
;
}
Loading