CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ZMuMuBack.h
Go to the documentation of this file.
1 #ifndef ElectroWeakAnalysis_ZMuMu_ZMuMuBack_h
2 #define ElectroWeakAnalysis_ZMuMu_ZMuMuBack_h
3 
6 #include <boost/shared_ptr.hpp>
7 
8 namespace function{
9  class ZMuMuBack {
10  public:
11  enum{ arguments = 1 };
12  enum{ parameters = 4 };
13  ZMuMuBack(boost::shared_ptr<double> Nb, boost::shared_ptr<double> l,
14  boost::shared_ptr<double> a, boost::shared_ptr<double> b):
15  Nbkg(Nb), lambda(l), a1(a), a2(b),
16  expo_(-(*l)), poly_(1., *a, *b) {}
17  ZMuMuBack(double Nb, double l, double a, double b):
18  Nbkg(new double(Nb)), lambda(new double(l)), a1(new double(a)), a2(new double(b)),
19  expo_(-l), poly_(1, a, b) {}
20  double operator()(double x) const {
21  return *Nbkg * expo_(x) * poly_(x);
22  }
23  void setParameters(double Nb, double l, double a, double b) {
24  *Nbkg = Nb;
25  *lambda = l;
26  *a1 = a;
27  *a2 = b;
28  expo_.setParameters(-l);
29  poly_.setParameters(1., a, b);
30  }
31 
32  boost::shared_ptr<double> Nbkg, lambda, a1, a2;
33  private:
34  Exponential expo_;
35  Polynomial<2> poly_;
36  };
37 }
38 
39 #endif
Definition: vlib.h:257
ZMuMuBack(boost::shared_ptr< double > Nb, boost::shared_ptr< double > l, boost::shared_ptr< double > a, boost::shared_ptr< double > b)
Definition: ZMuMuBack.h:13
int l
Definition: vlib.h:269
boost::shared_ptr< double > a2
Definition: ZMuMuBack.h:32
boost::shared_ptr< double > a1
Definition: ZMuMuBack.h:32
Polynomial< 2 > poly_
Definition: ZMuMuBack.h:35
ZMuMuBack(double Nb, double l, double a, double b)
Definition: ZMuMuBack.h:17
void setParameters(double Nb, double l, double a, double b)
Definition: ZMuMuBack.h:23
Exponential expo_
Definition: ZMuMuBack.h:34
double operator()(double x) const
Definition: ZMuMuBack.h:20
double b
Definition: hdecay.h:120
boost::shared_ptr< double > Nbkg
Definition: ZMuMuBack.h:32
double a
Definition: hdecay.h:121
Definition: DDAxes.h:10
boost::shared_ptr< double > lambda
Definition: ZMuMuBack.h:32