BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
StandardSimulations Namespace Reference

Functions

GISASSimulationBasicGISAS ()
 
GISASSimulationBasicGISAS00 ()
 
GISASSimulationBasicPolarizedGISAS ()
 
GISASSimulationMiniGISAS ()
 
GISASSimulationMiniGISAS_v2 ()
 
GISASSimulationMiniGISASBeamDivergence ()
 
GISASSimulationMiniGISASDetectorResolution ()
 
GISASSimulationMiniGISASSpecularPeak ()
 
GISASSimulationGISASWithMasks ()
 
GISASSimulationMaxiGISAS ()
 
GISASSimulationMaxiGISAS00 ()
 
GISASSimulationIsGISAXSSimulation1 ()
 
GISASSimulationIsGISAXSSimulation2 ()
 
GISASSimulationRectDetectorGeneric ()
 
GISASSimulationRectDetectorPerpToSample ()
 
GISASSimulationRectDetectorPerpToDirectBeam ()
 
GISASSimulationRectDetectorPerpToReflectedBeam ()
 
GISASSimulationRectDetectorPerpToReflectedBeamDpos ()
 
GISASSimulationMiniGISASMonteCarlo ()
 
GISASSimulationSphericalDetWithRoi ()
 
GISASSimulationRectDetWithRoi ()
 
GISASSimulationConstantBackgroundGISAS ()
 
GISASSimulationMiniGISASFit ()
 
GISASSimulationExtraLongWavelengthGISAS ()
 
GISASSimulationMiniGISASPolarizationPP ()
 
GISASSimulationMiniGISASPolarizationPM ()
 
GISASSimulationMiniGISASPolarizationMP ()
 
GISASSimulationMiniGISASPolarizationMM ()
 
SpecularSimulationBasicSpecular ()
 
SpecularSimulationBasicSpecularQ ()
 
SpecularSimulationSpecularWithGaussianBeam ()
 
SpecularSimulationSpecularWithSquareBeam ()
 
SpecularSimulationSpecularDivergentBeam ()
 
SpecularSimulationTOFRWithRelativeResolution ()
 
SpecularSimulationTOFRWithPointwiseResolution ()
 
SpecularSimulationBasicSpecularPP ()
 
SpecularSimulationBasicSpecularMM ()
 
SpecularSimulationBasicSpecularPM ()
 
SpecularSimulationBasicSpecularMP ()
 
SpecularSimulationBasicSpecularQPP ()
 
SpecularSimulationBasicSpecularQMM ()
 
SpecularSimulationBasicSpecularQPM ()
 
SpecularSimulationBasicSpecularQMP ()
 
OffSpecSimulationMiniOffSpec ()
 
DepthProbeSimulationBasicDepthProbe ()
 

Detailed Description

Standard pre-defined simulations.

Function Documentation

◆ BasicGISAS()

GISASSimulation * StandardSimulations::BasicGISAS ( )

Basic GISAS simulation with the detector phi[0,2], theta[0,2].

Definition at line 49 of file StandardSimulations.cpp.

50 {
51  GISASSimulation* result = new GISASSimulation();
52  result->setDetectorParameters(100, 0.0 * Units::degree, 2.0 * Units::degree, 100,
53  0.0 * Units::degree, 2.0 * Units::degree);
54  result->setBeamParameters(1.0 * Units::angstrom, 0.2 * Units::degree, 0.0 * Units::degree);
55  return result;
56 }
Main class to run a Grazing-Incidence Small-Angle Scattering simulation.
void setBeamParameters(double wavelength, double alpha_i, double phi_i)
Sets beam parameters from here (forwarded to Instrument)
void setDetectorParameters(size_t n_phi, double phi_min, double phi_max, size_t n_alpha, double alpha_min, double alpha_max)
Sets spherical detector parameters using angle ranges.
static constexpr double angstrom
Definition: Units.h:25
static constexpr double degree
Definition: Units.h:40

References Units::angstrom, Units::degree, GISASSimulation::setBeamParameters(), and Simulation2D::setDetectorParameters().

Referenced by BasicGISAS00(), BasicPolarizedGISAS(), and SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ BasicGISAS00()

GISASSimulation * StandardSimulations::BasicGISAS00 ( )

Basic GISAS for polarization studies.

Definition at line 60 of file StandardSimulations.cpp.

61 {
62  GISASSimulation* result = BasicGISAS();
63  kvector_t zplus(0.0, 0.0, 1.0);
64  result->setBeamPolarization(zplus);
65  result->setAnalyzerProperties(zplus, 1.0, 0.5);
66  return result;
67 }
void setAnalyzerProperties(const kvector_t direction, double efficiency, double total_transmission)
Sets the polarization analyzer characteristics of the detector.
Definition: Simulation.cpp:167
void setBeamPolarization(const kvector_t bloch_vector)
Sets the beam polarization according to the given Bloch vector.
Definition: Simulation.cpp:184
GISASSimulation * BasicGISAS()
Basic GISAS simulation with the detector phi[0,2], theta[0,2].

References BasicGISAS(), Simulation::setAnalyzerProperties(), and Simulation::setBeamPolarization().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ BasicPolarizedGISAS()

GISASSimulation * StandardSimulations::BasicPolarizedGISAS ( )

Basic GISAS simulation for spin flip channel.

Definition at line 71 of file StandardSimulations.cpp.

72 {
73  GISASSimulation* result = BasicGISAS();
74  kvector_t zplus(0.0, 0.0, 1.0);
75  result->setBeamPolarization(zplus);
76  result->setAnalyzerProperties(zplus, -1.0, 0.5);
77  return result;
78 }

References BasicGISAS(), Simulation::setAnalyzerProperties(), and Simulation::setBeamPolarization().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ MiniGISAS()

