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.5 by dnisson, Wed Sep 23 03:12:15 2009 UTC vs.
Revision 1.6 by dnisson, Wed Sep 23 17:52:05 2009 UTC

# Line 148 | Line 148 | namespace jetfit {
148        }
149  
150        // add errors due to Gaussians outside histogram
151 <      double eps = 0.1; // accuracy set for this function
151 >      double eps = 0.01; // accuracy set for this function
152        for (int i = 0; i < ngauss; i++) {
153          double *pval = xval+i*(mdef->get_formula()->GetNpar());
154          double par_x = pval[mdef->get_indiv_max_x()];
# Line 486 | Line 486 | namespace jetfit {
486    void fill_histo_with_vec(TH2 *hist, vector< vector<double> > &vec) {
487      for (int i = 0; i < vec.size(); i++) {
488        for (int j = 0; j < vec[i].size(); j++) {
489 <        hist->Fill(i+1, j+1, vec[i][j]);
489 >        hist->SetBinContent(i+1, j+1, vec[i][j]);
490        }
491      }
492    }
# Line 499 | Line 499 | namespace jetfit {
499      if (ngauss <= mdef->get_n_special_par_sets()) {
500        init_spec_pars = true;
501        for (int k = 0; k < ngauss; k++) {
502 <        int ipar0 = k*mdef->get_formula()->GetNpar(); // index of par 0
502 >        int ipar0 = k*mdef->get_formula()->GetNpar(); // index of indiv par 0
503          for (int l = 0; l < mdef->get_formula()->GetNpar(); l++) {
504            int ipar = ipar0 + l;
505            if (ipar < npar)
# Line 528 | Line 528 | namespace jetfit {
528            double y = static_cast<double>(j)*(energy.Yhi - energy.Ylo)
529              / static_cast<double>(energy.bins[i].size()) + energy.Ylo;
530            if (ngauss > 1) {
531 <            // subtract 4*sigma plus integral of fit function
531 >            // subtract integral of fit function
532              try {
533                int npval_other = r.pval.at(r.pval.size()-1).size();
534                if (npval_other > 256) {
# Line 541 | Line 541 | namespace jetfit {
541                ngauss--;
542                double nu = fit_fcn(x, y, pval_other) * XbinSize * YbinSize;
543                ngauss++;
544 <              sub_energy[i][j] = energy.bins[i][j] - nu
545 <                - 2.2*mdef->chisquare_error(nu);
544 >              sub_energy[i][j] = energy.bins[i][j] - nu;
545              }
546              catch (exception ex) {
547                cerr << "Exception in par_init" << endl;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines