ComPWA
Common Partial-Wave-Analysis Framework
RelativisticBreitWigner.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 
5 #ifndef PHYSICS_DYNAMICS_RELATIVISTICBREITWIGNER_HPP_
6 #define PHYSICS_DYNAMICS_RELATIVISTICBREITWIGNER_HPP_
7 
9 #include "Coupling.hpp"
10 #include "FormFactor.hpp"
11 
12 #include <vector>
13 
14 namespace ComPWA {
15 namespace Physics {
16 namespace Dynamics {
17 
18 struct InputInfo {
19  std::string Type;
21  unsigned int L;
23  std::pair<std::shared_ptr<ComPWA::FunctionTree::Value<std::vector<double>>>,
24  std::shared_ptr<ComPWA::FunctionTree::Value<std::vector<double>>>>
27  std::shared_ptr<ComPWA::FunctionTree::FitParameter> Mass;
28 
30  std::shared_ptr<ComPWA::FunctionTree::FitParameter> MesonRadius;
32  std::shared_ptr<FormFactor> FormFactorFunctor;
33 };
34 
35 namespace RelativisticBreitWigner {
36 
37 using BreitWignerFunction = std::function<std::complex<double>(
38  double, double, double, double, double, unsigned int, double,
39  std::shared_ptr<FormFactor>)>;
40 
43  std::shared_ptr<ComPWA::FunctionTree::FitParameter> Width;
44 };
45 
76 inline std::complex<double>
77 relativisticBreitWigner(double mSq, double mR, double ma, double mb,
78  double width, unsigned int L, double mesonRadius,
79  std::shared_ptr<FormFactor> FormFactorFunctor) {
80 
81  double sqrtS = std::sqrt(mSq);
82 
83  // Phase space factors at sqrt(s) and at the resonance position
84  auto phspFactorSqrtS = phspFactor(sqrtS, ma, mb);
85  auto phspFactormR = phspFactor(mR, ma, mb);
86 
87  // Check if we have an event which is exactly at the phase space boundary
88  if (phspFactorSqrtS == std::complex<double>(0, 0))
89  return std::complex<double>(0, 0);
90 
91  // The each FormFactor includes a term q^L. Therefore only q instead of
92  // q^(2L+1) has to be calculated. Also because phspFactor ~ q/sqrt(s) (see
93  // PDG2018, equation 48.2) the factor \frac{M_R}{\sqrt{s}} can also be omitted
94  double qRatio = (phspFactorSqrtS / phspFactormR);
95 
96  double ffR =
97  FormFactorFunctor->operator()(qSquared(mR * mR, ma, mb), L, mesonRadius);
98  double ff =
99  FormFactorFunctor->operator()(qSquared(mSq, ma, mb), L, mesonRadius);
100  double barrierTermSq = qRatio * (ff * ff) / (ffR * ffR);
101 
102  std::complex<double> denom(mR * mR - mSq,
103  -1. * sqrtS * width * barrierTermSq);
104 
105  std::complex<double> result = mR * width / denom;
106 
107  assert((!std::isnan(result.real()) || !std::isinf(result.real())) &&
108  "RelativisticBreitWigner::standardRelBW() | Result is NaN or Inf!");
109  assert((!std::isnan(result.imag()) || !std::isinf(result.imag())) &&
110  "RelativisticBreitWigner::standardRelBW() | Result is NaN or Inf!");
111 
112  return result;
113 }
114 
145 inline std::complex<double> relativisticBreitWignerAnalyticCont(
146  double mSq, double mR, double ma, double mb, double width, unsigned int L,
147  double mesonRadius, std::shared_ptr<FormFactor> FormFactorFunctor) {
148 
149  std::complex<double> i(0, 1);
150  double sqrtS = std::sqrt(mSq);
151 
152  // Phase space factors at sqrt(s) and at the resonance position
153  auto phspFactorSqrtS = phspFactorAC(sqrtS, ma, mb);
154  auto phspFactormR = phspFactorAC(mR, ma, mb);
155 
156  // Check if we have an event which is exactly at the phase space boundary
157  if (phspFactorSqrtS == std::complex<double>(0, 0))
158  return std::complex<double>(0, 0);
159 
160  // The each FormFactor includes a term q^L. Therefore only q instead of
161  // q^(2L+1) has to be calculated. Also because phspFactor ~ q/sqrt(s) (see
162  // PDG2018, equation 48.2) the factor \frac{M_R}{\sqrt{s}} can also be omitted
163  std::complex<double> qRatio = (phspFactorSqrtS / phspFactormR);
164 
165  double ffR = FormFactorFunctor->operator()(
166  std::pow(std::abs(qValueAC(mR, ma, mb)), 2), L, mesonRadius);
167  double ff = FormFactorFunctor->operator()(
168  std::pow(std::abs(qValueAC(sqrtS, ma, mb)), 2), L, mesonRadius);
169  std::complex<double> barrierTermSq = qRatio * (ff * ff) / (ffR * ffR);
170 
171  // Calculate normalized vertex function gammaA(s_R) at the resonance position
172  // (see PDG2018, Chapter 48.2)
173  std::complex<double> gammaA(1, 0); // spin==0
174  if (L > 0) {
175  std::complex<double> qR = std::pow(qValueAC(mR, ma, mb), L);
176  gammaA = ffR * qR;
177  }
178 
179  // Coupling to the final state (ma, mb)
180  std::complex<double> g_final =
181  widthToCoupling(mR, width, gammaA, phspFactorSqrtS);
182 
183  std::complex<double> denom(mR * mR - mSq, 0);
184  denom += (-1.0) * i * sqrtS * (width * barrierTermSq);
185 
186  std::complex<double> result = g_final / denom;
187 
188  assert((!std::isnan(result.real()) || !std::isinf(result.real())) &&
189  "RelativisticBreitWigner::relativisticBreitWignerAnalyticCont() | "
190  "Result is NaN or Inf!");
191  assert((!std::isnan(result.imag()) || !std::isinf(result.imag())) &&
192  "RelativisticBreitWigner::relativisticBreitWignerAnalyticCont() | "
193  "Result is NaN or Inf!");
194 
195  return result;
196 }
197 
198 std::shared_ptr<ComPWA::FunctionTree::TreeNode> createFunctionTree(
199  InputInfo Params,
200  std::shared_ptr<ComPWA::FunctionTree::Value<std::vector<double>>>
201  InvMassSquared);
202 
203 } // namespace RelativisticBreitWigner
204 
206 public:
207  BreitWignerStrategy(std::shared_ptr<FormFactor> FF,
209  : ComPWA::FunctionTree::Strategy(ComPWA::FunctionTree::ParType::MCOMPLEX,
210  "RelativisticBreitWigner"),
211  FormFactorFunctor(FF), BWFunction(BWFunction_) {}
212 
213  virtual void execute(ComPWA::FunctionTree::ParameterList &paras,
214  std::shared_ptr<ComPWA::FunctionTree::Parameter> &out);
215 
216 private:
217  std::shared_ptr<FormFactor> FormFactorFunctor;
219 };
220 
221 } // namespace Dynamics
222 } // namespace Physics
223 } // namespace ComPWA
224 
225 #endif
BreitWignerStrategy(std::shared_ptr< FormFactor > FF, RelativisticBreitWigner::BreitWignerFunction BWFunction_)
double phspFactor(double sqrtS, double ma, double mb)
Definition: FormFactor.hpp:32
RelativisticBreitWigner::BreitWignerFunction BWFunction
std::complex< double > phspFactorAC(double sqrtS, double ma, double mb)
Two body phsp factor.
Definition: FormFactor.hpp:42
std::function< std::complex< double >(double, double, double, double, double, unsigned int, double, std::shared_ptr< FormFactor >)> BreitWignerFunction
double qSquared(double S, double sqrtSA, double sqrtSB)
Calculate Break-up momentum squared.
Definition: FormFactor.hpp:24
std::shared_ptr< FormFactor > FormFactorFunctor
Form factor function object.
std::complex< double > relativisticBreitWigner(double mSq, double mR, double ma, double mb, double width, unsigned int L, double mesonRadius, std::shared_ptr< FormFactor > FormFactorFunctor)
Relativistic Breit-Wigner model with barrier factors.
std::shared_ptr< ComPWA::FunctionTree::FitParameter > Width
Decay width of resonant state.
std::shared_ptr< ComPWA::FunctionTree::FitParameter > MesonRadius
Meson radius of resonant state.
std::complex< double > relativisticBreitWignerAnalyticCont(double mSq, double mR, double ma, double mb, double width, unsigned int L, double mesonRadius, std::shared_ptr< FormFactor > FormFactorFunctor)
Relativistic Breit-Wigner model with barrier factors.
std::complex< double > widthToCoupling(double mR, double width, std::complex< double > gamma, std::complex< double > phspFactor)
Convert width to complex coupling.
Definition: Coupling.hpp:43
unsigned int L
Orbital Angular Momentum between two daughters in Resonance decay.
std::shared_ptr< ComPWA::FunctionTree::TreeNode > createFunctionTree(std::shared_ptr< ComPWA::FunctionTree::Value< std::vector< double >>> InvMassSquaredDaughter1, std::shared_ptr< ComPWA::FunctionTree::Value< std::vector< double >>> InvMassSquaredDaughter2, std::shared_ptr< ComPWA::FunctionTree::FitParameter > MesonRadius, unsigned int L, std::shared_ptr< FormFactor > FormFactorFunctor, std::shared_ptr< ComPWA::FunctionTree::Value< std::vector< double >>> InvMassSquared)
Definition: FormFactor.cpp:17
std::complex< double > qValueAC(double sqrtS, double ma, double mb)
Calculate Break-up momentum.
Definition: FormFactor.hpp:95
std::pair< std::shared_ptr< ComPWA::FunctionTree::Value< std::vector< double > > >, std::shared_ptr< ComPWA::FunctionTree::Value< std::vector< double > > > > DaughterInvariantMasses
Invariant Masses of daughter particles.
std::shared_ptr< ComPWA::FunctionTree::FitParameter > Mass
Resonance mass.
ParType
Enums for the type of the parameter, should be extended if an new parameter type is added...
Definition: Parameter.hpp:34
TreeNode class.
Virtual base class for operations of FunctionTree nodes.
Definition: Functions.hpp:30
This class provides a list of parameters and values of different types.