MINT2
RooAbsGaussModelEfficiency.h
Go to the documentation of this file.
1 #ifndef ROO_ABSGAUSSMODELEFF
2 #define ROO_ABSGAUSSMODELEFF
3 // Interface Mixin class for Piecewise Polynomial Efficiency
4 
5 
6 #include <complex>
7 #include "RooAbsReal.h"
8 
9 class RooAbsGaussModelEfficiency : public RooAbsReal {
10 public:
11  //C++11: using RooAbsReal::RooAbsReal;
12  RooAbsGaussModelEfficiency() : RooAbsReal() {}
13  RooAbsGaussModelEfficiency(const char *name, const char *title, const char *unit= "") : RooAbsReal(name,title, unit) {};
14  RooAbsGaussModelEfficiency(const RooAbsGaussModelEfficiency& other, const char* name=0) : RooAbsReal(other,name) {};
15 
17 
18  virtual std::complex<double> productAnalyticalIntegral(Double_t umin, Double_t umax,
19  Double_t scale, Double_t offset,
20  const std::complex<double>& z) const = 0;
21 private:
22  //ClassDef(RooAbsGaussModelEfficiency,1)
23 };
24 
25 
27 
28  // utilities for implementing the right integrals in productAnalysticalIntegral
29  // for fixed order (piecewise) polynomial acceptances (eg. cubic splines)
30  template <unsigned MaxOrder> class M_n {
31  std::complex<double> _m[MaxOrder];
32  public:
33  M_n(double x, const std::complex<double>& z) ;
34  const std::complex<double>& operator()(unsigned i) const { assert(i<MaxOrder); return _m[i]; }
35  M_n& operator-=(const M_n& other) { for(unsigned i=0;i<MaxOrder;++i) _m[i]= _m[i]-other._m[i]; return *this; }
36  M_n operator- (const M_n& other) const { return M_n(*this)-=other; }
37  };
38 
39  class K_n {
40  std::complex<double> _zi;
41  public:
42  K_n(const std::complex<double>& z) : _zi( std::complex<double>(1,0)/z) {}
43  std::complex<double> operator()(unsigned i) const;
44  };
45 
46 }
47 #endif
RooAbsGaussModelEfficiency(const RooAbsGaussModelEfficiency &other, const char *name=0)
RooAbsGaussModelEfficiency(const char *name, const char *title, const char *unit="")
std::complex< double > _m[MaxOrder]
K_n(const std::complex< double > &z)
const std::complex< double > & operator()(unsigned i) const
M_n operator-(const M_n &other) const
virtual std::complex< double > productAnalyticalIntegral(Double_t umin, Double_t umax, Double_t scale, Double_t offset, const std::complex< double > &z) const =0
std::complex< double > operator()(unsigned i) const
M_n(double x, const std::complex< double > &z)