CMS 3D CMS Logo

BreitWigner.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_Utilities_ZMuMu_BreitWigner_h
2 #define PhysicsTools_Utilities_ZMuMu_BreitWigner_h
4 
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) : mass(m.ptr()), width(g.ptr()) {}
12  BreitWigner(std::shared_ptr<double> m, std::shared_ptr<double> g) : mass(m), width(g) {}
13  BreitWigner(double m, double g) : mass(new double(m)), width(new double(g)) {}
14  double operator()(double x) const {
15  double m2 = *mass * (*mass);
16  double g2 = *width * (*width);
17  double g2OverM2 = g2 / m2;
18  double s = x * x;
19  double deltaS = s - m2;
20  double lineShape = 0;
21  if (fabs(deltaS / m2) < 16) {
22  double prop = deltaS * deltaS + s * s * g2OverM2;
23  lineShape = twoOverPi * (*width) * s / prop;
24  }
25  return lineShape;
26  }
27  std::shared_ptr<double> mass, width;
28  };
29 
30 } // namespace funct
31 
32 #endif
Definition: Abs.h:5
std::shared_ptr< double > mass
Definition: BreitWigner.h:27
const double twoOverPi
Definition: BreitWigner.h:8
BreitWigner(std::shared_ptr< double > m, std::shared_ptr< double > g)
Definition: BreitWigner.h:12
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
double operator()(double x) const
Definition: BreitWigner.h:14
BreitWigner(double m, double g)
Definition: BreitWigner.h:13
#define M_PI
std::shared_ptr< double > width
Definition: BreitWigner.h:27
BreitWigner(const Parameter &m, const Parameter &g)
Definition: BreitWigner.h:11
float x