BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
StandardSimulations.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Core/Simulation/StandardSimulations.cpp
6 //! @brief Implements functions for standard simulations.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
16 #include "Base/Const/Units.h"
19 #include "Core/Scan/QSpecScan.h"
28 #include "Device/Mask/Ellipse.h"
29 #include "Device/Mask/Line.h"
30 #include "Device/Mask/Polygon.h"
31 #include "Device/Mask/Rectangle.h"
39 #include <memory>
40 
41 namespace {
42 
43 const size_t rdet_nbinsx(40), rdet_nbinsy(30);
44 const double rdet_width(20.0), rdet_height(18.0), rdet_distance(1000.0);
45 
46 } // namespace
47 
48 using Units::angstrom;
49 using Units::deg;
50 
51 //! Basic GISAS simulation with the detector phi[0,2], theta[0,2].
52 
54 {
55  Beam beam(1.0, 1 * angstrom, Direction(0.2 * deg, 0 * deg));
56  SphericalDetector det(100, 0 * deg, 2 * deg, 100, 0 * deg, 2 * deg);
57  return new GISASSimulation(beam, det);
58 }
59 
60 //! Basic GISAS for polarization studies.
61 
63 {
64  GISASSimulation* result = BasicGISAS();
65  kvector_t zplus(0.0, 0.0, 1.0);
66  result->beam().setPolarization(zplus);
67  result->detector().setAnalyzerProperties(zplus, 1.0, 0.5);
68  return result;
69 }
70 
71 //! Basic GISAS simulation for spin flip channel.
72 
74 {
75  GISASSimulation* result = BasicGISAS();
76  kvector_t zplus(0.0, 0.0, 1.0);
77  result->beam().setPolarization(zplus);
78  result->detector().setAnalyzerProperties(zplus, -1.0, 0.5);
79  return result;
80 }
81 
82 //! GISAS simulation with small detector and phi[-2,2], theta[0,2].
83 
85 {
86  Beam beam(1.0, 1 * angstrom, Direction(0.2 * deg, 0 * deg));
87  SphericalDetector det(25, -2 * deg, 2 * deg, 25, 0 * deg, 2 * deg);
88  return new GISASSimulation(beam, det);
89 }
90 
91 //! GISAS simulation with small detector and phi[-1,1], theta[0,1].
92 
94 {
95  Beam beam(1.0, 1 * angstrom, Direction(0.2 * deg, 0 * deg));
96  SphericalDetector det(25, -1 * deg, 1 * deg, 25, 0 * deg, 1 * deg);
97  return new GISASSimulation(beam, det);
98 }
99 
100 //! GISAS simulation with beam divergence applied.
101 
103 {
104  GISASSimulation* result = MiniGISAS();
105 
106  DistributionLogNormal wavelength_distr(1 * angstrom, 0.1);
107  DistributionGaussian alpha_distr(0.2 * deg, 0.02 * deg);
108  DistributionGate phi_distr(-0.1 * deg, 0.02 * deg);
109 
110  ParameterPattern pattern1;
111  pattern1.beginsWith("*").add("Beam").add("Wavelength");
112  result->addParameterDistribution(pattern1.toStdString(), wavelength_distr, 5);
113  ParameterPattern pattern2;
114  pattern2.beginsWith("*").add("Beam").add("InclinationAngle");
115  result->addParameterDistribution(pattern2.toStdString(), alpha_distr, 4);
116  ParameterPattern pattern3;
117  pattern3.beginsWith("*").add("Beam").add("AzimuthalAngle");
118  result->addParameterDistribution(pattern3.toStdString(), phi_distr, 3);
119 
120  return result;
121 }
122 
123 //! GISAS simulation with multiple masks on the detector plane.
124 
126 {
127  Beam beam(1e7, 1 * angstrom, Direction(0.2 * deg, 0 * deg));
128  SphericalDetector det(50, -1 * deg, 1 * deg, 50, 0 * deg, 2 * deg);
129  GISASSimulation* result = new GISASSimulation(beam, det);
130 
131  result->maskAll();
132  // pacman
133  const double deg = Units::deg;
134  result->addMask(Ellipse(0.0 * deg, 1.0 * deg, 0.5 * deg, 0.5 * deg), false);
135  result->addMask(Ellipse(0.11 * deg, 1.25 * deg, 0.05 * deg, 0.05 * deg), true);
136 
137  std::vector<std::vector<double>> points = {{0.0 * deg, 1.0 * deg},
138  {0.5 * deg, 1.2 * deg},
139  {0.5 * deg, 0.8 * deg},
140  {0.0 * deg, 1.0 * deg}};
141  result->addMask(Polygon(points), true);
142 
143  result->addMask(Rectangle(0.45 * deg, 0.95 * deg, 0.55 * deg, 1.05 * deg), false);
144  result->addMask(Rectangle(0.61 * deg, 0.95 * deg, 0.71 * deg, 1.05 * deg), false);
145  result->addMask(Rectangle(0.75 * deg, 0.95 * deg, 0.85 * deg, 1.05 * deg), false);
146 
147  // more masks
148  result->addMask(Ellipse(-0.5 * deg, 1.5 * deg, 0.3 * deg, 0.1 * deg, 45. * deg), false);
149  result->addMask(VerticalLine(-0.6 * deg), true);
150  result->addMask(HorizontalLine(0.3 * deg), false);
151 
152  return result;
153 }
154 
155 //! GISAS simulation with detector resolution.
156 
158 {
159  GISASSimulation* result = MiniGISAS();
160  ResolutionFunction2DGaussian resfunc(0.0025, 0.0025);
161  result->setDetectorResolutionFunction(resfunc);
162  return result;
163 }
164 
166 {
167  GISASSimulation* result = MiniGISAS();
168 
169  kvector_t analyzer_dir(0.0, 0.0, 1.0);
170  kvector_t beampol(0.0, 0.0, 1.0);
171 
172  result->beam().setPolarization(beampol);
173  result->detector().setAnalyzerProperties(analyzer_dir, 1.0, 0.5);
174  return result;
175 }
176 
178 {
179  GISASSimulation* result = MiniGISAS();
180 
181  kvector_t analyzer_dir(0.0, 0.0, -1.0);
182  kvector_t beampol(0.0, 0.0, 1.0);
183 
184  result->beam().setPolarization(beampol);
185  result->detector().setAnalyzerProperties(analyzer_dir, 1.0, 0.5);
186  return result;
187 }
188 
190 {
191  GISASSimulation* result = MiniGISAS();
192 
193  kvector_t analyzer_dir(0.0, 0.0, 1.0);
194  kvector_t beampol(0.0, 0.0, -1.0);
195 
196  result->beam().setPolarization(beampol);
197  result->detector().setAnalyzerProperties(analyzer_dir, 1.0, 0.5);
198  return result;
199 }
200 
202 {
203  GISASSimulation* result = MiniGISAS();
204 
205  kvector_t analyzer_dir(0.0, 0.0, -1.0);
206  kvector_t beampol(0.0, 0.0, -1.0);
207 
208  result->beam().setPolarization(beampol);
209  result->detector().setAnalyzerProperties(analyzer_dir, 1.0, 0.5);
210  return result;
211 }
212 
213 //! GISAS simulation with small detector and including specular peak.
214 
216 {
217  Beam beam(1.0, 1 * angstrom, Direction(0.2 * deg, 0 * deg));
218  SphericalDetector det(25, -2 * deg, 2 * deg, 25, 0 * deg, 2 * deg);
219  GISASSimulation* result = new GISASSimulation(beam, det);
220  result->setBeamParameters(1 * angstrom, 0.2 * deg, 0 * deg);
221  result->getOptions().setIncludeSpecular(true);
222  return result;
223 }
224 
225 //! GISAS simulation with large detector to test performance.
226 
228 {
229  Beam beam(1.0, 1 * angstrom, Direction(0.2 * deg, 0 * deg));
230  SphericalDetector det(256, -2 * deg, 2 * deg, 256, 0 * deg, 2 * deg);
231  return new GISASSimulation(beam, det);
232 }
233 
234 //! Basic GISAS for polarization studies.
235 
237 {
238  GISASSimulation* result = MaxiGISAS();
239  kvector_t zplus(0.0, 0.0, 1.0);
240  result->beam().setPolarization(zplus);
241  result->detector().setAnalyzerProperties(zplus, 1.0, 0.5);
242  return result;
243 }
244 
245 //! Typical IsGISAXS simulation with the detector phi[-1,1], theta[0,2].
246 
248 {
249  Beam beam(1.0, 1 * angstrom, Direction(0.2 * deg, 0 * deg));
250  IsGISAXSDetector det(100, -1 * deg, 1 * deg, 100, 0 * deg, 2 * deg);
251  return new GISASSimulation(beam, det);
252 }
253 
254 //! Typical IsGISAXS simulation with the detector phi[0,2], theta[0,2].
255 
257 {
258  Beam beam(1.0, 1 * angstrom, Direction(0.2 * deg, 0 * deg));
259  SphericalDetector det(100, 0 * deg, 2 * deg, 100, 0 * deg, 2 * deg);
260  return new GISASSimulation(beam, det);
261 }
262 
263 //! GISAS simulation with generic rectangular detector.
264 
266 {
267  Beam beam(1.0, 1 * angstrom, Direction(0.2 * deg, 0 * deg));
268  RectangularDetector det(rdet_nbinsx, rdet_width, rdet_nbinsy, rdet_height);
269  det.setPosition(kvector_t(rdet_distance, 10.0, 5.0), rdet_width / 2., 1.0,
270  kvector_t(0.1, -1.0, 0.2));
271  return new GISASSimulation(beam, det);
272 }
273 
274 //! GISAS simulation with the rectangular detector perpendicular to the sample.
275 
277 {
278  Beam beam(1.0, 1 * angstrom, Direction(0.2 * deg, 0 * deg));
279  RectangularDetector det(rdet_nbinsx, rdet_width, rdet_nbinsy, rdet_height);
280  det.setPerpendicularToSampleX(rdet_distance, rdet_width / 2., 1.0);
281  return new GISASSimulation(beam, det);
282 }
283 
284 //! GISAS simulation with the rectangular detector perpendicular to the direct beam.
285 
287 {
288  Beam beam(1.0, 1 * angstrom, Direction(0.2 * deg, 0 * deg));
289  RectangularDetector det(rdet_nbinsx, rdet_width, rdet_nbinsy, rdet_height);
290  det.setPerpendicularToDirectBeam(rdet_distance, rdet_width / 2., 1.0);
291  return new GISASSimulation(beam, det);
292 }
293 
294 //! GISAS simulation with the rectangular detector perpendicular to the reflected beam.
295 
297 {
298  Beam beam(1.0, 1 * angstrom, Direction(0.2 * deg, 0 * deg));
299  RectangularDetector det(rdet_nbinsx, rdet_width, rdet_nbinsy, rdet_height);
300  det.setPerpendicularToReflectedBeam(rdet_distance, rdet_width / 2., 1.0);
301  return new GISASSimulation(beam, det);
302 }
303 
304 //! GISAS simulation with the rectangular detector perpendicular to the reflected beam when
305 //! the coordinates of direct beam are known.
306 
308 {
309  Beam beam(1.0, 1 * angstrom, Direction(0.2 * deg, 0 * deg));
310  RectangularDetector det(rdet_nbinsx, rdet_width, rdet_nbinsy, rdet_height);
311  det.setPerpendicularToReflectedBeam(rdet_distance);
312  det.setDirectBeamPosition(rdet_width / 2., 1.0);
313  return new GISASSimulation(beam, det);
314 }
315 
316 //! GISAS simulation with Monte-Carlo integration switched ON.
317 
319 {
320  GISASSimulation* result = MiniGISAS();
321  result->getOptions().setMonteCarloIntegration(true, 100);
322  return result;
323 }
324 
325 //! GISAS simulation with spherical detector, region of interest and mask.
326 
328 {
329  Beam beam(1.0, 1 * angstrom, Direction(0.2 * deg, 0 * deg));
330  SphericalDetector det(40, -2 * deg, 2 * deg, 30, 0 * deg, 3 * deg);
331  GISASSimulation* result = new GISASSimulation(beam, det);
332  result->addMask(Rectangle(-0.5 * deg, 0.3 * deg, -0.2 * deg, 0.6 * deg));
333  result->setRegionOfInterest(-1.5 * deg, 0.25 * deg, 1.5 * deg, 1.75 * deg);
334  return result;
335 }
336 
337 //! GISAS simulation with rectangular detector, region of interest and mask.
338 
340 {
342  result->addMask(Rectangle(3.0, 4.0, 5.0, 7.0));
343  result->setRegionOfInterest(2.0, 3.0, 18.0, 15.0);
344  return result;
345 }
346 
348 {
349  GISASSimulation* result = MiniGISAS();
350  ConstantBackground bg(1e3);
351  result->setBackground(bg);
352  return result;
353 }
354 
355 //! GISAS simulation with an extra long wavelength
356 
358 {
359  Beam beam(1e8, 13.52 * Units::nm, Direction(0.2 * deg, 0 * deg));
360  SphericalDetector det(100, -1 * deg, 1 * deg, 100, 0.0, 2 * deg);
361  auto* simulation = new GISASSimulation(beam, det);
362  simulation->getOptions().setIncludeSpecular(true);
363  return simulation;
364 }
365 
367 {
368  const double wavelength = 1.54 * angstrom;
369  const int number_of_bins = 2000;
370  const double min_angle = 0 * deg;
371  const double max_angle = 5 * deg;
372  AngularSpecScan scan(wavelength, FixedBinAxis("axis", number_of_bins, min_angle, max_angle));
373 
374  auto* result = new SpecularSimulation();
375  result->setScan(scan);
376  result->getOptions().setUseAvgMaterials(true);
377  return result;
378 }
379 
381 {
382  std::vector<double> qs;
383  {
384  const double wavelength_0 = 1.54 * angstrom;
385  const int number_of_bins = 2000;
386  const double min_angle = 0 * deg;
387  const double max_angle = 5 * deg;
388  FixedBinAxis angle_axis("axis", number_of_bins, min_angle, max_angle);
389  auto angles = angle_axis.binCenters();
390 
391  qs.resize(angle_axis.size(), 0.0);
392  for (size_t i = 0, size = qs.size(); i < size; ++i)
393  qs[i] = 4.0 * M_PI * std::sin(angles[i]) / wavelength_0;
394  }
395  QSpecScan q_scan(qs);
396 
397  auto* result = new SpecularSimulation;
398  result->setScan(q_scan);
399  result->getOptions().setUseAvgMaterials(true);
400  return result;
401 }
402 
404 {
405  const double wavelength = 1.54 * angstrom;
406  const int number_of_bins = 2000;
407  const double min_angle = 0 * deg;
408  const double max_angle = 5 * deg;
409  auto gaussian_ff = std::make_unique<FootprintGauss>(1.0);
410  AngularSpecScan scan(wavelength, FixedBinAxis("axis", number_of_bins, min_angle, max_angle));
411  scan.setFootprintFactor(gaussian_ff.get());
412 
413  auto* result = new SpecularSimulation;
414  result->setScan(scan);
415  return result;
416 }
417 
419 {
420  const double wavelength = 1.54 * angstrom;
421  const int number_of_bins = 2000;
422  const double min_angle = 0 * deg;
423  const double max_angle = 5 * deg;
424  auto square_ff = std::make_unique<FootprintSquare>(1.0);
425  AngularSpecScan scan(wavelength, FixedBinAxis("axis", number_of_bins, min_angle, max_angle));
426  scan.setFootprintFactor(square_ff.get());
427 
428  auto* result = new SpecularSimulation;
429  result->setScan(scan);
430  return result;
431 }
432 
434 {
435  const double wavelength = 1.54 * angstrom;
436  const int number_of_bins = 20;
437  const size_t n_integration_points = 10;
438  const double min_angle = 0 * deg;
439  const double max_angle = 5 * deg;
440  const double wl_stddev = 0.1 * angstrom;
441  const double ang_stddev = 0.1 * deg;
442  AngularSpecScan scan(wavelength, FixedBinAxis("axis", number_of_bins, min_angle, max_angle));
443 
444  RangedDistributionGaussian wl_distr(n_integration_points, /*sigma_factor = */ 2.0);
445  std::unique_ptr<ScanResolution> wl_res(
446  ScanResolution::scanAbsoluteResolution(wl_distr, wl_stddev));
447 
448  RangedDistributionGaussian alpha_distr(n_integration_points, /*sigma_factor = */ 2.0);
449  std::unique_ptr<ScanResolution> ang_res(
450  ScanResolution::scanAbsoluteResolution(alpha_distr, ang_stddev));
451 
452  scan.setWavelengthResolution(*wl_res);
453  scan.setAngleResolution(*ang_res);
454 
455  auto* result = new SpecularSimulation;
456  result->setScan(scan);
457  return result;
458 }
459 
461 {
462  FixedBinAxis qs("axis", 500, 0.0, 1.0);
463  QSpecScan q_scan(qs);
464  q_scan.setRelativeQResolution(RangedDistributionGaussian(20, 2.0), 0.03);
465 
466  auto* result = new SpecularSimulation;
467  result->setScan(q_scan);
468  result->getOptions().setUseAvgMaterials(true);
469  return result;
470 }
471 
473 {
474  FixedBinAxis qs("axis", 500, 0.0, 1.0);
475  QSpecScan q_scan(qs);
476 
477  std::vector<double> resolutions;
478  resolutions.reserve(qs.size());
479  auto qs_vector = qs.binCenters();
480  std::for_each(qs_vector.begin(), qs_vector.end(),
481  [&resolutions](double q_val) { resolutions.push_back(0.03 * q_val); });
482  q_scan.setAbsoluteQResolution(RangedDistributionGaussian(20, 2.0), resolutions);
483 
484  auto* result = new SpecularSimulation;
485  result->setScan(q_scan);
486  result->getOptions().setUseAvgMaterials(true);
487  return result;
488 }
489 
490 // ------------ polarized specular ----------------
492 {
493  auto* simulation = BasicSpecular();
494  simulation->beam().setPolarization({0.0, 1.0, 0.0});
495  simulation->detector().setAnalyzerProperties({0.0, 1.0, 0.0}, 1.0, 0.5);
496  return simulation;
497 }
498 
500 {
501  auto* simulation = BasicSpecular();
502  simulation->beam().setPolarization({0.0, 1.0, 0.0});
503  simulation->detector().setAnalyzerProperties({0.0, -1.0, 0.0}, 1.0, 0.5);
504  return simulation;
505 }
506 
508 {
509  auto* simulation = BasicSpecular();
510  simulation->beam().setPolarization({0.0, -1.0, 0.0});
511  simulation->detector().setAnalyzerProperties({0.0, 1.0, 0.0}, 1.0, 0.5);
512  return simulation;
513 }
514 
516 {
517  auto* simulation = BasicSpecular();
518  simulation->beam().setPolarization({0.0, -1.0, 0.0});
519  simulation->detector().setAnalyzerProperties({0.0, -1.0, 0.0}, 1.0, 0.5);
520  return simulation;
521 }
522 
524 {
525  auto* simulation = BasicSpecularQ();
526  simulation->beam().setPolarization({0.0, 1.0, 0.0});
527  simulation->detector().setAnalyzerProperties({0.0, 1.0, 0.0}, 1.0, 0.5);
528  return simulation;
529 }
530 
532 {
533  auto* simulation = BasicSpecularQ();
534  simulation->beam().setPolarization({0.0, -1.0, 0.0});
535  simulation->detector().setAnalyzerProperties({0.0, -1.0, 0.0}, 1.0, 0.5);
536  return simulation;
537 }
538 
540 {
541  auto* simulation = BasicSpecularQ();
542  simulation->beam().setPolarization({0.0, 1.0, 0.0});
543  simulation->detector().setAnalyzerProperties({0.0, -1.0, 0.0}, 1.0, 0.5);
544  return simulation;
545 }
546 
548 {
549  auto* simulation = BasicSpecularQ();
550  simulation->beam().setPolarization({0.0, -1.0, 0.0});
551  simulation->detector().setAnalyzerProperties({0.0, 1.0, 0.0}, 1.0, 0.5);
552  return simulation;
553 }
554 
555 // ----------------------- off-spec simulations ------------------
556 
557 // OffSpecular simulation used in ResonatorOffSpecularSetup.py
559 {
560  auto* result = new OffSpecularSimulation;
561 
562  const int n_alpha(19);
563  const double alpha_min(0 * deg);
564  const double alpha_max(4 * deg);
565  const int n_phi(9);
566  const double phi_min(-0.1 * deg);
567  const double phi_max(0.1 * deg);
568 
569  result->setDetectorParameters(n_phi, phi_min, phi_max, n_alpha, alpha_min, alpha_max);
570 
571  const int n_scan_points(n_alpha);
572  const double alpha_i_min(alpha_min);
573  const double alpha_i_max(alpha_max);
574 
575  FixedBinAxis alpha_i_axis("alpha_i", n_scan_points, alpha_i_min, alpha_i_max);
576  result->setBeamParameters(5 * angstrom, alpha_i_axis, 0.0);
577 
578  result->beam().setIntensity(1e9);
579  result->getOptions().setIncludeSpecular(true);
580 
581  return result;
582 }
583 
585 {
586  auto* result = new DepthProbeSimulation;
587 
588  const double wavelength = 10 * angstrom;
589  const size_t n_alpha = 20;
590  const double alpha_min = 0 * deg;
591  const double alpha_max = 1 * deg;
592  const size_t n_z = n_alpha;
593  const double z_min = -100.0 * Units::nm;
594  const double z_max = 100.0 * Units::nm;
595 
596  result->setBeamParameters(wavelength, n_alpha, alpha_min, alpha_max);
597  result->setZSpan(n_z, z_min, z_max);
598 
599  return result;
600 }
601 
602 //! ISimulation with fitting.
603 //! Beam intensity set to provide reasonably large values in detector channels.
605 {
606  auto* result = new GISASSimulation;
607  result->setDetectorParameters(25, -2 * deg, 2 * deg, 25, 0 * deg, 2 * deg);
608  result->setBeamParameters(1 * angstrom, 0.2 * deg, 0 * deg);
609  result->beam().setIntensity(1e6);
610  return result;
611 }
Declares AngularSpecScan class.
Defines class ConstantBackground.
#define M_PI
Definition: Constants.h:44
Defines class DepthProbeSimulation.
Defines classes representing one-dimensional distributions.
Defines class Rectangle.
Defines class FootprintGauss.
Defines class FootprintSquare.
Defines class GISASSimulation.
Defines class IsGISAXSDetector.
Defines class Line.
Defines class OffSpecularSimulation.
Defines class ParameterPattern.
Defines class Polygon.
Declares QSpecScan class.
Defines classes representing ranged one-dimensional distributions.
Defines class RealParameter.
Defines class Rectangle.
Defines class RectangularDetector.
Defines class ResolutionFunction2DGaussian.
Defines class SampleBuilderFactory.
Defines scan resolution class.
Defines class SpecularSimulation.
Defines namespace and functions for standard simulations.
Defines some unit conversion factors and other constants in namespace Units.
BasicVector3D< double > kvector_t
Definition: Vectors3D.h:21
Scan type with inclination angles as coordinate values and a unique wavelength.
void setAngleResolution(const ScanResolution &resolution)
Sets angle resolution values via ScanResolution object.
void setFootprintFactor(const IFootprintFactor *f_factor)
Sets footprint correction factor.
void setWavelengthResolution(const ScanResolution &resolution)
Sets wavelength resolution values via ScanResolution object.
An incident neutron or x-ray beam.
Definition: Beam.h:27
void setPolarization(const kvector_t bloch_vector)
Sets the polarization density matrix according to the given Bloch vector.
Definition: Beam.cpp:112
Class representing a constant background signal.
A direction in three-dimensional space.
Definition: Direction.h:24
Uniform distribution function with half width hwhm.
Definition: Distributions.h:88
Gaussian distribution with standard deviation std_dev.
Log-normal distribution.
An ellipse, for use in detector masks.
Definition: Ellipse.h:23
Axis with fixed bin size.
Definition: FixedBinAxis.h:23
std::vector< double > binCenters() const
size_t size() const
retrieve the number of bins
Definition: FixedBinAxis.h:35
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)
An infinite horizontal line.
Definition: Line.h:55
void setAnalyzerProperties(const kvector_t direction, double efficiency, double total_transmission)
Sets the polarization analyzer characteristics of the detector.
Definition: IDetector.cpp:99
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.
void setRegionOfInterest(double xlow, double ylow, double xup, double yup)
Sets rectangular region of interest with lower left and upper right corners defined.
void maskAll()
Put the mask for all detector channels (i.e. exclude whole detector from the analysis)
void addMask(const IShape2D &shape, bool mask_value=true)
Adds mask of given shape to the stack of detector masks.
void setDetectorResolutionFunction(const IResolutionFunction2D &resolution_function)
void addParameterDistribution(const std::string &param_name, const IDistribution1D &distribution, size_t nbr_samples, double sigma_factor=0.0, const RealLimits &limits=RealLimits())
const SimulationOptions & getOptions() const
Definition: ISimulation.h:91
IDetector & detector()
Definition: ISimulation.h:63
void setBackground(const IBackground &bg)
Beam & beam()
Definition: ISimulation.h:58
A spherical detector used for validation with IsGISAXS results.
Main class to run an off-specular simulation.
Helper class for constructing parameter patterns.
ParameterPattern & beginsWith(std::string start_type)
std::string toStdString() const
ParameterPattern & add(std::string object_type)
A polygon, for use in detector masks.
Definition: Polygon.h:30
Scan type with z-components of scattering vector as coordinate values.
Definition: QSpecScan.h:28
void setAbsoluteQResolution(const IRangedDistribution &distr, double std_dev)
Definition: QSpecScan.cpp:122
void setRelativeQResolution(const IRangedDistribution &distr, double rel_dev)
Definition: QSpecScan.cpp:107
Gaussian distribution with standard deviation std_dev.
A rectangle, for use in detector masks.
Definition: Rectangle.h:25
A flat rectangular detector with axes and resolution function.
void setDirectBeamPosition(double u0, double v0)
void setPerpendicularToSampleX(double distance, double u0, double v0)
void setPerpendicularToDirectBeam(double distance, double u0, double v0)
void setPerpendicularToReflectedBeam(double distance, double u0=0.0, double v0=0.0)
void setPosition(const kvector_t normal_to_detector, double u0, double v0, const kvector_t direction=kvector_t(0.0, -1.0, 0.0))
Simple gaussian two-dimensional resolution function.
static ScanResolution * scanAbsoluteResolution(const IRangedDistribution &distr, double stddev)
void setIncludeSpecular(bool include_specular)
void setMonteCarloIntegration(bool flag=true, size_t mc_points=50)
Enables/disables MonetCarlo integration.
Main class to run a specular simulation.
void setScan(const ISpecularScan &scan)
Sets chosen specular scan to the simulation.
A detector with coordinate axes along angles phi and alpha.
An infinite vertical line.
Definition: Line.h:38
SpecularSimulation * BasicSpecularQPP()
GISASSimulation * RectDetectorPerpToReflectedBeam()
GISAS simulation with the rectangular detector perpendicular to the reflected beam.
GISASSimulation * BasicGISAS00()
Basic GISAS for polarization studies.
GISASSimulation * RectDetectorPerpToDirectBeam()
GISAS simulation with the rectangular detector perpendicular to the direct beam.
SpecularSimulation * BasicSpecularMP()
GISASSimulation * BasicGISAS()
Basic GISAS simulation with the detector phi[0,2], theta[0,2].
GISASSimulation * MiniGISASBeamDivergence()
GISAS simulation with beam divergence applied.
SpecularSimulation * SpecularWithSquareBeam()
GISASSimulation * GISASWithMasks()
GISAS simulation with multiple masks on the detector plane.
GISASSimulation * MiniGISAS()
GISAS simulation with small detector and phi[-2,2], theta[0,2].
SpecularSimulation * BasicSpecularPM()
GISASSimulation * IsGISAXSSimulation1()
Typical IsGISAXS simulation with the detector phi[-1,1], theta[0,2].
GISASSimulation * ExtraLongWavelengthGISAS()
GISAS simulation with an extra long wavelength.
OffSpecularSimulation * MiniOffSpecular()
GISASSimulation * RectDetectorPerpToSample()
GISAS simulation with the rectangular detector perpendicular to the sample.
GISASSimulation * SphericalDetWithRoi()
GISAS simulation with spherical detector, region of interest and mask.
GISASSimulation * MiniGISASPolarizationPM()
SpecularSimulation * TOFRWithRelativeResolution()
GISASSimulation * MiniGISASDetectorResolution()
GISAS simulation with detector resolution.
SpecularSimulation * BasicSpecularQMP()
GISASSimulation * MiniGISASMonteCarlo()
GISAS simulation with Monte-Carlo integration switched ON.
SpecularSimulation * SpecularWithGaussianBeam()
GISASSimulation * MiniGISASPolarizationMM()
GISASSimulation * MiniGISASPolarizationMP()
DepthProbeSimulation * BasicDepthProbe()
GISASSimulation * IsGISAXSSimulation2()
Typical IsGISAXS simulation with the detector phi[0,2], theta[0,2].
GISASSimulation * ConstantBackgroundGISAS()
SpecularSimulation * BasicSpecularQPM()
GISASSimulation * RectDetectorGeneric()
GISAS simulation with generic rectangular detector.
SpecularSimulation * BasicSpecularMM()
GISASSimulation * MiniGISASPolarizationPP()
SpecularSimulation * BasicSpecularPP()
SpecularSimulation * BasicSpecularQ()
GISASSimulation * MaxiGISAS()
GISAS simulation with large detector to test performance.
GISASSimulation * MiniGISAS_v2()
GISAS simulation with small detector and phi[-1,1], theta[0,1].
GISASSimulation * RectDetectorPerpToReflectedBeamDpos()
GISAS simulation with the rectangular detector perpendicular to the reflected beam when the coordinat...
SpecularSimulation * TOFRWithPointwiseResolution()
GISASSimulation * MiniGISASSpecularPeak()
GISAS simulation with small detector and including specular peak.
GISASSimulation * RectDetWithRoi()
GISAS simulation with rectangular detector, region of interest and mask.
GISASSimulation * MiniGISASFit()
ISimulation with fitting.
GISASSimulation * BasicPolarizedGISAS()
Basic GISAS simulation for spin flip channel.
SpecularSimulation * SpecularDivergentBeam()
SpecularSimulation * BasicSpecularQMM()
GISASSimulation * MaxiGISAS00()
Basic GISAS for polarization studies.
SpecularSimulation * BasicSpecular()
static constexpr double deg
Definition: Units.h:46
static constexpr double nm
Definition: Units.h:39
static constexpr double angstrom
Definition: Units.h:34