BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FormFactorSphereLogNormalRadius.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/SoftParticle/FormFactorSphereLogNormalRadius.h
6 //! @brief Defines and implements class FormFactorSphereLogNormalRadius.
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_SOFTPARTICLE_FORMFACTORSPHERELOGNORMALRADIUS_H
16 #define BORNAGAIN_CORE_SOFTPARTICLE_FORMFACTORSPHERELOGNORMALRADIUS_H
17 
20 #include <memory>
21 
22 //! A sphere with log normal radius distribution.
23 //! @ingroup softParticle
24 
26 {
27 public:
28  FormFactorSphereLogNormalRadius(const std::vector<double> P, size_t n_samples = 0);
29  FormFactorSphereLogNormalRadius(double mean, double scale_param, size_t n_samples);
30 
31  FormFactorSphereLogNormalRadius* clone() const override final;
32 
33  void accept(INodeVisitor* visitor) const override final { visitor->visit(this); }
34 
35  double radialExtension() const override final { return m_mean; }
36 
37  complex_t evaluate_for_q(cvector_t q) const override final;
38 
39 protected:
40  void onChange() override final;
41 
42 private:
43  const double& m_mean;
44  const double& m_scale_param;
45  size_t m_n_samples;
46 
47  std::vector<double> m_radii;
48  std::vector<double> m_probabilities;
49 };
50 
51 #endif // BORNAGAIN_CORE_SOFTPARTICLE_FORMFACTORSPHERELOGNORMALRADIUS_H
std::complex< double > complex_t
Definition: Complex.h:20
Defines pure virtual interface class IFormFactorBorn.
Defines and implements template class SafePointerVector.
A sphere with log normal radius distribution.
double radialExtension() const override final
Returns the (approximate in some cases) radial size of the particle of this form factor's shape.
void accept(INodeVisitor *visitor) const override final
Calls the INodeVisitor's visit method.
void onChange() override final
Action to be taken in inherited class when a parameter has changed.
FormFactorSphereLogNormalRadius * clone() const override final
Returns a clone of this ISample object.
FormFactorSphereLogNormalRadius(const std::vector< double > P, size_t n_samples=0)
complex_t evaluate_for_q(cvector_t q) const override final
Returns scattering amplitude for complex scattering wavevector q=k_i-k_f.
Pure virtual base class for Born form factors.
Visitor interface to visit ISample objects.
Definition: INodeVisitor.h:149