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
9c109190
Commit
9c109190
authored
3 years ago
by
Wouter Deconinck
Browse files
Options
Downloads
Patches
Plain Diff
Forward DRICH benchmark
parent
e63b7323
No related branches found
Branches containing commit
No related tags found
1 merge request
!105
Forward DRICH benchmark
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
benchmarks/pid/config.yml
+22
-0
22 additions, 0 deletions
benchmarks/pid/config.yml
benchmarks/pid/scripts/drich_analysis.cxx
+73
-0
73 additions, 0 deletions
benchmarks/pid/scripts/drich_analysis.cxx
with
95 additions
and
0 deletions
benchmarks/pid/config.yml
+
22
−
0
View file @
9c109190
...
...
@@ -8,6 +8,16 @@ sim:backward:
matrix
:
-
PARTICLE
:
[
"
e-"
,
"
pi+"
,
"
proton"
]
sim:forward
:
extends
:
.det_benchmark
stage
:
simulate
script
:
-
ddsim --runType batch --numberOfEvents 100 --filter.tracker edep0 --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml --enableGun --gun.energy "5*GeV" --gun.particle "${PARTICLE}" --gun.thetaMin 3*deg --gun.thetaMax 50*deg --gun.distribution "cos(theta)" --outputFile sim_output/sim_pid_forward_${PARTICLE}_5GeV.edm4hep.root
-
rootls -t sim_output/sim_pid_forward_${PARTICLE}_5GeV.edm4hep.root
parallel
:
matrix
:
-
PARTICLE
:
[
"
e-"
,
"
pi+"
,
"
proton"
]
bench:mrich
:
extends
:
.det_benchmark
stage
:
benchmarks
...
...
@@ -25,6 +35,18 @@ bench:mrich:
matrix
:
-
PARTICLE
:
[
"
e-"
,
"
pi+"
,
"
proton"
]
bench:drich
:
extends
:
.det_benchmark
stage
:
benchmarks
needs
:
[
"
sim:forward"
]
script
:
-
|
mkdir -p results/pid/forward/drich/
root -t -x -q -b "benchmarks/pid/scripts/drich_analysis.cxx+(\"sim_output/sim_pid_forward_${PARTICLE}_5GeV.edm4hep.root\", \"${PARTICLE}\")"
parallel
:
matrix
:
-
PARTICLE
:
[
"
e-"
,
"
pi+"
,
"
proton"
]
bench:erich
:
extends
:
.det_benchmark
stage
:
benchmarks
...
...
This diff is collapsed.
Click to expand it.
benchmarks/pid/scripts/drich_analysis.cxx
0 → 100644
+
73
−
0
View file @
9c109190
////////////////////////////////////////
// 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
());
}
}
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