示例#1
0
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
0
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();
  
}