File: PhysicalScan.h

package info (click to toggle)
bornagain 23.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 103,936 kB
  • sloc: cpp: 423,131; python: 40,997; javascript: 11,167; awk: 630; sh: 318; ruby: 173; xml: 130; makefile: 51; ansic: 24
file content (85 lines) | stat: -rw-r--r-- 2,900 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//  ************************************************************************************************
//
//  BornAgain: simulate and fit reflection and scattering
//
//! @file      Sim/Scan/PhysicalScan.h
//! @brief     Declares interface PhysicalScan.
//!
//! @homepage  http://www.bornagainproject.org
//! @license   GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2023
//! @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
//  ************************************************************************************************

#ifndef BORNAGAIN_SIM_SCAN_PHYSICALSCAN_H
#define BORNAGAIN_SIM_SCAN_PHYSICALSCAN_H

#include "Sim/Scan/BeamScan.h"
#include <memory>

class IDistribution1D;
class IFootprint;
struct ParameterSample;

//! Abstract base class for alpha and lambda scans.

class PhysicalScan : public BeamScan {
public:
    PhysicalScan(const Scale& axis);
    ~PhysicalScan() override;

    void setWavelength(double lambda);
    //! Distribution with absolute width, **complementing** wavelength values
    void setWavelengthDistribution(const IDistribution1D& distr);

    void setGrazingAngle(double alpha);
    //! Distribution with absolute width, **complementing** grazing angle values
    void setGrazingAngleDistribution(const IDistribution1D& distr);

    void setAzimuthalAngle(double phi);
    //! Distribution with absolute width, **complementing** azimuthal angle values
    void setAzimuthalAngleDistribution(const IDistribution1D& distr);

    void setFootprint(const IFootprint* footprint);

#ifndef SWIG
    PhysicalScan* clone() const override = 0;

    std::vector<const INode*> nodeChildren() const override;

    const IFootprint* commonFootprint() const;
    const IFootprint* footprintAt(size_t i) const;

    double commonWavelength() const;
    double wavelengthAt(size_t i) const;

    double commonGrazingAngle() const;
    double grazingAngleAt(size_t i) const;

    double commonAzimuthalAngle() const;
    double azimuthalAngleAt(size_t i) const;

    // needed for export
    const IDistribution1D* wavelengthDistribution() const { return m_lambda_distrib.get(); }
    const IDistribution1D* grazingAngleDistribution() const { return m_alpha_distrib.get(); }
    const IDistribution1D* azimuthalAngleDistribution() const { return m_phi_distrib.get(); }
    size_t nDistributionSamples() const override;

protected:
    void copyPhysicalScan(PhysicalScan* dest) const; //!< Used by subclass::clone

    std::unique_ptr<IDistribution1D> m_lambda_distrib;
    std::unique_ptr<IDistribution1D> m_alpha_distrib;
    std::unique_ptr<IDistribution1D> m_phi_distrib;

private:
    bool isCommonFootprint() const;
    bool isCommonWavelength() const;
    bool isCommonGrazingAngle() const;
    bool isCommonAzimuthalAngle() const;

#endif // SWIG
};

#endif // BORNAGAIN_SIM_SCAN_PHYSICALSCAN_H