Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
physics_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
physics_benchmarks
Commits
d04cf57b
Commit
d04cf57b
authored
Sep 16, 2021
by
Wouter Deconinck
Browse files
Options
Downloads
Patches
Plain Diff
Use rdataframe tests
parent
059cef4b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
benchmarks/single/analyze.cxx
+38
-0
38 additions, 0 deletions
benchmarks/single/analyze.cxx
benchmarks/single/single.sh
+1
-1
1 addition, 1 deletion
benchmarks/single/single.sh
with
39 additions
and
1 deletion
benchmarks/single/analyze.cxx
0 → 100644
+
38
−
0
View file @
d04cf57b
#include
<iostream>
#include
<string>
#include
<ROOT/RDataFrame.hxx>
#include
<eicd/ReconstructedParticleData.h>
int
analyze
(
std
::
string
name
)
{
// open dataframe
ROOT
::
RDataFrame
df
(
"events"
,
url
,
{
"mcparticles2"
,
"GeneratedParticles"
,
"ReconstructedParticles"
});
// count total events
auto
count
=
df
.
Count
();
if
(
count
==
0
)
{
std
::
cout
<<
"Error: No events found"
<<
std
::
endl
;
return
-
1
;
}
auto
n_tracks
=
[](
const
std
::
vector
<
eic
::
ReconstructedParticleData
>
&
p
)
{
return
(
int
)
p
.
size
();
};
auto
d
=
df
.
Define
(
"n_tracks_gen"
,
n_tracks
,
{
"GeneratedParticles"
})
.
Define
(
"n_tracks_rec"
,
n_tracks
,
{
"ReconstructedParticles"
})
;
auto
stats_n_tracks_gen
=
d
.
Stats
(
"n_tracks_gen"
);
auto
stats_n_tracks_rec
=
d
.
Stats
(
"n_tracks_rec"
);
if
(
stats_n_tracks_gen
->
GetMean
()
<
1.0
||
stats_n_tracks_rec
->
GetMean
())
{
std
::
cout
<<
"Error: too few tracks per events "
<<
std
::
endl
;
stats_n_tracks_gen
->
Print
();
stats_n_tracks_rec
->
Print
();
return
-
1
;
}
// success
return
0
;
}
This diff is collapsed.
Click to expand it.
benchmarks/single/single.sh
+
1
−
1
View file @
d04cf57b
...
...
@@ -31,7 +31,7 @@ if [[ "$?" -ne "0" ]] ; then
fi
# Analysis
root
-l
-b
-q
${
JUGGLER_REC_FILE
}
-e
'events->Scan("@ReconstructedParticles.size()","","",10)'
root
-l
-b
-q
"benchmarks/single/analyze.cxx+(
\"
${
JUGGLER_REC_FILE
}
\"
)"
if
[[
"
$?
"
-ne
"0"
]]
;
then
echo
"ERROR analysis failed"
exit
1
...
...
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