Hello,fellor root users. Im now struggling with intehration of peak (area of peak calculation). Here is part of my code where i do this
double integralRangeStart = f->GetParameter(1) - 3 * f->GetParameter(2);
double integralRangeEnd = f->GetParameter(1) + 3 * f->GetParameter(2);
// double area = f->Integral(integralRangeStart, integralRangeEnd);
int bin1 = h1->FindBin(integralRangeStart);
int bin2 = h1->FindBin(integralRangeEnd);
double area = h1->Integral(bin1, bin2, "width");
std::cout << "Integral of the peak (area): " << area << std::endl;
Here i calculate area of whole fitted peak. the question is how i can subtract from whole area an area of background ?