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
funct::Parameter
Definition: Parameter.h:8
funct::BreitWigner::operator()
double operator()(double x) const
Definition: BreitWigner.h:14
funct::BreitWigner
Definition: BreitWigner.h:10
Parameter.h
alignCSCRings.s
s
Definition: alignCSCRings.py:92
funct::m
m
Definition: Factorize.h:45
funct::BreitWigner::BreitWigner
BreitWigner(double m, double g)
Definition: BreitWigner.h:13
funct::BreitWigner::BreitWigner
BreitWigner(const Parameter &m, const Parameter &g)
Definition: BreitWigner.h:11
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
diffTwoXMLs.g2
g2
Definition: diffTwoXMLs.py:71
callgraph.m2
m2
Definition: callgraph.py:38
funct::BreitWigner::mass
std::shared_ptr< double > mass
Definition: BreitWigner.h:27
funct::twoOverPi
const double twoOverPi
Definition: BreitWigner.h:8
funct::BreitWigner::width
std::shared_ptr< double > width
Definition: BreitWigner.h:27
funct
Definition: Abs.h:5
g
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
funct::BreitWigner::BreitWigner
BreitWigner(std::shared_ptr< double > m, std::shared_ptr< double > g)
Definition: BreitWigner.h:12