BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ProcessedLayout.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Core/Computation/ProcessedLayout.h
6 //! @brief Defines class ProcessedLayout.
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 
15 #ifndef BORNAGAIN_CORE_COMPUTATION_PROCESSEDLAYOUT_H
16 #define BORNAGAIN_CORE_COMPUTATION_PROCESSEDLAYOUT_H
17 
18 #include <map>
19 #include <memory>
20 #include <vector>
21 
23 struct HomogeneousRegion;
24 class IFresnelMap;
26 class ILayout;
27 class IParticle;
28 class Slice;
29 
30 //! Data structure that contains preprocessed data for a single layout.
31 //!
32 //! If particles in the layout crossed the limits of the layer slices, these particles will
33 //! be sliced themselves.
34 //!
35 //! @ingroup algorithms_internal
36 
38 {
39 public:
40  ProcessedLayout(const ILayout& layout, const std::vector<Slice>& slices, double z_ref,
41  const IFresnelMap* p_fresnel_map, bool polarized);
43  ~ProcessedLayout();
44 
45  size_t numberOfSlices() const;
46  double surfaceDensity() const;
47  const std::vector<FormFactorCoherentSum>& formFactorList() const;
48  const IInterferenceFunction* interferenceFunction() const;
49  std::map<size_t, std::vector<HomogeneousRegion>> regionMap() const;
50 
51 private:
52  void collectFormFactors(const ILayout& layout, const std::vector<Slice>& slices, double z_ref);
53  FormFactorCoherentSum ProcessParticle(const IParticle& particle,
54  const std::vector<Slice>& slices, double z_ref);
55  void mergeRegionMap(const std::map<size_t, std::vector<HomogeneousRegion>>& region_map);
56  const IFresnelMap* mp_fresnel_map;
57  bool m_polarized;
58  size_t m_n_slices;
59  double m_surface_density;
60  std::vector<FormFactorCoherentSum> m_formfactors;
61  std::unique_ptr<IInterferenceFunction> mP_iff;
62  std::map<size_t, std::vector<HomogeneousRegion>> m_region_map;
63 };
64 
65 #endif // BORNAGAIN_CORE_COMPUTATION_PROCESSEDLAYOUT_H
Information about particle form factor and abundance.
Holds the necessary information to calculate the radiation wavefunction in every layer for different ...
Definition: IFresnelMap.h:30
Pure virtual base class of interference functions.
Pure virtual interface class to equip a sample layer with scattering properties.
Definition: ILayout.h:32
Pure virtual base class for Particle, ParticleComposition, ParticleCoreShell, MesoCrystal.
Definition: IParticle.h:33
Data structure that contains preprocessed data for a single layout.
Data structure containing the data of a single slice, for calculating the Fresnel coefficients.
Definition: Slice.h:28
Struct that contains information on a single homogeneous region of a particle inside a single layer.