GISASSimulation * StandardSimulations::MiniGISAS ( )

GISAS simulation with small detector and phi[-2,2], theta[0,2].

Definition at line 82 of file StandardSimulations.cpp.

83 {
84  GISASSimulation* result = new GISASSimulation();
85  result->setDetectorParameters(25, -2.0 * Units::degree, 2.0 * Units::degree, 25,
86  0.0 * Units::degree, 2.0 * Units::degree);
87  result->setBeamParameters(1.0 * Units::angstrom, 0.2 * Units::degree, 0.0 * Units::degree);
88  return result;
89 }

References Units::angstrom, Units::degree, GISASSimulation::setBeamParameters(), and Simulation2D::setDetectorParameters().

Referenced by ConstantBackgroundGISAS(), MiniGISASBeamDivergence(), MiniGISASDetectorResolution(), MiniGISASMonteCarlo(), MiniGISASPolarizationMM(), MiniGISASPolarizationMP(), MiniGISASPolarizationPM(), MiniGISASPolarizationPP(), and SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ MiniGISAS_v2()

GISASSimulation * StandardSimulations::MiniGISAS_v2 ( )

GISAS simulation with small detector and phi[-1,1], theta[0,1].

Definition at line 93 of file StandardSimulations.cpp.

94 {
95  GISASSimulation* result = new GISASSimulation();
96  result->setDetectorParameters(25, -1.0 * Units::degree, 1.0 * Units::degree, 25,
97  0.0 * Units::degree, 1.0 * Units::degree);
98  result->setBeamParameters(1.0 * Units::angstrom, 0.2 * Units::degree, 0.0 * Units::degree);
99  return result;
100 }

References Units::angstrom, Units::degree, GISASSimulation::setBeamParameters(), and Simulation2D::setDetectorParameters().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ MiniGISASBeamDivergence()

GISASSimulation * StandardSimulations::MiniGISASBeamDivergence ( )

GISAS simulation with beam divergence applied.

Definition at line 104 of file StandardSimulations.cpp.

105 {
106  GISASSimulation* result = MiniGISAS();
107 
108  DistributionLogNormal wavelength_distr(1.0 * Units::angstrom, 0.1);
109  DistributionGaussian alpha_distr(0.2 * Units::degree, 0.1 * Units::degree);
110  DistributionGate phi_distr(-0.1 * Units::degree, 0.1 * Units::degree);
111 
112  ParameterPattern pattern1;
113  pattern1.beginsWith("*").add("Beam").add("Wavelength");
114  result->addParameterDistribution(pattern1.toStdString(), wavelength_distr, 5);
115  ParameterPattern pattern2;
116  pattern2.beginsWith("*").add("Beam").add("InclinationAngle");
117  result->addParameterDistribution(pattern2.toStdString(), alpha_distr, 4);
118  ParameterPattern pattern3;
119  pattern3.beginsWith("*").add("Beam").add("AzimuthalAngle");
120  result->addParameterDistribution(pattern3.toStdString(), phi_distr, 3);
121 
122  return result;
123 }
Uniform distribution function with half width hwhm.
Definition: Distributions.h:86
Gaussian distribution with standard deviation std_dev.
Log-normal distribution.
Helper class for constructing parameter patterns.
ParameterPattern & beginsWith(std::string start_type)
std::string toStdString() const
ParameterPattern & add(std::string object_type)
void addParameterDistribution(const std::string &param_name, const IDistribution1D &distribution, size_t nbr_samples, double sigma_factor=0.0, const RealLimits &limits=RealLimits())
Definition: Simulation.cpp:273
GISASSimulation * MiniGISAS()
GISAS simulation with small detector and phi[-2,2], theta[0,2].

References ParameterPattern::add(), Simulation::addParameterDistribution(), Units::angstrom, ParameterPattern::beginsWith(), Units::degree, MiniGISAS(), and ParameterPattern::toStdString().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ MiniGISASDetectorResolution()

GISASSimulation * StandardSimulations::MiniGISASDetectorResolution ( )

GISAS simulation with detector resolution.

Definition at line 161 of file StandardSimulations.cpp.

162 {
163  GISASSimulation* result = MiniGISAS();
164  ResolutionFunction2DGaussian resfunc(0.0025, 0.0025);
165  result->setDetectorResolutionFunction(resfunc);
166  return result;
167 }
Simple gaussian two-dimensional resolution function.
void setDetectorResolutionFunction(const IResolutionFunction2D &resolution_function)
Definition: Simulation.cpp:156

References MiniGISAS(), and Simulation::setDetectorResolutionFunction().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ MiniGISASSpecularPeak()

GISASSimulation * StandardSimulations::MiniGISASSpecularPeak ( )

GISAS simulation with small detector and including specular peak.

Definition at line 219 of file StandardSimulations.cpp.

220 {
221  GISASSimulation* result = new GISASSimulation();
222  result->setDetectorParameters(25, -2.0 * Units::degree, 2.0 * Units::degree, 25,
223  0.0 * Units::degree, 2.0 * Units::degree);
224  result->setBeamParameters(1.0 * Units::angstrom, 0.2 * Units::degree, 0.0 * Units::degree);
225  result->getOptions().setIncludeSpecular(true);
226  return result;
227 }
void setIncludeSpecular(bool include_specular)
const SimulationOptions & getOptions() const
Definition: Simulation.h:92

References Units::angstrom, Units::degree, Simulation::getOptions(), GISASSimulation::setBeamParameters(), Simulation2D::setDetectorParameters(), and SimulationOptions::setIncludeSpecular().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ GISASWithMasks()

GISASSimulation * StandardSimulations::GISASWithMasks ( )

