|
EvtGen
2.0.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
|
Go to the documentation of this file. 42 #define EVTITGROOTFINDER_MAXIT 100 43 #define EVTITGROOTFINDER_RELATIVEPRECISION 1.0e-16 47 double upperValue, double precision ) 52 double xLower = 0.0, xUpper = 0.0; 55 double f1 = theFunc-> value( lowerValue ) - functionValue; 56 double f2 = theFunc-> value( upperValue ) - functionValue; 58 if ( f1 * f2 > 0.0 ) { 60 << "EvtBtoXsgammaRootFinder: No root in specified range !" << endl; 65 if ( fabs( f1 ) < precision ) { 69 if ( fabs( f2 ) < precision ) { 83 double rootGuess = 0.5 * ( lowerValue + upperValue ); 84 double dxold = fabs( upperValue - lowerValue ); 87 double f = theFunc-> value( rootGuess ) - functionValue; 91 dx = 0.5 * ( xUpper - xLower ); 92 rootGuess = xLower + dx; 95 if ( fabs( xLower - rootGuess ) < precision ) { 100 f = theFunc-> value( rootGuess ) - functionValue; 110 << "EvtBtoXsgammaRootFinder: Maximum number of iterations " 111 << "in EvtBtoXsgammaRootFinder::foundRoot exceeded!" 112 << " Returning false." << endl; 118 double integ1Precision, double integ2Precision, int maxLoop1, int maxLoop2, 119 double integLower, double integUpper, double lowerValue, double upperValue, 133 theFunc1-> setCoeff( 1, 0, lowerValue ); 134 theFunc2-> setCoeff( 1, 0, lowerValue ); 136 double f1 = func1Integ.evaluate( integLower, integUpper ) - 138 func2Integ.evaluate( integLower, integUpper ); 139 theFunc1-> setCoeff( 1, 0, upperValue ); 140 theFunc2-> setCoeff( 1, 0, upperValue ); 141 double f2 = func1Integ.evaluate( integLower, integUpper ) - 143 func2Integ.evaluate( integLower, integUpper ); 145 double xLower = 0.0, xUpper = 0.0; 148 if ( f1 * f2 > 0.0 ) { 150 << "EvtBtoXsgammaRootFinder: No root in specified range !" << endl; 155 if ( fabs( f1 ) < precision ) { 159 if ( fabs( f2 ) < precision ) { 173 double rootGuess = 0.5 * ( lowerValue + upperValue ); 174 double dxold = fabs( upperValue - lowerValue ); 177 theFunc1-> setCoeff( 1, 0, rootGuess ); 178 theFunc2-> setCoeff( 1, 0, rootGuess ); 179 double f = func1Integ.evaluate( integLower, integUpper ) - 181 func2Integ.evaluate( integLower, integUpper ); 185 dx = 0.5 * ( xUpper - xLower ); 186 rootGuess = xLower + dx; 189 if ( fabs( xLower - rootGuess ) < precision ) { 194 theFunc1-> setCoeff( 1, 0, rootGuess ); 195 theFunc2-> setCoeff( 1, 0, rootGuess ); 196 f = func1Integ.evaluate( integLower, integUpper ) - 198 func2Integ.evaluate( integLower, integUpper ); 208 << "EvtBtoXsgammaRootFinder: Maximum number of iterations " 209 << "in EvtBtoXsgammaRootFinder::foundRoot exceeded!" 210 << " Returning false." << endl;
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=0)
#define EVTITGROOTFINDER_MAXIT
virtual void setCoeff(int, int, double)=0
double GetGaussIntegFcnRoot(EvtItgAbsFunction *theFunc1, EvtItgAbsFunction *theFunc2, double integ1Precision, double integ2Precision, int maxLoop1, int maxLoop2, double integLower, double integUpper, double lowerValue, double upperValue, double precision)
virtual double value(double x) const
double GetRootSingleFunc(const EvtItgAbsFunction *theFunc, double functionValue, double lowerValue, double upperValue, double precision)
virtual double getCoeff(int, int)=0
|