BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
CoherentFFSum.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Resample/Coherence/CoherentFFSum.cpp
6 //! @brief Implements class CoherentFFSum.
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 
18 #include <utility>
19 
20 CoherentFFSum::CoherentFFSum(double abundance, std::vector<std::shared_ptr<const SumDWBA>> terms)
21  : m_abundance(abundance)
22  , m_terms(std::move(terms))
23 {
24 }
25 
26 complex_t CoherentFFSum::summedFF(const DiffuseElement& ele) const
27 {
28  complex_t result = 0.;
29  for (const auto& term : m_terms)
30  result += term->coherentFF(ele);
31  return result;
32 }
33 
35 {
36  SpinMatrix result;
37  for (const auto& term : m_terms)
38  result += term->coherentPolFF(ele);
39  return result;
40 }
41 
43 {
44  return m_terms[0]->ff().radialExtension();
45 }
Defines class CoherentFFSum.
Defines and implements interface IReParticle.
Defines class SumDWBA.
SpinMatrix summedPolFF(const DiffuseElement &ele) const
double radialExtension() const
CoherentFFSum(double abundance, std::vector< std::shared_ptr< const SumDWBA >> terms)
complex_t summedFF(const DiffuseElement &ele) const
const std::vector< std::shared_ptr< const SumDWBA > > m_terms
Definition: CoherentFFSum.h:45
Data stucture containing both input and output of a single detector cell.