BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
UnitConverterUtils.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Core/Simulation/UnitConverterUtils.h
6 //! @brief Declares utilities for unit converters.
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_CORE_SIMULATION_UNITCONVERTERUTILS_H
21 #define BORNAGAIN_CORE_SIMULATION_UNITCONVERTERUTILS_H
22 
24 
25 class Instrument;
26 class ISimulation;
27 template <class T> class OutputData;
28 
29 //! Namespace enclosing a number of utilities/helpers for unit converters
30 
31 namespace UnitConverterUtils {
32 
33 //! Returns zero-valued output data array in specified units
34 std::unique_ptr<OutputData<double>> createOutputData(const IUnitConverter& converter,
35  Axes::Units units);
36 
37 //! Helper factory function to use in GISASSimulation. Depending on the type of detector,
38 //! returns either RectangularConverter or SphericalConverter.
39 std::unique_ptr<IUnitConverter> createConverterForGISAS(const Instrument& instrument);
40 
41 std::unique_ptr<IUnitConverter> createConverter(const ISimulation& simulation);
42 } // namespace UnitConverterUtils
43 
44 #endif // BORNAGAIN_CORE_SIMULATION_UNITCONVERTERUTILS_H
45 #endif // USER_API
Defines interface IUnitConverter and possible axis units.
Abstract base class of OffSpecularSimulation, GISASSimulation and SpecularSimulation.
Definition: ISimulation.h:38
Interface to provide axis translations to different units for simulation output.
Assembles beam, detector and their relative positions with respect to the sample.
Definition: Instrument.h:32
Templated class to store data of type double or CumulativeValue in multi-dimensional space.
Definition: OutputData.h:32
Namespace enclosing a number of utilities/helpers for unit converters.
std::unique_ptr< IUnitConverter > createConverter(const ISimulation &simulation)
std::unique_ptr< OutputData< double > > createOutputData(const IUnitConverter &converter, Axes::Units units)
Returns zero-valued output data array in specified units.
std::unique_ptr< IUnitConverter > createConverterForGISAS(const Instrument &instrument)
Helper factory function to use in GISASSimulation.