CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BreitWigner.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_Utilities_ZMuMu_BreitWigner_h
2 #define PhysicsTools_Utilities_ZMuMu_BreitWigner_h
4 #include <boost/shared_ptr.hpp>
5 #include <cmath>
6 
7 namespace funct {
8  const double twoOverPi = 2./M_PI;
9 
10  struct BreitWigner {
11  BreitWigner(const Parameter& m, const Parameter& g):
12  mass(m.ptr()), width(g.ptr()) { }
13  BreitWigner(boost::shared_ptr<double> m, boost::shared_ptr<double> g):
14  mass(m), width(g) {}
15  BreitWigner(double m, double g):
16  mass(new double(m)), width(new double(g)) {}
17  double operator()(double x) const {
18  double m2 = *mass * (*mass);
19  double g2 = *width * (*width);
20  double g2OverM2 = g2/m2;
21  double s = x*x;
22  double deltaS = s - m2;
23  double lineShape = 0;
24  if (fabs(deltaS/m2)<16) {
25  double prop = deltaS*deltaS + s*s*g2OverM2;
26  lineShape = twoOverPi * (*width) * s/prop;
27  }
28  return lineShape;
29  }
30  boost::shared_ptr<double> mass, width;
31  };
32 
33 }
34 
35 #endif
const double twoOverPi
Definition: BreitWigner.h:8
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
boost::shared_ptr< double > width
Definition: BreitWigner.h:30
BreitWigner(boost::shared_ptr< double > m, boost::shared_ptr< double > g)
Definition: BreitWigner.h:13
boost::shared_ptr< double > mass
Definition: BreitWigner.h:30
BreitWigner(double m, double g)
Definition: BreitWigner.h:15
#define M_PI
double operator()(double x) const
Definition: BreitWigner.h:17
BreitWigner(const Parameter &m, const Parameter &g)
Definition: BreitWigner.h:11
Definition: DDAxes.h:10