BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
RotatedPyramidsBuilder.cpp
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/StandardSamples/RotatedPyramidsBuilder.cpp
6 //! @brief Implements classe RotatedPyramidsBuilder
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"
23 
24 MultiLayer* RotatedPyramidsBuilder::buildSample() const
25 {
26  const double m_length(10 * Units::nanometer);
27  const double m_height(5 * Units::nanometer);
28  const double m_alpha(Units::deg2rad(54.73));
29  const double m_zangle(45. * Units::degree);
30 
31  Layer vacuum_layer(refMat::Vacuum);
32  Layer substrate_layer(refMat::Substrate);
33 
34  FormFactorPyramid ff_pyramid(m_length, m_height, m_alpha);
35 
36  Particle pyramid(refMat::Particle, ff_pyramid);
37 
38  RotationZ z_rotation(m_zangle);
39 
40  ParticleLayout particle_layout;
41  particle_layout.addParticle(pyramid, 1.0, kvector_t(0, 0, 0), z_rotation);
42 
43  vacuum_layer.addLayout(particle_layout);
44 
45  MultiLayer* multi_layer = new MultiLayer();
46  multi_layer->addLayer(vacuum_layer);
47  multi_layer->addLayer(substrate_layer);
48  return multi_layer;
49 }
Defines class FormFactorPyramid.
Defines class Layer.
Defines class MultiLayer.
Defines class ParticleLayout.
Defines class Particle.
Defines materials in namespace refMat.
Defines class RotatedPyramidsBuilder.
Defines some unit conversion factors and other constants in namespace Units.
A frustum with a quadratic base.
A layer, with thickness (in nanometer) and material.
Definition: Layer.h:28
Our sample model: a stack of layers one below the other.
Definition: MultiLayer.h:42
void addLayer(const Layer &layer)
Adds object to multilayer.
Definition: MultiLayer.cpp:54
Decorator class that adds particles to ISample objects.
void addParticle(const IAbstractParticle &particle, double abundance=-1.0, const kvector_t position={}, const IRotation &rotation=IdentityRotation())
Adds particle to the layout with abundance, position and the rotation defined.
A particle with a form factor and refractive index.
Definition: Particle.h:26
A rotation about the z axis.
Definition: Rotations.h:114