CMS 3D CMS Logo

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 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  }
29  };
30 
31  template <typename F, unsigned int args, typename Tag>
33  } // namespace helper
34 } // namespace root
35 
36 #endif
static RootFunctionAdapter< F, args > adapter_
Definition: helper.py:1
double(* root_function)(const double *, const double *)
double f[11][100]
static void addParameter(const std::shared_ptr< double > &par)
static double fun_(const double *x, const double *par)
float x
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
static root_function fun(F &f)