ComPWA
Common Partial-Wave-Analysis Framework
WignerD.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 COMPWA_PHYSICS_HELICITY_FORMALISM_WIGNERD_HPP_
6 #define COMPWA_PHYSICS_HELICITY_FORMALISM_WIGNERD_HPP_
7 
10 
11 #include "ThirdParty/qft++/include/qft++/WignerD.h"
12 
13 namespace ComPWA {
14 
15 struct DataPoint;
16 
17 namespace Physics {
18 namespace HelicityFormalism {
19 
23 namespace WignerD {
24 
25 inline double dynamicalFunction(double J, double muPrime, double mu,
26  double beta) {
27 
28  if ((double)J == 0)
29  return 1.0;
30 
31  assert(!std::isnan(beta));
32  assert(std::cos(beta) <= 1 && std::cos(beta) >= -1);
33 
34  double result = QFT::Wigner_d(J, muPrime, mu, beta);
35  assert(!std::isnan(result));
36 
37  double pi4 = M_PI * 4.0;
38  double norm = std::sqrt((2.0 * J + 1) / pi4);
39 
40  return norm * result;
41 }
42 
43 inline std::complex<double> dynamicalFunction(double J, double muPrime,
44  double mu, double alpha,
45  double beta, double gamma) {
46  if ((double)J == 0)
47  return std::complex<double>(1.0, 0);
48 
49  assert(!std::isnan(alpha));
50  assert(!std::isnan(beta));
51  assert(!std::isnan(gamma));
52 
53  std::complex<double> i(0, 1);
54 
55  double tmp = WignerD::dynamicalFunction(J, muPrime, mu, beta);
56  std::complex<double> result =
57  tmp * std::exp(-i * (muPrime * alpha + mu * gamma));
58 
59  assert(!std::isnan(result.real()));
60  assert(!std::isnan(result.imag()));
61 
62  return result;
63 }
64 
65 std::shared_ptr<ComPWA::FunctionTree::TreeNode> createFunctionTree(
66  double J, double MuPrime, double Mu,
67  std::shared_ptr<ComPWA::FunctionTree::Value<std::vector<double>>> Theta,
68  std::shared_ptr<ComPWA::FunctionTree::Value<std::vector<double>>> Phi);
69 } // namespace WignerD
70 
72 public:
73  WignerDStrategy(std::string Name = "")
74  : Strategy(ComPWA::FunctionTree::ParType::MCOMPLEX, "WignerD" + Name) {}
75 
76  virtual void execute(ComPWA::FunctionTree::ParameterList &paras,
77  std::shared_ptr<ComPWA::FunctionTree::Parameter> &out);
78 };
79 
80 } // namespace HelicityFormalism
81 } // namespace Physics
82 } // namespace ComPWA
83 
84 #endif
double dynamicalFunction(double J, double muPrime, double mu, double beta)
Definition: WignerD.hpp:25
std::shared_ptr< ComPWA::FunctionTree::TreeNode > createFunctionTree(double J, double MuPrime, double Mu, std::shared_ptr< ComPWA::FunctionTree::Value< std::vector< double >>> Theta, std::shared_ptr< ComPWA::FunctionTree::Value< std::vector< double >>> Phi)
Definition: WignerD.cpp:13
This file contains Functions implementing the Strategy interface so they can be used inside a node of...
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.