BornAgain  1.19.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 reflection and scattering
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 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_SAMPLE_SLICE_SLICEDFORMFACTORLIST_H
21 #define BORNAGAIN_SAMPLE_SLICE_SLICEDFORMFACTORLIST_H
22 
25 #include <map>
26 #include <memory>
27 
28 class MultiLayer;
29 class Slice;
30 
31 //! Class that contains and owns a list of form factors and the index of their containing layer.
32 //! This class also handles the slicing of form factors if they cross layer interfaces.
33 //!
34 //! @ingroup intern
35 
37 public:
38  SlicedFormFactorList() = default;
41  ~SlicedFormFactorList() = default;
42 
44  const std::vector<Slice>& slices,
45  double z_ref);
46 
47  size_t size() const;
48 
49  std::pair<const IFormFactor*, size_t> operator[](size_t index) const;
50 
51  std::map<size_t, std::vector<HomogeneousRegion>> regionMap() const;
52 
53 private:
54  void addParticle(IParticle& particle, const std::vector<Slice>& slices, double z_ref);
55  std::vector<std::pair<std::unique_ptr<IFormFactor>, size_t>> m_ff_list;
56  std::map<size_t, std::vector<HomogeneousRegion>> m_region_map;
57 };
58 
59 #endif // BORNAGAIN_SAMPLE_SLICE_SLICEDFORMFACTORLIST_H
60 #endif // USER_API
Defines struct HomogeneousRegion, and declares fct createAveragedMaterial.
Defines and implements interface IFormFactor.
Abstract 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:41
Data structure containing the data of a single slice, for calculating the Fresnel coefficients.
Definition: Slice.h:32
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