CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  */
9 
10 namespace root {
11  namespace helper {
12  struct null_t;
13 
14  template<typename F, unsigned int args, typename Tag = null_t>
16  typedef double (*root_function)(const double *, const double *);
17  static root_function fun(F& f) {
19  return &fun_;
20  }
21  static void addParameter(const boost::shared_ptr<double> & par) {
22  adapter_.addParameter(par);
23  }
24  private:
25  static double fun_(const double * x, const double * par) {
26  adapter_.setParameters(par);
27  return adapter_(x);
28  }
30  };
31 
32  template<typename F, unsigned int args, typename Tag>
34  }
35  }
36 
37 #endif
static RootFunctionAdapter< F, args > adapter_
double(* root_function)(const double *, const double *)
double f[11][100]
static void addParameter(const boost::shared_ptr< double > &par)
static double fun_(const double *x, const double *par)
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281
x
Definition: VDTMath.h:216
static root_function fun(F &f)
string root
initialization
Definition: dbtoconf.py:70