In my code, this part was working before in this form as stated below. After I change the code a bit in the 2nd version, I couldn’t figure out about the correct type for my objects. Thus, it doesn’t work properly.
Relevant part of my code:////////////////////////////////////////////////////
double* gaussParameters = new double[3] ;
gaussParameters[0] = p0;
gaussParameters[1] = p1;
gaussParameters[2] = p2;
auto r1 = h1->Fit(g1,“RS”);
// h1 is my histogram, so the type of r1 object should be the same as h1 in Theory.
auto covMatrix = r1->GetCovarianceMatrix();
// r1 is defined above, so the type of covMatrix object should be the same as h1 in Theory.
double GrossArea1 = g1->Integral( xVmin, xVmax) ; // g1 is a Gaussian function here.
double Error_GA1 = g1->IntegralError(xVmin, xVmax , gaussParameters, covMatrix.GetMatrixArray());
/////////////////////////////////////////////////////////////////////
On the other hand, the ROOT website type specifications are on this link:
In my new code:////////////////////////////////////////////////
I fitted total function with 2 Gaussians and 1 Pol2 on a histogram. Then, I wanted to get these 2 lines below without fitting gaussians explicitly like this as in the 1st code: auto r1 = h1->Fit(g1,“RS”);
void *r1= g1->GetParameters(); ???How should this part be?
void covMatrix1 = r1->GetCovarianceMatrix(); ???How should this part be?
//This integral initially does not cover the 100% of the area, only the one in the selected range
double GrossArea1 = g1->Integral( xVmin, xVmax) / HistoBinning ;// ConfidenceLimitCorrection; //virtual Double_t Integral (Double_t a, Double_t b, Double_t epsrel=1.e-12)
double Error_GA1 = g1->IntegralError(xVmin, xVmax , g1Parameters, covMatrix1.GetMatrixArray()) / HistoBinning;
ROOT: TVirtualFitter Class Reference (cern.ch)
ROOT: TMatrixT< Element > Class Template Reference (cern.ch)