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
2b070d90
Commit
2b070d90
authored
2 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
ItemizeSimulation: pass detector instead of simulation; decouple polarizers 1 and 2
parent
fc93e06c
No related branches found
No related tags found
1 merge request
!1267
cleanup
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GUI/Model/FromCore/ItemizeSimulation.cpp
+9
-12
9 additions, 12 deletions
GUI/Model/FromCore/ItemizeSimulation.cpp
with
9 additions
and
12 deletions
GUI/Model/FromCore/ItemizeSimulation.cpp
+
9
−
12
View file @
2b070d90
...
@@ -137,9 +137,8 @@ void setMaskContainer(MaskItems* destMaskItems, const IDetector& detector, doubl
...
@@ -137,9 +137,8 @@ void setMaskContainer(MaskItems* destMaskItems, const IDetector& detector, doubl
}
}
}
}
void
setDetectorMasks
(
DetectorItem
*
detector_item
,
const
I
Simulation2D
&
simulation
)
void
setDetectorMasks
(
DetectorItem
*
detector_item
,
const
I
Detector
&
detector
)
{
{
const
IDetector
&
detector
=
simulation
.
detector
();
if
((
detector
.
detectorMask
()
&&
detector
.
detectorMask
()
->
hasMasks
())
if
((
detector
.
detectorMask
()
&&
detector
.
detectorMask
()
->
hasMasks
())
||
detector
.
hasExplicitRegionOfInterest
())
{
||
detector
.
hasExplicitRegionOfInterest
())
{
const
double
scale
=
1.0
/
detector_item
->
axesToCoreUnitsFactor
();
const
double
scale
=
1.0
/
detector_item
->
axesToCoreUnitsFactor
();
...
@@ -373,11 +372,8 @@ void setDetectorResolution(DetectorItem* detector_item, const IDetector& detecto
...
@@ -373,11 +372,8 @@ void setDetectorResolution(DetectorItem* detector_item, const IDetector& detecto
ASSERT
(
0
);
ASSERT
(
0
);
}
}
void
setPolarizer
Analyzer
(
Instrument2DItem
*
instrument_item
,
const
I
Simulation2D
&
simulation
)
void
setPolarizer
2
(
Instrument2DItem
*
instrument_item
,
const
I
Detector
&
detector
)
{
{
instrument_item
->
setPolarization
(
simulation
.
beam
().
polVector
());
const
IDetector
&
detector
=
simulation
.
detector
();
double
total_transmission
=
detector
.
analyzer
().
totalTransmission
();
double
total_transmission
=
detector
.
analyzer
().
totalTransmission
();
if
(
total_transmission
<=
0.0
)
if
(
total_transmission
<=
0.0
)
return
;
return
;
...
@@ -389,16 +385,15 @@ void setPolarizerAnalyzer(Instrument2DItem* instrument_item, const ISimulation2D
...
@@ -389,16 +385,15 @@ void setPolarizerAnalyzer(Instrument2DItem* instrument_item, const ISimulation2D
instrument_item
->
setAnalyzerTotalTransmission
(
total_transmission
);
instrument_item
->
setAnalyzerTotalTransmission
(
total_transmission
);
}
}
void
updateDetector
(
Instrument2DItem
*
instrument_item
,
const
I
Simulation2D
&
simulation
)
void
updateDetector
(
Instrument2DItem
*
instrument_item
,
const
I
Detector
&
detector
)
{
{
const
IDetector
&
detector
=
simulation
.
detector
();
setDetectorGeometry
(
instrument_item
,
detector
);
setDetectorGeometry
(
instrument_item
,
detector
);
auto
*
detector_item
=
instrument_item
->
detectorItem
();
auto
*
detector_item
=
instrument_item
->
detectorItem
();
setDetectorResolution
(
detector_item
,
detector
);
setDetectorResolution
(
detector_item
,
detector
);
setDetectorMasks
(
detector_item
,
simulation
);
setDetectorMasks
(
detector_item
,
detector
);
setPolarizer
Analyzer
(
instrument_item
,
simulation
);
setPolarizer
2
(
instrument_item
,
detector
);
}
}
void
setBackground
(
InstrumentItem
*
instrument_item
,
const
ISimulation
&
simulation
)
void
setBackground
(
InstrumentItem
*
instrument_item
,
const
ISimulation
&
simulation
)
...
@@ -416,7 +411,8 @@ GISASInstrumentItem* createGISASInstrumentItem(const ScatteringSimulation& simul
...
@@ -416,7 +411,8 @@ GISASInstrumentItem* createGISASInstrumentItem(const ScatteringSimulation& simul
{
{
auto
*
result
=
new
GISASInstrumentItem
();
auto
*
result
=
new
GISASInstrumentItem
();
setGISASBeamItem
(
result
->
beamItem
(),
simulation
);
setGISASBeamItem
(
result
->
beamItem
(),
simulation
);
updateDetector
(
result
,
simulation
);
result
->
setPolarization
(
simulation
.
beam
().
polVector
());
updateDetector
(
result
,
simulation
.
detector
());
return
result
;
return
result
;
}
}
...
@@ -425,7 +421,8 @@ OffspecInstrumentItem* createOffspecInstrumentItem(const OffspecSimulation& simu
...
@@ -425,7 +421,8 @@ OffspecInstrumentItem* createOffspecInstrumentItem(const OffspecSimulation& simu
{
{
auto
*
result
=
new
OffspecInstrumentItem
();
auto
*
result
=
new
OffspecInstrumentItem
();
setOffspecBeamItem
(
result
->
beamItem
(),
simulation
);
setOffspecBeamItem
(
result
->
beamItem
(),
simulation
);
updateDetector
(
result
,
simulation
);
result
->
setPolarization
(
simulation
.
beam
().
polVector
());
updateDetector
(
result
,
simulation
.
detector
());
const
double
factor
=
1.
/
Units
::
deg
;
const
double
factor
=
1.
/
Units
::
deg
;
result
->
alphaAxis
().
setNbins
(
simulation
.
beamAxis
()
->
size
());
result
->
alphaAxis
().
setNbins
(
simulation
.
beamAxis
()
->
size
());
...
...
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