/*** CALIBRATION STAGE ***/
/* get fit function */
- TF1 *fitFunc = (TF1 *)gROOT->GetFunction("gaus");
-
+ // TF1 *fitFunc = (TF1 *)gROOT->GetFunction("gaus");
+ TF1 ftgs("ftgs","gaus",-1,1);
+ TF1 *fitFunc = &ftgs; //new (TF1 *)gROOT->GetFunction("gaus");
+
/* projection-x */
TH1D *histoVertexTimestamppx = histoVertexTimestamp->ProjectionX("histoVertexTimestamppx");
TH1D *histoDeltatTimestamppx = histoDeltatTimestamp->ProjectionX("histoDeltatTimestamppx");
/*
* fit peak
*/
-
+ for (int i=3;i--;) fitFunc->SetParError(i,0);
+ fitFunc->SetRange(h->GetXaxis()->GetXmin(),h->GetXaxis()->GetXmax());
Double_t fitCent = h->GetBinCenter(h->GetMaximumBin());
Double_t fitMin = fitCent - nSigmaMin * startSigma;
Double_t fitMax = fitCent + nSigmaMax * startSigma;