Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
detector_benchmarks
Manage
Activity
Members
Labels
Plan
Issues
21
Issue boards
Milestones
Wiki
Code
Merge requests
7
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
af5f691e
Commit
af5f691e
authored
3 years ago
by
Maria Zurek
Committed by
Jihee Kim
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Convert vectors to scalars in dataframe functions
parent
8096e970
No related branches found
Branches containing commit
No related tags found
1 merge request
!25
Convert vectors to scalars in dataframe functions
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
benchmarks/barrel_ecal/config.yml
+1
-1
1 addition, 1 deletion
benchmarks/barrel_ecal/config.yml
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
7 additions
and
15 deletions
benchmarks/barrel_ecal/config.yml
+
1
−
1
View file @
af5f691e
...
@@ -31,7 +31,7 @@ collect_results:barrel_ecal:
...
@@ -31,7 +31,7 @@ collect_results:barrel_ecal:
extends
:
.det_benchmark
extends
:
.det_benchmark
stage
:
collect
stage
:
collect
needs
:
needs
:
-
[
"
bench:emcal_barrel_pions"
,
"
sim
:emcal_barrel_electrons"
]
-
[
"
bench:emcal_barrel_pions"
,
"
bench
:emcal_barrel_electrons"
]
script
:
script
:
-
ls -lrht
-
ls -lrht
This diff is collapsed.
Click to expand it.
benchmarks/barrel_ecal/scripts/emcal_barrel_electrons_analysis.cxx
+
6
−
14
View file @
af5f691e
...
@@ -37,9 +37,9 @@ void emcal_barrel_electrons_analysis(const char* input_fname = "sim_output/sim_e
...
@@ -37,9 +37,9 @@ void emcal_barrel_electrons_analysis(const char* input_fname = "sim_output/sim_e
// Thrown Energy [GeV]
// Thrown Energy [GeV]
auto
Ethr
=
[](
std
::
vector
<
dd4pod
::
Geant4ParticleData
>
const
&
input
)
{
auto
Ethr
=
[](
std
::
vector
<
dd4pod
::
Geant4ParticleData
>
const
&
input
)
{
std
::
vector
<
double
>
result
;
auto
p
=
input
[
2
]
;
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
)
)
;
auto
energy
=
TMath
::
Sqrt
(
p
.
psx
*
p
.
psx
+
p
.
psy
*
p
.
psy
+
p
.
psz
*
p
.
psz
+
p
.
mass
*
p
.
mass
);
return
result
;
return
energy
;
};
};
// Number of hits
// Number of hits
...
@@ -47,23 +47,15 @@ void emcal_barrel_electrons_analysis(const char* input_fname = "sim_output/sim_e
...
@@ -47,23 +47,15 @@ void emcal_barrel_electrons_analysis(const char* input_fname = "sim_output/sim_e
// Energy deposition [GeV]
// Energy deposition [GeV]
auto
Esim
=
[](
const
std
::
vector
<
dd4pod
::
CalorimeterHitData
>&
evt
)
{
auto
Esim
=
[](
const
std
::
vector
<
dd4pod
::
CalorimeterHitData
>&
evt
)
{
std
::
vector
<
double
>
result
;
auto
total_edep
=
0.0
;
auto
total_edep
=
0.0
;
for
(
const
auto
&
i
:
evt
)
for
(
const
auto
&
i
:
evt
)
total_edep
+=
i
.
energyDeposit
;
total_edep
+=
i
.
energyDeposit
;
result
.
push_back
(
total_edep
);
return
total_edep
;
return
result
;
};
};
// Sampling fraction = Esampling / Ethrown
// Sampling fraction = Esampling / Ethrown
auto
fsam
=
[](
const
std
::
vector
<
double
>&
sampled
,
auto
fsam
=
[](
const
double
sampled
,
const
double
thrown
)
{
const
std
::
vector
<
double
>&
thrown
)
{
return
sampled
/
thrown
;
std
::
vector
<
double
>
result
;
for
(
const
auto
&
E1
:
thrown
)
{
for
(
const
auto
&
E2
:
sampled
)
result
.
push_back
(
E2
/
E1
);
}
return
result
;
};
};
// Define variables
// 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