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


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

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


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

示例1: drawEFF

void drawEFF()
{   
   std::string wp = "LOOSE";
   std::string j1 = "";
   std::string flav = "beauty";
   std::string typ = "2011FINALCSV_NEW";
//   std::string typ = "2011FINALCSV";
   std::string eff = "results/SF_"+j1+wp+"_"+typ+"_"+flav+".root";

   std::string off = "results/SF_OFFICIAL2011_"+wp+"_CSV.root";
   
   gROOT->SetBatch();
   gROOT->SetStyle("Plain");
   
   gStyle->SetOptStat(0);

   gROOT->ProcessLine(".x def.C");
   gROOT->ProcessLine(".x common.C");

   TCanvas *c1 = new TCanvas("c1","c1",0,0,600,500);
   c1->SetGrid(1);

   std::string csv = "#bf{CSVL}";
   if( wp == "MEDIUM" ) csv = "#bf{CSVM}";
   if( wp == "TIGHT" ) csv = "#bf{CSVT}";

   TFile *feff = TFile::Open(eff.c_str());
   
   TH1F *hEFFMC, *hEFFDATA;
   TPolyLine *hEFFMCSYS, *hEFFDATASYS;
   
   hEFFMC = (TH1F*)feff->Get("hEFFMC");
   hEFFMCSYS = (TPolyLine*)feff->Get("hEFFMCSYS");
   
   hEFFDATA = (TH1F*)feff->Get("hEFFDATA");
   hEFFDATASYS = (TPolyLine*)feff->Get("hEFFDATASYS");

   TFile *foff = TFile::Open(off.c_str());
   
   TH1F *hEFFMC_OFF, *hEFFDATA_OFF;
   TPolyLine *hEFFMCSYS_OFF, *hEFFDATASYS_OFF;
   
   hEFFMC_OFF = (TH1F*)foff->Get("OFF_EFFMC");
   hEFFMCSYS_OFF = (TPolyLine*)foff->Get("OFF_EFFSYSMC");
   
   hEFFDATA_OFF = (TH1F*)foff->Get("OFF_EFFDATA");
   hEFFDATASYS_OFF = (TPolyLine*)foff->Get("OFF_EFFSYSDATA");   

   if( flav == "beauty" )
     hEFFMC->GetYaxis()->SetTitle("b-tagging efficiency");
   else
     hEFFMC->GetYaxis()->SetTitle("c-tagging efficiency");
   hEFFMC->SetMarkerSize(0.8);
   hEFFMC->GetXaxis()->SetTitle("P_{T} [TeV]");

   if( flav == "beauty" )
     hEFFDATA->GetYaxis()->SetTitle("b-tagging efficiency");
   else
     hEFFDATA->GetYaxis()->SetTitle("c-tagging efficiency");
   hEFFDATA->SetMarkerSize(0.8);
   
   hEFFMC->Draw("e1p");

   hEFFMC->GetXaxis()->SetMoreLogLabels();
   
   if( flav == "beauty" )
     {	
	if( wp == "LOOSE" ) hEFFMC->GetYaxis()->SetRangeUser(0.5,1.0);
	if( wp == "MEDIUM" ) hEFFMC->GetYaxis()->SetRangeUser(0.3,0.9);
	if( wp == "TIGHT" ) hEFFMC->GetYaxis()->SetRangeUser(0.1,0.7);
     }
   else
     {
	if( wp == "LOOSE" ) hEFFMC->GetYaxis()->SetRangeUser(0.,0.8);
	if( wp == "MEDIUM" ) hEFFMC->GetYaxis()->SetRangeUser(0.,0.6);
	if( wp == "TIGHT" ) hEFFMC->GetYaxis()->SetRangeUser(0.,0.15);
     }  
   hEFFMCSYS->Draw("fSAME");
   hEFFMC->Draw("e1p same");

   hEFFMC_OFF->SetMarkerSize(0.8);
   hEFFMC_OFF->SetMarkerStyle(23);
   hEFFMC_OFF->SetMarkerColor(kRed);
   hEFFMC_OFF->SetLineColor(kRed);
   hEFFMC_OFF->Draw("p same");
   
   hEFFMCSYS_OFF->Draw("lSAME");
   
   TLegend *leg;
   leg = new TLegend(0.35,0.45,0.70,0.20);
   leg->SetFillColor(253);
   leg->SetBorderSize(0);
  
   TLatex *legl = new TLatex();
   legl->SetNDC();
   legl->SetTextAlign(22);
   legl->SetTextFont(63);
   legl->SetTextSizePixels(30);
   legl->DrawLatex(0.55,0.85,csv.c_str());

//.........这里部分代码省略.........
开发者ID:kskovpen,项目名称:bTag,代码行数:101,代码来源:drawEFF.C

示例2: PlotTrkPt

void PlotTrkPt()
{
  gROOT->LoadMacro("$LOCAL/include/TUntilsOpHisto.h");
  gROOT->LoadMacro("$LOCAL/include/TUntilsAliFigs.h");
  gROOT->LoadMacro("$LOCAL/include/TUntilsPlotStd.h"); SetStyle();
//=============================================================================

  TFile *file = TFile::Open("data/AnalysisResults_vac_JetR05_skTR01.root", "READ");
  TH2D *hTrkPtEtaVac = (TH2D*)file->Get("hTrkPtEta"); hTrkPtEtaVac->SetName("hTrkPtEtaVac"); hTrkPtEtaVac->SetDirectory(0);
  file->Close();

  file = TFile::Open("data/AnalysisResults_med_JetR05_skTR01.root", "READ");
  TH2D *hTrkPtEtaMed = (TH2D*)file->Get("hTrkPtEta"); hTrkPtEtaMed->SetName("hTrkPtEtaMed"); hTrkPtEtaMed->SetDirectory(0);
  file->Close();
//=============================================================================

  TH1D *hTrkPtVac = hTrkPtEtaVac->ProjectionX("hTrkPtVac");
  TH1D *hTrkPtMed = hTrkPtEtaMed->ProjectionX("hTrkPtMed");

  hTrkPtVac->Rebin(10); hTrkPtVac->Scale(1./5.);
  hTrkPtMed->Rebin(10); hTrkPtMed->Scale(1./5.);
//=============================================================================

  TH1F    *hfm = 0;
  TCanvas *can = 0;
  TLegend *leg = 0;
  TLatex  *tex = 0;
  TLine  *line = 0;

  const Float_t dflx = 0., dfux = 300.;
  const Float_t dfly = 8e-13, dfuy = 8e2;

  const Float_t dlsx = 0.05, dlsy = 0.05;
  const Float_t dtsx = 0.06, dtsy = 0.06;
  const Float_t dtox = 1.10, dtoy = 1.00;

  const TString stnx = "#it{p}_{T} (GeV/#it{c})";
  const TString stny = "d#sigma/d#it{p}_{T} (mb/GeV/#it{c})";

  TH1D *hSE = new TH1D("hSE", "", 10., 0., 10.);
  hSE->SetLineWidth(2);
  hSE->SetLineColor(wcl[0]);
  hSE->SetMarkerStyle(wmk[0]);
  hSE->SetMarkerColor(wcl[0]);

  TH1D *hME = new TH1D("hME", "", 10., 0., 10.);
  hME->SetLineWidth(2);
  hME->SetLineColor(wcl[0]);
  hME->SetMarkerStyle(wmk[2]);
  hME->SetMarkerColor(wcl[0]);
//=============================================================================

  can = MakeCanvas("TrkPt"); can->SetGridx(); can->SetGridy(); can->SetLogy();
  hfm = can->DrawFrame(dflx, dfly, dfux, dfuy); SetupFrame(hfm, dlsx, dlsy, dtsx, dtsy, dtox, dtoy, stnx, stny);
  hfm->GetXaxis()->SetNdivisions(510);
  hfm->GetYaxis()->SetNdivisions(510);

  DrawHisto(hTrkPtVac, wcl[3], wmk[0], "SAME");
  DrawHisto(hTrkPtMed, wcl[1], wmk[0], "SAME");

  leg = new TLegend(0.62, 0.72, 0.98, 0.88); SetupLegend(leg);
  leg->AddEntry(hTrkPtVac, "Vacuum", "LP")->SetTextSizePixels(24);
  leg->AddEntry(hTrkPtMed, "Medium", "LP")->SetTextSizePixels(24);
  leg->Draw();

  tex = new TLatex();
  tex->SetNDC();
  tex->SetTextSizePixels(24);
  tex->DrawLatex(0.16, 0.92, "PYTHIA+JEWEL, 2.76 TeV, |#eta|<2.6");
  CanvasEnd(can);
//=============================================================================

  const Double_t dBins[] = { 0., 5., 10., 20., 30., 50., 80., 120., 160., 200., 250., 300., 400., 500. };
  const Int_t nBins = sizeof(dBins) / sizeof(Double_t) - 1;

  TH1D *hTrkPtVacRB = hTrkPtVac->Rebin(nBins, "hTrkPtVacRB", dBins);
  TH1D *hTrkPtMedRB = hTrkPtMed->Rebin(nBins, "hTrkPtMedRB", dBins); hTrkPtMedRB->Divide(hTrkPtVacRB);

  can = MakeCanvas("TrkPtRAA"); can->SetGridx(); can->SetGridy();
  hfm = can->DrawFrame(dflx, 0., dfux, 2.); SetupFrame(hfm, dlsx, dlsy, dtsx, dtsy, dtox, dtoy, stnx, "#it{R}_{AA}");
  hfm->GetXaxis()->SetNdivisions(510);
  hfm->GetYaxis()->SetNdivisions(510);

  DrawHisto(hTrkPtMedRB, wcl[0], wmk[0], "SAME");

  tex = new TLatex();
  tex->SetNDC();
  tex->SetTextSizePixels(24);
  tex->DrawLatex(0.16, 0.92, "PYTHIA+JEWEL, 2.76 TeV, |#eta|<2.6");
  CanvasEnd(can);
//=============================================================================

  return;
}
开发者ID:xcheung,项目名称:AnaSubjetsMC,代码行数:94,代码来源:PlotTrkPt.C

示例3: PlotJetRAA

void PlotJetRAA()
{
  gROOT->LoadMacro("$LOCAL/include/TUntilsOpHisto.h");
  gROOT->LoadMacro("$LOCAL/include/TUntilsAliFigs.h");
  gROOT->LoadMacro("$LOCAL/include/TUntilsPlotStd.h"); SetStyle();
//=============================================================================

  TFile *file = TFile::Open("data/incl/AnalysisOutputs_jet_py8_JetR05_SjeR01.root", "READ");
  TH1D *h5py8 = (TH1D*)file->Get("hJet"); h5py8->SetName("h5py8"); h5py8->SetDirectory(0);
  file->Close();

  file = TFile::Open("data/incl/AnalysisOutputs_jet_py6_JetR05_SjeR01.root", "READ");
  TH1D *h5py6 = (TH1D*)file->Get("hJet"); h5py6->SetName("h5py6"); h5py6->SetDirectory(0);
  file->Close();

  file = TFile::Open("data/incl/AnalysisOutputs_jet_qpy_JetR05_SjeR01.root", "READ");
  TH1D *h5qpy = (TH1D*)file->Get("hJet"); h5qpy->SetName("h5qpy"); h5qpy->SetDirectory(0);
  file->Close();

  file = TFile::Open("data/incl/AnalysisOutputs_jet_vac_JetR05_SjeR01.root", "READ");
  TH1D *h5vac = (TH1D*)file->Get("hJet"); h5vac->SetName("h5vac"); h5vac->SetDirectory(0);
  file->Close();

  file = TFile::Open("data/incl/AnalysisOutputs_jet_med_JetR05_SjeR01.root", "READ");
  TH1D *h5med = (TH1D*)file->Get("hJet"); h5med->SetName("h5med"); h5med->SetDirectory(0);
  file->Close();


  file = TFile::Open("data/incl/AnalysisOutputs_jet_py8_JetR04_SjeR01.root", "READ");
  TH1D *h4py8 = (TH1D*)file->Get("hJet"); h4py8->SetName("h4py8"); h4py8->SetDirectory(0);
  file->Close();

  file = TFile::Open("data/incl/AnalysisOutputs_jet_py6_JetR04_SjeR01.root", "READ");
  TH1D *h4py6 = (TH1D*)file->Get("hJet"); h4py6->SetName("h4py6"); h4py6->SetDirectory(0);
  file->Close();

  file = TFile::Open("data/incl/AnalysisOutputs_jet_qpy_JetR04_SjeR01.root", "READ");
  TH1D *h4qpy = (TH1D*)file->Get("hJet"); h4qpy->SetName("h4qpy"); h4qpy->SetDirectory(0);
  file->Close();

  file = TFile::Open("data/incl/AnalysisOutputs_jet_vac_JetR04_SjeR01.root", "READ");
  TH1D *h4vac = (TH1D*)file->Get("hJet"); h4vac->SetName("h4vac"); h4vac->SetDirectory(0);
  file->Close();

  file = TFile::Open("data/incl/AnalysisOutputs_jet_med_JetR04_SjeR01.root", "READ");
  TH1D *h4med = (TH1D*)file->Get("hJet"); h4med->SetName("h4med"); h4med->SetDirectory(0);
  file->Close();
//=============================================================================

  TH1F    *hfm = 0;
  TCanvas *can = 0;
  TLegend *leg = 0;
  TLatex  *tex = 0;
  TLine  *line = 0;

  const Float_t dflx = -40., dfux = 200.;
  const Float_t dfly = 8e-10, dfuy = 8e3;

  const Float_t dlsx = 0.05, dlsy = 0.05;
  const Float_t dtsx = 0.06, dtsy = 0.06;
  const Float_t dtox = 1.10, dtoy = 1.00;

  const TString stnx = "#it{p}_{T,jet}^{ch} (GeV/#it{c})";
  const TString stny = "d#sigma/d#it{p}_{T} (mb/GetV/#it{c})";

  TH1D *hSE = new TH1D("hSE", "", 10., 0., 10.);
  hSE->SetLineWidth(2);
  hSE->SetLineColor(wcl[0]);
  hSE->SetMarkerStyle(wmk[0]);
  hSE->SetMarkerColor(wcl[0]);

  TH1D *hME = new TH1D("hME", "", 10., 0., 10.);
  hME->SetLineWidth(2);
  hME->SetLineColor(wcl[0]);
  hME->SetMarkerStyle(wmk[2]);
  hME->SetMarkerColor(wcl[0]);
//=============================================================================

  can = MakeCanvas("Jet5"); can->SetGridx(); can->SetGridy(); can->SetLogy();
  hfm = can->DrawFrame(0., 8e-13, 500., 8e3); SetupFrame(hfm, dlsx, dlsy, dtsx, dtsy, dtox, dtoy,
                                                        "#it{p}_{T,jet} (GeV/#it{c})",
                                                        "d#sigma/d#it{p}_{T} (mb/GeV/#it{c})");
  hfm->GetXaxis()->SetNdivisions(510);
  hfm->GetYaxis()->SetNdivisions(510);

  DrawHisto(h5py8, wcl[3], wmk[0], "SAME");
  DrawHisto(h5qpy, wcl[1], wmk[0], "SAME");
  DrawHisto(h5med, wcl[5], wmk[0], "SAME");

  leg = new TLegend(0.62, 0.64, 0.98, 0.88); SetupLegend(leg);
  leg->AddEntry(h5py8, "PYTHIA 8", "LP")->SetTextSizePixels(24);
  leg->AddEntry(h5qpy, "Q-PYTHIA", "LP")->SetTextSizePixels(24);
  leg->AddEntry(h5med, "JEWEL+PYTHIA", "LP")->SetTextSizePixels(24);
  leg->Draw();

  tex = new TLatex();
  tex->SetNDC();
  tex->SetTextSizePixels(24);
  tex->DrawLatex(0.16, 0.92, "2.76 TeV, jet anti-#it{k}_{T}, #it{R}=0.5, |#eta_{jet}|<1");
  CanvasEnd(can);
//.........这里部分代码省略.........
开发者ID:xcheung,项目名称:AnaSubjetsMC,代码行数:101,代码来源:PlotJetRAA.C

示例4: combine


//.........这里部分代码省略.........
   for(int k=0;k<nPT+2;k++)
     {
	xp_sysTot_SF[nPT+2+k] = xp_sysTot_SF[nPT+2-k-1];
     }	
   xp_sysTot_SF[np-1] = xp_sysTot_SF[0];   
   yp_sysTot_SF[np-1] = yp_sysTot_SF[0];
   
   TPolyLine *sysTot_SF = new TPolyLine(np,xp_sysTot_SF,yp_sysTot_SF);
   sysTot_SF->SetFillColor(kYellow);
	
   if( !doSFc ) h_SF->GetYaxis()->SetTitle("SF_{b}");
   else h_SF->GetYaxis()->SetTitle("SF_{c}");
   h_SF->GetXaxis()->SetTitle("p_{T} [TeV]");
   h_SF->SetMarkerSize(0.8);

   h_SF->Draw("e1p");
	
   h_SF->GetXaxis()->SetMoreLogLabels();
   h_SF->GetXaxis()->SetNoExponent();
   h_SF->GetYaxis()->SetRangeUser(0.40,1.30);
	
   sysTot_SF->Draw("fSAME");
   h_SF->Draw("e1p same");
   
   TLegend *leg;
   leg = new TLegend(0.35,0.45,0.70,0.20);
   leg->SetFillColor(253);
   leg->SetBorderSize(0);
   
   TLatex *legl = new TLatex();
   legl->SetNDC();
   legl->SetTextAlign(22);
   legl->SetTextFont(63);
   legl->SetTextSizePixels(30);
   legl->DrawLatex(0.55,0.82,csv.c_str());
   
   leg->AddEntry(h_SF,"Scale factor","p");
   leg->AddEntry(h_SF,"stat","l");
   leg->AddEntry(sysTot_SF,"stat #oplus syst","f");
   
   c1->RedrawAxis("g");
   
   leg->Draw();
   
//   c1->SetLogx(1);
//   TLatex *lab = CMSLABEL();
//   lab->Draw("same");
   
   TLatex *tex = new TLatex(0.1969,0.906825,"CMS");
   tex->SetNDC();
   tex->SetTextAlign(13);
   tex->SetTextFont(61);
   tex->SetTextSize(0.07475);
   tex->SetLineWidth(2);
   tex->Draw();

   TLatex *tex2 = new TLatex(0.1969,0.817125,"Preliminary");
   tex2->SetNDC();
   tex2->SetTextAlign(13);
   tex2->SetTextFont(52);
   tex2->SetTextSize(0.05681);
   tex2->SetLineWidth(2);
   tex2->Draw();

   TLatex *text1 = new TLatex(0.98,0.95125,"#sqrt{s} = 13 TeV, 25 ns");
   text1->SetNDC();
开发者ID:kskovpen,项目名称:bTag,代码行数:67,代码来源:combine.C

示例5: PlotNsjMedian

void PlotNsjMedian()
{
  gROOT->LoadMacro("$LOCAL/include/TUntilsOpHisto.h");
  gROOT->LoadMacro("$LOCAL/include/TUntilsAliFigs.h");
  gROOT->LoadMacro("$LOCAL/include/TUntilsPlotStd.h"); SetStyle();
//=============================================================================

  TFile *file = TFile::Open("data/AnalysisOutputs_Nsj.root", "READ");
  TList *listPy8R4S1 = (TList*)file->Get("list_py8_JetR04_SjeR01");
  TList *listPy8R4S2 = (TList*)file->Get("list_py8_JetR04_SjeR02");
  TList *listPy8R4S3 = (TList*)file->Get("list_py8_JetR04_SjeR03");
  TList *listPy8R5S1 = (TList*)file->Get("list_py8_JetR05_SjeR01");
  TList *listPy8R5S2 = (TList*)file->Get("list_py8_JetR05_SjeR02");
  TList *listPy8R5S3 = (TList*)file->Get("list_py8_JetR05_SjeR03");
  TList *listPy8R5S4 = (TList*)file->Get("list_py8_JetR05_SjeR04");

  TList *listVacR4S1 = (TList*)file->Get("list_vac_JetR04_SjeR01");
  TList *listVacR4S2 = (TList*)file->Get("list_vac_JetR04_SjeR02");
  TList *listVacR4S3 = (TList*)file->Get("list_vac_JetR04_SjeR03");
  TList *listVacR5S1 = (TList*)file->Get("list_vac_JetR05_SjeR01");
  TList *listVacR5S2 = (TList*)file->Get("list_vac_JetR05_SjeR02");
  TList *listVacR5S3 = (TList*)file->Get("list_vac_JetR05_SjeR03");
  TList *listVacR5S4 = (TList*)file->Get("list_vac_JetR05_SjeR04");

  TList *listMedR4S1 = (TList*)file->Get("list_med_JetR04_SjeR01");
  TList *listMedR4S2 = (TList*)file->Get("list_med_JetR04_SjeR02");
  TList *listMedR4S3 = (TList*)file->Get("list_med_JetR04_SjeR03");
  TList *listMedR5S1 = (TList*)file->Get("list_med_JetR05_SjeR01");
  TList *listMedR5S2 = (TList*)file->Get("list_med_JetR05_SjeR02");
  TList *listMedR5S3 = (TList*)file->Get("list_med_JetR05_SjeR03");
  TList *listMedR5S4 = (TList*)file->Get("list_med_JetR05_SjeR04");
  file->Close();

  TH1D *hPy8R4S1 = (TH1D*)listPy8R4S1->FindObject("hJetNsj_Median"); hPy8R4S1->SetName("hPy8R4S1");
  TH1D *hPy8R4S2 = (TH1D*)listPy8R4S2->FindObject("hJetNsj_Median"); hPy8R4S2->SetName("hPy8R4S2");
  TH1D *hPy8R4S3 = (TH1D*)listPy8R4S3->FindObject("hJetNsj_Median"); hPy8R4S3->SetName("hPy8R4S3");
  TH1D *hPy8R5S1 = (TH1D*)listPy8R5S1->FindObject("hJetNsj_Median"); hPy8R5S1->SetName("hPy8R5S1");
  TH1D *hPy8R5S2 = (TH1D*)listPy8R5S2->FindObject("hJetNsj_Median"); hPy8R5S2->SetName("hPy8R5S2");
  TH1D *hPy8R5S3 = (TH1D*)listPy8R5S3->FindObject("hJetNsj_Median"); hPy8R5S3->SetName("hPy8R5S3");
  TH1D *hPy8R5S4 = (TH1D*)listPy8R5S4->FindObject("hJetNsj_Median"); hPy8R5S4->SetName("hPy8R5S4");

  TH1D *hVacR4S1 = (TH1D*)listVacR4S1->FindObject("hJetNsj_Median"); hVacR4S1->SetName("hVacR4S1");
  TH1D *hVacR4S2 = (TH1D*)listVacR4S2->FindObject("hJetNsj_Median"); hVacR4S2->SetName("hVacR4S2");
  TH1D *hVacR4S3 = (TH1D*)listVacR4S3->FindObject("hJetNsj_Median"); hVacR4S3->SetName("hVacR4S3");
  TH1D *hVacR5S1 = (TH1D*)listVacR5S1->FindObject("hJetNsj_Median"); hVacR5S1->SetName("hVacR5S1");
  TH1D *hVacR5S2 = (TH1D*)listVacR5S2->FindObject("hJetNsj_Median"); hVacR5S2->SetName("hVacR5S2");
  TH1D *hVacR5S3 = (TH1D*)listVacR5S3->FindObject("hJetNsj_Median"); hVacR5S3->SetName("hVacR5S3");
  TH1D *hVacR5S4 = (TH1D*)listVacR5S4->FindObject("hJetNsj_Median"); hVacR5S4->SetName("hVacR5S4");

  TH1D *hMedR4S1 = (TH1D*)listMedR4S1->FindObject("hJetNsj_Median"); hMedR4S1->SetName("hMedR4S1");
  TH1D *hMedR4S2 = (TH1D*)listMedR4S2->FindObject("hJetNsj_Median"); hMedR4S2->SetName("hMedR4S2");
  TH1D *hMedR4S3 = (TH1D*)listMedR4S3->FindObject("hJetNsj_Median"); hMedR4S3->SetName("hMedR4S3");
  TH1D *hMedR5S1 = (TH1D*)listMedR5S1->FindObject("hJetNsj_Median"); hMedR5S1->SetName("hMedR5S1");
  TH1D *hMedR5S2 = (TH1D*)listMedR5S2->FindObject("hJetNsj_Median"); hMedR5S2->SetName("hMedR5S2");
  TH1D *hMedR5S3 = (TH1D*)listMedR5S3->FindObject("hJetNsj_Median"); hMedR5S3->SetName("hMedR5S3");
  TH1D *hMedR5S4 = (TH1D*)listMedR5S4->FindObject("hJetNsj_Median"); hMedR5S4->SetName("hMedR5S4");
//=============================================================================

  TH1F    *hfm = 0;
  TCanvas *can = 0;
  TLegend *leg = 0;
  TLatex  *tex = 0;
  TLine  *line = 0;

  const Float_t dflx = 0., dfux = 500.;
  const Float_t dfly = 0., dfuy = 15.;

  const Float_t dlsx = 0.05, dlsy = 0.05;
  const Float_t dtsx = 0.06, dtsy = 0.06;
  const Float_t dtox = 1.10, dtoy = 1.00;

  const TString stnx = "#it{p}_{T,jet} (GeV/#it{c})";
  const TString stny = "Number of sub-jets: median";

  TH1D *hSE = new TH1D("hSE", "", 10., 0., 10.);
  hSE->SetLineWidth(2);
  hSE->SetLineColor(wcl[0]);
  hSE->SetMarkerStyle(wmk[0]);
  hSE->SetMarkerColor(wcl[0]);

  TH1D *hME = new TH1D("hME", "", 10., 0., 10.);
  hME->SetLineWidth(2);
  hME->SetLineColor(wcl[0]);
  hME->SetMarkerStyle(wmk[2]);
  hME->SetMarkerColor(wcl[0]);
//=============================================================================

  can = MakeCanvas("NsjPy8R04_Median"); can->SetGridx(); can->SetGridy(); //can->SetLogy();
  hfm = can->DrawFrame(dflx,dfly,dfux,dfuy); SetupFrame(hfm,dlsx,dlsy,dtsx,dtsy,dtox,dtoy, stnx, stny);
  hfm->GetXaxis()->SetNdivisions(510);
  hfm->GetYaxis()->SetNdivisions(510);

  DrawHisto(hPy8R4S1, wcl[1], wmk[0], "SAME");
  DrawHisto(hPy8R4S2, wcl[3], wmk[0], "SAME");
  DrawHisto(hPy8R4S3, wcl[4], wmk[0], "SAME");

  leg = new TLegend(0.68, 0.66, 0.98, 0.90); SetupLegend(leg);
  leg->AddEntry(hPy8R4S1, "#it{R}_{sub}=0.1", "LP")->SetTextSizePixels(24);
  leg->AddEntry(hPy8R4S2, "#it{R}_{sub}=0.2", "LP")->SetTextSizePixels(24);
  leg->AddEntry(hPy8R4S3, "#it{R}_{sub}=0.3", "LP")->SetTextSizePixels(24);
//.........这里部分代码省略.........
开发者ID:xcheung,项目名称:AnaSubjetsMC,代码行数:101,代码来源:PlotNsjMedian.C

示例6: PlotDrmCorr

void PlotDrmCorr()
{
  gROOT->LoadMacro("$LOCAL/include/TUntilsOpHisto.h");
  gROOT->LoadMacro("$LOCAL/include/TUntilsAliFigs.h");
  gROOT->LoadMacro("$LOCAL/include/TUntilsPlotStd.h"); SetStyle();

 const TString sJetTag = "120<#it{p}_{T,jet}<150 GeV/#it{c}";
//=============================================================================

  TFile *file = TFile::Open("data/mass/AnalysisOutputs_Dsm_py8_JetR05_SjeR01.root", "READ");
  TH2D *h5py8 = (TH2D*)file->Get("hDfrDdm120"); h5py8->SetName("h5py8"); h5py8->SetDirectory(0);
  file->Close();

  file = TFile::Open("data/mass/AnalysisOutputs_Dsm_qpy_JetR05_SjeR01.root", "READ");
  TH2D *h5qpy = (TH2D*)file->Get("hDfrDdm120"); h5qpy->SetName("h5qpy"); h5qpy->SetDirectory(0);
  file->Close();

  file = TFile::Open("data/mass/AnalysisOutputs_Dsm_med_JetR05_SjeR01.root", "READ");
  TH2D *h5med = (TH2D*)file->Get("hDfrDdm120"); h5med->SetName("h5med"); h5med->SetDirectory(0);
  file->Close();


  file = TFile::Open("data/mass/AnalysisOutputs_Dsm_py8_JetR04_SjeR01.root", "READ");
  TH2D *h4py8 = (TH2D*)file->Get("hDfrDdm120"); h4py8->SetName("h4py8"); h4py8->SetDirectory(0);
  file->Close();

  file = TFile::Open("data/mass/AnalysisOutputs_Dsm_qpy_JetR04_SjeR01.root", "READ");
  TH2D *h4qpy = (TH2D*)file->Get("hDfrDdm120"); h4qpy->SetName("h4qpy"); h4qpy->SetDirectory(0);
  file->Close();

  file = TFile::Open("data/mass/AnalysisOutputs_Dsm_med_JetR04_SjeR01.root", "READ");
  TH2D *h4med = (TH2D*)file->Get("hDfrDdm120"); h4med->SetName("h4med"); h4med->SetDirectory(0);
  file->Close();
//=============================================================================

  const Double_t dBin[] = { 0., 0.1, 0.3, 0.5, 0.8, 1.2 };
  const Int_t nBin = sizeof(dBin) / sizeof(Double_t) -1;

  h5py8->RebinX(50); h4py8->RebinX(50);
  h5qpy->RebinX(50); h4qpy->RebinX(50);
  h5med->RebinX(50); h4med->RebinX(50);

  TH1D *h5py8M = SetRMS(h5py8,"h5py8M"); TH1D *h4py8M = SetRMS(h4py8,"h4py8M");
  TH1D *h5qpyM = SetRMS(h5qpy,"h5qpyM"); TH1D *h4qpyM = SetRMS(h4qpy,"h4qpyM");
  TH1D *h5medM = SetRMS(h5med,"h5medM"); TH1D *h4medM = SetRMS(h4med,"h4medM");

  TGraph *g5py8 = new TGraph(h5py8M); TGraph *g4py8 = new TGraph(h4py8M);
  TGraph *g5qpy = new TGraph(h5qpyM); TGraph *g4qpy = new TGraph(h4qpyM);
  TGraph *g5med = new TGraph(h5medM); TGraph *g4med = new TGraph(h4medM);
//=============================================================================

  TH1F    *hfm = 0;
  TCanvas *can = 0;
  TLegend *leg = 0;
  TLatex  *tex = 0;
  TLine  *line = 0;

  const Float_t dflx = 0.2, dfux = 1.;
  const Float_t dfly = 2., dfuy = 15.;

  const Float_t dlsx = 0.05, dlsy = 0.05;
  const Float_t dtsx = 0.06, dtsy = 0.06;
  const Float_t dtox = 1.10, dtoy = 1.00;

  const TString stnx = "#it{R}(sj^{1st},sj^{2nd})";
  const TString stny = "#sigma(m_{jet}-m_{sj}) (GeV/#it{c}^{2})";

  TH1D *hSE = new TH1D("hSE", "", 10., 0., 10.);
  hSE->SetLineWidth(2);
  hSE->SetLineColor(wcl[0]);
  hSE->SetMarkerStyle(wmk[0]);
  hSE->SetMarkerColor(wcl[0]);

  TH1D *hME = new TH1D("hME", "", 10., 0., 10.);
  hME->SetLineWidth(2);
  hME->SetLineColor(wcl[0]);
  hME->SetMarkerStyle(wmk[2]);
  hME->SetMarkerColor(wcl[0]);
//=============================================================================

  can = MakeCanvas("Jet5py8DrmRMS"); can->SetGridx(); can->SetGridy();
  hfm = can->DrawFrame(dflx, dfly, dfux, dfuy); SetupFrame(hfm, dlsx, dlsy, dtsx, dtsy, dtox, dtoy, stnx, stny);
  hfm->GetXaxis()->SetNdivisions(510);
  hfm->GetYaxis()->SetNdivisions(510);

  DrawGraph(g5py8, wcl[3], "C");
  DrawGraph(g5qpy, wcl[1], "C");
  DrawGraph(g5med, wcl[5], "C");

  leg = new TLegend(0.62, 0.64, 0.98, 0.88); SetupLegend(leg);
  leg->AddEntry(g5py8, "PYTHIA 8", "L")->SetTextSizePixels(24);
  leg->AddEntry(g5qpy, "Q-PYTHIA", "L")->SetTextSizePixels(24);
  leg->AddEntry(g5med, "JEWEL+PYTHIA", "L")->SetTextSizePixels(24);
  leg->Draw();

  tex = new TLatex();
  tex->SetNDC();
  tex->SetTextSizePixels(24);
  tex->DrawLatex(0.16, 0.92, "2.76 TeV, Jet #it{R}=0.5, anti-#it{k}_{T}, |#eta_{jet}|<1");
  tex->DrawLatex(0.16, 0.84, sJetTag.Data());
//.........这里部分代码省略.........
开发者ID:xcheung,项目名称:AnaSubjetsMC,代码行数:101,代码来源:PlotDrmCorr.C


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