GISAS simulation with multiple masks on the detector plane.

Definition at line 127 of file StandardSimulations.cpp.

128 {
129  GISASSimulation* result = new GISASSimulation();
130  result->setDetectorParameters(50, -1.0 * Units::degree, 1.0 * Units::degree, 50,
131  0.0 * Units::degree, 2.0 * Units::degree);
132  result->setBeamParameters(1.0 * Units::angstrom, 0.2 * Units::degree, 0.0 * Units::degree);
133  result->setBeamIntensity(1e+7);
134 
135  result->maskAll();
136  // pacman
137  const double deg = Units::degree;
138  result->addMask(Ellipse(0.0 * deg, 1.0 * deg, 0.5 * deg, 0.5 * deg), false);
139  result->addMask(Ellipse(0.11 * deg, 1.25 * deg, 0.05 * deg, 0.05 * deg), true);
140 
141  std::vector<std::vector<double>> points = {{0.0 * deg, 1.0 * deg},
142  {0.5 * deg, 1.2 * deg},
143  {0.5 * deg, 0.8 * deg},
144  {0.0 * deg, 1.0 * deg}};
145  result->addMask(Polygon(points), true);
146 
147  result->addMask(Rectangle(0.45 * deg, 0.95 * deg, 0.55 * deg, 1.05 * deg), false);
148  result->addMask(Rectangle(0.61 * deg, 0.95 * deg, 0.71 * deg, 1.05 * deg), false);
149  result->addMask(Rectangle(0.75 * deg, 0.95 * deg, 0.85 * deg, 1.05 * deg), false);
150 
151  // more masks
152  result->addMask(Ellipse(-0.5 * deg, 1.5 * deg, 0.3 * deg, 0.1 * deg, 45. * deg), false);
153  result->addMask(VerticalLine(-0.6 * deg), true);
154  result->addMask(HorizontalLine(0.3 * deg), false);
155 
156  return result;
157 }
Ellipse shape.
Definition: Ellipse.h:24
An infinite horizontal line.
Definition: Line.h:58
A polygon in 2D space.
Definition: Polygon.h:31
The rectangle shape having its axis aligned to the (non-rotated) coordinate system.
Definition: Rectangle.h:24
void addMask(const IShape2D &shape, bool mask_value=true)
Adds mask of given shape to the stack of detector masks.
void maskAll()
Put the mask for all detector channels (i.e. exclude whole detector from the analysis)
void setBeamIntensity(double intensity)
Definition: Simulation.cpp:173
An infinite vertical line.
Definition: Line.h:40
static constexpr double deg
Definition: Units.h:56

References Simulation2D::addMask(), Units::angstrom, Units::deg, Units::degree, Simulation2D::maskAll(), Simulation::setBeamIntensity(), GISASSimulation::setBeamParameters(), and Simulation2D::setDetectorParameters().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ MaxiGISAS()

GISASSimulation * StandardSimulations::MaxiGISAS ( )

GISAS simulation with large detector to test performance.

Definition at line 231 of file StandardSimulations.cpp.

232 {
233  GISASSimulation* result = new GISASSimulation();
234  result->setDetectorParameters(256, -2.0 * Units::degree, 2.0 * Units::degree, 256,
235  0.0 * Units::degree, 2.0 * Units::degree);
236  result->setBeamParameters(1.0 * Units::angstrom, 0.2 * Units::degree, 0.0 * Units::degree);
237  return result;
238 }

References Units::angstrom, Units::degree, GISASSimulation::setBeamParameters(), and Simulation2D::setDetectorParameters().

Referenced by MaxiGISAS00(), and SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ MaxiGISAS00()

GISASSimulation * StandardSimulations::MaxiGISAS00 ( )

Basic GISAS for polarization studies.

Definition at line 242 of file StandardSimulations.cpp.

243 {
244  GISASSimulation* result = MaxiGISAS();
245  kvector_t zplus(0.0, 0.0, 1.0);
246  result->setBeamPolarization(zplus);
247  result->setAnalyzerProperties(zplus, 1.0, 0.5);
248  return result;
249 }
GISASSimulation * MaxiGISAS()
GISAS simulation with large detector to test performance.

References MaxiGISAS(), Simulation::setAnalyzerProperties(), and Simulation::setBeamPolarization().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ IsGISAXSSimulation1()

GISASSimulation * StandardSimulations::IsGISAXSSimulation1 ( )

Typical IsGISAXS simulation with the detector phi[-1,1], theta[0,2].

Definition at line 253 of file StandardSimulations.cpp.

254 {
255  GISASSimulation* result = new GISASSimulation();
256  IsGISAXSDetector detector;
257  detector.setDetectorParameters(100, -1.0 * Units::degree, 1.0 * Units::degree, 100,
258  0.0 * Units::degree, 2.0 * Units::degree);
259  result->setDetector(detector);
260  result->setBeamParameters(1.0 * Units::angstrom, 0.2 * Units::degree, 0.0 * Units::degree);
261  return result;
262 }
void setDetectorParameters(size_t n_x, double x_min, double x_max, size_t n_y, double y_min, double y_max)
Sets detector parameters using angle ranges.
Definition: IDetector2D.cpp:35
A spherical detector used for validation with IsGISAXS results.
void setDetector(const IDetector2D &detector)
Sets the detector (axes can be overwritten later)

References Units::angstrom, Units::degree, GISASSimulation::setBeamParameters(), Simulation2D::setDetector(), and IDetector2D::setDetectorParameters().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ IsGISAXSSimulation2()

GISASSimulation * StandardSimulations::IsGISAXSSimulation2 ( )

Typical IsGISAXS simulation with the detector phi[0,2], theta[0,2].

Definition at line 266 of file StandardSimulations.cpp.

