evtgen is hosted by Hepforge, IPPP Durham
EvtGen  2.0.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
EvtPFermi.cpp
Go to the documentation of this file.
1 
2 /***********************************************************************
3 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4 * *
5 * This file is part of EvtGen. *
6 * *
7 * EvtGen is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * EvtGen is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19 ***********************************************************************/
20 
22 
23 #include "EvtGenBase/EvtPatches.hh"
24 #include "EvtGenBase/EvtReport.hh"
25 
26 #include <math.h>
27 #include <stdlib.h>
28 
29 //----------------
30 // Constructors --
31 //----------------
32 
33 //for DFN model
34 EvtPFermi::EvtPFermi( const double& a, const double& mB, const double& mb )
35 {
36  _a = a;
37  _mb = mb;
38  _mB = mB;
39 }
40 
41 // for BLNP modell
42 EvtPFermi::EvtPFermi( const double& Lambda, const double& b )
43 {
44  _Lambda = Lambda;
45  _b = b;
46 }
47 
48 //-----------
49 // Methods --
50 //-----------
51 
52 double EvtPFermi::getFPFermi( const double& kplus )
53 {
54  double FKplus;
55  double x = kplus / ( _mB - _mb );
56 
57  if ( x >= 1 )
58  return 0;
59  if ( kplus <= -_mb )
60  return 0;
61 
62  FKplus = pow( 1 - x, _a ) * exp( ( 1 + _a ) * x );
63 
64  return FKplus;
65 }
66 
67 // get value for the leading order exponential SF
68 double EvtPFermi::getSFBLNP( const double& what )
69 {
70  double SF;
71  double massB = 5.2792;
72 
73  if ( what > massB )
74  return 0;
75  if ( what < 0 )
76  return 0;
77 
78 #if defined( __SUNPRO_CC )
79  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
80  << "The tgamma function is not available on this platform\n";
81  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
82  << "Presumably, you are getting the wrong answer, so I abort..";
83  ::abort();
84 #else
85  SF = pow( _b, _b ) / ( tgamma( _b ) * _Lambda ) *
86  pow( what / _Lambda, _b - 1 ) * exp( -_b * what / _Lambda );
87 #endif
88 
89  return SF;
90 }
EvtPFermi(const double &a, const double &mB, const double &mb)
Definition: EvtPFermi.cpp:34
double getSFBLNP(const double &what)
Definition: EvtPFermi.cpp:68
double _a
Definition: EvtPFermi.hh:60
double _b
Definition: EvtPFermi.hh:64
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=0)
Definition: EvtReport.cpp:33
double getFPFermi(const double &kplus)
Definition: EvtPFermi.cpp:52
double _mB
Definition: EvtPFermi.hh:62
double _mb
Definition: EvtPFermi.hh:61
double _Lambda
Definition: EvtPFermi.hh:63
EvtComplex exp(const EvtComplex &c)
Definition: EvtComplex.hh:240