ComPWA
Common Partial-Wave-Analysis Framework
Voigtian.hpp
Go to the documentation of this file.
1 // Copyright (c) 2013, 2017 The ComPWA Team.
2 // This file is part of the ComPWA framework, check
3 // https://github.com/ComPWA/ComPWA/license.txt for details.
4 
12 
13 #ifndef VOIGT_FUNCTION_HPP
14 #define VOIGT_FUNCTION_HPP
15 
17 #include "FormFactor.hpp"
19 #include "Utils/Faddeeva.hh"
20 
21 namespace ComPWA {
22 namespace Physics {
23 namespace Dynamics {
24 
39 namespace Voigtian {
40 
44  double Sigma;
45 };
46 
53 inline std::complex<double> dynamicalFunction(double mSq, double mR, double wR,
54  double sigma) {
55 
56  double sqrtS = sqrt(mSq);
57 
58  // the non-relativistic BreitWigner which is convoluted in Voigtian
59  // has the exactly following expression:
60  // BW(x, m, width) = 1/pi * width/2 * 1/((x - m)^2 + (width/2)^2)
61  // i.e., the Lorentz formula with Gamma = width/2 and x' = x - m
63  double argu = sqrtS - mR;
64  double c = 1.0 / (sqrt(2.0) * sigma);
65  double a = c * 0.5 * wR;
66  double u = c * argu;
67  std::complex<double> z(u, a);
68  std::complex<double> v = Faddeeva::w(z, 1e-13);
69  double val = c * 1.0 / sqrt(M_PI) * v.real();
70  double sqrtVal = sqrt(val);
71 
73  std::complex<double> invBW(argu, 0.5 * wR);
74  std::complex<double> BW = 1.0 / invBW;
75  double phi = std::arg(BW);
76  std::complex<double> result(sqrtVal * cos(phi), sqrtVal * sin(phi));
77 
78  // transform width to coupling
79  // Calculate coupling constant to final state
80  // MesonRadius = 0.0, noFormFactor
81  // std::complex<double> g_final = widthToCoupling(mSq, mR, wR, ma, mb, L, 0.0,
82  // formFactorType::noFormFactor);
83  // the BW to convolved in voigt is 1/PI * Gamma/2 * 1/((x-m)^2 + (Gamma/2)^2)
84  // while I think the one common used in physics is Gamma/2 * 1/((x-m)^2 +
85  // (Gamma/2)^2)
86  // So we time the PI at last
87  std::complex<double> g_final = sqrt(M_PI);
88  double g_production = 1;
89  result *= g_production;
90  result *= g_final;
91 
92  assert((!std::isnan(result.real()) || !std::isinf(result.real())) &&
93  "Voigtian::dynamicalFunction() | Result is NaN or Inf!");
94  assert((!std::isnan(result.imag()) || !std::isinf(result.imag())) &&
95  "Voigtian::dynamicalFunction() | Result is NaN or Inf!");
96 
97  return result;
98 }
99 
100 std::shared_ptr<ComPWA::FunctionTree::TreeNode> createFunctionTree(
101  InputInfo Params,
102  std::shared_ptr<ComPWA::FunctionTree::Value<std::vector<double>>>
103  InvMassSquared);
104 
105 } // namespace Voigtian
106 
108 public:
109  VoigtianStrategy(std::string name = "")
110  : ComPWA::FunctionTree::Strategy(ComPWA::FunctionTree::ParType::MCOMPLEX,
111  "Voigtian" + name) {}
112 
113  virtual void execute(ComPWA::FunctionTree::ParameterList &paras,
114  std::shared_ptr<ComPWA::FunctionTree::Parameter> &out);
115 };
116 
117 } // namespace Dynamics
118 } // namespace Physics
119 } // namespace ComPWA
120 
121 #endif
double Sigma
resolution: the width of gaussian function which is used to represent the resolution of mass spectrum...
Definition: Voigtian.hpp:44
cmplx FADDEEVA() w(cmplx z, double relerr)
Definition: Faddeeva.cc:668
std::shared_ptr< ComPWA::FunctionTree::TreeNode > createFunctionTree(InputInfo Params, std::shared_ptr< ComPWA::FunctionTree::Value< std::vector< double >>> InvMassSquared)
Definition: Voigtian.cpp:17
This file contains Functions implementing the Strategy interface so they can be used inside a node of...
This file contains the declaration of the Faddeeva package, which is used only in the Voigtian class ...
ParType
Enums for the type of the parameter, should be extended if an new parameter type is added...
Definition: Parameter.hpp:34
std::complex< double > dynamicalFunction(double mSq, double mR, double wR, double sigma)
Dynamical voigt function.
Definition: Voigtian.hpp:53
Virtual base class for operations of FunctionTree nodes.
Definition: Functions.hpp:30
Voigtian is the convolution of a non-relativisitc Breit-Wigner with a Gaussian, see Wikipedia In the...
This class provides a list of parameters and values of different types.