Hammer  1.0.0
Helicity Amplitude Module for Matrix Element Reweighting
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FFBtoD0starBLRVar.cc
Go to the documentation of this file.
1 ///
2 /// @file FFBtoD0starBLRVar.cc
3 /// @brief \f$ B \rightarrow D_0^* \f$ BLR form factors with variations
4 ///
5 
6 //**** This file is a part of the HAMMER library
7 //**** Copyright (C) 2016 - 2020 The HAMMER Collaboration
8 //**** HAMMER is licensed under version 3 of the GPL; see COPYING for details
9 //**** Please note the MCnet academic guidelines; see GUIDELINES for details
10 
11 // -*- C++ -*-
13 #include "Hammer/IndexLabels.hh"
14 #include "Hammer/Math/Constants.hh"
15 #include "Hammer/Math/Utils.hh"
16 #include "Hammer/Particle.hh"
17 #include "Hammer/Tools/Pdg.hh"
19 #include <cmath>
20 #include <iostream>
21 
22 using namespace std;
23 
24 namespace Hammer {
25 
26  namespace MD = MultiDimensional;
27 
28  FFBtoD0starBLRVar::FFBtoD0starBLRVar() {
29  // Create tensor rank and dimensions
30  vector<IndexType> dims = {4, 6}; // size is _FFErrNames + 1 to include central values in zeroth component
31  setGroup("BLRVar"); //override BLPR base class FF group setting
32  string name{"FFBtoD0starBLRVar"};
33 
34  setPrefix("BtoD**0*");
35  _FFErrLabel = FF_BDSSD0STAR_VAR;
36  addProcessSignature(PID::BPLUS, {-PID::DSSD0STAR});
37  addTensor(Tensor{name, MD::makeEmptySparse(dims, {FF_BDSSD0STAR, FF_BDSSD0STAR_VAR})});
38 
39  addProcessSignature(PID::BZERO, {PID::DSSD0STARMINUS});
40  addTensor(Tensor{name, MD::makeEmptySparse(dims, {FF_BDSSD0STAR, FF_BDSSD0STAR_VAR})});
41 
42  setPrefix("BstoDs**0*");
43  _FFErrLabel = FF_BSDSSDS0STAR_VAR;
44  addProcessSignature(PID::BS, {PID::DSSDS0STARMINUS});
46 
47  setSignatureIndex();
48  }
49 
50  void FFBtoD0starBLRVar::defineSettings() {
51  _FFErrNames = {"delta_zt1", "delta_ztp", "delta_zeta1", "delta_chi1", "delta_chi2"};
52  //_FFErrNames = ;
53  setPath(getFFErrPrefixGroup().get());
54  setUnits("GeV");
55 
56  //1S scheme: mb1S = 4710, mbBar = 5313, lambda1 = -3 10^5 MeV^2, delta mb-mc = 3400, alpha_s = 26/100
57  addSetting<double>("as",0.26);
58  addSetting<double>("mb",4.710);
59  addSetting<double>("mc",4.710 - 3.400);
60  addSetting<double>("zt1", 0.7);
61  addSetting<double>("ztp", 0.2);
62  addSetting<double>("zeta1", 0.6);
63  addSetting<double>("chi1", 0.);
64  addSetting<double>("chi2", 0.);
65  addSetting<double>("laB", 0.4);
66  addSetting<double>("laS", 0.76);
67 
68  // correlation matrix and set zero error eigenvectors
69  // Row basis is zt1, ztp, zeta1, chi1(1), chi2(1)
70  vector<vector<double>> sliwmat{ {1., 0., 0., 0., 0.},
71  {0., 1., 0., 0., 0.},
72  {0., 0., 1., 0., 0.},
73  {0., 0., 0., 1., 0.},
74  {0., 0., 0., 0., 1.}};
75  addSetting<vector<vector<double>>>("sliwmatrix",sliwmat);
76 
77  for (auto elem : _FFErrNames) {
78  addSetting<double>(elem, 0.);
79  }
80 
81  initialized = true;
82  }
83 
84  void FFBtoD0starBLRVar::evalAtPSPoint(const vector<double>& point, const vector<double>& masses) {
85  Tensor& result = getTensor();
86  result.clearData();
87 
88  if(!initialized){
89  MSG_WARNING("Warning, Setting have not been defined!");
90  }
91 
92  double Mb = 0.;
93  double Mc = 0.;
94  // double unitres = 1.;
95  if(masses.size() >= 2) {
96  Mb = masses[0];
97  Mc = masses[1];
98  //unitres = _units;
99  }
100  else {
101  Mb = this->masses()[0];
102  Mc = this->masses()[1];
103  }
104  const double Mb2 = Mb*Mb;
105  const double Mc2 = Mc*Mc;
106 
107  double Sqq = point[0];
108 
109  // const double sqSqq = sqrt(Sqq);
110  double w = (Mb2 + Mc2 - Sqq)/(2.*Mb*Mc);
111  //safety measure if w==1.0
112  if(isZero(w - 1.0)) w += 1e-6;
113 
114  //BLR parameters
115  const double zBC = (*getSetting<double>("mc"))/(*getSetting<double>("mb"));
116  const double eB = 1./(*getSetting<double>("mb")*2.);
117  const double eC = 1./(*getSetting<double>("mc")*2.);
118  const double as = (*getSetting<double>("as"))/pi;
119  const double zt1 = (*getSetting<double>("zt1"));
120  const double ztp = (*getSetting<double>("ztp"));
121  const double zeta1 = (*getSetting<double>("zeta1"));
122  const double chi1 = (*getSetting<double>("chi1"));
123  const double chi2 = (*getSetting<double>("chi2"));
124  const double laB = (*getSetting<double>("laB"));
125  const double laS = (*getSetting<double>("laS"));
126 
127  const vector<vector<double>>& sliwmat = (*getSetting<vector<vector<double>>>("sliwmatrix"));
128 
129  const double LambdaD12 = -laB + laS * w;
130  const double Gb = (-(laB*(2 + w)) + laS*(1 + 2*w))/(1 + w) - 2*(w-1)*zeta1;
131  const double LOIWzeta = zt1 + (w-1)*zt1*ztp;
132 
133  //QCD correction functions
134  // const double Cs = CS(w, zBC);
135  const double Cps = CP(w, zBC);
136  // const double Cv1 = CV1(w, zBC);
137  // const double Cv2 = CV2(w, zBC);
138  // const double Cv3 = CV3(w, zBC);
139  const double Ca1 = CA1(w, zBC);
140  const double Ca2 = CA2(w, zBC);
141  const double Ca3 = CA3(w, zBC);
142  const double Ct1 = CT1(w, zBC);
143  // const double Ct2 = CT2(w, zBC);
144  // const double Ct3 = CT3(w, zBC);
145 
146  //Form factors
147  const double gps = eC*(3*LambdaD12 - 2*(-1 + w*w)*zeta1 + (w-1)*(6*chi1 - 2*(1 + w)*chi2)) + (w-1)*(1 + as*Cps) - (1 + w)*eB*Gb;
148  const double gp = -(eC*((3*LambdaD12)/(1 + w) - 2*(w-1)*zeta1)) + ((w-1)*as*(Ca2 + Ca3))/2. - eB*Gb;
149  const double gm = 1 + eC*(6*chi1 - 2*(1 + w)*chi2) + as*(Ca1 + ((w-1)*(Ca2 - Ca3))/2.);
150  const double gt = 1 + eC*((3*LambdaD12)/(1 + w) - 2*(w-1)*zeta1 + 6*chi1 - 2*(1 + w)*chi2) + as*Ct1 - eB*Gb;
151 
152  // defined as 1/LOIWzeta * D[LOIWzeta * f, var]
153  const array<double, 5> gpsDer = {gps / zt1, gps / LOIWzeta * zt1 * (w - 1), 2*(eB - eC)*(-1 + w*w), 6*eC*(-1 + w), -2*eC*(-1 + w*w)};
154  const array<double, 5> gpDer = {gp / zt1, gp / LOIWzeta * zt1 * (w - 1), 2*(eB + eC)*(-1 + w), 0., 0.};
155  const array<double, 5> gmDer = {gm / zt1, gm / LOIWzeta * zt1 * (w - 1), 0., 6*eC, -2*eC*(1 + w)};
156  const array<double, 5> gtDer = {gt / zt1, gt / LOIWzeta * zt1 * (w - 1), 2*(eB - eC)*(-1 + w), 6*eC, -2*eC*(1 + w)};
157 
158  //Set elements
159  result.element({0, 0}) = gps;
160  result.element({1, 0}) = gp;
161  result.element({2, 0}) = gm;
162  result.element({3, 0}) = gt;
163 
164  for (IndexType i1 = 1; i1 <=5; ++i1) {
165  for (size_t i2 = 0; i2 < 5; ++i2) {
166  result.element({0, i1}) += sliwmat[i2][i1 - 1] * gpsDer[i2];
167  result.element({1, i1}) += sliwmat[i2][i1 - 1] * gpDer[i2];
168  result.element({2, i1}) += sliwmat[i2][i1 - 1] * gmDer[i2];
169  result.element({3, i1}) += sliwmat[i2][i1 - 1] * gtDer[i2];
170  }
171  }
172 
173  result *= LOIWzeta;
174  result.toVector();
175  }
176 
177  std::unique_ptr<FormFactorBase> FFBtoD0starBLRVar::clone(const std::string& label) {
179  }
180 
181 } // namespace Hammer
#define MSG_WARNING(x)
Definition: Logging.hh:366
TensorData makeEmptySparse(const IndexList &dimensions, const LabelsList &labels)
std::complex< double > & element(const IndexList &indices={})
access an element given its indices
Definition: Tensor.cc:67
Tensor & toVector()
forces conversion of a tensor to vector type
Definition: Tensor.cc:171
Tensor indices label definitions.
BLR form factors with variations
uint16_t IndexType
Sparse tensor data container.
Multidimensional tensor class with complex numbers as elements.
Definition: Tensor.hh:33
bool isZero(const std::complex< double > val)
Definition: Math/Utils.hh:25
void clearData()
sets all the elements to 0
Definition: Tensor.cc:229
Various numerical constants.
Hammer particle data class.
Hammer particle class.
#define MAKE_CLONE(OBJ, LABEL)
static constexpr double pi
Definition: Constants.hh:21