Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
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
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
23fe7452
Commit
23fe7452
authored
4 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
Core: RectangularDetector + few 'const'
parent
4ddf862d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Core/Binning/IPixel.h
+1
-1
1 addition, 1 deletion
Core/Binning/IPixel.h
Core/Detector/IDetector.cpp
+1
-2
1 addition, 2 deletions
Core/Detector/IDetector.cpp
Core/Detector/RectangularDetector.cpp
+8
-8
8 additions, 8 deletions
Core/Detector/RectangularDetector.cpp
with
10 additions
and
11 deletions
Core/Binning/IPixel.h
+
1
−
1
View file @
23fe7452
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
// BornAgain: simulate and fit scattering at grazing incidence
// BornAgain: simulate and fit scattering at grazing incidence
//
//
//! @file Core/Binning/IPixel.h
//! @file Core/Binning/IPixel.h
//! @brief Defines interface IPixel
.
//! @brief Defines
pure virtual
interface IPixel
(has no cpp file)
//!
//!
//! @homepage http://www.bornagainproject.org
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @license GNU General Public License v3 or higher (see COPYING)
...
...
This diff is collapsed.
Click to expand it.
Core/Detector/IDetector.cpp
+
1
−
2
View file @
23fe7452
...
@@ -81,9 +81,8 @@ size_t IDetector::totalSize() const
...
@@ -81,9 +81,8 @@ size_t IDetector::totalSize() const
if
(
dim
==
0
)
if
(
dim
==
0
)
return
0
;
return
0
;
size_t
result
=
1
;
size_t
result
=
1
;
for
(
size_t
i_axis
=
0
;
i_axis
<
dim
;
++
i_axis
)
{
for
(
size_t
i_axis
=
0
;
i_axis
<
dim
;
++
i_axis
)
result
*=
m_axes
[
i_axis
]
->
size
();
result
*=
m_axes
[
i_axis
]
->
size
();
}
return
result
;
return
result
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Core/Detector/RectangularDetector.cpp
+
8
−
8
View file @
23fe7452
...
@@ -213,16 +213,16 @@ size_t RectangularDetector::indexOfSpecular(const Beam& beam) const
...
@@ -213,16 +213,16 @@ size_t RectangularDetector::indexOfSpecular(const Beam& beam) const
{
{
if
(
dimension
()
!=
2
)
if
(
dimension
()
!=
2
)
return
totalSize
();
return
totalSize
();
double
alpha
=
beam
.
getAlpha
();
const
double
alpha
=
beam
.
getAlpha
();
double
phi
=
beam
.
getPhi
();
const
double
phi
=
beam
.
getPhi
();
kvector_t
k_spec
=
vecOfLambdaAlphaPhi
(
beam
.
getWavelength
(),
alpha
,
phi
);
const
kvector_t
k_spec
=
vecOfLambdaAlphaPhi
(
beam
.
getWavelength
(),
alpha
,
phi
);
kvector_t
normal_unit
=
m_normal_to_detector
.
unit
();
const
kvector_t
normal_unit
=
m_normal_to_detector
.
unit
();
double
kd
=
k_spec
.
dot
(
normal_unit
);
const
double
kd
=
k_spec
.
dot
(
normal_unit
);
if
(
kd
<=
0.0
)
if
(
kd
<=
0.0
)
return
totalSize
();
return
totalSize
();
kvector_t
k_orth
=
(
k_spec
/
kd
-
normal_unit
)
*
m_distance
;
const
kvector_t
k_orth
=
(
k_spec
/
kd
-
normal_unit
)
*
m_distance
;
double
u
=
k_orth
.
dot
(
m_u_unit
)
+
m_u0
;
const
double
u
=
k_orth
.
dot
(
m_u_unit
)
+
m_u0
;
double
v
=
k_orth
.
dot
(
m_v_unit
)
+
m_v0
;
const
double
v
=
k_orth
.
dot
(
m_v_unit
)
+
m_v0
;
const
IAxis
&
u_axis
=
getAxis
(
0
);
const
IAxis
&
u_axis
=
getAxis
(
0
);
const
IAxis
&
v_axis
=
getAxis
(
1
);
const
IAxis
&
v_axis
=
getAxis
(
1
);
if
(
u_axis
.
contains
(
u
)
&&
v_axis
.
contains
(
v
))
if
(
u_axis
.
contains
(
u
)
&&
v_axis
.
contains
(
v
))
...
...
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