[ROOT] FitSlicesX/Y

From: Eddy Offermann (eddy@rentec.com)
Date: Wed May 17 2000 - 22:47:45 MEST


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