File indexing completed on 2025-01-18 09:54:34
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #ifndef DoubleParamToArgAdaptor_h_
0022 #define DoubleParamToArgAdaptor_h_
0023
0024 #include <functional>
0025 #include <iostream>
0026 #include <string>
0027 #include "CLHEP/GenericFunctions/Parameter.hh"
0028 #include "CLHEP/GenericFunctions/AbsFunction.hh"
0029
0030 namespace Genfun {
0031
0032
0033
0034
0035
0036 template <class F>
0037 class DoubleParamToArgAdaptor : public AbsFunction {
0038
0039 FUNCTION_OBJECT_DEF(DoubleParamToArgAdaptor)
0040
0041 public:
0042
0043
0044 typedef Parameter & (F::*ScopedMethodPtr) ();
0045
0046
0047 DoubleParamToArgAdaptor(const F & function,
0048 ScopedMethodPtr parameterFetchMethod0,
0049 ScopedMethodPtr paraemterFetchMethod1);
0050
0051
0052 DoubleParamToArgAdaptor(const DoubleParamToArgAdaptor &right);
0053
0054
0055 virtual ~DoubleParamToArgAdaptor();
0056
0057
0058 virtual double operator ()(double argument) const override;
0059 virtual double operator ()(const Argument & a) const override;
0060
0061
0062 virtual unsigned int dimensionality() const override;
0063
0064
0065 Parameter & scaleFactor0();
0066 const Parameter & scaleFactor0() const;
0067
0068
0069 Parameter & scaleFactor1();
0070 const Parameter & scaleFactor1() const;
0071
0072
0073 private:
0074
0075
0076 const DoubleParamToArgAdaptor & operator=(const DoubleParamToArgAdaptor &right);
0077
0078
0079 Parameter _scaleFactor0;
0080 Parameter _scaleFactor1;
0081
0082
0083 F *_function;
0084
0085
0086 std::mem_fun_ref_t<Parameter &, F> _parameterFetchMethod0;
0087 std::mem_fun_ref_t<Parameter &, F> _parameterFetchMethod1;
0088
0089 };
0090 }
0091 #include "CLHEP/GenericFunctions/DoubleParamToArgAdaptor.icc"
0092 #endif