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
bf1ae78b
Commit
bf1ae78b
authored
3 years ago
by
Wouter Deconinck
Browse files
Options
Downloads
Patches
Plain Diff
Material scans: allow for cylindrical instead of spherical scans
parent
da9668aa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!99
Material scans: allow for cylindrical instead of spherical scans
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
benchmarks/others/config.yml
+23
-3
23 additions, 3 deletions
benchmarks/others/config.yml
benchmarks/others/materialScan.cxx
+15
-12
15 additions, 12 deletions
benchmarks/others/materialScan.cxx
with
38 additions
and
15 deletions
benchmarks/others/config.yml
+
23
−
3
View file @
bf1ae78b
...
@@ -2,13 +2,33 @@ bench:materialscan:
...
@@ -2,13 +2,33 @@ bench:materialscan:
stage
:
benchmarks
stage
:
benchmarks
extends
:
.det_benchmark
extends
:
.det_benchmark
script
:
script
:
-
echo ".x benchmarks/others/materialScan.cxx(-4.5, +4.5, 0.01, 500.)" | materialScan ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml -interactive
-
echo ".x benchmarks/others/materialScan.cxx(-4.5, +4.5, 0.01, 750., 0.0)" | materialScan ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml -interactive
-
mkdir results/images/ && mv materialScan.png materialScan.pdf results/images/
-
mkdir results/images/
-
mv materialScan.png results/images/materialScan.png
-
mv materialScan.pdf results/images/materialScan.pdf
bench:materialscan:tracking
:
stage
:
benchmarks
extends
:
.det_benchmark
script
:
-
echo ".x benchmarks/others/materialScan.cxx(-4.5, +4.5, 0.01, 750., 0.0, 103., 191., 350.)" | materialScan ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml -interactive
-
mkdir results/images/
-
mv materialScan.png results/images/materialScanTracking.png
-
mv materialScan.pdf results/images/materialScanTracking.pdf
bench:materialscan:ecal
:
stage
:
benchmarks
extends
:
.det_benchmark
script
:
-
echo ".x benchmarks/others/materialScan.cxx(-4.5, +4.5, 0.01, 750., 0.0, 230., 355., 380.)" | materialScan ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml -interactive
-
mkdir results/images/
-
mv materialScan.png results/images/materialScanEcal.png
-
mv materialScan.pdf results/images/materialScanEcal.pdf
collect_results:materialscan
:
collect_results:materialscan
:
extends
:
.det_benchmark
extends
:
.det_benchmark
stage
:
collect
stage
:
collect
needs
:
needs
:
-
[
"
bench:materialscan"
]
-
[
"
bench:materialscan"
,
"
bench:materialscan:tracking"
]
script
:
script
:
-
ls -lrht
-
ls -lrht
This diff is collapsed.
Click to expand it.
benchmarks/others/materialScan.cxx
+
15
−
12
View file @
bf1ae78b
...
@@ -41,12 +41,15 @@ Color_t color(const Material& m) {
...
@@ -41,12 +41,15 @@ Color_t color(const Material& m) {
}
}
void
materialScan
(
void
materialScan
(
double
etamin
=
-
2.0
,
double
etamin
=
-
2.0
,
// minimum eta
double
etamax
=
+
1.0
,
double
etamax
=
+
1.0
,
// maximum eta
double
etastep
=
0.2
,
double
etastep
=
0.2
,
// steps in eta
double
rmax
=
100.0
,
double
rmax
=
100.0
,
// maximum radius to scan to
double
phi
=
0.0
)
double
phi
=
0.0
,
// phi angle for material scan
{
double
rhomax
=
10000.0
,
// maximum distance from z axis
double
znmax
=
10000.0
,
// maximum negative endcap z plane (positive number)
double
zpmax
=
10000.0
// maximum positive endcap z plane (positive number)
)
{
// check inputs
// check inputs
if
(
etamin
>
etamax
||
rmax
<=
0.0
)
{
if
(
etamin
>
etamax
||
rmax
<=
0.0
)
{
std
::
cout
<<
"Error: ordered eta range required"
<<
std
::
endl
;
std
::
cout
<<
"Error: ordered eta range required"
<<
std
::
endl
;
...
@@ -58,10 +61,11 @@ void materialScan(
...
@@ -58,10 +61,11 @@ void materialScan(
std
::
vector
<
dd4hep
::
rec
::
MaterialVec
>
scan
;
std
::
vector
<
dd4hep
::
rec
::
MaterialVec
>
scan
;
double
x0
{
0
},
y0
{
0
},
z0
{
0
};
double
x0
{
0
},
y0
{
0
},
z0
{
0
};
for
(
double
eta
=
etamin
;
eta
<=
etamax
+
0.5
*
etastep
;
eta
+=
etastep
)
{
for
(
double
eta
=
etamin
;
eta
<=
etamax
+
0.5
*
etastep
;
eta
+=
etastep
)
{
double
theta
=
2.0
*
atan
(
exp
(
-
eta
));
double
theta
=
2.0
*
(
atan
(
1
)
-
atan
(
exp
(
-
eta
)));
double
x
=
rmax
*
cos
(
phi
)
*
sin
(
theta
);
double
r
=
min
((
theta
>
0
?
zpmax
:
-
znmax
)
/
sin
(
theta
),
min
(
rmax
,
rhomax
/
cos
(
theta
)));
double
y
=
rmax
*
sin
(
phi
)
*
sin
(
theta
);
double
x
=
r
*
cos
(
theta
)
*
cos
(
phi
);
double
z
=
rmax
*
cos
(
theta
);
double
y
=
r
*
cos
(
theta
)
*
sin
(
phi
);
double
z
=
r
*
sin
(
theta
);
scan
.
emplace_back
(
gMaterialScan
->
scan
(
x0
,
y0
,
z0
,
x
,
y
,
z
));
scan
.
emplace_back
(
gMaterialScan
->
scan
(
x0
,
y0
,
z0
,
x
,
y
,
z
));
total
+=
scan
.
back
().
size
();
total
+=
scan
.
back
().
size
();
}
}
...
@@ -101,7 +105,7 @@ void materialScan(
...
@@ -101,7 +105,7 @@ void materialScan(
std
::
cout
<<
histograms
.
size
()
<<
" histograms created"
<<
std
::
endl
;
std
::
cout
<<
histograms
.
size
()
<<
" histograms created"
<<
std
::
endl
;
// plot histograms as stack
// plot histograms as stack
THStack
hs
(
"hs"
,
Form
(
"Material Scan (
max distance %.0f cm)"
,
r
max
));
THStack
hs
(
"hs"
,
Form
(
"Material Scan (
r < %.0f cm, rho < %.0f cm, -%.0f cm < z < %.0f cm)"
,
rmax
,
rhomax
,
znmax
,
zp
max
));
for
(
auto
&
h
:
histograms
)
{
for
(
auto
&
h
:
histograms
)
{
hs
.
Add
(
&
h
);
hs
.
Add
(
&
h
);
}
}
...
@@ -112,7 +116,6 @@ void materialScan(
...
@@ -112,7 +116,6 @@ void materialScan(
hs
.
GetXaxis
()
->
SetTitle
(
"eta"
);
hs
.
GetXaxis
()
->
SetTitle
(
"eta"
);
hs
.
GetYaxis
()
->
SetTitle
(
"Fraction X0"
);
hs
.
GetYaxis
()
->
SetTitle
(
"Fraction X0"
);
hs
.
SetMinimum
(
2.5e-3
);
hs
.
SetMinimum
(
2.5e-3
);
hs
.
SetMaximum
(
100.
);
cs
.
SaveAs
(
"materialScan.png"
);
cs
.
SaveAs
(
"materialScan.png"
);
cs
.
SaveAs
(
"materialScan.pdf"
);
cs
.
SaveAs
(
"materialScan.pdf"
);
}
}
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