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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIC
benchmarks
detector_benchmarks
Merge requests
!105
Forward DRICH benchmark
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Forward DRICH benchmark
benchmark-forward-drich
into
master
Overview
0
Commits
3
Pipelines
0
Changes
2
Merged
Wouter Deconinck
requested to merge
benchmark-forward-drich
into
master
3 years ago
Overview
0
Commits
3
Pipelines
0
Changes
2
Expand
0
0
Merge request reports
Compare
master
version 2
4546fc96
3 years ago
version 1
da2e4df3
3 years ago
master (base)
and
latest version
latest version
778c3068
3 commits,
3 years ago
version 2
4546fc96
2 commits,
3 years ago
version 1
da2e4df3
1 commit,
3 years ago
2 files
+
95
−
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)
benchmarks/pid/scripts/drich_analysis.cxx
0 → 100644
+
73
−
0
Options
////////////////////////////////////////
// Read reconstruction ROOT output file
// Plot variables
////////////////////////////////////////
#include
"ROOT/RDataFrame.hxx"
#include
<iostream>
#include
<fmt/core.h>
#include
"edm4hep/MCParticleCollection.h"
#include
"edm4hep/SimTrackerHitCollection.h"
#include
"TCanvas.h"
#include
"TStyle.h"
#include
"TMath.h"
#include
"TH1.h"
#include
"TF1.h"
#include
"TH1D.h"
using
ROOT
::
RDataFrame
;
using
namespace
ROOT
::
VecOps
;
void
drich_analysis
(
const
char
*
input_fname
=
"sim_output/sim_pid_forward_e-_5GeV.edm4hep.root"
,
const
char
*
input_pname
=
"e-"
)
{
// Setting for graphs
gROOT
->
SetStyle
(
"Plain"
);
gStyle
->
SetOptFit
(
1
);
gStyle
->
SetLineWidth
(
2
);
gStyle
->
SetPadTickX
(
1
);
gStyle
->
SetPadTickY
(
1
);
gStyle
->
SetPadGridX
(
1
);
gStyle
->
SetPadGridY
(
1
);
gStyle
->
SetPadLeftMargin
(
0.14
);
gStyle
->
SetPadRightMargin
(
0.14
);
ROOT
::
EnableImplicitMT
();
ROOT
::
RDataFrame
d0
(
"events"
,
input_fname
);
// Define variables
auto
d1
=
d0
.
Define
(
"nhits"
,
{
"DRICHHits.size()"
});
// Define Histograms
auto
hNhits
=
d1
.
Histo1D
({
"hNhits"
,
"Number of hits per events; Number of hits; Events"
,
100
,
0.0
,
2000.0
},
"nhits"
);
auto
hXYhits
=
d1
.
Histo2D
({
"hXYhits"
,
"Hit positions for events; Horizontal position [mm]; Vertical position [mm]"
,
1000
,
-
2500.0
,
+
2500.0
,
1000
,
-
2500.0
,
+
2500.0
},
"DRICHHits.position.x"
,
"DRICHHits.position.y"
);
// Event Counts
auto
nevents_thrown
=
d1
.
Count
();
std
::
cout
<<
"Number of Thrown Events: "
<<
(
*
nevents_thrown
)
<<
"
\n
"
;
// Draw Histograms
{
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
"c1"
,
700
,
500
);
auto
h
=
hXYhits
->
DrawCopy
();
c1
->
SaveAs
(
fmt
::
format
(
"results/pid/forward/drich/drich_{}_hits_xy.png"
,
input_pname
).
c_str
());
c1
->
SaveAs
(
fmt
::
format
(
"results/pid/forward/drich/drich_{}_hits_xy.pdf"
,
input_pname
).
c_str
());
}
{
TCanvas
*
c2
=
new
TCanvas
(
"c2"
,
"c2"
,
700
,
500
);
c2
->
SetLogy
(
1
);
auto
h
=
hNhits
->
DrawCopy
();
//h->GetYaxis()->SetTitleOffset(1.4);
h
->
SetLineWidth
(
2
);
h
->
SetLineColor
(
kBlue
);
c2
->
SaveAs
(
fmt
::
format
(
"results/pid/forward/drich/drich_{}_nhits.png"
,
input_pname
).
c_str
());
c2
->
SaveAs
(
fmt
::
format
(
"results/pid/forward/drich/drich_{}_nhits.pdf"
,
input_pname
).
c_str
());
}
}
Loading