Hi Eddy,
Could you clarify your problem ? TH1::FitSlicesX/Y has a parameter "cut"
to reject slices with a number of entries (not the sum of weights) less than
cut.
Rene Brun
Eddy Offermann wrote:
>
> Dear Fons and Rene
>
> TH1::FitSlicesY and X are giving me troubles. I have a TH2D which
> contains fractions between -1 and 1.
> Unfortunately, nentries is an integer and I fail the (nentries ==0) test
> hpx->GetEntries() should not be cast to an integer, I wonder also
> why cut is an integer ??
>
> //Loop on all bins in Y, generate a projection along X
> Int_t bin;
> ==>Int_t nentries;
> for (bin=binmin;bin<=binmax;bin++) {
> TH1D *hpx = ProjectionX("_temp",bin,bin,"e");
> if (hpx == 0) continue;
> nentries = Int_t(hpx->GetEntries());
> if (nentries == 0 || nentries < cut) {delete hpx; continue;}
> f1->SetParameters(parsave);
> hpx->Fit(fname,option);
> Int_t npfits = f1->GetNumberFitPoints();
> if (npfits > npar && npfits >= cut) {
> for (ipar=0;ipar<npar;ipar++) {
> hlist[ipar]->Fill(fYaxis.GetBinCenter(bin),f1->GetParameter(ipar));
> hlist[ipar]->SetBinError(bin,f1->GetParError(ipar));
> }
> hchi2->Fill(fYaxis.GetBinCenter(bin),f1->GetChisquare()/(npfits-npar));
> }
> delete hpx;
> }
>
> Best Regards, Eddy
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:25 MET