Hammer  1.0.0
Helicity Amplitude Module for Matrix Element Reweighting
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FFBtoD1starBLRVar.cc
Go to the documentation of this file.
1 ///
2 /// @file FFBtoD1starBLRVar.cc
3 /// @brief \f$ B \rightarrow D_1^* \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  FFBtoD1starBLRVar::FFBtoD1starBLRVar() {
29  // Create tensor rank and dimensions
30  vector<IndexType> dims = {8, 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{"FFBtoD1starBLRVar"};
33 
34  setPrefix("BtoD**1*");
35  _FFErrLabel = FF_BDSSD1STAR_VAR;
36  addProcessSignature(PID::BPLUS, {-PID::DSSD1STAR});
37  addTensor(Tensor{name, MD::makeEmptySparse(dims, {FF_BDSSD1STAR, FF_BDSSD1STAR_VAR})});
38 
39  addProcessSignature(PID::BZERO, {PID::DSSD1STARMINUS});
40  addTensor(Tensor{name, MD::makeEmptySparse(dims, {FF_BDSSD1STAR, FF_BDSSD1STAR_VAR})});
41 
42  setPrefix("BstoDs**1*");
43  _FFErrLabel = FF_BSDSSDS1STAR_VAR;
44  addProcessSignature(PID::BS, {PID::DSSDS1STARMINUS});
46 
47  setSignatureIndex();
48  }
49 
50  void FFBtoD1starBLRVar::defineSettings() {
51  _FFErrNames = {"delta_zt1", "delta_ztp", "delta_zeta1", "delta_chi1", "delta_chi2"};
52  setPath(getFFErrPrefixGroup().get());
53  setUnits("GeV");
54 
55  //1S scheme: mb1S = 4710, mbBar = 5313, lambda1 = -3 10^5 MeV^2, delta mb-mc = 3400, alpha_s = 26/100
56  addSetting<double>("as",0.26);
57  addSetting<double>("mb",4.710);
58  addSetting<double>("mc",4.710 - 3.400);
59  addSetting<double>("zt1", 0.7);
60  addSetting<double>("ztp", 0.2);
61  addSetting<double>("zeta1", 0.6);
62  addSetting<double>("chi1", 0.);
63  addSetting<double>("chi2", 0.);
64  addSetting<double>("laB", 0.4);
65  addSetting<double>("laS", 0.76);
66 
67  // correlation matrix and set zero error eigenvectors
68  // Row basis is zt1, ztp, zeta1, chi1(1), chi2(1)
69  vector<vector<double>> sliwmat{{1., 0., 0., 0., 0.},
70  {0., 1., 0., 0., 0.},
71  {0., 0., 1., 0., 0.},
72  {0., 0., 0., 1., 0.},
73  {0., 0., 0., 0., 1.}};
74  addSetting<vector<vector<double>>>("sliwmatrix", sliwmat);
75 
76  for (auto elem : _FFErrNames) {
77  addSetting<double>(elem, 0.);
78  }
79 
80  initialized = true;
81  }
82 
83  void FFBtoD1starBLRVar::evalAtPSPoint(const vector<double>& point, const vector<double>& masses) {
84  Tensor& result = getTensor();
85  result.clearData();
86 
87  if(!initialized){
88  MSG_WARNING("Warning, Setting have not been defined!");
89  }
90 
91  double Mb = 0.;
92  double Mc = 0.;
93  // double unitres = 1.;
94  if(masses.size() >= 2) {
95  Mb = masses[0];
96  Mc = masses[1];
97  //unitres = _units;
98  }
99  else {
100  Mb = this->masses()[0];
101  Mc = this->masses()[1];
102  }
103  const double Mb2 = Mb*Mb;
104  const double Mc2 = Mc*Mc;
105 
106  double Sqq = point[0];
107 
108  // const double sqSqq = sqrt(Sqq);
109  double w = (Mb2 + Mc2 - Sqq)/(2.*Mb*Mc);
110  //safety measure if w==1.0
111  if(isZero(w - 1.0)) w += 1e-6;
112 
113  //BLR parameters
114  const double zBC = (*getSetting<double>("mc"))/(*getSetting<double>("mb"));
115  const double eB = 1./(*getSetting<double>("mb")*2.);
116  const double eC = 1./(*getSetting<double>("mc")*2.);
117  const double as = (*getSetting<double>("as"))/pi;
118  const double zt1 = (*getSetting<double>("zt1"));
119  const double ztp = (*getSetting<double>("ztp"));
120  const double zeta1 = (*getSetting<double>("zeta1"));
121  const double chi1 = (*getSetting<double>("chi1"));
122  const double chi2 = (*getSetting<double>("chi2"));
123  const double laB = (*getSetting<double>("laB"));
124  const double laS = (*getSetting<double>("laS"));
125 
126  const vector<vector<double>>& sliwmat = (*getSetting<vector<vector<double>>>("sliwmatrix"));
127 
128  const double LambdaD12 = -laB + laS * w;
129  const double Gb = (-(laB*(2 + w)) + laS*(1 + 2*w))/(1 + w) - 2*(w-1)*zeta1;
130  const double LOIWzeta = zt1 + (w-1)*zt1*ztp;
131 
132  //QCD correction functions
133  const double Cs = CS(w, zBC);
134  // const double Cps = CP(w, zBC);
135  const double Cv1 = CV1(w, zBC);
136  const double Cv2 = CV2(w, zBC);
137  const double Cv3 = CV3(w, zBC);
138  const double Ca1 = CA1(w, zBC);
139  // const double Ca2 = CA2(w, zBC);
140  // const double Ca3 = CA3(w, zBC);
141  const double Ct1 = CT1(w, zBC);
142  const double Ct2 = CT2(w, zBC);
143  const double Ct3 = CT3(w, zBC);
144 
145  //Form factors
146  const double Gs = 1 - eC*(LambdaD12/(1 + w) - 2*(w-1)*zeta1 + 2*chi1 - 2*(1 + w)*chi2) + as*Cs - eB*Gb;
147  const double Gv1 = eC*(LambdaD12 - 2*(w-1)*chi1) + (w-1)*(1 + as*Cv1) - (1 + w)*eB*Gb;
148  const double Gv2 = eC*(2*zeta1 - 2*chi2) - as*Cv2;
149  const double Gv3 = -1 - eC*(LambdaD12/(1 + w) + 2*zeta1 - 2*chi1 + 2*chi2) - as*(Cv1 + Cv3) + eB*Gb;
150  const double Ga = 1 + eC*(LambdaD12/(1 + w) - 2*chi1) + as*Ca1 - eB*Gb;
151  const double Gt1 = -1 + eC*(LambdaD12/(1 + w) + 2*chi1) - as*(Ct1 + (w-1)*Ct2) + eB*Gb;
152  const double Gt2 = 1 + eC*(LambdaD12/(1 + w) - 2*chi1) + as*(Ct1 - (w-1)*Ct3) + eB*Gb;
153  const double Gt3 = eC*(2*zeta1 + 2*chi2) - as*Ct2;
154 
155 
156  // defined as 1/LOIWzeta * D[LOIWzeta * f, var]
157  const array<double, 5> GsDer = {Gs / zt1, Gs / LOIWzeta * zt1 * (w - 1), 2*(eB + eC)*(-1 + w), -2*eC, 2*eC*(1 + w)};
158  const array<double, 5> Gv1Der = {Gv1 / zt1, Gv1 / LOIWzeta * zt1 * (w - 1), 2*eB*(-1 + w*w), -2*eC*(-1 + w), 0};
159  const array<double, 5> Gv2Der = {Gv2 / zt1, Gv2 / LOIWzeta * zt1 * (w - 1), 2*eC, 0, -2*eC};
160  const array<double, 5> Gv3Der = {Gv3 / zt1, Gv3 / LOIWzeta * zt1 * (w - 1), -2*(eC + eB*(-1 + w)), 2*eC, -2*eC};
161  const array<double, 5> GaDer = {Ga / zt1, Ga / LOIWzeta * zt1 * (w - 1), 2*eB*(-1 + w), -2*eC, 0};
162  const array<double, 5> Gt1Der = {Gt1 / zt1, Gt1 / LOIWzeta * zt1 * (w - 1), -2*eB*(-1 + w), 2*eC, 0};
163  const array<double, 5> Gt2Der = {Gt2 / zt1, Gt2 / LOIWzeta * zt1 * (w - 1), -2*eB*(-1 + w), -2*eC, 0};
164  const array<double, 5> Gt3Der = {Gt3 / zt1, Gt3 / LOIWzeta * zt1 * (w - 1), 2*eC, 0, 2*eC};
165 
166  //Set elements
167  result.element({0, 0}) = Gs;
168  result.element({1, 0}) = Gv1;
169  result.element({2, 0}) = Gv2;
170  result.element({3, 0}) = Gv3;
171  result.element({4, 0}) = Ga;
172  result.element({5, 0}) = Gt1;
173  result.element({6, 0}) = Gt2;
174  result.element({7, 0}) = Gt3;
175 
176  for (IndexType i1 = 1; i1 <= 5; ++i1) {
177  for (size_t i2 = 0; i2 < 5; ++i2) {
178  result.element({0, i1}) += sliwmat[i2][i1 - 1] * GsDer[i2];
179  result.element({1, i1}) += sliwmat[i2][i1 - 1] * Gv1Der[i2];
180  result.element({2, i1}) += sliwmat[i2][i1 - 1] * Gv2Der[i2];
181  result.element({3, i1}) += sliwmat[i2][i1 - 1] * Gv3Der[i2];
182  result.element({4, i1}) += sliwmat[i2][i1 - 1] * GaDer[i2];
183  result.element({5, i1}) += sliwmat[i2][i1 - 1] * Gt1Der[i2];
184  result.element({6, i1}) += sliwmat[i2][i1 - 1] * Gt2Der[i2];
185  result.element({7, i1}) += sliwmat[i2][i1 - 1] * Gt3Der[i2];
186  }
187  }
188 
189  result *= LOIWzeta;
190  result.toVector();
191  }
192 
193  std::unique_ptr<FormFactorBase> FFBtoD1starBLRVar::clone(const std::string& label) {
195  }
196 
197 } // 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