BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
DetectionProperties.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Device/Detector/DetectionProperties.h
6 //! @brief Defines class DetectionProperties.
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_DEVICE_DETECTOR_DETECTIONPROPERTIES_H
21 #define BORNAGAIN_DEVICE_DETECTOR_DETECTIONPROPERTIES_H
22 
23 #include "Base/Vector/EigenCore.h"
24 #include "Param/Node/INode.h"
25 
26 //! Detector properties (efficiency, transmission).
27 //! @ingroup detector
28 
29 class DetectionProperties : public INode {
30 public:
31  DetectionProperties(kvector_t direction, double efficiency, double total_transmission);
34 
35  virtual ~DetectionProperties() = default;
36 
37  //! Sets the polarization analyzer characteristics of the detector
38  void setAnalyzerProperties(const kvector_t direction, double efficiency,
39  double total_transmission);
40 
41  //! Return the polarization density matrix (in spin basis along z-axis)
42  Eigen::Matrix2cd analyzerOperator() const;
43 
44  //! Retrieve the analyzer characteristics
46  double analyzerEfficiency() const; //!< will always return positive value
47  double analyzerTotalTransmission() const;
48 
49  void accept(INodeVisitor* visitor) const final { visitor->visit(this); }
50 
51 private:
52  //! Verify if the given analyzer properties are physical
53  bool checkAnalyzerProperties(const kvector_t direction, double efficiency,
54  double total_transmission) const;
55 
56  kvector_t m_direction; //!< direction of polarization analysis
57  double m_efficiency; //!< efficiency of polarization analysis
58  double m_total_transmission; //!< total transmission of polarization analysis
59 };
60 
61 #endif // BORNAGAIN_DEVICE_DETECTOR_DETECTIONPROPERTIES_H
62 #endif // USER_API
Include to deal with Eigen alignment centrally.
Defines interface INode.
Detector properties (efficiency, transmission).
double m_efficiency
efficiency of polarization analysis
virtual ~DetectionProperties()=default
double m_total_transmission
total transmission of polarization analysis
double analyzerEfficiency() const
will always return positive value
void setAnalyzerProperties(const kvector_t direction, double efficiency, double total_transmission)
Sets the polarization analyzer characteristics of the detector.
void accept(INodeVisitor *visitor) const final
Calls the INodeVisitor's visit method.
double analyzerTotalTransmission() const
bool checkAnalyzerProperties(const kvector_t direction, double efficiency, double total_transmission) const
Verify if the given analyzer properties are physical.
kvector_t m_direction
direction of polarization analysis
kvector_t analyzerDirection() const
Retrieve the analyzer characteristics.
Eigen::Matrix2cd analyzerOperator() const
Return the polarization density matrix (in spin basis along z-axis)
Visitor interface to visit ISampleNode objects.
Definition: INodeVisitor.h:146
Base class for tree-like structures containing parameterized objects.
Definition: INode.h:49