Hammer  1.0.0
Helicity Amplitude Module for Matrix Element Reweighting
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FFBtoD2starBLRVar.cc
Go to the documentation of this file.
1 ///
2 /// @file FFBtoD2starBLRVar.cc
3 /// @brief \f$ B \rightarrow D_2^* \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  FFBtoD2starBLRVar::FFBtoD2starBLRVar() {
29  // Create tensor rank and dimensions
30  vector<IndexType> dims = {8, 8}; // size is _FFErrNames + 1 to include central values in zeroth component
31  setGroup("BLRVar"); // override BLPR base class FF group setting
32  string name{"FFBtoD2starBLRVar"};
33 
34  setPrefix("BtoD**2*");
35  _FFErrLabel = FF_BDSSD1_VAR;
36  addProcessSignature(PID::BPLUS, {-PID::DSSD2STAR});
37  addTensor(Tensor{name, MD::makeEmptySparse(dims, {FF_BDSSD2STAR, FF_BDSSD2STAR_VAR})});
38 
39  addProcessSignature(PID::BZERO, {PID::DSSD2STARMINUS});
40  addTensor(Tensor{name, MD::makeEmptySparse(dims, {FF_BDSSD2STAR, FF_BDSSD2STAR_VAR})});
41 
42  setPrefix("BstoDs**2*");
43  _FFErrLabel = FF_BSDSSDS2STAR_VAR;
44  addProcessSignature(PID::BS, {PID::DSSDS2STARMINUS});
46 
47  setSignatureIndex();
48  }
49 
50  void FFBtoD2starBLRVar::defineSettings() {
51  _FFErrNames = {"delta_t1", "delta_tp", "delta_tau1", "delta_tau2", "delta_eta1", "delta_eta2", "delta_eta3"};
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>("t1", 0.7);
60  addSetting<double>("tp", -1.6);
61  addSetting<double>("tau1", -0.5);
62  addSetting<double>("tau2", 2.9);
63  addSetting<double>("eta1", 0.);
64  addSetting<double>("eta2", 0.);
65  addSetting<double>("eta3", 0.);
66  addSetting<double>("laB", 0.4);
67  addSetting<double>("laP", 0.8);
68 
69  // correlation matrix and set zero error eigenvectors
70  // Row basis is t1, tp, tau1, tau2, eta1(1), eta2(1), eta3(1)
71  vector<vector<double>> sliwmat{ {1., 0., 0., 0., 0., 0., 0.},
72  {0., 1., 0., 0., 0., 0., 0.},
73  {0., 0., 1., 0., 0., 0., 0.},
74  {0., 0., 0., 1., 0., 0., 0.},
75  {0., 0., 0., 0., 1., 0., 0.},
76  {0., 0., 0., 0., 0., 1., 0.},
77  {0., 0., 0., 0., 0., 0., 1.}};
78  addSetting<vector<vector<double>>>("sliwmatrix",sliwmat);
79 
80  for (auto elem : _FFErrNames) {
81  addSetting<double>(elem, 0.);
82  }
83 
84  initialized = true;
85  }
86 
87  void FFBtoD2starBLRVar::evalAtPSPoint(const vector<double>& point, const vector<double>& masses) {
88  Tensor& result = getTensor();
89  result.clearData();
90 
91  if(!initialized){
92  MSG_WARNING("Warning, Setting have not been defined!");
93  }
94 
95  double Mb = 0.;
96  double Mc = 0.;
97  // double unitres = 1.;
98  if(masses.size() >= 2) {
99  Mb = masses[0];
100  Mc = masses[1];
101  //unitres = _units;
102  }
103  else {
104  Mb = this->masses()[0];
105  Mc = this->masses()[1];
106  }
107  const double Mb2 = Mb*Mb;
108  const double Mc2 = Mc*Mc;
109 
110  double Sqq = point[0];
111 
112  // const double sqSqq = sqrt(Sqq);
113  double w = (Mb2 + Mc2 - Sqq)/(2.*Mb*Mc);
114  //safety measure if w==1.0
115  if(isZero(w - 1.0)) w += 1e-6;
116 
117  //BLR parameters
118  const double zBC = (*getSetting<double>("mc"))/(*getSetting<double>("mb"));
119  const double eB = 1./(*getSetting<double>("mb")*2.);
120  const double eC = 1./(*getSetting<double>("mc")*2.);
121  const double as = (*getSetting<double>("as"))/pi;
122  const double t1 = (*getSetting<double>("t1"));
123  const double tp = (*getSetting<double>("tp"));
124  const double tau1 = (*getSetting<double>("tau1"));
125  const double tau2 = (*getSetting<double>("tau2"));
126  const double eta1 = (*getSetting<double>("eta1"));
127  const double eta2 = (*getSetting<double>("eta2"));
128  const double eta3 = (*getSetting<double>("eta3"));
129  const double laB = (*getSetting<double>("laB"));
130  const double laP = (*getSetting<double>("laP"));
131 
132  const vector<vector<double>>& sliwmat = (*getSetting<vector<vector<double>>>("sliwmatrix"));
133 
134  // const double LambdaD32 = -laB + laP*w;
135  const double Fb = laB + laP - tau2 - tau1*(1 + 2*w);
136  const double LOIWtau = t1 + (w-1)*t1*tp;
137 
138  //QCD correction functions
139  // const double Cs = CS(w, zBC);
140  const double Cps = CP(w, zBC);
141  const double Cv1 = CV1(w, zBC);
142  // const double Cv2 = CV2(w, zBC);
143  // const double Cv3 = CV3(w, zBC);
144  const double Ca1 = CA1(w, zBC);
145  const double Ca2 = CA2(w, zBC);
146  const double Ca3 = CA3(w, zBC);
147  const double Ct1 = CT1(w, zBC);
148  const double Ct2 = CT2(w, zBC);
149  const double Ct3 = CT3(w, zBC);
150 
151  //Form factors
152  const double Kp = 1 + eC*(-2*eta1 - 2*(w-1)*eta2 + eta3 + (1 + 2*w)*tau1 + tau2) + as*Cps + eB*Fb;
153  const double Ka1 = -(eC*(-((1 + w)*(2*eta1 - eta3)) + (w-1)*(tau1 - tau2))) + (-1 - w)*(1 + as*Ca1) - (w-1)*eB*Fb;
154  const double Ka2 = -2*eC*(eta2 + tau1) + as*Ca2;
155  const double Ka3 = 1 - eC*(2*eta1 - 2*eta2 - eta3 + tau1 + tau2) + as*(Ca1 + Ca3) + eB*Fb;
156  const double Kv = -1 - eC*(-2*eta1 + eta3 + tau1 - tau2) - as*Cv1 - eB*Fb;
157  const double Kt1 = 1 - eC*(2*eta1 - eta3) + as*(Ct1 + ((w-1)*(Ct2 - Ct3))/2.);
158  const double Kt2 = -(eC*(tau1 - tau2)) + ((1 + w)*as*(Ct2 + Ct3))/2. + eB*Fb;
159  const double Kt3 = 2*eC*(-eta2 + tau1) - as*Ct2;
160 
161  // defined as 1/LOIWtau * D[LOIWtau * f, var]
162  const array<double, 7> KpDer = {Kp / t1, Kp / LOIWtau * t1 * (w - 1),-(eB - eC)*(1 + 2*w), -eB + eC, -2*eC, -2*eC*(-1 + w), eC};
163  const array<double, 7> Ka1Der = {Ka1 / t1, Ka1 / LOIWtau * t1 * (w - 1), (-1 + w)*(eB - eC + 2*eB*w), (eB + eC)*(-1 + w), 2*eC*(1 + w), 0,
164  -eC*(1 + w)};
165  const array<double, 7> Ka2Der = { Ka2 / t1, Ka2 / LOIWtau * t1 * (w - 1), -2*eC, 0., 0., -2*eC, 0.};
166  const array<double, 7> Ka3Der = {Ka3 / t1, Ka3 / LOIWtau * t1 * (w - 1), -eC - eB*(1 + 2*w), -eB - eC, -2*eC, 2*eC, eC};
167  const array<double, 7> KvDer = {Kv / t1, Kv / LOIWtau * t1 * (w - 1), eB - eC + 2*eB*w, eB + eC, 2*eC, 0., -eC};
168  const array<double, 7> Kt1Der = {Kt1 / t1, Kt1 / LOIWtau * t1 * (w - 1), 0., 0., -2*eC, 0., eC};
169  const array<double, 7> Kt2Der = {Kt2 / t1, Kt2 / LOIWtau * t1 * (w - 1), -eC - eB*(1 + 2*w), -eB + eC, 0., 0., 0.};
170  const array<double, 7> Kt3Der = {Kt3 / t1, Kt3 / LOIWtau * t1 * (w - 1), 2*eC, 0., 0., -2*eC, 0.};
171 
172  // Set elements
173  result.element({0, 0}) = Kp;
174  result.element({1, 0}) = Ka1;
175  result.element({2, 0}) = Ka2;
176  result.element({3, 0}) = Ka3;
177  result.element({4, 0}) = Kv;
178  result.element({5, 0}) = Kt1;
179  result.element({6, 0}) = Kt2;
180  result.element({7, 0}) = Kt3;
181 
182  for(IndexType i1 = 1; i1<=7; ++i1) {
183  for(size_t i2 = 0; i2<7; ++i2) {
184  result.element({0, i1}) += sliwmat[i2][i1-1]*KpDer[i2];
185  result.element({1, i1}) += sliwmat[i2][i1-1]*Ka1Der[i2];
186  result.element({2, i1}) += sliwmat[i2][i1-1]*Ka2Der[i2];
187  result.element({3, i1}) += sliwmat[i2][i1-1]*Ka3Der[i2];
188  result.element({4, i1}) += sliwmat[i2][i1-1]*KvDer[i2];
189  result.element({5, i1}) += sliwmat[i2][i1-1]*Kt1Der[i2];
190  result.element({6, i1}) += sliwmat[i2][i1-1]*Kt2Der[i2];
191  result.element({7, i1}) += sliwmat[i2][i1-1]*Kt3Der[i2];
192  }
193  }
194 
195  result *= LOIWtau;
196  result.toVector();
197  }
198 
199  std::unique_ptr<FormFactorBase> FFBtoD2starBLRVar::clone(const std::string& label) {
201  }
202 
203 } // 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