当前位置: 首页>>代码示例>>C++>>正文


C++ TCanvas::GetTickx方法代码示例

本文整理汇总了C++中TCanvas::GetTickx方法的典型用法代码示例。如果您正苦于以下问题:C++ TCanvas::GetTickx方法的具体用法?C++ TCanvas::GetTickx怎么用?C++ TCanvas::GetTickx使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TCanvas的用法示例。


在下文中一共展示了TCanvas::GetTickx方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: allInOneLifetime

void allInOneLifetime(double lumi=4560., double maxInstLumi=5000.) {

  ExtraLimitPlots plots(lumi);
  plots.calculateCrossSections(4,6,3,39,9);
  
  // graphs - observed
  TGraph* g_obs      = plots.getObsLimit();
  TGraph* g_exp      = plots.getExpLimit();
  TGraphAsymmErrors* g_exp_1sig = plots.getExpLimit1Sig();
  TGraphAsymmErrors* g_exp_2sig = plots.getExpLimit2Sig();

  TGraph* g_obs_gluino = plots.getLimitGluino();
  double gluino2ref    = g_obs_gluino->GetY()[0] / g_obs->GetY()[0];
  TGraph* g_obs_stop   = plots.getLimitStop();
  double stop2ref      = g_obs_stop->GetY()[0] / g_obs->GetY()[0];
  TGraph* g_obs_stau   = plots.getLimitStau();
  double stau2ref      = g_obs_stau->GetY()[0] / g_obs->GetY()[0];

  cout << "scales: " << g_obs->GetY()[0] 
       << '/' <<g_obs_gluino->GetY()[0]
       << '/' <<g_obs_stop->GetY()[0]
       << '/' <<g_obs_stau->GetY()[0]
       <<endl;

  
  TCanvas *canvas = new TCanvas("allLifetime", "allLifetime", 1000, 600);
  
  canvas->SetLogx();
  canvas->SetLogy();

  canvas->SetRightMargin(0.8*canvas->GetLeftMargin());
  canvas->SetLeftMargin(1.2*canvas->GetLeftMargin());
  canvas->SetTicks (canvas->GetTickx(), 0);
  
  TH1F* h = new TH1F ("h", "", 1, 7.5e-8, 1e6);
  h->SetStats (0);
  h->SetMinimum (.0001);
  h->SetMaximum (0.99e1);
  // TH1* h = canvas->DrawFrame(7.5e-8, .001, 1e6, 1e2, "Y+");
  h->SetTitle("Beamgap Expt");
  //  h->GetXaxis()->SetTitle("#tau_{#tilde{g},#tilde{t},#tilde{#tau}} [s]");
  h->GetXaxis()->SetTitle("#tau [s]");
  h->GetYaxis()->SetTitle("#sigma #times BF #times #varepsilon_{stopping} #times #varepsilon_{reco}   [pb]  ");
  h->Draw ("Y+");

  ExtraAxis aGluino = anotherScale (h, gluino2ref, kRed+2, "#sigma(pp #rightarrow #tilde{g}#tilde{g}) #times BF(#tilde{g} #rightarrow g#tilde{#chi}^{0})   [pb]  ", 0.0);

  ExtraAxis aStop = anotherScale (h, stop2ref, kBlue+2, "#sigma(pp #rightarrow #tilde{t}#tilde{t}) #times BF(#tilde{t} #rightarrow t#tilde{#chi}^{0})   [pb]  ", 0.2);

  ExtraAxis aStau = anotherScale (h, stau2ref, kGreen+2, "#sigma(pp #rightarrow #tilde{#tau}#tilde{#tau}) #times BF(#tilde{#tau} #rightarrow #tau#tilde{#chi}^{0})   [pb]  ", 0.4);


  
  
  TPaveText* blurb = new TPaveText(0.25, 0.57, 0.50, 0.87, "NDC");

  blurb->AddText("CMS Preliminary 2015");
  // std::stringstream label;
  // label<<"#int L dt = "<<lumi<<" pb^{-1}";
  // blurb->AddText(label.str().c_str());
  // double peakInstLumi=maxInstLumi;
  // int exponent=30;
  // while (peakInstLumi>10) {
  //   peakInstLumi/=10;
  //   ++exponent;
  // }
  // std::stringstream label2;
  // label2<<"L^{max}_{inst} = "<<peakInstLumi<<" x 10^{"<<exponent<<"} cm^{-2}s^{-1}";
  // blurb->AddText(label2.str().c_str());

  //blurb->AddText("CMS 2011");
  blurb->AddText("#int L dt = 2.46 fb^{-1}");//,  #int L_{eff} dt = 935 pb^{-1}");
  //blurb->AddText("L^{max}_{inst} = 3.5 #times 10^{33} cm^{-2}s^{-1}");
  blurb->AddText("#sqrt{s} = 13 TeV");
  blurb->AddText("E_{g} > 120 GeV, E_{t} > 150 GeV");
  blurb->AddText("E_{jet} > 70 GeV");
  //blurb->AddText("m_{#tilde{g}} = 300 GeV/c^{2}");
  //blurb->AddText("m_{#tilde{#chi}^{0}} = 200 GeV/c^{2}");
  blurb->SetTextFont(42);
  blurb->SetBorderSize(0);
  blurb->SetFillColor(0);
  blurb->SetShadowColor(0);
  blurb->SetTextAlign(12);
  blurb->SetTextSize(0.033);
  blurb->Draw();
  
  
  // 2 sigma band
  if (g_exp_2sig) {
    g_exp_2sig->SetLineColor(0);
    g_exp_2sig->SetLineStyle(0);
    g_exp_2sig->SetLineWidth(0);
    g_exp_2sig->SetFillColor(kYellow);
    g_exp_2sig->SetFillStyle(1001);
    g_exp_2sig->Draw("3");
  }
  
  // 1 sigma band
  if (g_exp_1sig) {
    // g_exp_1sig->SetLineColor(8);
//.........这里部分代码省略.........
开发者ID:allenji,项目名称:StoppPtls,代码行数:101,代码来源:allInOneLifetime.C


注:本文中的TCanvas::GetTickx方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。