267 {
268  GISASSimulation* result = new GISASSimulation();
269  IsGISAXSDetector detector;
270  detector.setDetectorParameters(100, 0.0 * Units::degree, 2.0 * Units::degree, 100,
271  0.0 * Units::degree, 2.0 * Units::degree);
272  result->setDetector(detector);
273  result->setBeamParameters(1.0 * Units::angstrom, 0.2 * Units::degree, 0.0 * Units::degree);
274  return result;
275 }

References Units::angstrom, Units::degree, GISASSimulation::setBeamParameters(), Simulation2D::setDetector(), and IDetector2D::setDetectorParameters().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ RectDetectorGeneric()

GISASSimulation * StandardSimulations::RectDetectorGeneric ( )

GISAS simulation with generic rectangular detector.

Definition at line 279 of file StandardSimulations.cpp.

280 {
281  GISASSimulation* result = new GISASSimulation();
282  result->setBeamParameters(1.0 * Units::angstrom, 0.2 * Units::degree, 0.0 * Units::degree);
283 
285  detector.setPosition(kvector_t(rdet_distance, 10.0, 5.0), rdet_width / 2., 1.0,
286  kvector_t(0.1, -1.0, 0.2));
287 
288  result->setDetector(detector);
289  return result;
290 }
BasicVector3D< double > kvector_t
Definition: Vectors3D.h:21
A flat rectangular detector with axes and resolution function.

References Units::angstrom, Units::degree, anonymous_namespace{StandardSimulations.cpp}::rdet_distance(), anonymous_namespace{StandardSimulations.cpp}::rdet_height(), anonymous_namespace{StandardSimulations.cpp}::rdet_nbinsx(), anonymous_namespace{StandardSimulations.cpp}::rdet_nbinsy(), anonymous_namespace{StandardSimulations.cpp}::rdet_width(), GISASSimulation::setBeamParameters(), Simulation2D::setDetector(), and RectangularDetector::setPosition().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ RectDetectorPerpToSample()

GISASSimulation * StandardSimulations::RectDetectorPerpToSample ( )

GISAS simulation with the rectangular detector perpendicular to the sample.

Definition at line 294 of file StandardSimulations.cpp.

295 {
296  GISASSimulation* result = new GISASSimulation();
297  result->setBeamParameters(1.0 * Units::angstrom, 0.2 * Units::degree, 0.0 * Units::degree);
298 
300  detector.setPerpendicularToSampleX(rdet_distance, rdet_width / 2., 1.0);
301 
302  result->setDetector(detector);
303  return result;
304 }

References Units::angstrom, Units::degree, anonymous_namespace{StandardSimulations.cpp}::rdet_distance(), anonymous_namespace{StandardSimulations.cpp}::rdet_height(), anonymous_namespace{StandardSimulations.cpp}::rdet_nbinsx(), anonymous_namespace{StandardSimulations.cpp}::rdet_nbinsy(), anonymous_namespace{StandardSimulations.cpp}::rdet_width(), GISASSimulation::setBeamParameters(), Simulation2D::setDetector(), and RectangularDetector::setPerpendicularToSampleX().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ RectDetectorPerpToDirectBeam()

GISASSimulation * StandardSimulations::RectDetectorPerpToDirectBeam ( )

GISAS simulation with the rectangular detector perpendicular to the direct beam.

Definition at line 308 of file StandardSimulations.cpp.

309 {
310  GISASSimulation* result = new GISASSimulation();
311  result->setBeamParameters(1.0 * Units::angstrom, 0.2 * Units::degree, 0.0 * Units::degree);
312 
314  detector.setPerpendicularToDirectBeam(rdet_distance, rdet_width / 2., 1.0);
315 
316  result->setDetector(detector);
317  return result;
318 }

References Units::angstrom, Units::degree, anonymous_namespace{StandardSimulations.cpp}::rdet_distance(), anonymous_namespace{StandardSimulations.cpp}::rdet_height(), anonymous_namespace{StandardSimulations.cpp}::rdet_nbinsx(), anonymous_namespace{StandardSimulations.cpp}::rdet_nbinsy(), anonymous_namespace{StandardSimulations.cpp}::rdet_width(), GISASSimulation::setBeamParameters(), Simulation2D::setDetector(), and RectangularDetector::setPerpendicularToDirectBeam().

Referenced by RectDetWithRoi(), and SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ RectDetectorPerpToReflectedBeam()

GISASSimulation * StandardSimulations::RectDetectorPerpToReflectedBeam ( )

GISAS simulation with the rectangular detector perpendicular to the reflected beam.

Definition at line 322 of file StandardSimulations.cpp.

323 {
324  GISASSimulation* result = new GISASSimulation();
325  result->setBeamParameters(1.0 * Units::angstrom, 0.2 * Units::degree, 0.0 * Units::degree);
326 
328  detector.setPerpendicularToReflectedBeam(rdet_distance, rdet_width / 2., 1.0);
329 
330  result->setDetector(detector);
331  return result;
332 }

References Units::angstrom, Units::degree, anonymous_namespace{StandardSimulations.cpp}::rdet_distance(), anonymous_namespace{StandardSimulations.cpp}::rdet_height(), anonymous_namespace{StandardSimulations.cpp}::rdet_nbinsx(), anonymous_namespace{StandardSimulations.cpp}::rdet_nbinsy(), anonymous_namespace{StandardSimulations.cpp}::rdet_width(), GISASSimulation::setBeamParameters(), Simulation2D::setDetector(), and RectangularDetector::setPerpendicularToReflectedBeam().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ RectDetectorPerpToReflectedBeamDpos()

GISASSimulation * StandardSimulations::RectDetectorPerpToReflectedBeamDpos ( )

