Changeset View
Changeset View
Standalone View
Standalone View
src/EvtGenModels/EvtBtoXsgammaRootFinder.cpp
Show First 20 Lines • Show All 117 Lines • ▼ Show 20 Lines | double EvtBtoXsgammaRootFinder::GetGaussIntegFcnRoot( | ||||
double integ1Precision, double integ2Precision, int maxLoop1, int maxLoop2, | double integ1Precision, double integ2Precision, int maxLoop1, int maxLoop2, | ||||
double integLower, double integUpper, double lowerValue, double upperValue, | double integLower, double integUpper, double lowerValue, double upperValue, | ||||
double precision ) | double precision ) | ||||
{ | { | ||||
// Use the bisection to find the root. | // Use the bisection to find the root. | ||||
// Iterates until find root to the accuracy of precision | // Iterates until find root to the accuracy of precision | ||||
//Need to work with integrators | //Need to work with integrators | ||||
auto func1Integ = EvtItgSimpsonIntegrator{*theFunc1, integ1Precision, | auto func1Integ = EvtItgSimpsonIntegrator{ *theFunc1, integ1Precision, | ||||
maxLoop1}; | maxLoop1 }; | ||||
auto func2Integ = EvtItgSimpsonIntegrator{*theFunc2, integ2Precision, | auto func2Integ = EvtItgSimpsonIntegrator{ *theFunc2, integ2Precision, | ||||
maxLoop2}; | maxLoop2 }; | ||||
//coefficient 1 of the integrators is the root to be found | //coefficient 1 of the integrators is the root to be found | ||||
//need to set this to lower value to start off with | //need to set this to lower value to start off with | ||||
theFunc1->setCoeff( 1, 0, lowerValue ); | theFunc1->setCoeff( 1, 0, lowerValue ); | ||||
theFunc2->setCoeff( 1, 0, lowerValue ); | theFunc2->setCoeff( 1, 0, lowerValue ); | ||||
double f1 = func1Integ.evaluate( integLower, integUpper ) - | double f1 = func1Integ.evaluate( integLower, integUpper ) - | ||||
theFunc2->getCoeff( 1, 2 ) * | theFunc2->getCoeff( 1, 2 ) * | ||||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |