Belle II Software  release-08-01-10
EvtBCLFF.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #include <generators/evtgen/models/EvtBCLFF.h>
9 
10 #include <framework/logging/Logger.h>
11 
12 #include <EvtGenBase/EvtId.hh>
13 #include <EvtGenBase/EvtPDL.hh>
14 
15 #include <cmath>
16 
17 namespace Belle2 {
23  EvtBCLFF::EvtBCLFF(int numarg, double* arglist) : m_numBCLFFCoefficients(numarg)
24  {
25  for (int i = 0; i < m_numBCLFFCoefficients; ++i) {
26  m_BCLFFCoefficients[i] = arglist[i];
27  }
28  }
29 
30  void EvtBCLFF::getscalarff(EvtId parent, EvtId daughter, double t, double, double* fpf, double* f0f)
31  {
32 
33  if (m_numBCLFFCoefficients != 8) {
34  EvtGenReport(EVTGEN_ERROR, "EvtGen") << "Wrong number of arguments for EvtBCLFF::getscalarff!\n";
35  }
36 
37  const auto mB = EvtPDL::getMeanMass(parent);
38  const auto mM = EvtPDL::getMeanMass(daughter);
39 
40  const auto tplus = (mB + mM) * (mB + mM);
41  const auto tzero = (mB + mM) * (std::sqrt(mB) - std::sqrt(mM)) * (std::sqrt(mB) - std::sqrt(mM));
42 
43  const auto mR2 = m_resonance1Minus * m_resonance1Minus;
44  const auto pole = 1 / (1 - t / mR2);
45 
46  const std::vector<double> bplus = {m_BCLFFCoefficients[0], m_BCLFFCoefficients[1], m_BCLFFCoefficients[2], m_BCLFFCoefficients[3]};
47  const std::vector<double> bzero = {m_BCLFFCoefficients[4], m_BCLFFCoefficients[5], m_BCLFFCoefficients[6], m_BCLFFCoefficients[7]};
48 
49  const auto N_fpf = bplus.size();
50  const auto N_f0f = bzero.size();
51 
52  auto z = [tplus, tzero](decltype(t) q2) {
53  const auto term1 = std::sqrt(tplus - q2);
54  const auto term2 = std::sqrt(tplus - tzero);
55  return (term1 - term2) / (term1 + term2);
56  };
57 
58  double sum_fpf = 0;
59  for (unsigned int n = 0; n < N_fpf; ++n) {
60  sum_fpf += bplus[n] * (std::pow(z(t), n) - std::pow(-1, n - N_fpf) * n / N_fpf * std::pow(z(t), N_fpf));
61  }
62  *fpf = pole * sum_fpf;
63 
64  double sum_f0f = 0;
65  for (unsigned int n = 0; n < N_f0f; ++n) {
66  sum_f0f += bzero[n] * std::pow(z(t), n);
67  }
68  *f0f = sum_f0f;
69  }
70 
71  void EvtBCLFF::getvectorff(EvtId parent, EvtId daughter, double t, double, double* a1f, double* a2f, double* vf, double* a0f)
72  {
73 
74  if (m_numBCLFFCoefficients != 11) {
75  EvtGenReport(EVTGEN_ERROR, "EvtGen") << "Wrong number of arguments for EvtBCLFF::getvectorff!\n";
76  }
77 
78  const auto mB = EvtPDL::getMeanMass(parent);
79  const auto mB2 = mB * mB;
80  const auto mM = EvtPDL::getMeanMass(daughter);
81  const auto mM2 = mM * mM;
82 
83  const auto tplus = (mB + mM) * (mB + mM);
84  const auto tminus = (mB - mM) * (mB - mM);
85  const auto tzero = tplus * (1 - std::sqrt(1 - tminus / tplus));
86 
87  const auto mR2A0 = m_resonance0Minus * m_resonance0Minus;
88  const auto mR2A1 = m_resonance1Plus * m_resonance1Plus;
89  const auto mR2A12 = m_resonance1Plus * m_resonance1Plus;
90  const auto mR2V = m_resonance1Minus * m_resonance1Minus;
91 
92  const auto poleA0 = 1. / (1 - t / mR2A0);
93  const auto poleA1 = 1. / (1 - t / mR2A1);
94  const auto poleA12 = 1. / (1 - t / mR2A12);
95  const auto poleV = 1. / (1 - t / mR2V);
96 
97  const std::vector<double> A0 = {8 * mB* mM / (mB2 - mM2)* m_BCLFFCoefficients[5], m_BCLFFCoefficients[0], m_BCLFFCoefficients[1]};
98  const std::vector<double> A1 = {m_BCLFFCoefficients[2], m_BCLFFCoefficients[3], m_BCLFFCoefficients[4]};
99  const std::vector<double> A12 = {m_BCLFFCoefficients[5], m_BCLFFCoefficients[6], m_BCLFFCoefficients[7]};
100  const std::vector<double> V = {m_BCLFFCoefficients[8], m_BCLFFCoefficients[9], m_BCLFFCoefficients[10]};
101 
102  auto z = [tplus, tzero](decltype(t) q2) {
103  const auto term1 = std::sqrt(tplus - q2);
104  const auto term2 = std::sqrt(tplus - tzero);
105  return (term1 - term2) / (term1 + term2);
106  };
107 
108  auto sum = [&z](decltype(t) q2, std::vector<double> par) {
109  double tot = 0;
110  for (unsigned int n = 0; n < par.size(); ++n) {
111  tot += par[n] * std::pow(z(q2) - z(0), n);
112  }
113  return tot;
114  };
115 
116  auto kaellen = [mB, mM](decltype(t) q2) {
117  return ((mB + mM) * (mB + mM) - q2) * ((mB - mM) * (mB - mM) - q2);
118  };
119 
120  const auto ffA0 = poleA0 * sum(t, A0);
121  const auto ffA1 = poleA1 * sum(t, A1);
122  const auto ffA12 = poleA12 * sum(t, A12);
123  const auto ffV = poleV * sum(t, V);
124 
125  const auto ffA2 = ((mB + mM) * (mB + mM) * (mB2 - mM2 - t) * ffA1 - (16 * mB * mM2 * (mB + mM)) * ffA12) / kaellen(t);
126 
127  *a0f = ffA0;
128  *a1f = ffA1;
129  *a2f = ffA2;
130  *vf = ffV;
131 
132  }
133 
134  void EvtBCLFF::gettensorff(EvtId, EvtId, double, double, double*, double*, double*, double*)
135  {
136  B2FATAL("Not implemented :gettensorff in EvtBCLFF.");
137  }
138 
139  void EvtBCLFF::getbaryonff(EvtId, EvtId, double, double, double*, double*, double*, double*)
140  {
141  B2FATAL("Not implemented :getbaryonff in EvtBCLFF.");
142  }
143 
144  void EvtBCLFF::getdiracff(EvtId, EvtId, double, double, double*, double*, double*, double*, double*, double*)
145  {
146  B2FATAL("Not implemented :getbaryonff in EvtBCLFF.");
147  }
148 
149  void EvtBCLFF::getraritaff(EvtId, EvtId, double, double, double*, double*, double*, double*, double*, double*, double*, double*)
150  {
151  B2FATAL("Not implemented :getbaryonff in EvtBCLFF.");
152  }
154 }
static constexpr double m_resonance1Minus
Mass of the 1- resonance for the parametrization of the vector FF.
Definition: EvtBCLFF.h:83
static constexpr double m_resonance0Minus
Mass of the 0- resonance for the parametrization of the vector FF.
Definition: EvtBCLFF.h:81
static constexpr double m_resonance1Plus
Mass of the 1+ resonance for the parametrization of the vector FF.
Definition: EvtBCLFF.h:85
double m_BCLFFCoefficients[19]
Parameters passed to the model; BCL expansion coefficients.
Definition: EvtBCLFF.h:78
int m_numBCLFFCoefficients
Total number of parameters passed to the model.
Definition: EvtBCLFF.h:76
EvtBCLFF(int numarg, double *arglist)
constructor
Definition: EvtBCLFF.cc:23
void getscalarff(EvtId parent, EvtId daughter, double t, double, double *fpf, double *f0f)
Scalar FF's.
Definition: EvtBCLFF.cc:30
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28
void getdiracff(EvtId, EvtId, double, double, double *, double *, double *, double *, double *, double *)
Not Implemented.
Definition: EvtBCLFF.cc:144
void getraritaff(EvtId, EvtId, double, double, double *, double *, double *, double *, double *, double *, double *, double *)
Not Implemented.
Definition: EvtBCLFF.cc:149
void getbaryonff(EvtId, EvtId, double, double, double *, double *, double *, double *)
Not Implemented.
Definition: EvtBCLFF.cc:139
void gettensorff(EvtId parent, EvtId daughter, double t, double, double *hf, double *kf, double *bp, double *bm)
Not Implemented.
Definition: EvtBCLFF.cc:134
void getvectorff(EvtId parent, EvtId daughter, double t, double, double *a1f, double *a2f, double *vf, double *a0f)
Vector FF's.
Definition: EvtBCLFF.cc:71
Abstract base class for different kinds of events.