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
09b3293f
Commit
09b3293f
authored
3 years ago
by
Wouter Deconinck
Browse files
Options
Downloads
Patches
Plain Diff
MaterialScan: Allow range not including 0
parent
e0136ed5
No related branches found
Branches containing commit
No related tags found
1 merge request
!94
MaterialScan: Allow range not including 0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
benchmarks/others/materialScan.cxx
+4
-4
4 additions, 4 deletions
benchmarks/others/materialScan.cxx
with
4 additions
and
4 deletions
benchmarks/others/materialScan.cxx
+
4
−
4
View file @
09b3293f
...
@@ -48,15 +48,15 @@ void materialScan(
...
@@ -48,15 +48,15 @@ void materialScan(
double
phi
=
0.0
)
double
phi
=
0.0
)
{
{
// check inputs
// check inputs
if
(
etamin
*
etamax
>=
0.0
||
etamin
>
etamax
||
rmax
<=
0.0
)
{
if
(
etamin
>
etamax
||
rmax
<=
0.0
)
{
std
::
cout
<<
"Error: ordered eta range
around zero
required"
<<
std
::
endl
;
std
::
cout
<<
"Error: ordered eta range required"
<<
std
::
endl
;
return
-
1
;
return
-
1
;
}
}
// get material scans
// get material scans
size_t
total
{
0
};
size_t
total
{
0
};
std
::
vector
<
dd4hep
::
rec
::
MaterialVec
>
scan
;
std
::
vector
<
dd4hep
::
rec
::
MaterialVec
>
scan
;
double
x0
{
0
},
y0
{
0
},
z0
{
+
0.001
};
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
(
exp
(
-
eta
));
double
x
=
rmax
*
cos
(
phi
)
*
sin
(
theta
);
double
x
=
rmax
*
cos
(
phi
)
*
sin
(
theta
);
...
@@ -73,7 +73,7 @@ void materialScan(
...
@@ -73,7 +73,7 @@ void materialScan(
std
::
vector
<
TH1F
>
histograms
;
std
::
vector
<
TH1F
>
histograms
;
while
(
total
>
0
)
{
while
(
total
>
0
)
{
// find next layer, starting from center bin outwards
// find next layer, starting from center bin outwards
size_t
eta0
=
static_cast
<
unsigned
int
>
(
std
::
rint
(
abs
(
-
etamin
/
etastep
)));
size_t
eta0
=
static_cast
<
unsigned
int
>
(
std
::
rint
(
abs
(
(
etamax
-
etamin
)
/
etastep
/
2
)));
for
(
size_t
i
=
0
,
j
=
eta0
;
for
(
size_t
i
=
0
,
j
=
eta0
;
i
<
scan
.
size
();
i
<
scan
.
size
();
++
i
,
j
+=
(
2
*
eta0
<
scan
.
size
()
?
-
1
:
+
1
)
*
(
i
<=
2
*
min
(
eta0
,
scan
.
size
()
-
eta0
-
1
)
?
(
i
%
2
==
0
?
-
i
:
+
i
)
:
-
1
))
{
++
i
,
j
+=
(
2
*
eta0
<
scan
.
size
()
?
-
1
:
+
1
)
*
(
i
<=
2
*
min
(
eta0
,
scan
.
size
()
-
eta0
-
1
)
?
(
i
%
2
==
0
?
-
i
:
+
i
)
:
-
1
))
{
...
...
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