本文整理汇总了C++中TMinuit::GetNumFreePars方法的典型用法代码示例。如果您正苦于以下问题:C++ TMinuit::GetNumFreePars方法的具体用法?C++ TMinuit::GetNumFreePars怎么用?C++ TMinuit::GetNumFreePars使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TMinuit
的用法示例。
在下文中一共展示了TMinuit::GetNumFreePars方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
cout << "+++++++++++++++++++++" << endl;
}
// MIGRAD: error optimiser
if(ierflg==0 && 0){
arglist[0] = 500000;
gMinuit->mnexcm("MIGRAD", arglist ,1,ierflg);
cout << " MIGRAD flag is " << ierflg << endl;
if(ierflg!=0){
cout << "+++++++++++++++++++++" << endl;
cout << "+ ups.. check again +" << endl;
cout << "+++++++++++++++++++++" << endl;
}
}
// Minos: error optimiser
if(ierflg==0 && 0){
arglist[0] = 500000;
gMinuit->mnexcm("MINOS", arglist ,1,ierflg);
cout << " MINOS flag is " << ierflg << endl;
if(ierflg!=0){
cout << "+++++++++++++++++++++" << endl;
cout << "+ ups.. check again +" << endl;
cout << "+++++++++++++++++++++" << endl;
}
}
// Print results
Double_t amin,edm,errdef;
Int_t nvpar,nparx,icstat;
gMinuit->mnstat(amin,edm,errdef,nvpar,nparx,icstat);
gMinuit->mnprin(3,amin);
cout << "prob = " << TMath::Prob(amin,gEntriesUsed-gMinuit->GetNumFreePars())*100 << " %" << endl;
cout << "ndf = " << gEntriesUsed-gMinuit->GetNumFreePars() << endl;
cout << "output" << endl;
// gMinuit->mnexcm("SHO COV", arglist ,0,ierflg);
// gMinuit->mnexcm("SHO COR", arglist ,0,ierflg);
// gMinuit->mnexcm("SHO EIG", arglist ,0,ierflg);
//get fit parameters
double par[15], epar;
for(int i=0; i<NoPar; i++){
gMinuit->GetParameter(i,par[i],epar);
}
TFile *output = new TFile("FitParFieldStrength_out.root","RECREATE");
int tcount = 0;
float tmpBAngle, tmpZenith;
float r0x[gMaxEvents], r0y[gMaxEvents];
float bx[gMaxEvents], by[gMaxEvents];
for(int i=0; i<gEntries; i++){
if(gFieldStrengthAnt[i]>0 && gFieldStrengthNS[i]>0 && gFieldStrengthEW[i]>0){
tmpBAngle = gBAngle[i] * TMath::Pi() / 180.;
tmpZenith = gZenith[i] * TMath::Pi() / 180.;
r0x[tcount] = -gDistanceShowerAxis[i];
r0y[tcount] = (log( (gFieldStrengthAnt[i]/gEffBand) / ( par[0]*cos(tmpZenith+par[3])*(par[5]+sin(tmpBAngle+par[4]))*powf(10,par[2]*(gEg[i]-8)))) );
//if(r0y[tcount] < -4 && r0x[tcount] > 50) cout << "E = " << gEg[i] << " -- i = " << i << endl;
bx[tcount] = tmpBAngle;