Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
analysis
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
campaigns
analysis
Merge requests
!1
First iteration of S3 run summary
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
First iteration of S3 run summary
s3-run-summary
into
main
Overview
0
Commits
1
Pipelines
1
Changes
2
Open
Wouter Deconinck
requested to merge
s3-run-summary
into
main
3 years ago
Overview
0
Commits
1
Pipelines
1
Changes
2
Expand
0
0
Merge request reports
Compare
main
main (HEAD)
and
latest version
latest version
358c928a
1 commit,
3 years ago
2 files
+
74
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
scripts/s3_run_summary.cxx
0 → 100644
+
42
−
0
Options
#include
<iostream>
#include
<string>
#include
<ROOT/RDataFrame.hxx>
#include
<eicd/ReconstructedParticleData.h>
int
s3_run_summary
(
std
::
string
name
)
{
// determine s3https url
auto
slash
=
name
.
find_first_of
(
"/"
);
if
(
slash
==
std
::
string
::
npos
)
{
std
::
cout
<<
"Error: No slash in file name"
<<
std
::
endl
;
return
-
1
;
}
std
::
string
url
(
"s3https://dtn01.sdcc.bnl.gov:9000/"
+
name
.
substr
(
slash
+
1
));
std
::
cout
<<
"Info: url = "
<<
url
<<
std
::
endl
;
// 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
;
}
// work on range only
auto
d
=
df
.
Range
(
100
)
// number of tracks
.
Define
(
"n_tracks"
,
[](
const
std
::
vector
<
eic
::
ReconstructedParticleData
>
&
p
)
{
return
(
int
)
p
.
size
();
},
{
"ReconstructedParticles"
});
auto
stats_n_tracks
=
d
.
Stats
(
"n_tracks"
);
if
(
stats_n_tracks
->
GetMean
()
<
1.0
)
{
std
::
cout
<<
"Error: too few tracks per events "
<<
std
::
endl
;
stats_n_tracks
->
Print
();
return
-
1
;
}
// success
return
0
;
}
Loading