GISAS simulation with the rectangular detector perpendicular to the reflected beam when the coordinates of direct beam are known.

Definition at line 337 of file StandardSimulations.cpp.

338 {
339  GISASSimulation* result = new GISASSimulation();
340  result->setBeamParameters(1.0 * Units::angstrom, 0.2 * Units::degree, 0.0 * Units::degree);
341 
343  detector.setPerpendicularToReflectedBeam(rdet_distance);
344  detector.setDirectBeamPosition(rdet_width / 2., 1.0);
345 
346  result->setDetector(detector);
347  return result;
348 }

References Units::angstrom, Units::degree, anonymous_namespace{StandardSimulations.cpp}::rdet_distance(), anonymous_namespace{StandardSimulations.cpp}::rdet_height(), anonymous_namespace{StandardSimulations.cpp}::rdet_nbinsx(), anonymous_namespace{StandardSimulations.cpp}::rdet_nbinsy(), anonymous_namespace{StandardSimulations.cpp}::rdet_width(), GISASSimulation::setBeamParameters(), Simulation2D::setDetector(), RectangularDetector::setDirectBeamPosition(), and RectangularDetector::setPerpendicularToReflectedBeam().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ MiniGISASMonteCarlo()

GISASSimulation * StandardSimulations::MiniGISASMonteCarlo ( )

GISAS simulation with Monte-Carlo integration switched ON.

Definition at line 352 of file StandardSimulations.cpp.

353 {
354  GISASSimulation* result = MiniGISAS();
355  result->getOptions().setMonteCarloIntegration(true, 100);
356  return result;
357 }
void setMonteCarloIntegration(bool flag=true, size_t mc_points=50)
Enables/disables MonetCarlo integration.

References Simulation::getOptions(), MiniGISAS(), and SimulationOptions::setMonteCarloIntegration().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ SphericalDetWithRoi()

GISASSimulation * StandardSimulations::SphericalDetWithRoi ( )

GISAS simulation with spherical detector, region of interest and mask.

Definition at line 361 of file StandardSimulations.cpp.

362 {
363  GISASSimulation* result = new GISASSimulation();
364  result->setDetectorParameters(40, -2.0 * Units::degree, 2.0 * Units::degree, 30,
365  0.0 * Units::degree, 3.0 * Units::degree);
366  result->setBeamParameters(1.0 * Units::angstrom, 0.2 * Units::degree, 0.0 * Units::degree);
367  result->addMask(Rectangle(-0.5 * Units::degree, 0.3 * Units::degree, -0.2 * Units::degree,
368  0.6 * Units::degree));
369  result->setRegionOfInterest(-1.5 * Units::degree, 0.25 * Units::degree, 1.5 * Units::degree,
370  1.75 * Units::degree);
371  return result;
372 }
void setRegionOfInterest(double xlow, double ylow, double xup, double yup)
Sets rectangular region of interest with lower left and upper right corners defined.

References Simulation2D::addMask(), Units::angstrom, Units::degree, GISASSimulation::setBeamParameters(), Simulation2D::setDetectorParameters(), and Simulation2D::setRegionOfInterest().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ RectDetWithRoi()

GISASSimulation * StandardSimulations::RectDetWithRoi ( )

GISAS simulation with rectangular detector, region of interest and mask.

Definition at line 376 of file StandardSimulations.cpp.

377 {
379  result->addMask(Rectangle(3.0, 4.0, 5.0, 7.0));
380  result->setRegionOfInterest(2.0, 3.0, 18.0, 15.0);
381  return result;
382 }
GISASSimulation * RectDetectorPerpToDirectBeam()
GISAS simulation with the rectangular detector perpendicular to the direct beam.

References Simulation2D::addMask(), RectDetectorPerpToDirectBeam(), and Simulation2D::setRegionOfInterest().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ ConstantBackgroundGISAS()

GISASSimulation * StandardSimulations::ConstantBackgroundGISAS ( )

Definition at line 384 of file StandardSimulations.cpp.

385 {
386  GISASSimulation* result = MiniGISAS();
387  ConstantBackground bg(1e3);
388  result->setBackground(bg);
389  return result;
390 }
Class representing a constant background signal.
void setBackground(const IBackground &bg)
Definition: Simulation.cpp:257

References MiniGISAS(), and Simulation::setBackground().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ MiniGISASFit()

GISASSimulation * StandardSimulations::MiniGISASFit ( )

Simulation with fitting.

Beam intensity set to provide reasonably large values in detector channels.

Definition at line 644 of file StandardSimulations.cpp.

645 {
646  auto* result = new GISASSimulation;
647  result->setDetectorParameters(25, -2.0 * Units::degree, 2.0 * Units::degree, 25,
648  0.0 * Units::degree, 2.0 * Units::degree);
649  result->setBeamParameters(1.0 * Units::angstrom, 0.2 * Units::degree, 0.0 * Units::degree);
650  result->setBeamIntensity(1e6);
651  return result;
652 }

References Units::angstrom, Units::degree, and Simulation2D::setDetectorParameters().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ ExtraLongWavelengthGISAS()

GISASSimulation * StandardSimulations::ExtraLongWavelengthGISAS ( )

GISAS simulation with an extra long wavelength.

Definition at line 394 of file StandardSimulations.cpp.

395 {
396  auto* simulation = new GISASSimulation;
397  simulation->setDetectorParameters(100, -1.0 * Units::deg, 1.0 * Units::deg, 100, 0.0,
398  2.0 * Units::deg);
399 
400  simulation->setBeamParameters(13.52 * Units::nm, 0.2 * Units::deg, 0.0 * Units::deg);
401  simulation->setBeamIntensity(1.0e+08);
402  simulation->getOptions().setIncludeSpecular(true);
403  return simulation;
404 }
static constexpr double nm
Definition: Units.h:31

