1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
//-----------------------------------------------------------------------
// File and Version Information:
//
// Copyright Information: See EvtGen/COPYRIGHT
//
//
// Description:
//   DFN model:
//      F(k+) = N (1-x)^a exp((1+a)x) ,x=k+/(mB-mb) 
//      the fermi motion distribution according to
//      hep-ph/9905351 v2
//   BLNP model:
//      F(wtilde,Lambda,b) = pow(_b,_b)/(tgamma(_b)*_Lambda)*pow(wtilde/_Lambda,_b-1)*
//                           exp(-_b*wtilde/Lambda);
//      the leading order shape function (exp) (hep-ph/0504071)
// Environment:
//      Software developed for the BaBar Detector at the SLAC B-Factory.
//
// Author List:
//      Sven Menke (DFN model)
//      Alexei Volk (BLNP model)
//-----------------------------------------------------------------------
//-----------------------
// This Class's Header --
//-----------------------
#include "EvtGenBase/EvtPatches.hh"
#include "EvtGenModels/EvtPFermi.hh"
#include "EvtGenBase/EvtReport.hh"
//---------------
// C Headers --
//---------------
#include <math.h>
#include <stdlib.h>

//----------------
// Constructors --
//----------------

//for DFN model
EvtPFermi::EvtPFermi(const double &a, const double &mB, const double &mb)
{
  _a = a;
  _mb = mb;
  _mB = mB;
}

// for BLNP modell
EvtPFermi::EvtPFermi(const double &Lambda, const double &b)
{
  _Lambda = Lambda;
  _b = b;
}


//--------------
// Destructor --
//--------------

EvtPFermi::~EvtPFermi( )
{
}

//-----------
// Methods --
//-----------

double EvtPFermi::getFPFermi(const double &kplus)
{
  double FKplus;
  double x = kplus/(_mB-_mb);

  if ( x      >= 1)   return 0;
  if ( kplus <= -_mb) return 0; 

  FKplus = pow(1-x,_a)*exp((1+_a)*x);

  return FKplus;
}

// get value for the leading order exponential SF 
double EvtPFermi::getSFBLNP(const double &what)
{
  double SF;
  double massB = 5.2792; 
  

  if ( what      > massB )   return 0;
  if ( what < 0 ) return 0; 

#if defined(__SUNPRO_CC)
  EvtGenReport(EVTGEN_ERROR,"EvtGen") << "The tgamma function is not available on this platform\n";
  EvtGenReport(EVTGEN_ERROR,"EvtGen") <<"Presumably, you are getting the wrong answer, so I abort..";
  ::abort();
#else
  SF = pow(_b,_b)/(tgamma(_b)*_Lambda)*pow(what/_Lambda,_b-1)*exp(-_b*what/_Lambda); 
#endif
  
  return SF;<--- Uninitialized variable: SF
}