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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIC
benchmarks
detector_benchmarks
Commits
a931ef85
Commit
a931ef85
authored
Apr 28, 2021
by
Marshall Scott
Browse files
Options
Downloads
Patches
Plain Diff
checking include issues
parent
4d8ab8d2
No related branches found
No related tags found
1 merge request
!24
Resolve "pi0 resolution for ECal barrel"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
benchmarks/barrel_ecal/scripts/emcal_barrel_pions_analysis.cxx
+11
-24
11 additions, 24 deletions
...marks/barrel_ecal/scripts/emcal_barrel_pions_analysis.cxx
with
11 additions
and
24 deletions
benchmarks/barrel_ecal/scripts/emcal_barrel_pions_analysis.cxx
+
11
−
24
View file @
a931ef85
...
...
@@ -9,9 +9,9 @@
#include
"dd4pod/Geant4ParticleCollection.h"
#include
"dd4pod/CalorimeterHitCollection.h"
//
#include
<detector_benchmarks/include/
benchmark.h
>
//
#include "mt.h"
//
#include "util.h"
#include
"
benchmark.h
"
#include
"mt.h"
#include
"util.h"
#include
"TCanvas.h"
#include
"TStyle.h"
...
...
@@ -20,8 +20,6 @@
#include
"TF1.h"
#include
"TH1D.h"
#include
<TFitResult.h>
#include
"TSystem.h"
#include
<fstream>
using
ROOT
::
RDataFrame
;
using
namespace
ROOT
::
VecOps
;
...
...
@@ -85,18 +83,8 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
return
result
;
};
// Sampling fraction = Esampling / Ethrown
//
Layer
Sampling fraction = Esampling / Ethrown
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
);
}
return
result
;
};
// Sampling fraction = Esampling / Ethrown, revised
auto
fsam2
=
[](
const
std
::
vector
<
double
>&
sampled
,
const
std
::
vector
<
double
>&
thrown
)
{
std
::
vector
<
double
>
result
;
auto
it_sam
=
sampled
.
cbegin
();
auto
it_thr
=
thrown
.
cbegin
();
...
...
@@ -132,8 +120,7 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
auto
d1
=
d0
.
Define
(
"Ethr"
,
Ethr
,
{
"mcparticles"
})
.
Define
(
"nhits"
,
nhits
,
{
"EcalBarrelHits"
})
.
Define
(
"Esim"
,
Esim
,
{
"EcalBarrelHits"
})
//.Define("fsam", fsam, {"Esim","Ethr"})
.
Define
(
"fsam"
,
fsam2
,
{
"Esim"
,
"Ethr"
})
.
Define
(
"fsam"
,
fsam
,
{
"Esim"
,
"Ethr"
})
.
Define
(
"dE"
,
eResol
,
{
"Esim"
,
"Ethr"
})
.
Define
(
"dE_rel"
,
eResol_rel
,
{
"Esim"
,
"Ethr"
})
;
...
...
@@ -142,7 +129,7 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
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
hfsam
=
d1
.
Histo1D
({
"hfsam"
,
"
Layer
Sampling Fraction;
Layer
Sampling Fraction; Events"
,
100
,
0.0
,
0.1
},
"fsam"
);
// Event Counts
auto
nevents_thrown
=
d1
.
Count
();
...
...
@@ -190,8 +177,8 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
//Energy Resolution Work
auto
hdE
=
d1
.
Histo1D
({
"hdE"
,
"dE; dE[GeV]; Events"
,
20
,
-
7.5
,
7.5
},
"dE"
);
//changed from 100
auto
hdE_rel
=
d1
.
Histo1D
({
"hdE_rel"
,
"dE Relative; dE Relative; Events"
,
20
,
-
7.5
,
7.5
},
"dE_rel"
);
//changed from 100
hdE_rel
->
Fit
(
"gaus"
,
""
,
""
,
-
7.5
,
7.5
);
auto
hdE_rel
=
d1
.
Histo1D
({
"hdE_rel"
,
"dE Relative; dE Relative; Events"
,
20
,
-
2
,
2
},
"dE_rel"
);
//changed from 100
hdE_rel
->
Fit
(
"gaus"
,
""
,
""
,
-
2
,
2
);
double
*
res
=
hdE_rel
->
GetFunction
(
"gaus"
)
->
GetParameters
();
//Pass/Fail
...
...
@@ -202,7 +189,7 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
pion0_energy_resolution.fail(res[2]);
}
*/
std
::
printf
(
"Energy Resolution is %f
\n
"
,
res
[
2
]);
//
std::printf("Energy Resolution is %f\n", res[2]);
//Energy Resolution Histogram Plotting
auto
*
cdE
=
new
TCanvas
(
"cdE"
,
"cdE"
,
700
,
500
);
...
...
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