References Units::deg, Units::nm, and Simulation2D::setDetectorParameters().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ MiniGISASPolarizationPP()

GISASSimulation * StandardSimulations::MiniGISASPolarizationPP ( )

Definition at line 169 of file StandardSimulations.cpp.

170 {
171  GISASSimulation* result = MiniGISAS();
172 
173  kvector_t analyzer_dir(0.0, 0.0, 1.0);
174  kvector_t beampol(0.0, 0.0, 1.0);
175 
176  result->setBeamPolarization(beampol);
177  result->setAnalyzerProperties(analyzer_dir, 1.0, 0.5);
178  return result;
179 }

References MiniGISAS(), Simulation::setAnalyzerProperties(), and Simulation::setBeamPolarization().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ MiniGISASPolarizationPM()

GISASSimulation * StandardSimulations::MiniGISASPolarizationPM ( )

Definition at line 181 of file StandardSimulations.cpp.

182 {
183  GISASSimulation* result = MiniGISAS();
184 
185  kvector_t analyzer_dir(0.0, 0.0, -1.0);
186  kvector_t beampol(0.0, 0.0, 1.0);
187 
188  result->setBeamPolarization(beampol);
189  result->setAnalyzerProperties(analyzer_dir, 1.0, 0.5);
190  return result;
191 }

References MiniGISAS(), Simulation::setAnalyzerProperties(), and Simulation::setBeamPolarization().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ MiniGISASPolarizationMP()

GISASSimulation * StandardSimulations::MiniGISASPolarizationMP ( )

Definition at line 193 of file StandardSimulations.cpp.

194 {
195  GISASSimulation* result = MiniGISAS();
196 
197  kvector_t analyzer_dir(0.0, 0.0, 1.0);
198  kvector_t beampol(0.0, 0.0, -1.0);
199 
200  result->setBeamPolarization(beampol);
201  result->setAnalyzerProperties(analyzer_dir, 1.0, 0.5);
202  return result;
203 }

References MiniGISAS(), Simulation::setAnalyzerProperties(), and Simulation::setBeamPolarization().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ MiniGISASPolarizationMM()

GISASSimulation * StandardSimulations::MiniGISASPolarizationMM ( )

Definition at line 205 of file StandardSimulations.cpp.

206 {
207  GISASSimulation* result = MiniGISAS();
208 
209  kvector_t analyzer_dir(0.0, 0.0, -1.0);
210  kvector_t beampol(0.0, 0.0, -1.0);
211 
212  result->setBeamPolarization(beampol);
213  result->setAnalyzerProperties(analyzer_dir, 1.0, 0.5);
214  return result;
215 }

References MiniGISAS(), Simulation::setAnalyzerProperties(), and Simulation::setBeamPolarization().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ BasicSpecular()

SpecularSimulation * StandardSimulations::BasicSpecular ( )

Definition at line 406 of file StandardSimulations.cpp.

407 {
408  const double wavelength = 1.54 * Units::angstrom;
409  const int number_of_bins = 2000;
410  const double min_angle = 0 * Units::deg;
411  const double max_angle = 5 * Units::deg;
412  AngularSpecScan scan(wavelength, FixedBinAxis("axis", number_of_bins, min_angle, max_angle));
413 
414  auto* result = new SpecularSimulation();
415  result->setScan(scan);
416  result->getOptions().setUseAvgMaterials(true);
417  return result;
418 }
Scan type with inclination angles as coordinate values and a unique wavelength.
Axis with fixed bin size.
Definition: FixedBinAxis.h:24
Main class to run a specular simulation.

References Units::angstrom, Units::deg, and anonymous_namespace{SlicedCylindersBuilder.cpp}::wavelength().

Referenced by BasicSpecularMM(), BasicSpecularMP(), BasicSpecularPM(), BasicSpecularPP(), and SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ BasicSpecularQ()

SpecularSimulation * StandardSimulations::BasicSpecularQ ( )

Definition at line 420 of file StandardSimulations.cpp.

421 {
422  std::vector<double> qs;
423  {
424  const double wavelength_0 = 1.54 * Units::angstrom;
425  const int number_of_bins = 2000;
426  const double min_angle = 0 * Units::deg;
427  const double max_angle = 5 * Units::deg;
428  FixedBinAxis angle_axis("axis", number_of_bins, min_angle, max_angle);
429  auto angles = angle_axis.getBinCenters();
430 
431  qs.resize(angle_axis.size(), 0.0);
432  for (size_t i = 0, size = qs.size(); i < size; ++i)
433  qs[i] = 4.0 * M_PI * std::sin(angles[i]) / wavelength_0;
434  }
435  QSpecScan q_scan(qs);
436 
437  auto* result = new SpecularSimulation;
438  result->setScan(q_scan);
439  result->getOptions().setUseAvgMaterials(true);
440  return result;
441 }
#define M_PI
Definition: MathConstants.h:39
Scan type with z-components of scattering vector as coordinate values.
Definition: QSpecScan.h:29
void setScan(const ISpecularScan &scan)
Sets chosen specular scan to the simulation.

References Units::angstrom, Units::deg, FixedBinAxis::getBinCenters(), M_PI, SpecularSimulation::setScan(), and FixedBinAxis::size().

Referenced by BasicSpecularQMM(), BasicSpecularQMP(), BasicSpecularQPM(), BasicSpecularQPP(), and SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ SpecularWithGaussianBeam()

SpecularSimulation * StandardSimulations::SpecularWithGaussianBeam ( )

Definition at line 443 of file StandardSimulations.cpp.

