本文整理汇总了C++中TF1::ResetBit方法的典型用法代码示例。如果您正苦于以下问题:C++ TF1::ResetBit方法的具体用法?C++ TF1::ResetBit怎么用?C++ TF1::ResetBit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TF1
的用法示例。
在下文中一共展示了TF1::ResetBit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fit_dscb
//.........这里部分代码省略.........
hrsp->GetListOfFunctions()->Delete();
return -1;
}
// implementation of the low pt bias threshold
string histname = hrsp->GetName();
double ptRefMax(1.0),rspMax(0.0);
int pos1 = histname.find("RefPt");
int pos2 = histname.find("to",pos1);
string ss = histname.substr(pos1+5,pos2);
if (from_string(ptRefMax,ss,std::dec)) {
if (histname.find("RelRsp")==0)
rspMax = jtptmin/ptRefMax;
if (histname.find("AbsRsp")==0)
rspMax = jtptmin-ptRefMax;
}
double fitrange_min(fitmin);
double fitrange_max(fitmax);
fitrange_min = std::max(rspMax,fitmin);
adjust_fitrange(hrsp,fitrange_min,fitrange_max);
TF1* fdscb = new TF1("fdscb",fnc_dscb,fitrange_min,fitrange_max,7);
fdscb->SetLineWidth(2);
fdscb->SetLineStyle(2);
double norm = 2*fgaus->GetParameter(0);
double mean = fgaus->GetParameter(1);
double sigma= fgaus->GetParameter(2);
//cout << hrsp->GetName() << " fgaus "<< mean << " \t " << hrsp->GetMean() << endl;
// double norm = 2*hrsp->GetMaximum();
// double mean = hrsp->GetMean();
// //double mean = GetPeak(hrsp);
// cout << " mean : " << mean << " hist mean : "<< hrsp->GetMean() << endl;
// double sigma= hrsp->GetRMS();
double aone(2.0),atwo(2.0),pone(10.0),ptwo(10.0);
//double aone(1.0),atwo(1.0),pone(10.0),ptwo(10.0);
TVirtualFitter::SetDefaultFitter("Minuit");
int fitstatus(0);
for (int i=0;i<niter;i++) {
fdscb->SetParameter(0,norm); // N
fdscb->SetParameter(1,mean); // mean
fdscb->SetParameter(2,sigma);// sigma
fdscb->SetParameter(3,aone); // a1
fdscb->SetParameter(4,pone); // p1
fdscb->SetParameter(5,atwo); // a2
fdscb->SetParameter(6,ptwo); // p2
fdscb->FixParameter(1,mean);
fdscb->FixParameter(2,sigma);
if (i>0) fdscb->FixParameter(3,aone);
else{
fdscb->SetParLimits(3,0.,20.); //! best
}
if (i>1) fdscb->FixParameter(5,atwo);
else{
fdscb->SetParLimits(5,0.,20.); //! best
}
//! best
fdscb->SetParLimits(4,0.,60.);
fdscb->SetParLimits(6,0.,60.);
fitstatus = hrsp->Fit(fdscb,"RQ+");
if (0==fitstatus) i=999;
delete fdscb;
fdscb = hrsp->GetFunction("fdscb");
if (0==fdscb) return -1;
norm = fdscb->GetParameter(0);
aone = fdscb->GetParameter(3);
pone = fdscb->GetParameter(4);
atwo = fdscb->GetParameter(5);
ptwo = fdscb->GetParameter(6);
//cout << " aone : " << aone << " atwo : " << atwo << " pone : " << pone << " ptwo : " << ptwo << endl;
//reset sigma and mean to gauss values...
fdscb->SetParameter(1,fgaus->GetParameter(1));
fdscb->SetParError (1,fgaus->GetParError(1));
fdscb->SetParameter(2,fgaus->GetParameter(2));
fdscb->SetParError (2,fgaus->GetParError(2));
}
if (0!=fitstatus){
cout<<"fit_fdscb() to "<<alg.c_str()<<" " <<hrsp->GetName()
<<" failed. Fitstatus: "<<fitstatus<<endl;
hrsp->GetFunction("fdscb")->Delete();
}
else fdscb->ResetBit(TF1::kNotDraw);
//cout << " aone : " << aone << " atwo : " << atwo << " pone : " << pone << " ptwo : " << ptwo << endl;
return fitstatus;
}