BornAgain  1.19.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 reflection and scattering
4 //
5 //! @file Sample/Processed/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 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_SAMPLE_PROCESSED_PROCESSEDLAYOUT_H
21 #define BORNAGAIN_SAMPLE_PROCESSED_PROCESSEDLAYOUT_H
22 
23 #include <map>
24 #include <memory>
25 #include <vector>
26 
28 struct HomogeneousRegion;
29 class IFresnelMap;
31 class ParticleLayout;
32 class IParticle;
33 class Slice;
34 
35 //! Data structure that contains preprocessed data for a single layout.
36 //!
37 //! If particles in the layout crossed the limits of the layer slices, these particles will
38 //! be sliced themselves.
39 //!
40 //! @ingroup algorithms_internal
41 
43 public:
44  ProcessedLayout(const ParticleLayout& layout, const std::vector<Slice>& slices, double z_ref,
45  const IFresnelMap* p_fresnel_map, bool polarized);
48 
49  size_t numberOfSlices() const;
50  double surfaceDensity() const;
51  const std::vector<FormFactorCoherentSum>& formFactorList() const;
53  std::map<size_t, std::vector<HomogeneousRegion>> regionMap() const;
54 
55 private:
56  void collectFormFactors(const ParticleLayout& layout, const std::vector<Slice>& slices,
57  double z_ref);
59  const std::vector<Slice>& slices, double z_ref);
60  void mergeRegionMap(const std::map<size_t, std::vector<HomogeneousRegion>>& region_map);
63  size_t m_n_slices;
65  std::vector<FormFactorCoherentSum> m_formfactors;
66  std::unique_ptr<IInterferenceFunction> m_iff;
67  std::map<size_t, std::vector<HomogeneousRegion>> m_region_map;
68 };
69 
70 #endif // BORNAGAIN_SAMPLE_PROCESSED_PROCESSEDLAYOUT_H
71 #endif // USER_API
Information about particle form factor and abundance.
Holds the necessary information to calculate the radiation wavefunction in every layer for different ...
Definition: IFresnelMap.h:34
Abstract base class of interference functions.
Abstract base class for Particle, ParticleComposition, ParticleCoreShell, MesoCrystal.
Definition: IParticle.h:33
Decorator class that adds particles to ISampleNode objects.
Data structure that contains preprocessed data for a single layout.
FormFactorCoherentSum processParticle(const IParticle &particle, const std::vector< Slice > &slices, double z_ref)
ProcessedLayout(const ParticleLayout &layout, const std::vector< Slice > &slices, double z_ref, const IFresnelMap *p_fresnel_map, bool polarized)
void mergeRegionMap(const std::map< size_t, std::vector< HomogeneousRegion >> &region_map)
std::map< size_t, std::vector< HomogeneousRegion > > m_region_map
size_t numberOfSlices() const
std::vector< FormFactorCoherentSum > m_formfactors
std::map< size_t, std::vector< HomogeneousRegion > > regionMap() const
std::unique_ptr< IInterferenceFunction > m_iff
double m_surface_density
const std::vector< FormFactorCoherentSum > & formFactorList() const
void collectFormFactors(const ParticleLayout &layout, const std::vector< Slice > &slices, double z_ref)
const IInterferenceFunction * interferenceFunction() const
double surfaceDensity() const
const IFresnelMap * m_fresnel_map
Data structure containing the data of a single slice, for calculating the Fresnel coefficients.
Definition: Slice.h:32
matrixFFVector_t polarized(const SimulationElement &sim_element, const std::vector< FormFactorCoherentSum > &ff_wrappers)
Struct that contains information on a single homogeneous region of a particle inside a single layer.