444 {
445  const double wavelength = 1.54 * Units::angstrom;
446  const int number_of_bins = 2000;
447  const double min_angle = 0 * Units::deg;
448  const double max_angle = 5 * Units::deg;
449  auto gaussian_ff = std::make_unique<FootprintGauss>(1.0);
450  AngularSpecScan scan(wavelength, FixedBinAxis("axis", number_of_bins, min_angle, max_angle));
451  scan.setFootprintFactor(gaussian_ff.get());
452 
453  auto* result = new SpecularSimulation;
454  result->setScan(scan);
455  return result;
456 }

References Units::angstrom, Units::deg, AngularSpecScan::setFootprintFactor(), SpecularSimulation::setScan(), and anonymous_namespace{SlicedCylindersBuilder.cpp}::wavelength().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ SpecularWithSquareBeam()

SpecularSimulation * StandardSimulations::SpecularWithSquareBeam ( )

Definition at line 458 of file StandardSimulations.cpp.

459 {
460  const double wavelength = 1.54 * Units::angstrom;
461  const int number_of_bins = 2000;
462  const double min_angle = 0 * Units::deg;
463  const double max_angle = 5 * Units::deg;
464  auto square_ff = std::make_unique<FootprintSquare>(1.0);
465  AngularSpecScan scan(wavelength, FixedBinAxis("axis", number_of_bins, min_angle, max_angle));
466  scan.setFootprintFactor(square_ff.get());
467 
468  auto* result = new SpecularSimulation;
469  result->setScan(scan);
470  return result;
471 }

References Units::angstrom, Units::deg, AngularSpecScan::setFootprintFactor(), SpecularSimulation::setScan(), and anonymous_namespace{SlicedCylindersBuilder.cpp}::wavelength().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ SpecularDivergentBeam()

SpecularSimulation * StandardSimulations::SpecularDivergentBeam ( )

Definition at line 473 of file StandardSimulations.cpp.

474 {
475  const double wavelength = 1.54 * Units::angstrom;
476  const int number_of_bins = 20;
477  const size_t n_integration_points = 10;
478  const double min_angle = 0 * Units::deg;
479  const double max_angle = 5 * Units::deg;
480  const double wl_stddev = 0.1 * Units::angstrom;
481  const double ang_stddev = 0.1 * Units::degree;
482  AngularSpecScan scan(wavelength, FixedBinAxis("axis", number_of_bins, min_angle, max_angle));
483 
484  RangedDistributionGaussian wl_distr(n_integration_points, /*sigma_factor = */ 2.0);
485  std::unique_ptr<ScanResolution> wl_res(
486  ScanResolution::scanAbsoluteResolution(wl_distr, wl_stddev));
487 
488  RangedDistributionGaussian alpha_distr(n_integration_points, /*sigma_factor = */ 2.0);
489  std::unique_ptr<ScanResolution> ang_res(
490  ScanResolution::scanAbsoluteResolution(alpha_distr, ang_stddev));
491 
492  scan.setWavelengthResolution(*wl_res);
493  scan.setAngleResolution(*ang_res);
494 
495  auto* result = new SpecularSimulation;
496  result->setScan(scan);
497  return result;
498 }
Gaussian distribution with standard deviation std_dev.
static ScanResolution * scanAbsoluteResolution(const RangedDistribution &distr, double stddev)

References Units::angstrom, Units::deg, Units::degree, ScanResolution::scanAbsoluteResolution(), AngularSpecScan::setAngleResolution(), SpecularSimulation::setScan(), AngularSpecScan::setWavelengthResolution(), and anonymous_namespace{SlicedCylindersBuilder.cpp}::wavelength().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ TOFRWithRelativeResolution()

SpecularSimulation * StandardSimulations::TOFRWithRelativeResolution ( )

Definition at line 500 of file StandardSimulations.cpp.

501 {
502  FixedBinAxis qs("axis", 500, 0.0, 1.0);
503  QSpecScan q_scan(qs);
504  q_scan.setRelativeQResolution(RangedDistributionGaussian(20, 2.0), 0.03);
505 
506  auto* result = new SpecularSimulation;
507  result->setScan(q_scan);
508  result->getOptions().setUseAvgMaterials(true);
509  return result;
510 }

References QSpecScan::setRelativeQResolution(), and SpecularSimulation::setScan().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ TOFRWithPointwiseResolution()

SpecularSimulation * StandardSimulations::TOFRWithPointwiseResolution ( )

Definition at line 512 of file StandardSimulations.cpp.

513 {
514  FixedBinAxis qs("axis", 500, 0.0, 1.0);
515  QSpecScan q_scan(qs);
516 
517  std::vector<double> resolutions;
518  resolutions.reserve(qs.size());
519  auto qs_vector = qs.getBinCenters();
520  std::for_each(qs_vector.begin(), qs_vector.end(),
521  [&resolutions](double q_val) { resolutions.push_back(0.03 * q_val); });
522  q_scan.setAbsoluteQResolution(RangedDistributionGaussian(20, 2.0), resolutions);
523 
524  auto* result = new SpecularSimulation;
525  result->setScan(q_scan);
526  result->getOptions().setUseAvgMaterials(true);
527  return result;
528 }

References FixedBinAxis::getBinCenters(), QSpecScan::setAbsoluteQResolution(), SpecularSimulation::setScan(), and FixedBinAxis::size().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ BasicSpecularPP()

SpecularSimulation * StandardSimulations::BasicSpecularPP ( )

Definition at line 531 of file StandardSimulations.cpp.

532 {
533  auto* simulation = BasicSpecular();
534  simulation->setBeamPolarization({0.0, 1.0, 0.0});
535  simulation->setAnalyzerProperties({0.0, 1.0, 0.0}, 1.0, 0.5);
536  return simulation;
537 }
SpecularSimulation * BasicSpecular()

