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
a94a5db9
Commit
a94a5db9
authored
Apr 23, 2021
by
Maria Zurek
Browse files
Options
Downloads
Patches
Plain Diff
Convert vectors to scalars in dataframe functions
parent
8096e970
No related branches found
No related tags found
1 merge request
!25
Convert vectors to scalars in dataframe functions
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
benchmarks/barrel_ecal/scripts/emcal_barrel_electrons_analysis.cxx
+6
-14
6 additions, 14 deletions
...s/barrel_ecal/scripts/emcal_barrel_electrons_analysis.cxx
with
6 additions
and
14 deletions
benchmarks/barrel_ecal/scripts/emcal_barrel_electrons_analysis.cxx
+
6
−
14
View file @
a94a5db9
...
...
@@ -37,9 +37,9 @@ void emcal_barrel_electrons_analysis(const char* input_fname = "sim_output/sim_e
// Thrown Energy [GeV]
auto
Ethr
=
[](
std
::
vector
<
dd4pod
::
Geant4ParticleData
>
const
&
input
)
{
std
::
vector
<
double
>
result
;
result
.
push_back
(
TMath
::
Sqrt
(
input
[
2
].
psx
*
input
[
2
].
psx
+
input
[
2
].
psy
*
input
[
2
].
psy
+
input
[
2
].
psz
*
input
[
2
].
psz
+
input
[
2
].
mass
*
input
[
2
]
.
mass
)
)
;
return
result
;
auto
p
=
input
[
2
]
;
auto
energy
=
TMath
::
Sqrt
(
p
.
psx
*
p
.
psx
+
p
.
psy
*
p
.
psy
+
p
.
psz
*
p
.
psz
+
p
.
mass
*
p
.
mass
);
return
energy
;
};
// Number of hits
...
...
@@ -47,23 +47,15 @@ void emcal_barrel_electrons_analysis(const char* input_fname = "sim_output/sim_e
// Energy deposition [GeV]
auto
Esim
=
[](
const
std
::
vector
<
dd4pod
::
CalorimeterHitData
>&
evt
)
{
std
::
vector
<
double
>
result
;
auto
total_edep
=
0.0
;
for
(
const
auto
&
i
:
evt
)
total_edep
+=
i
.
energyDeposit
;
result
.
push_back
(
total_edep
);
return
result
;
return
total_edep
;
};
// 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
;
auto
fsam
=
[](
const
double
sampled
,
const
double
thrown
)
{
return
sampled
/
thrown
;
};
// Define variables
...
...
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