BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
LongBoxGauss.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/HardParticle/LongBoxGauss.h
6 //! @brief Defines class LongBoxGauss.
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_SAMPLE_HARDPARTICLE_LONGBOXGAUSS_H
16 #define BORNAGAIN_SAMPLE_HARDPARTICLE_LONGBOXGAUSS_H
17 
19 
20 //! The form factor for a long rectangular box.
21 //! @ingroup legacyGrating
22 
23 class LongBoxGauss : public IFormFactor {
24 public:
25  LongBoxGauss(double length, double width, double height);
26 #ifndef USER_API
27  LongBoxGauss(std::vector<double> P);
28 
29  LongBoxGauss* clone() const override { return new LongBoxGauss(m_length, m_width, m_height); }
30  std::string className() const final { return "LongBoxGauss"; }
31  // const auto tooltip = "class_tooltip";
32  std::vector<ParaMeta> parDefs() const final
33  {
34  return {{"Length", "nm", "para_tooltip", 0, +INF, 0},
35  {"Width", "nm", "para_tooltip", 0, +INF, 0},
36  {"Height", "nm", "para_tooltip", 0, +INF, 0}};
37  }
38 
39  double length() const { return m_length; }
40  double height() const { return m_height; }
41  double width() const { return m_width; }
42  double radialExtension() const override { return m_length / 2.0; }
43 
44  complex_t formfactor_at_bottom(C3 q) const override;
45 
46 private:
47  const double& m_length;
48  const double& m_width;
49  const double& m_height;
50 #endif // USER_API
51 };
52 
53 #endif // BORNAGAIN_SAMPLE_HARDPARTICLE_LONGBOXGAUSS_H
Defines interface IDecoratableBorn.
const double INF
Definition: INode.h:26
Abstract base class for Born form factors.
Definition: IFormFactor.h:36
The form factor for a long rectangular box.
Definition: LongBoxGauss.h:23
double height() const
Definition: LongBoxGauss.h:40
complex_t formfactor_at_bottom(C3 q) const override
LongBoxGauss(double length, double width, double height)
const double & m_length
Definition: LongBoxGauss.h:47
double length() const
Definition: LongBoxGauss.h:39
LongBoxGauss * clone() const override
Returns a clone of this ISampleNode object.
Definition: LongBoxGauss.h:29
double width() const
Definition: LongBoxGauss.h:41
std::string className() const final
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
Definition: LongBoxGauss.h:30
std::vector< ParaMeta > parDefs() const final
Returns the parameter definitions, to be hard-coded in each leaf class.
Definition: LongBoxGauss.h:32
double radialExtension() const override
Returns the (approximate in some cases) radial size of the particle of this form factor's shape....
Definition: LongBoxGauss.h:42
const double & m_height
Definition: LongBoxGauss.h:49
const double & m_width
Definition: LongBoxGauss.h:48