本文整理汇总了C++中TFitResultPtr::GetConfidenceIntervals方法的典型用法代码示例。如果您正苦于以下问题:C++ TFitResultPtr::GetConfidenceIntervals方法的具体用法?C++ TFitResultPtr::GetConfidenceIntervals怎么用?C++ TFitResultPtr::GetConfidenceIntervals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TFitResultPtr
的用法示例。
在下文中一共展示了TFitResultPtr::GetConfidenceIntervals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TLatex
//---------------------------------------------------------------
double *treat(TString fileData, double lumi, TString decay, vector<double> mtop, vector<double> xlim, int binned, TString date, TString version)
//---------------------------------------------------------------
{
//TString indir = date+"/v"+version+"/";
TString indir = date+"/"+version+"/";
TString outdir = indir;
TString channel = " + Jets channel";
if (fileData.Contains("ElectronHad")) {
outdir += "CalibEl/";
indir += "MyAnaEl/";
if (decay.Contains("semi", TString::kIgnoreCase))
channel = "e"+channel;
if (decay.Contains("di", TString::kIgnoreCase))
channel = "ee/e#mu"+channel;
if (decay.Contains("all", TString::kIgnoreCase))
channel = "e/ee/e#mu"+channel;
}
if (fileData.Contains("MuHad")) {
outdir += "CalibMu/";
indir += "MyAnaMu/";
if (decay.Contains("semi", TString::kIgnoreCase))
channel = "#mu"+channel;
if (decay.Contains("di", TString::kIgnoreCase))
channel = "#mu#mu/#mue"+channel;
if (decay.Contains("all", TString::kIgnoreCase))
channel = "#mu/#mu#mu/#mue"+channel;
}
if (fileData.Contains("Run2012")) {
outdir += "CalibAll/";
indir += "MyAnaAll/";
if (decay.Contains("semi", TString::kIgnoreCase))
channel = "e/#mu"+channel;
if (decay.Contains("di", TString::kIgnoreCase))
channel = "ee/#mu#mu/e#mu"+channel;
if (decay.Contains("all", TString::kIgnoreCase))
channel = "e/#mu/ee/#mu#mu/e#mu"+channel;
}
gROOT->ProcessLine(".! mkdir "+outdir);
TLatex* channel_tex = new TLatex(0.22, 0.9, channel);
channel_tex->SetNDC(true);
channel_tex->SetTextFont(43);
channel_tex->SetTextSize(TITLE_FONTSIZE - 6);
const unsigned int numberOfPoints = mtop.size();
double x[numberOfPoints], ex[numberOfPoints];
double y[numberOfPoints], ey[numberOfPoints];
for (unsigned int itop = 0; itop < numberOfPoints; itop++) {
TString fileMC = TString::Format("All_%d_5.root", (int)mtop[itop]);
//TString fileMC = TString::Format("TTJets_MSDecays_JpsiFilter_%d_5.root", (int)mtop[itop]);
double *mean_err = new double[2];
if (binned < 2)
mean_err = unbinnedFit(indir+fileMC, xlim, mtop[itop], channel_tex, outdir, lumi);
if (binned == 2)
mean_err = binnedFit(indir+fileMC, xlim, mtop[itop], channel_tex, outdir, lumi);
y[itop] = mean_err[0];
ey[itop] = mean_err[1];
x[itop] = mtop[itop]+0.5;
ex[itop] = 0.;
}
TGraphErrors *gr = new TGraphErrors(numberOfPoints, x, y, ex, ey);
TFitResultPtr fitptr = gr->Fit("pol1", "FSQ", "");
TF1 *fit = gr->GetFunction("pol1");
double yinte = fitptr->Parameter(0);
double errYinte = fitptr->ParError(0);
double slope = fitptr->Parameter(1);
double errSlope = fitptr->ParError(1);
double chi2 = fitptr->Chi2();
double ndf = fitptr->Ndf();
double err_up[numberOfPoints];
double err_down[numberOfPoints];
double err_val[numberOfPoints];
fitptr->GetConfidenceIntervals(numberOfPoints, 1, 1, x, err_val, 0.68);
for(unsigned int itop = 0; itop < numberOfPoints; itop++) {
double error = err_val[itop];
err_up[itop] = fit->Eval(x[itop]) + error;
err_down[itop] = fit->Eval(x[itop]) - error;
}
TGraph *gr_up = new TGraph(numberOfPoints,x,err_up);
gr_up->Fit("pol2","FQ","");
TF1 *fit_up = gr_up->GetFunction("pol2");
TGraph *gr_down = new TGraph(numberOfPoints,x,err_down);
gr_down->Fit("pol2","FQ","");
TF1 *fit_down = gr_down->GetFunction("pol2");
TLegend *leg_calib = new TLegend(0.2,0.75,0.65,0.83,NULL,"brNDC");
leg_calib->SetTextSize(0.04);
leg_calib->AddEntry(gr,TString::Format("Slope of %.2f #pm %.2f", slope, errSlope),"lp");
leg_calib->SetHeader("Calibration curve");
// Blinded analysis
TCanvas *cn_calib = new TCanvas("cn_calib", "cn_calib", 800, 800);
cn_calib->cd();
grapherrors_myStyle(gr,"gr",2,30,1,30,1001,-1111,-1111,510,510,21,36,1.,"M_{t} (GeV)","M_{J/#psi+l} (GeV)");
//.........这里部分代码省略.........