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
440abb9d
Commit
440abb9d
authored
2 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
repaired - don't understand why previous version was not threadsafe
parent
541f3d48
No related branches found
No related tags found
1 merge request
!1454
rm Beam from Dp|Offsp-Sim
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Sim/Scan/AlphaScan.h
+4
-1
4 additions, 1 deletion
Sim/Scan/AlphaScan.h
Sim/Simulation/DepthprobeSimulation.cpp
+12
-15
12 additions, 15 deletions
Sim/Simulation/DepthprobeSimulation.cpp
Sim/Simulation/DepthprobeSimulation.h
+3
-2
3 additions, 2 deletions
Sim/Simulation/DepthprobeSimulation.h
with
19 additions
and
18 deletions
Sim/Scan/AlphaScan.h
+
4
−
1
View file @
440abb9d
...
...
@@ -56,7 +56,10 @@ public:
return
m_alpha_distrib
.
get
();
}
double
alphaOffset
()
const
{
return
m_alpha_offset
;
}
double
alphaOffset
()
const
{
return
m_alpha_offset
;
}
private
:
void
checkInitialization
();
...
...
This diff is collapsed.
Click to expand it.
Sim/Simulation/DepthprobeSimulation.cpp
+
12
−
15
View file @
440abb9d
...
...
@@ -32,10 +32,12 @@
DepthprobeSimulation
::
DepthprobeSimulation
(
const
IBeamScan
&
scan
,
const
MultiLayer
&
sample
)
:
ISimulation
(
sample
)
,
m_scan
(
scan
.
clone
())
,
m_scan
(
dynamic_cast
<
AlphaScan
*>
(
scan
.
clone
())
)
,
m_beam
(
InBeam
(
1.
,
scan
.
wavelength
(),
0.
,
0.
).
clone
())
,
m_alpha_axis
(
scan
.
coordinateAxis
()
->
clone
())
{
if
(
!
m_scan
)
throw
std
::
runtime_error
(
"DepthprobeSimulation not implemented for non-alpha scan"
);
}
DepthprobeSimulation
::~
DepthprobeSimulation
()
=
default
;
...
...
@@ -69,14 +71,12 @@ void DepthprobeSimulation::initDistributionHandler()
for
(
const
auto
&
distribution
:
distributionHandler
().
paramDistributions
())
{
switch
(
distribution
.
whichParameter
())
{
case
ParameterDistribution
::
BeamInclinationAngle
:
{
auto
*
s
=
dynamic_cast
<
AlphaScan
*>
(
m_scan
.
get
());
if
(
!
s
)
throw
std
::
runtime_error
(
"Alpha distribution not compatible with non-alpha scan"
);
distributionHandler
().
defineCallbackForDistribution
(
&
distribution
,
[
&
](
double
d
)
{
m_beam
->
setInclination
(
d
);
s
->
setAlphaOffset
(
d
);
ASSERT
(
s
->
alphaOffset
()
==
m_beam
->
alpha_i
());});
case
ParameterDistribution
::
BeamInclinationAngle
:
{
distributionHandler
().
defineCallbackForDistribution
(
&
distribution
,
[
&
](
double
d
)
{
m_beam
->
setInclination
(
d
);
m_scan
->
setAlphaOffset
(
d
);
ASSERT
(
m_scan
->
alphaOffset
()
==
m_beam
->
alpha_i
());
});
break
;
}
case
ParameterDistribution
::
BeamWavelength
:
...
...
@@ -91,12 +91,9 @@ void DepthprobeSimulation::initDistributionHandler()
void
DepthprobeSimulation
::
runComputation
(
const
ReSample
&
re_sample
,
size_t
i
,
double
weight
)
{
const
auto
*
s
=
dynamic_cast
<
AlphaScan
*>
(
m_scan
.
get
());
if
(
!
s
)
throw
std
::
runtime_error
(
"Alpha distribution not compatible with non-alpha scan"
);
std
::
cout
<<
s
->
alphaOffset
()
<<
" vs "
<<
m_beam
->
alpha_i
()
<<
std
::
endl
;
ASSERT
(
s
->
alphaOffset
()
==
m_beam
->
alpha_i
());
const
double
result_angle
=
m_alpha_axis
->
bin
(
i
).
center
()
+
s
->
alphaOffset
();
std
::
cout
<<
m_scan
->
alphaOffset
()
<<
" vs "
<<
m_beam
->
alpha_i
()
<<
std
::
endl
;
ASSERT
(
m_scan
->
alphaOffset
()
==
m_beam
->
alpha_i
());
const
double
result_angle
=
m_alpha_axis
->
bin
(
i
).
center
()
+
m_scan
->
alphaOffset
();
DepthprobeElement
ele
(
m_scan
->
wavelength
(),
-
result_angle
,
m_z_axis
.
get
(),
0
<
result_angle
&&
result_angle
<
M_PI_2
);
...
...
This diff is collapsed.
Click to expand it.
Sim/Simulation/DepthprobeSimulation.h
+
3
−
2
View file @
440abb9d
...
...
@@ -17,6 +17,7 @@
#include
"Sim/Simulation/ISimulation.h"
class
AlphaScan
;
class
Beam
;
class
DepthprobeElement
;
class
IAxis
;
...
...
@@ -43,7 +44,7 @@ public:
#ifndef SWIG
const
IBeam
Scan
&
scan
()
const
const
Alpha
Scan
&
scan
()
const
{
return
*
m_scan
;
}
...
...
@@ -74,7 +75,7 @@ private:
SimulationResult
packResult
()
override
;
//... Model components:
std
::
unique_ptr
<
IBeam
Scan
>
m_scan
;
std
::
unique_ptr
<
Alpha
Scan
>
m_scan
;
std
::
unique_ptr
<
Beam
>
m_beam
;
//... Caches:
...
...
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