Numerical integration using R passing the function from ROOT
std::vector<Double_t> BreitWignerVectorized(std::vector<Double_t> xx)
{
std::vector<Double_t> result(xx.size());
for(
Int_t i=0;i<xx.size();i++)
{
}
return result;
}
double BreitWignerWrap( double x){
}
{
Double_t value=r.
Eval(
"integrate(BreitWigner, lower = -2, upper = 2)$value");
std::cout.precision(18);
std::cout<<"Integral of the BreitWigner Function in the interval [-2, 2] R = "<<value<<std::endl;
value=i.Integral(-2,2);
std::cout<<"Integral of the BreitWigner Function in the interval [-2, 2] MathMore = "<<value<<std::endl;
TF1 f1(
"BreitWigner",
"BreitWignerWrap(x)");
std::cout<<"Integral of the BreitWigner Function in the interval [-2, 2] TF1 = "<<value<<std::endl;
value=r.
Eval(
"integrate(BreitWigner, lower = -Inf, upper = Inf)$value");
std::cout<<"Integral of BreitWigner Function in the interval [-Inf, Inf] R = "<<value<<std::endl;
}
- Author
Definition in file Integration.C.