do Int_t fitres = htot->Fit(f, opt);
while (fitres != 0);
+ cout<<" Fit sys+stat for " <<f->GetName()<<endl;
+ cout<<"NDF="<<f->GetNDF()<<" Chi^2="<<f->GetChisquare()<<" Chi^2/NDF="<<f->GetChisquare()/f->GetNDF()<<endl;
+
hlo = YieldMean_LowExtrapolationHisto(htot, f, min, loprecision);
hhi = YieldMean_HighExtrapolationHisto(htot, f, max, hiprecision);
- YieldMean_IntegralMean(htot, hlo, hhi, integral, mean);
+ YieldMean_IntegralMean(htot, hlo, hhi, integral, mean,kTRUE);
hout->SetBinContent(kYield, integral);
hout->SetBinContent(kMean, mean);
return hmax;
}
-YieldMean_IntegralMean(TH1 *hdata, TH1 *hlo, TH1 *hhi, Double_t &integral, Double_t &mean)
+YieldMean_IntegralMean(TH1 *hdata, TH1 *hlo, TH1 *hhi, Double_t &integral, Double_t &mean,Bool_t printinfo=kFALSE)
{
/*
Double_t cont, err, width, cent;
Double_t I = 0., IX = 0., Ierr = 0., IXerr = 0., Ilerr = 0., IXlerr = 0.;
Double_t M = 0., Merr = 0., Mlerr = 0., C;
+ Double_t dataonly=0.0;
/* integrate the data */
for (Int_t ibin = 0; ibin < hdata->GetNbinsX(); ibin++) {
I += cont;
IX += cont * cent;
}
+ dataonly=I;
/* integrate low */
for (Int_t ibin = 0; ibin < hlo->GetNbinsX(); ibin++) {
cent = hlo->GetBinCenter(ibin + 1);
/* set values */
integral = I;
mean = IX / I;
+ if(printinfo)
+ cout<<"data only = "<<dataonly<<" total = "<<I<<" ratio= "<<dataonly/I<<endl;
}