17 : m_pos(pos), m_sigma(sigma), m_height(height), m_fnam(fnam), m_fopt(fopt),
23 Name myname =
"GausStepFitter::fit: ";
27 for (
int ifit=0; ifit<5; ++ifit ) {
29 double sigmax = 1.1*sigfac*sigma;
30 double sigmin = 0.9*sigma/sigfac;
31 if (
m_LogLevel >= 1 ) cout << myname <<
" Doing constrained fit " << ifit
32 <<
" with pos=" <<
m_pos <<
", sigma=" << sigma
33 <<
" (" << sigmin <<
", " << sigmax <<
")" <<
endl;
34 pffix->SetParameter(2, sigma);
35 pffix->SetParLimits(2, sigmin, sigmax);
37 pffix->SetParLimits(0, 0.0, 1.e10);
38 }
else if ( height > 0.0 ) {
39 pffix->SetParLimits(0, 0.1*height, 2.0*height);
40 }
else if ( height < 0.0 ) {
41 pffix->SetParLimits(0, 2.0*height, 0.1*height);
46 double signew = pffix->GetParameter(2);
47 bool atHiLimit = signew > 0.999*sigmax;
48 bool atLoLimit = signew < 1.001*sigmin;
49 if (
m_LogLevel >= 1 ) cout << myname <<
" status " << fstat <<
", fit sigma=" << signew <<
endl;
50 if ( fstat == 0 && !atHiLimit && !atLoLimit ) {
55 ph->GetListOfFunctions()->Clear();
57 if ( atLoLimit ) sigma /= sigfac;
GausStepFitter(double pos, double sigma, double height, Name fnam, Name fopt="WWS")
int quietHistFit(TH1 *ph, std::string fname, std::string fopt)
TF1 * gausTF1(double heightIn, double meanIn, double sigmaIn, std::string fname)
QTextStream & endl(QTextStream &s)