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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIC
benchmarks
physics_benchmarks
Merge requests
!71
cleanup dvcs to serve as example
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
cleanup dvcs to serve as example
dvcs_cleanup
into
master
Overview
0
Commits
11
Pipelines
0
Changes
5
Merged
Whitney Armstrong
requested to merge
dvcs_cleanup
into
master
3 years ago
Overview
0
Commits
11
Pipelines
0
Changes
5
Expand
0
0
Merge request reports
Compare
master
version 10
9986cc0d
3 years ago
version 9
f824b626
3 years ago
version 8
85318fa0
3 years ago
version 7
cc5e1d2a
3 years ago
version 6
7439d24d
3 years ago
version 5
24e0db90
3 years ago
version 4
0c421ec0
3 years ago
version 3
e229b77b
3 years ago
version 2
4c6f1592
3 years ago
version 1
8e544a46
3 years ago
master (base)
and
latest version
latest version
a45df340
11 commits,
3 years ago
version 10
9986cc0d
10 commits,
3 years ago
version 9
f824b626
9 commits,
3 years ago
version 8
85318fa0
8 commits,
3 years ago
version 7
cc5e1d2a
7 commits,
3 years ago
version 6
7439d24d
6 commits,
3 years ago
version 5
24e0db90
5 commits,
3 years ago
version 4
0c421ec0
4 commits,
3 years ago
version 3
e229b77b
3 commits,
3 years ago
version 2
4c6f1592
2 commits,
3 years ago
version 1
8e544a46
1 commit,
3 years ago
5 files
+
169
−
85
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
benchmarks/dvcs/scripts/dvcs_tests.cxx
+
22
−
16
Options
#include
<ROOT/RDataFrame.hxx>
#include
<cmath>
#include
"fmt/color.h"
#include
"fmt/core.h"
#include
<iostream>
#include
<string>
#include
<vector>
#include
"ROOT/RDataFrame.hxx"
#include
<nlohmann/json.hpp>
using
json
=
nlohmann
::
json
;
R__LOAD_LIBRARY
(
libfmt
.
so
)
#include
"fmt/core.h"
#include
"fmt/color.h"
R__LOAD_LIBRARY
(
libeicd
.
so
)
R__LOAD_LIBRARY
(
libDD4pod
.
so
)
#include
"dd4pod/Geant4ParticleCollection.h"
#include
"eicd/TrackParametersCollection.h"
#include
"eicd/ClusterCollection.h"
#include
"eicd/ClusterData.h"
#include
"eicd/ReconstructedParticleCollection.h"
#include
"eicd/
ReconstructedParticleData
.h"
#include
"eicd/
BasicParticleCollection
.h"
using
ROOT
::
RDataFrame
;
using
namespace
ROOT
::
VecOps
;
@@ -58,7 +64,7 @@ auto fourvec = [](ROOT::VecOps::RVec<dd4pod::Geant4ParticleData> const& in) {
}
return
result
;
};
auto
dum
fourvec
=
[](
ROOT
::
VecOps
::
RVec
<
eic
::
ReconstructedParticleData
>
const
&
in
)
{
auto
rec
fourvec
=
[](
ROOT
::
VecOps
::
RVec
<
eic
::
ReconstructedParticleData
>
const
&
in
)
{
std
::
vector
<
ROOT
::
Math
::
PxPyPzMVector
>
result
;
ROOT
::
Math
::
PxPyPzMVector
lv
;
for
(
size_t
i
=
0
;
i
<
in
.
size
();
++
i
)
{
@@ -106,34 +112,34 @@ void dvcs_tests(const char* fname = "rec_dvcs.root"){
auto
df0
=
df
.
Define
(
"isThrown"
,
"mcparticles2.genStatus == 1"
)
.
Define
(
"thrownParticles"
,
"mcparticles2[isThrown]"
)
.
Define
(
"thrownP"
,
fourvec
,
{
"thrownParticles"
})
.
Define
(
"
dumR
ec"
,
dum
fourvec
,
{
"ReconstructedParticles"
})
.
Define
(
"
dum
NPart"
,
"
dumR
ec.size()"
)
.
Define
(
"
r
ec
P
"
,
rec
fourvec
,
{
"ReconstructedParticles"
})
.
Define
(
"NPart"
,
"
r
ec
P
.size()"
)
.
Define
(
"p_thrown"
,
momentum
,
{
"thrownP"
})
.
Define
(
"nTracks"
,
"outputTrackParameters.size()"
)
.
Define
(
"p_track"
,
p_track
,
{
"outputTrackParameters"
})
//.Define("p_track1", p_track, {"outputTrackParameters1"})
//.Define("p_track2", p_track, {"outputTrackParameters2"})
.
Define
(
"delta_p"
,
delta_p
,
{
"p_track"
,
"p_thrown"
})
//.Define("delta_p1",delta_p, {"p_track1", "p_thrown"})
//.Define("delta_p2",delta_p, {"p_track2", "p_thrown"})
.
Define
(
"eprime"
,
eprime
,
{
"thrownParticles"
})
.
Define
(
"q"
,
q_vec
,
{
"eprime"
})
.
Define
(
"Q2"
,
"-1.0*(q.Dot(q))"
);
auto
h_n_dummy
=
df0
.
Histo1D
({
"h_n_dummy"
,
"; h_n_dummy n"
,
10
,
0
,
10
},
"dumNPart"
);
auto
h_Q2
=
df0
.
Histo1D
({
"h_Q2"
,
"; Q^{2} [GeV^{2}/c^{2}]"
,
100
,
0
,
30
},
"Q2"
);
auto
n_Q2
=
df0
.
Filter
(
"Q2>1"
).
Count
();
auto
h_n_dummy
=
df0
.
Histo1D
({
"h_n_part"
,
"; h_n_part n"
,
10
,
0
,
10
},
"NPart"
);
auto
h_Q2
=
df0
.
Histo1D
({
"h_Q2"
,
"; Q^{2} [GeV^{2}/c^{2}]"
,
100
,
0
,
30
},
"Q2"
);
auto
n_Q2
=
df0
.
Filter
(
"Q2>1"
).
Count
();
auto
n_tracks
=
df0
.
Mean
(
"nTracks"
);
// ---------------------------
// Do evaluation
auto
c
=
new
TCanvas
();
h_Q2
->
DrawCopy
();
c
->
SaveAs
(
"results/dvcs/Q2.png"
);
c
->
SaveAs
(
"results/dvcs/Q2.pdf"
);
fmt
::
print
(
"{} DVCS events
\n
"
,
*
n_Q2
);
fmt
::
print
(
"{} tracks per event
\n
"
,
*
n_tracks
);
c
=
new
TCanvas
();
h_n_dummy
->
DrawCopy
();
c
->
SaveAs
(
"results/dvcs/n_dummy.png"
);
//c->SaveAs("results/dvcs/n_dummy.pdf");
}
Loading