本文整理汇总了C++中TF1::SetMaximum方法的典型用法代码示例。如果您正苦于以下问题:C++ TF1::SetMaximum方法的具体用法?C++ TF1::SetMaximum怎么用?C++ TF1::SetMaximum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TF1
的用法示例。
在下文中一共展示了TF1::SetMaximum方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: plotmean
TF1* plotmean(TString tagger, TString TaggerStrength, float Etamin, float Etamax, TString opt = "" , int col = 1, float lineWidth = 1, int lineStyle = 1)
{
TF1* f = GetSFlmean(tagger,TaggerStrength,Etamin,Etamax);
if( f != NULL )
{
f->SetLineColor(col);
f->SetMinimum(0.4);
f->SetMaximum(1.6);
f->SetLineWidth(lineWidth);
f->SetLineStyle(lineStyle);
f->Draw(opt);
}
//else cout << "NULL pointer returned... Function seems not to exist" << endl;
return f;
}
示例2: fitBvar
void fitBvar(TString collsyst="PbPb", TString inputfile ="", TString npfile="ROOTfiles/NPFitPbPb.root", float centMin=0, float centMax=100, TString outputfile="outHisto")
{
collisionsystem = collsyst;
infname = outputfile;
centmin = centMin;
centmax = centMax;
if(collsyst != "PbPb") isPbPb = false;
gStyle->SetTextSize(0.05);
gStyle->SetTextFont(42);
gStyle->SetPadRightMargin(0.02);
gStyle->SetPadLeftMargin(0.18);
gStyle->SetPadTopMargin(0.09);
gStyle->SetPadBottomMargin(0.145);
gStyle->SetTitleX(.0f);
TF1* fit (float ptmin, float ptmax, int s, int b, int widVar); // widVar=0,1
TCanvas* c = new TCanvas("c","",600,600);
TF1* bmass = new TF1("bmass","[0]",7,50);
bmass->SetTitle(";B^{+} p_{T} (GeV/c);fraction of default yield");
bmass->SetMinimum(0.9);
bmass->SetMaximum(1.1);
if(isPbPb)
{
bmass->SetMinimum(0.9);
bmass->SetMaximum(1.1);
}
bmass->SetParameter(0,1);
bmass->SetLineWidth(1);
bmass->SetLineColor(kRed);
bmass->SetLineStyle(2);
bmass->GetXaxis()->SetTitleOffset(1.3);
bmass->GetYaxis()->SetTitleOffset(1.8);
bmass->GetXaxis()->SetLabelOffset(0.007);
bmass->GetYaxis()->SetLabelOffset(0.007);
bmass->GetXaxis()->SetTitleSize(0.045);
bmass->GetYaxis()->SetTitleSize(0.045);
bmass->GetXaxis()->SetTitleFont(42);
bmass->GetYaxis()->SetTitleFont(42);
bmass->GetXaxis()->SetLabelFont(42);
bmass->GetYaxis()->SetLabelFont(42);
bmass->GetXaxis()->SetLabelSize(0.04);
bmass->GetYaxis()->SetLabelSize(0.04);
bmass->Draw();
TLatex* Title = new TLatex(0.1,0.94, Form("Fit Variation for %s",collisionsystem.Data()));
Title->SetNDC();
Title->SetTextAlign(12);
Title->SetTextSize(0.04);
Title->SetTextFont(42);
Title->Draw("Same");
TLegend* leg = new TLegend(0.2,0.67,0.4,0.87,NULL,"brNDC");
leg->SetBorderSize(0);
leg->SetTextSize(0.04);
leg->SetTextFont(42);
leg->SetFillStyle(0);
getNPFnPar(npfile, NPpar);
std::cout<<"NP parameter 0: "<<NPpar[0]<<std::endl;
std::cout<<"NP parameter 1: "<<NPpar[1]<<std::endl;
TString inputf;
if(nBins == 1) inputf = Form("%s_integrated.root",inputfile.Data());
else inputf = Form("%s.root",inputfile.Data());
TFile* data = new TFile(inputf.Data());
TH1D* h_def = (TH1D*)data->Get("hPt");
TH1D* hwidvar;
int cnt =0;
for(int s=0;s<nsig;s++)
{
bkgmax[0]=sigmax[s]+2;
for(int b=0;b<nbkg;b++)
{
if(s==0 || b==0)
{
TH1D* hvar = new TH1D(Form("h_%s",bkgname[b].Data()),"",nBins,ptBins);
if(s==0 && b==0) hwidvar = new TH1D("h_widvar","",nBins,ptBins);
for(int i=0;i<nBins;i++)
{
double def_y = h_def->GetBinContent(i+1);
double def_err = h_def->GetBinError(i+1);
TF1* f = fit(ptBins[i],ptBins[i+1],s,b,0);
cout<<"YIELD / YIELDERR: "<< yield <<" "<< yieldErr << endl;
cout << "DEF YIELD: "<< def_y*(ptBins[i+1]-ptBins[i]) <<endl;
double y = yield/(ptBins[i+1]-ptBins[i]);
double err = yieldErr/(ptBins[i+1]-ptBins[i]);
double y_fr = y/def_y;
cout << "YIELD FRACTION: " << y_fr << endl;
double err_fr = sqrt(pow(err/def_y,2)+pow(def_err*y/(def_y*def_y),2));
//.........这里部分代码省略.........