References BasicSpecular().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ BasicSpecularMM()

SpecularSimulation * StandardSimulations::BasicSpecularMM ( )

Definition at line 555 of file StandardSimulations.cpp.

556 {
557  auto* simulation = BasicSpecular();
558  simulation->setBeamPolarization({0.0, -1.0, 0.0});
559  simulation->setAnalyzerProperties({0.0, -1.0, 0.0}, 1.0, 0.5);
560  return simulation;
561 }

References BasicSpecular().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ BasicSpecularPM()

SpecularSimulation * StandardSimulations::BasicSpecularPM ( )

Definition at line 539 of file StandardSimulations.cpp.

540 {
541  auto* simulation = BasicSpecular();
542  simulation->setBeamPolarization({0.0, 1.0, 0.0});
543  simulation->setAnalyzerProperties({0.0, -1.0, 0.0}, 1.0, 0.5);
544  return simulation;
545 }

References BasicSpecular().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ BasicSpecularMP()

SpecularSimulation * StandardSimulations::BasicSpecularMP ( )

Definition at line 547 of file StandardSimulations.cpp.

548 {
549  auto* simulation = BasicSpecular();
550  simulation->setBeamPolarization({0.0, -1.0, 0.0});
551  simulation->setAnalyzerProperties({0.0, 1.0, 0.0}, 1.0, 0.5);
552  return simulation;
553 }

References BasicSpecular().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ BasicSpecularQPP()

SpecularSimulation * StandardSimulations::BasicSpecularQPP ( )

Definition at line 563 of file StandardSimulations.cpp.

564 {
565  auto* simulation = BasicSpecularQ();
566  simulation->setBeamPolarization({0.0, 1.0, 0.0});
567  simulation->setAnalyzerProperties({0.0, 1.0, 0.0}, 1.0, 0.5);
568  return simulation;
569 }
SpecularSimulation * BasicSpecularQ()

References BasicSpecularQ().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ BasicSpecularQMM()

SpecularSimulation * StandardSimulations::BasicSpecularQMM ( )

Definition at line 571 of file StandardSimulations.cpp.

572 {
573  auto* simulation = BasicSpecularQ();
574  simulation->setBeamPolarization({0.0, -1.0, 0.0});
575  simulation->setAnalyzerProperties({0.0, -1.0, 0.0}, 1.0, 0.5);
576  return simulation;
577 }

References BasicSpecularQ().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ BasicSpecularQPM()

SpecularSimulation * StandardSimulations::BasicSpecularQPM ( )

Definition at line 579 of file StandardSimulations.cpp.

580 {
581  auto* simulation = BasicSpecularQ();
582  simulation->setBeamPolarization({0.0, 1.0, 0.0});
583  simulation->setAnalyzerProperties({0.0, -1.0, 0.0}, 1.0, 0.5);
584  return simulation;
585 }

References BasicSpecularQ().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ BasicSpecularQMP()

SpecularSimulation * StandardSimulations::BasicSpecularQMP ( )

Definition at line 587 of file StandardSimulations.cpp.

588 {
589  auto* simulation = BasicSpecularQ();
590  simulation->setBeamPolarization({0.0, -1.0, 0.0});
591  simulation->setAnalyzerProperties({0.0, 1.0, 0.0}, 1.0, 0.5);
592  return simulation;
593 }

References BasicSpecularQ().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function:

◆ MiniOffSpec()

OffSpecSimulation * StandardSimulations::MiniOffSpec ( )

Definition at line 598 of file StandardSimulations.cpp.

599 {
600  auto* result = new OffSpecSimulation;
601 
602  const int n_alpha(19);
603  const double alpha_min(0.0 * Units::deg);
604  const double alpha_max(4.0 * Units::deg);
605  const int n_phi(9);
606  const double phi_min(-0.1 * Units::deg);
607  const double phi_max(0.1 * Units::deg);
608 
609  result->setDetectorParameters(n_phi, phi_min, phi_max, n_alpha, alpha_min, alpha_max);
610 
611  const int n_scan_points(n_alpha);
612  const double alpha_i_min(alpha_min);
613  const double alpha_i_max(alpha_max);
614 
615  FixedBinAxis alpha_i_axis("alpha_i", n_scan_points, alpha_i_min, alpha_i_max);
616  result->setBeamParameters(5.0 * Units::angstrom, alpha_i_axis, 0.0);
617 
618  result->setBeamIntensity(1e9);
619  result->getOptions().setIncludeSpecular(true);
620 
621  return result;
622 }
Main class to run an off-specular simulation.

References Units::angstrom, and Units::deg.

Referenced by SimulationFactory::SimulationFactory().

◆ BasicDepthProbe()

DepthProbeSimulation * StandardSimulations::BasicDepthProbe ( )

Definition at line 624 of file StandardSimulations.cpp.

625 {
626  auto* result = new DepthProbeSimulation;
627 
628  const double wavelength = 10.0 * Units::angstrom;
629  const size_t n_alpha = 20;
630  const double alpha_min = 0.0 * Units::deg;
631  const double alpha_max = 1.0 * Units::deg;
632  const size_t n_z = n_alpha;
633  const double z_min = -100.0 * Units::nm;
634  const double z_max = 100.0 * Units::nm;
635 
636  result->setBeamParameters(wavelength, n_alpha, alpha_min, alpha_max);
637  result->setZSpan(n_z, z_min, z_max);
638 
639  return result;
640 }

References Units::angstrom, Units::deg, Units::nm, and anonymous_namespace{SlicedCylindersBuilder.cpp}::wavelength().

Referenced by SimulationFactory::SimulationFactory().

Here is the call graph for this function: