Changeset 7392 for trunk/MagicSoft/Mars/mhflux
- Timestamp:
- 11/10/05 12:03:37 (19 years ago)
- Location:
- trunk/MagicSoft/Mars/mhflux
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc
r7386 r7392 116 116 Double_t bgmax =fBgMax; 117 117 118 //*fLog << inf << "Fit: " << sigmax << " " << fSigInt << " " << bgmin << " " << bgmax << endl;119 120 //TF1 fFunc("", Form("gaus(0) + pol%d(3)", fPolynomOrder), 0, 90);121 122 //fFunc->SetParameters(fCoefficients.GetArray());123 124 fFunc->FixParameter(1, 0);125 if (fPolynomOrder!=1)126 fFunc->FixParameter(4, 0);127 fFunc->SetParLimits(2, 0, 90);128 fFunc->SetParLimits(3, -1, 1);129 130 118 const Double_t alpha0 = h.GetBinContent(1); 131 119 const Double_t alphaw = h.GetXaxis()->GetBinWidth(1); … … 137 125 // First fit a polynom in the off region 138 126 fFunc->FixParameter(0, 0); 127 fFunc->FixParameter(1, 0); 139 128 fFunc->FixParameter(2, 1); 140 129 fFunc->ReleaseParameter(3); 130 if (fPolynomOrder!=1) 131 fFunc->FixParameter(4, 0); 141 132 142 133 for (int i=5; i<fFunc->GetNpar(); i++) … … 145 136 else 146 137 fFunc->SetParameter(i, 0); 138 139 fFunc->SetParLimits(2, 0, 90); 140 // fFunc->SetParLimits(3, -1, 1); 147 141 148 142 // options : N do not store the function, do not draw … … 171 165 //func.ReleaseParameter(1); 172 166 fFunc->ReleaseParameter(2); 173 fFunc->FixParameter(3, fFunc->GetParameter(3)); 174 fFunc->FixParameter(4, fFunc->GetParameter(4)); 175 for (int i=5; i<fFunc->GetNpar(); i++) 167 for (int i=3; i<fFunc->GetNpar(); i++) 176 168 fFunc->FixParameter(i, fFunc->GetParameter(i)); 177 169 178 170 // Do not allow signals smaller than the background 179 const Double_t A = alpha0-fFunc->GetParameter(3); 171 const Double_t s = fSignalFunc==kGauss ? fFunc->GetParameter(3) : TMath::Exp(fFunc->GetParameter(3)); 172 const Double_t A = alpha0-s; 180 173 const Double_t dA = TMath::Abs(A); 181 174 fFunc->SetParLimits(0, -dA*4, dA*4); … … 334 327 switch (fSignalFunc) 335 328 { 336 case kGauss: *fLog << "gauss(x) ";break;337 case kThetaSq: *fLog << "gauss(sqrt(x)) "; break;329 case kGauss: *fLog << "gauss(x)/pol" << fPolynomOrder; break; 330 case kThetaSq: *fLog << "gauss(sqrt(x))/expo"; break; 338 331 } 339 332 *fLog << endl; -
trunk/MagicSoft/Mars/mhflux/MAlphaFitter.h
r7386 r7392 136 136 break; 137 137 case kThetaSq: 138 fFunc=new TF1 ("", Form("[0]*exp(-0.5*((sqrt(x)-[1])/[2])^2) + pol%d(3)", fPolynomOrder)); 138 // if (fPolynomOrder==0) 139 // fFunc=new TF1("", "[0]*exp(-0.5*((sqrt(x)-[1])/[2])^2) + pol0(3)"); 140 // else 141 // { 142 if (fPolynomOrder>0) 143 fPolynomOrder = 1; 144 fFunc=new TF1("", "[0]*exp(-0.5*((sqrt(x)-[1])/[2])^2) + expo(3)"); 145 // } 139 146 break; 140 147 }
Note:
See TracChangeset
for help on using the changeset viewer.