ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/JetFitAnalyzer/src/jetfit.cpp
(Generate patch)

Comparing UserCode/JetFitAnalyzer/src/jetfit.cpp (file contents):
Revision 1.1 by dnisson, Wed Sep 2 21:44:14 2009 UTC vs.
Revision 1.2 by dnisson, Fri Sep 4 20:01:38 2009 UTC

# Line 106 | Line 106 | namespace jetfit {
106          double y = (static_cast<double>(j) + 0.5)*ystep + ylo;
107          double sig_cut = 1.0e-5;
108          double nu = XbinSize * YbinSize * fit_fcn(x, y, xval);
109 <        double sigma = mdef->chisquare_error(nu) < sig_cut
109 >        double sigma = fabs(mdef->chisquare_error(nu)) < sig_cut
110            ? sig_cut : mdef->chisquare_error(nu);
111  
112          fsum += xstep * ystep * mdef->get_formula()->Eval(x, y)
# Line 136 | Line 136 | namespace jetfit {
136              / static_cast<double>(energy.bins.at(i).size()) + energy.Ylo;
137            double nu = fit_fcn(x, y, xval) * XbinSize * YbinSize;
138            double sig_cut = 1.0e-5;
139 <          if (mdef->chisquare_error(nu) > sig_cut || !ignorezero)
139 >          if (fabs(mdef->chisquare_error(nu)) > sig_cut || !ignorezero)
140              chisquare += pow(energy.bins.at(i).at(j) - nu, 2.0)
141                / pow(mdef->chisquare_error(nu), 2.0);
142            else
# Line 158 | Line 158 | namespace jetfit {
158          bool left = par_x < energy.Xlo + cutoff_rad;
159          bool right = par_x > energy.Xhi - cutoff_rad;
160          bool top = par_y > energy.Yhi - cutoff_rad;
161 <        bool bottom = par_y > energy.Ylo + cutoff_rad;
161 >        bool bottom = par_y < energy.Ylo + cutoff_rad;
162  
163          if (left) {
164            double xlo = par_x - cutoff_rad;
# Line 766 | Line 766 | namespace jetfit {
766        }
767        ndof -= npar;
768  
769 +      r.chisquare.push_back(chisquare);
770        double P = prob(chisquare, ndof);
770      cout << "P = "<<P << endl;
771        if (P > P_cutoff_val) {
772          break;
773        }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines