CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ZMuMuBackNorm.h
Go to the documentation of this file.
1 #ifndef ElectroWeakAnalysis_ZMuMu_ZMuMuBackNorm_h
2 #define ElectroWeakAnalysis_ZMuMu_ZMuMuBackNorm_h
3 
6 #include <boost/shared_ptr.hpp>
7 #include <cmath>
8 
9 namespace function {
10  class ZMuMuBackNorm {
11  public:
12  enum{ arguments = 2 };
13  enum{ parameters = 3 };
14  ZMuMuBackNorm(boost::shared_ptr<double> l, boost::shared_ptr<double> a, boost::shared_ptr<double> b):
15  lambda(l), a1(a), a2(b),
16  expo_(-(*l)),
17  pol_(-pow(*l, 2)- (*l) * (*a) - 2 * (*b), -pow(*l, 2) * (*a) - 2 * (*l) * (*b), -pow(*l, 2) * (*b)) {}
18  ZMuMuBackNorm(double l, double a, double b):
19  lambda(new double(l)), a1(new double(a)), a2(new double(b)),
20  expo_(-l), pol_(-pow(l, 2)-l*a-2*b, -pow(l, 2)*a-2*l*b, -pow(l, 2)*b) {}
21  ZMuMuBackNorm(const Exponential & expo, const Polynomial<2> & pol) : expo_(expo), pol_(pol) { }
22  double operator()(const int x_min, const int x_max) const {
23  double l = - (*(expo_.lambda)); //the exponential is constructed as negative!!
24  double l3inv = 1/(l*l*l);
25  double N1 = expo_(x_max)*l3inv * pol_(x_max);
26  double N2 = expo_(x_min)*l3inv * pol_(x_min);
27  return 1/(N1 - N2);
28  }
29  void setParameters(double l, double a, double b) {
30  expo_.setParameters(-l);
31  double l2 = l*l;
32  pol_.setParameters(-l2-l*a-2*b, -l2*a-2*l*b, -l2*b);
33  }
34  boost::shared_ptr<double> lambda, a1, a2;
35  private:
36  Exponential expo_;
37  Polynomial<2> pol_;
38  };
39 }
40 
41 #endif
Definition: vlib.h:256
int l
Definition: vlib.h:268
ZMuMuBackNorm(const Exponential &expo, const Polynomial< 2 > &pol)
Definition: ZMuMuBackNorm.h:21
boost::shared_ptr< double > lambda
Definition: ZMuMuBackNorm.h:34
ZMuMuBackNorm(boost::shared_ptr< double > l, boost::shared_ptr< double > a, boost::shared_ptr< double > b)
Definition: ZMuMuBackNorm.h:14
ZMuMuBackNorm(double l, double a, double b)
Definition: ZMuMuBackNorm.h:18
void setParameters(double l, double a, double b)
Definition: ZMuMuBackNorm.h:29
boost::shared_ptr< double > a2
Definition: ZMuMuBackNorm.h:34
boost::shared_ptr< double > a1
Definition: ZMuMuBackNorm.h:34
double operator()(const int x_min, const int x_max) const
Definition: ZMuMuBackNorm.h:22
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
Polynomial< 2 > pol_
Definition: ZMuMuBackNorm.h:37
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40