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


C++ TLatex::DrawClone方法代码示例

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


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

示例1: MCtoSTATerrors

void MCtoSTATerrors() {
  TLatex *tplus = labelLatex(0.1364943,0.8114407,"MC sample");

  TFile *file0 = TFile::Open("results/StandardCutflow/allmc.root");

  TCanvas *c1 = new TCanvas();
  //TCanvas *c2 = new TCanvas();
  TH1D * LPplus = (TH1D*)file0->Get("RECO_PolPlots_50toinf/RECO_ICVarPFPlus");
  TH1D * LPminus = (TH1D*)file0->Get("RECO_PolPlots_50toinf/RECO_ICVarPFMinus");

  LPplus->Rebin(20);
  LPminus->Rebin(20);

  LPplus->Scale(0.3);
  LPminus->Scale(0.3);

  TH1D * newLPplus = (TH1D*)LPplus->Clone();
  TH1D * newLPminus = (TH1D*)LPminus->Clone();

  for(unsigned int i=1; i < LPplus->GetXaxis()->GetNbins(); i++) {
    newLPplus->SetBinError(i, TMath::Sqrt(LPplus->GetBinContent(i)));
    newLPminus->SetBinError(i, TMath::Sqrt(LPminus->GetBinContent(i)));
  }

  c1->cd();
  newLPplus->GetYaxis()->SetTitle("Events / 300 nb^{-1}");
  //newLPplus->GetXaxis()->SetTitle("LP(#mu^{+})");
  newLPplus->GetXaxis()->SetTitle("LP(#mu)");
  newLPplus->GetXaxis()->SetRangeUser(-1.0,2.0);
  newLPplus->SetLineWidth(3);
  newLPplus->SetLineStyle(2);
  newLPplus->SetLineColor(kRed);
  newLPplus->DrawCopy();
  tplus->DrawClone("same");

//   c2->cd();
//   newLPminus->GetYaxis()->SetTitle("Events / 100 nb^{-1}");
//   newLPminus->GetXaxis()->SetTitle("LP(#mu^{-})");
  newLPminus->SetLineWidth(3);
  newLPminus->SetLineStyle(2);
  newLPminus->SetLineColor(kBlack);
  newLPminus->DrawCopy("same");
//   tplus->DrawClone("same");

  leg = new TLegend(0.762931,0.720339,0.8649425,0.8622881,NULL,"brNDC");
  leg->AddEntry(newLPplus,"#mu^{+}","l");
  leg->AddEntry(newLPminus,"#mu^{-}","l");

  leg->SetFillColor(kWhite);
  leg->SetBorderSize(0);
  leg->SetTextFont(62);
  leg->DrawClone();

  file0->Close();

  return;
}
开发者ID:bluejelibaby,项目名称:AnalysisV2,代码行数:57,代码来源:MCtoSTATerrors.C

示例2: getAiZ


//.........这里部分代码省略.........
  }
  hPA0->SetLineWidth(3);
  hPA0->GetYaxis()->SetRangeUser(-1.,2.);
  hPA0->GetXaxis()->SetTitle("P_{T}(Z) [GeV]");
  hPA0->GetXaxis()->SetRangeUser(0,220);
  hPA0->GetYaxis()->SetTitle("A_{i}");
  hPA0->GetXaxis()->SetTitleSize(0.0625);
  hPA0->GetYaxis()->SetTitleSize(0.0625);
  hPA0->GetXaxis()->SetTitleOffset(1.00);
  hPA0->GetYaxis()->SetTitleOffset(1.20);
  hPA0->GetXaxis()->SetLabelSize(0.052);
  hPA0->GetYaxis()->SetLabelSize(0.052);
  hPA0->GetXaxis()->SetLabelOffset(0.01);
  hPA0->GetYaxis()->SetLabelOffset(0.01);
  hPA0->DrawCopy("hist");

  hPA1->Scale(5.0);
  hPA1->Divide(hPD);
  hPA1->SetLineColor(kRed);
  hPA1->SetLineWidth(3);
  //hPA1->DrawCopy("histsame");//we don't have sensitivity to A1 - sign of cos(theta_CS)

  hPA2->Scale(10.0);
  hPA2->Divide(hPD);
  hPA2->SetLineColor(kBlue);
  hPA2->SetLineWidth(3);
  hPA2->DrawCopy("histsame");

  hPA3->Scale(4.0);
  hPA3->Divide(hPD);
  hPA3->SetLineColor(kGreen);
  hPA3->SetLineWidth(3);
  hPA3->DrawCopy("histsame");

  hPA4->Scale(4.0);
  hPA4->Divide(hPD);
  hPA4->SetLineColor(kCyan);
  hPA4->SetLineWidth(3);
  //hPA4->DrawCopy("histsame");//we don't have sensitivity to A4 - sign of cos(theta_CS)

  TLatex *tplus = labelLatex(0.25,0.25,"Lepton Plus Charge");
  tplus->DrawClone("same");

  aLegend->DrawClone("same");  

  setPadMargins(aCanvas->cd(2));

  hMA0->Scale(20.0/3.0);
  hMA0->Divide(hMD);
  for(unsigned int i=0; i<hMA0->GetNbinsX(); i++) {
    hMA0->SetBinContent(i, (2.0/3.0) + hMA0->GetBinContent(i));
  }
  hMA0->SetLineWidth(3);
  hMA0->GetYaxis()->SetRangeUser(-1.,2.);
  hMA0->GetXaxis()->SetTitle("P_{T}(Z) [GeV]");
  hMA0->GetXaxis()->SetRangeUser(0,220);
  hMA0->GetYaxis()->SetTitle("A_{i}");
  hMA0->GetXaxis()->SetTitleSize(0.0625);
  hMA0->GetYaxis()->SetTitleSize(0.0625);
  hMA0->GetXaxis()->SetTitleOffset(1.00);
  hMA0->GetYaxis()->SetTitleOffset(1.20);
  hMA0->GetXaxis()->SetLabelSize(0.052);
  hMA0->GetYaxis()->SetLabelSize(0.052);
  hMA0->GetXaxis()->SetLabelOffset(0.01);
  hMA0->GetYaxis()->SetLabelOffset(0.01);
  hMA0->DrawCopy("hist");

  hMA1->Scale(5.0);
  hMA1->Divide(hMD);
  hMA1->SetLineColor(kRed);
  hMA1->SetLineWidth(3);
  //hMA1->DrawCopy("histsame");

  hMA2->Scale(10.0);
  hMA2->Divide(hMD);
  hMA2->SetLineColor(kBlue);
  hMA2->SetLineWidth(3);
  hMA2->DrawCopy("histsame");

  hMA3->Scale(4.0);
  hMA3->Divide(hMD);
  hMA3->SetLineColor(kGreen);
  hMA3->SetLineWidth(3);
  hMA3->DrawCopy("histsame");

  hMA4->Scale(4.0);
  hMA4->Divide(hMD);
  hMA4->SetLineColor(kCyan);
  hMA4->SetLineWidth(3);
  //hMA4->DrawCopy("histsame");

  TLatex *tminus = labelLatex(0.25,0.25,"Lepton Minus Charge");
  tminus->DrawClone("same");

  aLegend->DrawClone("same");  

  aCanvas->Print(".png");

  return;
}
开发者ID:bluejelibaby,项目名称:AnalysisV2,代码行数:101,代码来源:getAiZ.C


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