CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
DoubleParamToArgAdaptor.hh
Go to the documentation of this file.
1// -*- C++ -*-
2// $Id: DoubleParamToArgAdaptor.hh,v 1.2 2003/09/06 14:04:13 boudreau Exp $
3//-----------------------Class ParaToArgAdaptor-----------------------------//
4// //
5// Joe Boudreau //
6// January 2000 //
7// //
8// This class changes the interpretation of two PARAMETERs to a function //
9// connects them to a single argument, with scale factors controlling how //
10// the argument is increased before it is used to adjust the parameter. //
11// In other words it makes a function like //
12// //
13// F(a_0, a_1, a_2; x) //
14// //
15// and reinterprets it as //
16// //
17// F(a_0; x, a_1) //
18// //
19// //
20//--------------------------------------------------------------------------//
21#ifndef DoubleParamToArgAdaptor_h_
22#define DoubleParamToArgAdaptor_h_
23
24#include <functional>
25#include <iostream>
26#include <string>
27#include "CLHEP/GenericFunctions/Parameter.hh"
28#include "CLHEP/GenericFunctions/AbsFunction.hh"
29
30namespace Genfun {
31
32 /**
33 * @author
34 * @ingroup genfun
35 */
36 template <class F>
38
40
41 public:
42
43 // ScopedMethodName
44 typedef Parameter & (F::*ScopedMethodPtr) ();
45
46 // Constructor
47 DoubleParamToArgAdaptor(const F & function,
48 ScopedMethodPtr parameterFetchMethod0,
49 ScopedMethodPtr paraemterFetchMethod1);
50
51 // Copy constructor
53
54 // Destructor
56
57 // Retreive function value
58 virtual double operator ()(double argument) const override; // Gives an error.
59 virtual double operator ()(const Argument & a) const override; // Must use this one
60
61 // Dimensionality
62 virtual unsigned int dimensionality() const override;
63
64 // Get the mean of the DoubleParamToArgAdaptor
66 const Parameter & scaleFactor0() const;
67
68 // Get the mean of the DoubleParamToArgAdaptor
70 const Parameter & scaleFactor1() const;
71
72
73 private:
74
75 // It is illegal to assign an adjustable constant
76 const DoubleParamToArgAdaptor & operator=(const DoubleParamToArgAdaptor &right);
77
78 // Here is the scale:
79 Parameter _scaleFactor0;
80 Parameter _scaleFactor1;
81
82 // Here is the function being adapted;
83 F *_function;
84
85 // Here is the recipe for fetching the parameter from the function:
86 std::mem_fun_ref_t<Parameter &, F> _parameterFetchMethod0;
87 std::mem_fun_ref_t<Parameter &, F> _parameterFetchMethod1;
88
89 };
90} // namespace Genfun
91 #include "CLHEP/GenericFunctions/DoubleParamToArgAdaptor.icc"
92#endif
#define FUNCTION_OBJECT_DEF(classname)
Definition: AbsFunction.hh:143
virtual unsigned int dimensionality() const override
const Parameter & scaleFactor1() const
DoubleParamToArgAdaptor(const DoubleParamToArgAdaptor &right)
DoubleParamToArgAdaptor(const F &function, ScopedMethodPtr parameterFetchMethod0, ScopedMethodPtr paraemterFetchMethod1)
virtual double operator()(double argument) const override
const Parameter & scaleFactor0() const
Definition: Abs.hh:14