PhysicsTools
Utilities
interface
RootFunctionHelper.h
Go to the documentation of this file.
1
#ifndef PhysicsTools_Utilities_RootFunctionHelper_h
2
#define PhysicsTools_Utilities_RootFunctionHelper_h
3
/* Warning: this class users a static cache, so multiple
4
* instances of the same type would have the same cacke.
5
* This should be fixed to handle more general cases
6
*
7
*/
8
#include "
PhysicsTools/Utilities/interface/RootFunctionAdapter.h
"
9
10
namespace
root
{
11
namespace
helper
{
12
struct
null_t;
13
14
template
<
typename
F,
unsigned
int
args,
typename
Tag = null_t>
15
struct
RootFunctionHelper
{
16
typedef
double (*
root_function
)(
const
double
*,
const
double
*);
17
static
root_function
fun
(
F
&
f
) {
18
adapter_
=
RootFunctionAdapter<F, args>
(
f
);
19
return
&
fun_
;
20
}
21
static
void
addParameter
(
const
std::shared_ptr<double> &par) {
adapter_
.addParameter(par); }
22
23
private
:
24
static
double
fun_
(
const
double
*x,
const
double
*par) {
25
adapter_
.setParameters(par);
26
return
adapter_
(x);
27
}
28
static
RootFunctionAdapter<F, args>
adapter_
;
29
};
30
31
template
<
typename
F,
unsigned
int
args,
typename
Tag>
32
RootFunctionAdapter<F, args>
RootFunctionHelper<F, args, Tag>::adapter_
;
33
}
// namespace helper
34
}
// namespace root
35
36
#endif
root::helper::RootFunctionHelper::fun_
static double fun_(const double *x, const double *par)
Definition:
RootFunctionHelper.h:24
root::helper::RootFunctionAdapter
Definition:
RootFunctionAdapter.h:12
f
double f[11][100]
Definition:
MuScleFitUtils.cc:78
RootFunctionAdapter.h
root::helper::RootFunctionHelper::fun
static root_function fun(F &f)
Definition:
RootFunctionHelper.h:17
F
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition:
blowfish.cc:163
helper
Definition:
helper.py:1
root
Definition:
RooFitFunction.h:10
root::helper::RootFunctionHelper::adapter_
static RootFunctionAdapter< F, args > adapter_
Definition:
RootFunctionHelper.h:28
root::helper::RootFunctionHelper::root_function
double(* root_function)(const double *, const double *)
Definition:
RootFunctionHelper.h:16
root::helper::RootFunctionHelper::addParameter
static void addParameter(const std::shared_ptr< double > &par)
Definition:
RootFunctionHelper.h:21
root::helper::RootFunctionHelper
Definition:
RootFunctionHelper.h:15
Generated for CMSSW Reference Manual by
1.8.16