Hammer  1.0.0
Helicity Amplitude Module for Matrix Element Reweighting
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FFBtoDstarCLNVar.cc
Go to the documentation of this file.
1 ///
2 /// @file FFBtoDstarCLNVar.cc
3 /// @brief \f$ B \rightarrow D^* \f$ CLN 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  FFBtoDstarCLNVar::FFBtoDstarCLNVar() {
29  // Create tensor rank and dimensions
30  vector<IndexType> dims = {8, 5}; //size is _FFErrNames + 1 to include central values in zeroth component
31  setGroup("CLNVar"); // override CLN base class FF group setting
32  string name{"FFBtoDstarCLNVar"};
33 
34  setPrefix("BtoD*");
35  _FFErrLabel = FF_BDSTAR_VAR;
36  addProcessSignature(PID::BPLUS, {-PID::DSTAR});
37  addTensor(Tensor{name, MD::makeEmptySparse(dims, {FF_BDSTAR, FF_BDSTAR_VAR})});
38 
39  addProcessSignature(PID::BZERO, {PID::DSTARMINUS});
40  addTensor(Tensor{name, MD::makeEmptySparse(dims, {FF_BDSTAR, FF_BDSTAR_VAR})});
41 
42  setPrefix("BstoDs*");
43  _FFErrLabel = FF_BSDSSTAR_VAR;
44  addProcessSignature(PID::BS, {PID::DSSTARMINUS});
45  addTensor(Tensor{name, MD::makeEmptySparse(dims, {FF_BSDSSTAR, FF_BSDSSTAR_VAR})});
46 
47  setSignatureIndex();
48  }
49 
50  void FFBtoDstarCLNVar::defineSettings() {
51  _FFErrNames = {"delta_RhoSq", "delta_R1", "delta_R2", "delta_R0"};
52  setPath(getFFErrPrefixGroup().get());
53  setUnits("GeV");
54 
55  addSetting<double>("a",1.0); //zero recoil expansion
56  addSetting<double>("RhoSq",1.207);
57  addSetting<double>("F1",0.908);
58  addSetting<double>("R1",1.401);
59  addSetting<double>("R2",0.854);
60  addSetting<double>("R0",1.15);
61  addSetting<double>("as",0.26); //mbmc scale
62  addSetting<double>("la",0.48); //CLN
63  addSetting<double>("mcOnmb",0.29); //CLN
64 
65  //correlation matrix and set zero error eignenvectors
66  //Row basis is RhoSq, R1, R2, R0
67  vector<vector<double>> RhoRsmat{{1., 0., 0., 0.},
68  {0., 1., 0., 0.},
69  {0., 0., 1., 0.},
70  {0., 0., 0., 1.}};
71  addSetting<vector<vector<double>>>("RhoRsmatrix",RhoRsmat);
72 
73 
74  for (auto elem : _FFErrNames) {
75  addSetting<double>(elem, 0.);
76  }
77  initialized = true;
78  }
79 
80  void FFBtoDstarCLNVar::evalAtPSPoint(const vector<double>& point, const vector<double>& masses) {
81  Tensor& result = getTensor();
82  result.clearData();
83 
84  if(!initialized){
85  MSG_WARNING("Warning, Setting have not been defined!");
86  }
87 
88  double Mb = 0.;
89  double Mc = 0.;
90  double unitres = 1.;
91  if(masses.size() >= 2) {
92  Mb = masses[0];
93  Mc = masses[1];
94  unitres = _units;
95  }
96  else {
97  Mb = this->masses()[0];
98  Mc = this->masses()[1];
99  }
100  const double Mb2 = Mb*Mb;
101  const double Mc2 = Mc*Mc;
102 
103  double Sqq = point[0];
104 
105  // const double sqMbMc = sqrt(Mb*Mc);
106  double w = (Mb2 + Mc2 - Sqq)/(2.*Mb*Mc);
107  //safety measure if w==1.0
108  if(isZero(w - 1.0)) w += 1e-6;
109  const double a = *getSetting<double>("a");
110  const double zCon = (sqrt(w+1) - sqrt2*a)/(sqrt(w+1) + sqrt2*a);
111 
112  const double RhoSq=*getSetting<double>("RhoSq");
113  const double R0par=*getSetting<double>("R0");
114  const double R1par=*getSetting<double>("R1");
115  const double R2par=*getSetting<double>("R2");
116  const double F1par=*getSetting<double>("F1");
117  const double as = *getSetting<double>("as")/pi;
118  const double LambdaBar = *getSetting<double>("la");
119  const double zR = *getSetting<double>("mcOnmb");
120 
121  const vector<vector<double>>& RhoRsmat = (*getSetting<vector<vector<double>>>("RhoRsmatrix"));
122 
123  const double rC=Mc/Mb;
124  const double rC2 = rC*rC;
125  const double sqrC = sqrt(rC);
126 
127  //MSbar masses
128  const double mbMu = Mb - unitres*LambdaBar - Mb*as*(4./3. + log(zR));
129  const double mcMu = Mc - unitres*LambdaBar - Mc*as*(4./3. - log(zR));
130 
131  //define the variables
132  const double Ha1= F1par*(1. - 8.* RhoSq * zCon +
133  (53. * RhoSq - 15.) * pow(zCon, 2.)
134  - (231. * RhoSq - 91.) * pow(zCon, 3.));
135  const double R0 = R0par - 0.11 * (w - 1.) + 0.01 * pow(w - 1., 2.);
136  const double R1 = R1par - 0.12 * (w - 1.) + 0.05 * pow(w - 1., 2.);
137  const double R2 = R2par + 0.11 * (w - 1.) - 0.06 * pow(w - 1., 2.);
138 
139  const double Ff = (Ha1*(Mb2*pow(1 + rC,2) - Sqq))/(2.*Mb*sqrC);
140  const double Fg = (Ha1*R1)/(2.*Mb*sqrC);
141  const double Fm = -(Ha1*(R2*(-1 + rC2) - 2*rC*(-1 + R0 + R0*rC - w)))/(2.*Mb*sqrC*(1 + rC2 - 2*rC*w));
142  const double Fp = -(Ha1*R2)/(2.*Mb*sqrC);
143  //Pseudoscalar check!
144  const double Fps = -(Ff + Mb2*(Fp*(1-rC2) + Fm*(1 + rC2 - 2*rC*w)))/(mbMu + mcMu);
145 
146  // set elements, mapping to amplitude FF basis
147  // Fps
148  result.element({0,0}) = Fps;
149  // Ff
150  result.element({1,0}) = Ff;
151  // Fg
152  result.element({2,0}) = Fg;
153  // Fm
154  result.element({3,0}) = Fm;
155  // Fp
156  result.element({4,0}) = Fp;
157  // Fzt
158  // result.element({5}) = 0;
159  // Fmt
160  // result.element({6}) = 0;
161  // Fpt
162  // result.element({7}) = 0;
163 
164  //Now create remaining FF tensor entries
165  const double Ha1p = F1par*(-8.*zCon + 53.*pow(zCon, 2.) - 231.*pow(zCon, 3.));
166  const vector<vector<double>> FRhoRsmat{{(Ff*Ha1p)/Ha1,0.,0.,0.},
167  {(Fg*Ha1p)/Ha1,Ha1/(2.*Mb*sqrC),0.,0.},
168  {(Fm*Ha1p)/Ha1,0.,-(Ha1*(-1. + rC2))/(2.*Mb*sqrC*(1. + rC2 - 2.*rC*w)),
169  (Ha1*sqrC*(1. + rC))/(Mb*(1. + rC2 - 2.*rC*w))},
170  {(Fp*Ha1p)/Ha1,0.,-Ha1/(2.*Mb*sqrC),0.}};
171 
172  for(IndexType idxd = 0; idxd < 4; ++idxd){
173  double fentry = 0.;
174  double gentry = 0.;
175  double fmentry = 0.;
176  double fpentry = 0.;
177  for(IndexType idxr = 0; idxr < 4; ++idxr){
178  fentry += FRhoRsmat[0][idxr]*RhoRsmat[idxr][idxd];
179  gentry += FRhoRsmat[1][idxr]*RhoRsmat[idxr][idxd];
180  fmentry += FRhoRsmat[2][idxr]*RhoRsmat[idxr][idxd];
181  fpentry += FRhoRsmat[3][idxr]*RhoRsmat[idxr][idxd];
182  }
183  const IndexType idxd1 = static_cast<IndexType>(idxd + 1u);
184  if(!isZero(fentry)) { result.element({1, idxd1}) = fentry; }
185  if(!isZero(gentry)) { result.element({2, idxd1}) = gentry; }
186  if(!isZero(fmentry)) { result.element({3, idxd1}) = fmentry; }
187  if(!isZero(fpentry)) { result.element({4, idxd1}) = fpentry; }
188  }
189 
190  }
191 
192 
193  std::unique_ptr<FormFactorBase> FFBtoDstarCLNVar::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 indices label definitions.
CLN form factors with variations
uint16_t IndexType
static constexpr double sqrt2
Definition: Constants.hh:26
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