BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
SlicedFormFactorList.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/Slice/SlicedFormFactorList.h
6 //! @brief Defines class SlicedFormFactorList.
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_MULTILAYER_SLICEDFORMFACTORLIST_H
16 #define BORNAGAIN_CORE_MULTILAYER_SLICEDFORMFACTORLIST_H
17 
20 #include <map>
21 #include <memory>
22 
23 class MultiLayer;
24 class Slice;
25 
26 //! Class that contains and owns a list of form factors and the index of their containing layer.
27 //! This class also handles the slicing of form factors if they cross layer interfaces.
28 //!
29 //! @ingroup intern
30 
32 {
33 public:
34  SlicedFormFactorList() = default;
37  ~SlicedFormFactorList() = default;
38 
40  const std::vector<Slice>& slices,
41  double z_ref);
42 
43  size_t size() const;
44 
45  std::pair<const IFormFactor*, size_t> operator[](size_t index) const;
46 
47  std::map<size_t, std::vector<HomogeneousRegion>> regionMap() const;
48 
49 private:
50  void addParticle(IParticle& particle, const std::vector<Slice>& slices, double z_ref);
51  std::vector<std::pair<std::unique_ptr<IFormFactor>, size_t>> m_ff_list;
52  std::map<size_t, std::vector<HomogeneousRegion>> m_region_map;
53 };
54 
55 #endif // BORNAGAIN_CORE_MULTILAYER_SLICEDFORMFACTORLIST_H
Defines struct HomogeneousRegion, and declares fct createAveragedMaterial.
Defines and implements pure virtual interface IFormFactor.
Pure virtual base class for Particle, ParticleComposition, ParticleCoreShell, MesoCrystal.
Definition: IParticle.h:33
Our sample model: a stack of layers one below the other.
Definition: MultiLayer.h:42
Data structure containing the data of a single slice, for calculating the Fresnel coefficients.
Definition: Slice.h:28
Class that contains and owns a list of form factors and the index of their containing layer.
std::pair< const IFormFactor *, size_t > operator[](size_t index) const
std::vector< std::pair< std::unique_ptr< IFormFactor >, size_t > > m_ff_list
~SlicedFormFactorList()=default
void addParticle(IParticle &particle, const std::vector< Slice > &slices, double z_ref)
static SlicedFormFactorList createSlicedFormFactors(const IParticle &particle, const std::vector< Slice > &slices, double z_ref)
std::map< size_t, std::vector< HomogeneousRegion > > regionMap() const
SlicedFormFactorList & operator=(SlicedFormFactorList &&other)=default
SlicedFormFactorList()=default
SlicedFormFactorList(SlicedFormFactorList &&other)=default
std::map< size_t, std::vector< HomogeneousRegion > > m_region_map