本文整理汇总了C++中TH2D::GetCellError方法的典型用法代码示例。如果您正苦于以下问题:C++ TH2D::GetCellError方法的具体用法?C++ TH2D::GetCellError怎么用?C++ TH2D::GetCellError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TH2D
的用法示例。
在下文中一共展示了TH2D::GetCellError方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: XS1S
void XS1S(){
TFile *f = new TFile("Upsilon_2D_10ptbins.root");
TH2D *H;
H = (TH2D*)gFile->Get("fXS");
double tot(0.); double totE(0.);
ofstream OUT("XS_1S.tex");
OUT << "% ----------------------------------------------------------------------" << endl;
OUT << "% -- XSections" << endl;
for ( int x = 1; x <= H->GetNbinsX(); ++x ){
for ( int y = 1; y <= H->GetNbinsY(); ++y ){
OUT << Form("\\vdef{XS%iS_bin%i_%iContent} {\\ensuremath{ {%.4f } } }",1, x, y, H->GetCellContent(x,y) ) << endl;
OUT << Form("\\vdef{XS%iS_bin%i_%iError} {\\ensuremath{ {%.4f } } }",1, x, y, H->GetCellError(x,y) ) << endl;
}
}
OUT.close();
}
示例2: Yield1S
void Yield1S(){
TFile *f = new TFile("Upsilon_2D_10ptbins.root");
TH2D *H;
H = (TH2D*)gFile->Get("fS1Yield");
double tot(0.); double totE(0.);
ofstream OUT("Yield_1S.tex");
OUT << "% ----------------------------------------------------------------------" << endl;
OUT << "% -- Yields" << endl;
for ( int x = 1; x <= H->GetNbinsX(); ++x ){
OUT << Form("\\vdef{%iS_Rap_bin%iLowEdge} {\\ensuremath{ {%.1f } } }",1, x, H->GetXaxis()->GetBinLowEdge(x) ) << endl;
if ( x == H->GetNbinsX() ) OUT << Form("\\vdef{%iS_Rap_bin%iHighEdge} {\\ensuremath{ {%.1f } } }",1 , x, H->GetXaxis()->GetBinUpEdge(x) ) << endl;
//OUT << Form("\\vdef{%iS_bin%iContent} {\\ensuremath{ {%.0f } } }",1, x, H->GetBinContent(x) ) << endl;
//OUT << Form("\\vdef{%iS_bin%iError} {\\ensuremath{ {%.0f } } }",1, x, H->GetBinError(x) ) << endl;
}
for ( int x = 1; x <= H->GetNbinsY(); ++x ){
OUT << Form("\\vdef{%iS_Pt_bin%iLowEdge} {\\ensuremath{ {%.1f } } }",1, x, H->GetYaxis()->GetBinLowEdge(x) ) << endl;
if ( x == H->GetNbinsY() ) OUT << Form("\\vdef{%iS_Pt_bin%iHighEdge} {\\ensuremath{ {%.1f } } }",1 , x, H->GetYaxis()->GetBinUpEdge(x) ) << endl;
}
for ( int x = 1; x <= H->GetNbinsX(); ++x ){
for ( int y = 1; y <= H->GetNbinsY(); ++y ){
OUT << Form("\\vdef{Yield%iS_bin%i_%iContent} {\\ensuremath{ {%.0f } } }",1, x, y, H->GetCellContent(x,y) ) << endl;
OUT << Form("\\vdef{Yield%iS_bin%i_%iError} {\\ensuremath{ {%.0f } } }",1, x, y, H->GetCellError(x,y) ) << endl;
}
}
OUT.close();
}