CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Main Page
Namespaces
Classes
Files
File List
File Members
GenericFunctions
CLHEP
GenericFunctions
CLHEP/GenericFunctions/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
30
namespace
Genfun {
31
36
template
<
class
F>
37
class
DoubleParamToArgAdaptor
:
public
AbsFunction
{
38
39
FUNCTION_OBJECT_DEF
(
DoubleParamToArgAdaptor
)
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
52
DoubleParamToArgAdaptor
(
const
DoubleParamToArgAdaptor
&right);
53
54
// Destructor
55
virtual
~DoubleParamToArgAdaptor
();
56
57
// Retreive function value
58
virtual
double
operator ()
(
double
argument)
const
;
// Gives an error.
59
virtual
double
operator ()
(
const
Argument
&
a
)
const
;
// Must use this one
60
61
// Dimensionality
62
virtual
unsigned
int
dimensionality
()
const
;
63
64
// Get the mean of the DoubleParamToArgAdaptor
65
Parameter
&
scaleFactor0
();
66
const
Parameter
&
scaleFactor0
()
const
;
67
68
// Get the mean of the DoubleParamToArgAdaptor
69
Parameter
&
scaleFactor1
();
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
Generated on Sun Jun 17 2012 08:08:26 for CLHEP by
1.8.1.1