Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
detector_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
detector_benchmarks
Commits
6efe2d3a
Commit
6efe2d3a
authored
4 years ago
by
Whitney Armstrong
Browse files
Options
Downloads
Patches
Plain Diff
modified: scripts/emcal_barrel_electrons_analysis.cxx
parent
c8277630
Branches
Branches containing commit
No related tags found
1 merge request
!20
Restructuring repo
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
benchmarks/calorimeters/scripts/emcal_barrel_electrons_analysis.cxx
+68
-51
68 additions, 51 deletions
.../calorimeters/scripts/emcal_barrel_electrons_analysis.cxx
with
68 additions
and
51 deletions
benchmarks/calorimeters/scripts/emcal_barrel_electrons_analysis.cxx
+
68
−
51
View file @
6efe2d3a
...
...
@@ -52,73 +52,90 @@ void emcal_barrel_electrons_analysis(const char* input_fname = "sim_output/sim_e
for
(
const
auto
&
i
:
evt
)
total_edep
+=
i
.
energyDeposit
;
result
.
push_back
(
total_edep
);
return
result
;
return
result
;
};
// Sampling fraction = Esampling / Ethrown
auto
fsam
=
[](
const
std
::
vector
<
double
>&
sampled
,
const
std
::
vector
<
double
>&
thrown
)
{
auto
fsam
=
[](
const
std
::
vector
<
double
>&
sampled
,
const
std
::
vector
<
double
>&
thrown
)
{
std
::
vector
<
double
>
result
;
for
(
const
auto
&
E1
:
thrown
)
{
for
(
const
auto
&
E2
:
sampled
)
result
.
push_back
(
E2
/
E1
);
result
.
push_back
(
E2
/
E1
);
}
return
result
;
};
// Define variables
auto
d1
=
d0
.
Define
(
"Ethr"
,
Ethr
,
{
"mcparticles"
})
.
Define
(
"nhits"
,
nhits
,
{
"EcalBarrelHits"
})
.
Define
(
"Esim"
,
Esim
,
{
"EcalBarrelHits"
})
.
Define
(
"fsam"
,
fsam
,
{
"Esim"
,
"Ethr"
})
;
auto
d1
=
d0
.
Define
(
"Ethr"
,
Ethr
,
{
"mcparticles"
})
.
Define
(
"nhits"
,
nhits
,
{
"EcalBarrelHits"
})
.
Define
(
"Esim"
,
Esim
,
{
"EcalBarrelHits"
})
.
Define
(
"fsam"
,
fsam
,
{
"Esim"
,
"Ethr"
});
// Define Histograms
auto
hEthr
=
d1
.
Histo1D
({
"hEthr"
,
"Thrown Energy; Thrown Energy [GeV]; Events"
,
100
,
0.0
,
7.5
},
"Ethr"
);
auto
hNhits
=
d1
.
Histo1D
({
"hNhits"
,
"Number of hits per events; Number of hits; Events"
,
100
,
0.0
,
2000.0
},
"nhits"
);
auto
hEsim
=
d1
.
Histo1D
({
"hEsim"
,
"Energy Deposit; Energy Deposit [GeV]; Events"
,
100
,
0.0
,
1.0
},
"Esim"
);
auto
hfsam
=
d1
.
Histo1D
({
"hfsam"
,
"Sampling Fraction; Sampling Fraction; Events"
,
100
,
0.0
,
0.1
},
"fsam"
);
auto
hEthr
=
d1
.
Histo1D
(
{
"hEthr"
,
"Thrown Energy; Thrown Energy [GeV]; Events"
,
100
,
0.0
,
7.5
},
"Ethr"
);
auto
hNhits
=
d1
.
Histo1D
({
"hNhits"
,
"Number of hits per events; Number of hits; Events"
,
100
,
0.0
,
2000.0
},
"nhits"
);
auto
hEsim
=
d1
.
Histo1D
(
{
"hEsim"
,
"Energy Deposit; Energy Deposit [GeV]; Events"
,
100
,
0.0
,
1.0
},
"Esim"
);
auto
hfsam
=
d1
.
Histo1D
(
{
"hfsam"
,
"Sampling Fraction; Sampling Fraction; Events"
,
100
,
0.0
,
0.1
},
"fsam"
);
// Event Counts
auto
nevents_thrown
=
d1
.
Count
();
auto
nevents_thrown
=
d1
.
Count
();
std
::
cout
<<
"Number of Thrown Events: "
<<
(
*
nevents_thrown
)
<<
"
\n
"
;
// Draw Histograms
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
"c1"
,
700
,
500
);
c1
->
SetLogy
(
1
);
hEthr
->
GetYaxis
()
->
SetTitleOffset
(
1.4
);
hEthr
->
SetLineWidth
(
2
);
hEthr
->
SetLineColor
(
kBlue
);
hEthr
->
DrawClone
();
c1
->
SaveAs
(
"results/emcal_barrel_electrons_Ethr.png"
);
c1
->
SaveAs
(
"results/emcal_barrel_electrons_Ethr.pdf"
);
TCanvas
*
c2
=
new
TCanvas
(
"c2"
,
"c2"
,
700
,
500
);
c2
->
SetLogy
(
1
);
hNhits
->
GetYaxis
()
->
SetTitleOffset
(
1.4
);
hNhits
->
SetLineWidth
(
2
);
hNhits
->
SetLineColor
(
kBlue
);
hNhits
->
DrawClone
();
c2
->
SaveAs
(
"results/emcal_barrel_electrons_nhits.png"
);
c2
->
SaveAs
(
"results/emcal_barrel_electrons_nhits.pdf"
);
TCanvas
*
c3
=
new
TCanvas
(
"c3"
,
"c3"
,
700
,
500
);
c3
->
SetLogy
(
1
);
hEsim
->
GetYaxis
()
->
SetTitleOffset
(
1.4
);
hEsim
->
SetLineWidth
(
2
);
hEsim
->
SetLineColor
(
kBlue
);
hEsim
->
DrawClone
();
c3
->
SaveAs
(
"results/emcal_barrel_electrons_Esim.png"
);
c3
->
SaveAs
(
"results/emcal_barrel_electrons_Esim.pdf"
);
TCanvas
*
c4
=
new
TCanvas
(
"c4"
,
"c4"
,
700
,
500
);
c4
->
SetLogy
(
1
);
hfsam
->
GetYaxis
()
->
SetTitleOffset
(
1.4
);
hfsam
->
SetLineWidth
(
2
);
hfsam
->
SetLineColor
(
kBlue
);
hfsam
->
Fit
(
"gaus"
,
""
,
""
,
0.01
,
0.1
);
hfsam
->
GetFunction
(
"gaus"
)
->
SetLineWidth
(
2
);
hfsam
->
GetFunction
(
"gaus"
)
->
SetLineColor
(
kRed
);
hfsam
->
DrawClone
();
c4
->
SaveAs
(
"results/emcal_barrel_electrons_fsam.png"
);
c4
->
SaveAs
(
"results/emcal_barrel_electrons_fsam.pdf"
);
{
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
"c1"
,
700
,
500
);
c1
->
SetLogy
(
1
);
auto
h
=
hEthr
->
DrawCopy
();
h
->
GetYaxis
()
->
SetTitleOffset
(
1.4
);
h
->
SetLineWidth
(
2
);
h
->
SetLineColor
(
kBlue
);
c1
->
SaveAs
(
"results/emcal_barrel_electrons_Ethr.png"
);
c1
->
SaveAs
(
"results/emcal_barrel_electrons_Ethr.pdf"
);
}
{
TCanvas
*
c2
=
new
TCanvas
(
"c2"
,
"c2"
,
700
,
500
);
c2
->
SetLogy
(
1
);
auto
h
=
hNhits
->
DrawCopy
();
h
->
GetYaxis
()
->
SetTitleOffset
(
1.4
);
h
->
SetLineWidth
(
2
);
h
->
SetLineColor
(
kBlue
);
c2
->
SaveAs
(
"results/emcal_barrel_electrons_nhits.png"
);
c2
->
SaveAs
(
"results/emcal_barrel_electrons_nhits.pdf"
);
}
{
TCanvas
*
c3
=
new
TCanvas
(
"c3"
,
"c3"
,
700
,
500
);
c3
->
SetLogy
(
1
);
auto
h
=
hEsim
->
DrawCopy
();
h
->
GetYaxis
()
->
SetTitleOffset
(
1.4
);
h
->
SetLineWidth
(
2
);
h
->
SetLineColor
(
kBlue
);
c3
->
SaveAs
(
"results/emcal_barrel_electrons_Esim.png"
);
c3
->
SaveAs
(
"results/emcal_barrel_electrons_Esim.pdf"
);
}
{
TCanvas
*
c4
=
new
TCanvas
(
"c4"
,
"c4"
,
700
,
500
);
c4
->
SetLogy
(
1
);
auto
h
=
hfsam
->
DrawCopy
();
h
->
GetYaxis
()
->
SetTitleOffset
(
1.4
);
h
->
SetLineWidth
(
2
);
h
->
SetLineColor
(
kBlue
);
h
->
Fit
(
"gaus"
,
""
,
""
,
0.01
,
0.1
);
h
->
GetFunction
(
"gaus"
)
->
SetLineWidth
(
2
);
h
->
GetFunction
(
"gaus"
)
->
SetLineColor
(
kRed
);
c4
->
SaveAs
(
"results/emcal_barrel_electrons_fsam.png"
);
c4
->
SaveAs
(
"results/emcal_barrel_electrons_fsam.pdf"
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment