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


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

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


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

示例1: ATLASLumi

void ATLASLumi(Double_t x,Double_t y, float datlum, int energy=7) 
{
// add the Atlas Lumi and centre of mass

  //float datlum=8.2;

//    if (!fIsPseudoData) {
//  TString tit="#sqrt{s} = 7 TeV, #int L dt=";
  TString tit;
  if(energy == 7) tit +="#sqrt{s} = 7 TeV";   
  if(energy == 8) tit +="#sqrt{s} = 8 TeV";   
  if(energy == 13) tit +="#sqrt{s} = 13 TeV";
  tit +=Form(", %.1f",datlum);  
  tit +=" fb^{-1}";

//

  float fTextScaleFactor=0.8;

  TLatex l; //l.SetTextAlign(12); 
  l.SetNDC();
//l.SetTextFont(42);// standard
  l.SetTextFont(72); // italics 
  float siz=l.GetTextSize();
  l.SetTextSize(siz*fTextScaleFactor); 
  //l.SetTextSize(siz*0.7); // set the size here
  l.SetTextColor(1);
  l.DrawLatex(x,y,tit);
}
开发者ID:jpyne17,项目名称:msci-hep,代码行数:29,代码来源:plotUtils.C

示例2: ATLASLabel

void ATLASLabel(Double_t x,Double_t y, bool Preliminary) 
{
  float fTextScaleFactor=0.8;

  TLatex l; //l.SetTextAlign(12); l.SetTextSize(tsize); 
  float siz=l.GetTextSize();
  l.SetTextSize(siz*fTextScaleFactor); // set the size here
  l.SetNDC();
  l.SetTextFont(72);
  l.SetTextColor(1);

  double delx = 0.115*696*gPad->GetWh()/(472*gPad->GetWw());
  l.DrawLatex(x,y,"ATLAS");
  if (Preliminary) {
    TLatex p; 
    siz=p.GetTextSize();
    p.SetTextSize(siz*fTextScaleFactor); // set the size here
    p.SetNDC();
    p.SetTextFont(42);
    p.SetTextColor(1);
    //  p.DrawLatex(x+delx-.03,y,"Preliminary");
    p.DrawLatex(x+delx,y,"Internal");
  }
}
开发者ID:jpyne17,项目名称:msci-hep,代码行数:24,代码来源:plotUtils.C

示例3: poiss

void poiss()
{
  TF1* func = new TF1("func","TMath::Poisson(x,0.06)",0,10);
  TH1D* h = new TH1D("h",";# of collisions",11,-0.5,10.5);
  for(int i=1;i<=11;i++) h->SetBinContent(i,func->Eval(h->GetBinCenter(i)));

  TCanvas* c = new TCanvas("c","c",550,500);
  c->SetLogy();
  h->GetXaxis()->CenterTitle();
  h->Draw("hist");

  TLatex* latex = new TLatex();
  latex->SetNDC();
  latex->SetTextSize(latex->GetTextSize()*0.75);
  latex->DrawLatex(0.43,0.87,"Poisson distribution, <#mu>=6%");

  SaveCanvas(c,"pPb/corr","Poisson_mu6");
}
开发者ID:CmsHI,项目名称:CVS_CmsHi,代码行数:18,代码来源:pileup.C

示例4: ATLASChannel

void ATLASChannel(Double_t x,Double_t y, TString label) 
{
// add the Atlas Lumi and centre of mass


//    if (!fIsPseudoData) {
//  TString tit="#sqrt{s} = 7 TeV, #int L dt=";
  
  float fTextScaleFactor=0.8;


//
  TLatex l; //l.SetTextAlign(12); l.SetTextSize(tsize); 
  l.SetNDC();
//l.SetTextFont(42);// standard
  l.SetTextFont(72); // italics 
  float siz=l.GetTextSize();
  l.SetTextSize(siz*fTextScaleFactor); 

  //l.SetTextSize(siz*0.7); // set the size here
  l.SetTextColor(1);
  l.DrawLatex(x,y,label);
}
开发者ID:jpyne17,项目名称:msci-hep,代码行数:23,代码来源:plotUtils.C

示例5: DrawRandCone

void DrawRandCone(string tag, int centmin, int centmax)
{
  TFile* f = new TFile(Form("merged/randcone_%s_centmin%d_centmax%d.root",tag.data(),centmin,centmax));
  TH1D* one = (TH1D*) f->Get("one");
  cout<<one->GetBinContent(1)<<endl;
  double norm = one->GetBinContent(1);
  
  TH1D * hmeanpfPtSumEta = (TH1D*) f->Get("hmeanpfPtSumEta");
  TH1D * hmeanpfVsPtSumEta = (TH1D*) f->Get("hmeanpfVsPtSumEta");
  TH1D * hmeanpfVsPtInitialSumEta = (TH1D*) f->Get("hmeanpfVsPtInitialSumEta");
  hmeanpfPtSumEta->GetXaxis()->CenterTitle();
  hmeanpfPtSumEta->GetYaxis()->CenterTitle();
  hmeanpfVsPtSumEta->GetXaxis()->CenterTitle();
  hmeanpfVsPtSumEta->GetYaxis()->CenterTitle();
  hmeanpfVsPtInitialSumEta->GetXaxis()->CenterTitle();
  hmeanpfVsPtInitialSumEta->GetYaxis()->CenterTitle();
  
  
  hmeanpfPtSumEta->Scale(1.0/norm);
  hmeanpfVsPtSumEta->Scale(1.0/norm);
  hmeanpfVsPtInitialSumEta->Scale(1.0/norm);
  
  
  TCanvas * c1 = new TCanvas("c1");
  hmeanpfPtSumEta->Draw();
  // hmeanpfVsPtSumEta->Draw();
  // hmeanpfVsPtInitialSumEta->Draw();
  
  TLatex * lmult = new TLatex(0.53, 0.95, Form("CMS PbPb %2.0f-%2.0f%%", centmin*0.5, centmax*0.5));
  lmult->SetNDC(1);
  lmult->SetTextSize(lmult->GetTextSize()*1.5);
  lmult->Draw();
  
  c1->SaveAs(Form("hmeanpfPtSumEta-%d_%d.png",centmin,centmax));
  // c1->SaveAs(Form("hmeanpfVsPtSumEta-%d_%d.png",centmin,centmax));
  // c1->SaveAs(Form("hmeanpfVsPtInitialSumEta-%d_%d.png",centmin,centmax));
}
开发者ID:velicanu,项目名称:randomcone,代码行数:37,代码来源:DrawRandCone.C

示例6: draw1step

void draw1step(int phoetmin, int phoetmax, int jetptmin = 30, int trkptcut = 4) {
  TFile *_file0 = TFile::Open(Form("closure_pbpb_%d_%d_%d.root",phoetmin,phoetmax,jetptmin));
  const static int ncentbins = 4;
  const int yaxismax = 20000;
  float binwidth = 5.000000e-01;
  int centmins[] = {0,20,60,100,140};
  int centmaxs[] = {20,60,100,200,200};
  string cents[] = {"0-10%","10-30%","30-50%","50-100%","70-100%"};
  TH1D * rawff_pbpbmc_recoreco[ncentbins];
  TH1D * rawffue_pbpbmc_recoreco[ncentbins];
  TH1D * rawffjetmix_pbpbmc_recoreco[ncentbins];
  TH1D * rawffjetmixue_pbpbmc_recoreco[ncentbins];
  TH2D * dummy_pbpbsub[ncentbins];
  TLegend * leg_ff_pbpbsub[ncentbins];

  TCanvas * call = new TCanvas("call","",1600,500);
  makeMultiPanelCanvas(call,ncentbins+1,1,0.02,0.0,-6,0.2,0.04);

  for (int icent = 0; icent < ncentbins; icent++) {
    call->cd(2+icent);
    dummy_pbpbsub[icent] = new TH2D(Form("dummy_pbpbsub_%d_%d",centmins[icent],centmaxs[icent]),";#xi;dN/d#xi",1,0.01,4.99,1,0,yaxismax);
    dummy_pbpbsub[icent]->GetXaxis()->SetTitleOffset(0.8);
    dummy_pbpbsub[icent]->GetXaxis()->CenterTitle();
    dummy_pbpbsub[icent]->GetYaxis()->CenterTitle();
    dummy_pbpbsub[icent]->GetXaxis()->SetTitleSize(dummy_pbpbsub[icent]->GetXaxis()->GetTitleSize()*1.4);
    dummy_pbpbsub[icent]->Draw();
    rawff_pbpbmc_recoreco[icent] = (TH1D*)_file0->Get(Form("hgammaffxi_pbpbmc_recoreco_%d_%d",centmins[icent],centmaxs[icent]));
    rawffue_pbpbmc_recoreco[icent] = (TH1D*)_file0->Get(Form("hgammaffxiuemix_pbpbmc_recoreco_%d_%d",centmins[icent],centmaxs[icent]));
    rawffjetmix_pbpbmc_recoreco[icent] = (TH1D*)_file0->Get(Form("hgammaffxijetmix_pbpbmc_recoreco_%d_%d",centmins[icent],centmaxs[icent]));
    rawffjetmixue_pbpbmc_recoreco[icent] = (TH1D*)_file0->Get(Form("hgammaffxijetmixue_pbpbmc_recoreco_%d_%d",centmins[icent],centmaxs[icent]));
    rawffjetmix_pbpbmc_recoreco[icent]->SetMarkerColor(kBlue);
    rawffue_pbpbmc_recoreco[icent]->SetMarkerStyle(24);
    rawffjetmixue_pbpbmc_recoreco[icent]->SetMarkerColor(kBlue);
    rawffjetmixue_pbpbmc_recoreco[icent]->SetMarkerStyle(24);
    rawff_pbpbmc_recoreco[icent]->Draw("same");
    rawffjetmix_pbpbmc_recoreco[icent]->Draw("same");
    rawffue_pbpbmc_recoreco[icent]->Draw("same");
    rawffjetmixue_pbpbmc_recoreco[icent]->Draw("same");


    if(icent==0)
    {
      leg_ff_pbpbsub[icent] = new TLegend(0.03,0.52,0.3,0.92);
    }
    else
    {
      leg_ff_pbpbsub[icent] = new TLegend(0,0.697,0.27,0.92);
    }
    leg_ff_pbpbsub[icent]->SetTextSize(0.05*1.3);
    leg_ff_pbpbsub[icent]->SetFillColor(0);
    leg_ff_pbpbsub[icent]->SetFillStyle(0);
    leg_ff_pbpbsub[icent]->SetTextFont(42);
    if(icent==0)
    {
      leg_ff_pbpbsub[icent]->AddEntry(rawff_pbpbmc_recoreco[icent],"Raw FF","p");
      leg_ff_pbpbsub[icent]->AddEntry(rawffjetmix_pbpbmc_recoreco[icent],"Jet Mix FF","p");
      leg_ff_pbpbsub[icent]->AddEntry(rawffue_pbpbmc_recoreco[icent],"Raw UE FF","p");
      leg_ff_pbpbsub[icent]->AddEntry(rawffjetmixue_pbpbmc_recoreco[icent],"Jet Mix UE FF","p");
    }
    else if(icent==1)
    {
      leg_ff_pbpbsub[icent]->AddEntry(rawff_pbpbmc_recoreco[icent],Form("trk p_{T}>%d GeV, R < 0.3",trkptcut),"");
      leg_ff_pbpbsub[icent]->AddEntry(rawff_pbpbmc_recoreco[icent],Form("%d>#gamma p_{T}>%d GeV",phoetmin,phoetmax),"");
    }
    else if(icent==2)
    {
      leg_ff_pbpbsub[icent]->AddEntry(rawff_pbpbmc_recoreco[icent],"0.3 < |#eta^{jet}| < 1.6","");
      leg_ff_pbpbsub[icent]->AddEntry(rawff_pbpbmc_recoreco[icent],Form("p_{T}^{jet} > %d GeV",jetptmin),"");
    }
    else if(icent==3)
    {
      leg_ff_pbpbsub[icent]->AddEntry(rawff_pbpbmc_recoreco[icent],"Pythia+Hydjet","");
      leg_ff_pbpbsub[icent]->AddEntry(rawff_pbpbmc_recoreco[icent],"#sigma_{i#eta#eta}<0.10","");
    }
    leg_ff_pbpbsub[icent]->AddEntry(rawff_pbpbmc_recoreco[icent],Form("%s",cents[icent].data()),"");
    leg_ff_pbpbsub[icent]->Draw();
  }

  call->cd(1);
  TH2D * axis_dummy = new TH2D("axis_dummy","",1,0.01,4.99,1,0,yaxismax);
  gStyle->SetFrameLineColor(0);
  axis_dummy->UseCurrentStyle();
  axis_dummy->Draw("FB BB A");

  TLatex * ldndxi = new TLatex(0.4,0.5,"dN/d#xi Raw");
  ldndxi->SetTextSize(ldndxi->GetTextSize()*1.2);
  ldndxi->SetNDC();
  ldndxi->SetTextAngle(90);

  int labelspace = yaxismax / 4;
  const int nlabels = yaxismax/labelspace;
  TLatex * laxis[nlabels];
  for (int ilatex = 0; ilatex < nlabels; ilatex++) {
    laxis[ilatex] = new TLatex(2.,ilatex*labelspace-0.1,Form("%d",ilatex*labelspace));
    laxis[ilatex]->SetTextSize(laxis[ilatex]->GetTextSize()*1.2);
    laxis[ilatex]->Draw();
  }
  ldndxi->Draw();
  call->SaveAs(Form("rawff_%d_%d_jetmixff_jetpt%d_pbpbmc_recoreco.png",phoetmin,phoetmax,jetptmin));
}
开发者ID:velicanu,项目名称:gammajettrack,代码行数:100,代码来源:draw1step.C

示例7: vn_spectra_trackHF


//.........这里部分代码省略.........
  ccorr->cd(1);
  fitfuns1[0]->Draw("Lsame");
  fitfuns1[1]->Draw("Lsame");
  fitfuns1[2]->Draw("Lsame");
  fitfuns1[3]->Draw("Lsame");
  fitfuns1[4]->Draw("Lsame");
  fitfuns1[5]->Draw("Lsame");
  ccorr->cd(2);
  fitfuns2[0]->Draw("Lsame");
  fitfuns2[1]->Draw("Lsame");
  fitfuns2[2]->Draw("Lsame");
  fitfuns2[3]->Draw("Lsame");
  fitfuns2[4]->Draw("Lsame");
  fitfuns2[5]->Draw("Lsame");

  TLegend* legend_corr = new TLegend(0.28,0.63,0.7,0.92);
  legend_corr->SetFillStyle(0);
  legend_corr->SetTextFont(42);
  legend_corr->AddEntry(fitfunc1,"Sum","L");
  legend_corr->AddEntry(fitfuns1[0],"n = 1","L");
  legend_corr->AddEntry(fitfuns1[1],"n = 2","L");
  legend_corr->AddEntry(fitfuns1[2],"n = 3","L");
  legend_corr->AddEntry(fitfuns1[3],"n = 4","L");
  legend_corr->AddEntry(fitfuns1[4],"n = 5","L");  
  legend_corr->AddEntry(fitfuns1[5],"n = 6","L");
  ccorr->cd(1);
  legend_corr->Draw("same");
  ccorr->cd(2);
  legend_corr->Draw("same");

  ccorr->cd(1);
  TLatex* latex_corr = new TLatex();
  latex_corr->SetNDC(1);
  latex_corr->SetTextSize(latex_corr->GetTextSize()*0.8);
  latex_corr->DrawLatex(0.47,0.88,"CMS PbPb  #sqrt{s_{NN}} = 2.76 TeV");
  latex_corr->DrawLatex(0.63,0.82,centtag.Data());
  latex_corr->DrawLatex(0.76,0.76,"|#Delta#eta| > 2");
  ccorr->cd(2);
  TLatex* latex1_corr = new TLatex();
  latex1_corr->SetNDC(1);
  latex1_corr->SetTextSize(latex1_corr->GetTextSize()*0.8);
  latex1_corr->DrawLatex(0.47,0.88,"CMS PbPb  #sqrt{s_{NN}} = 2.76 TeV");
  latex1_corr->DrawLatex(0.63,0.82,centtag.Data());
  latex1_corr->DrawLatex(0.76,0.76,"|#Delta#eta| > 2");  
  ccorr->cd(1);
  TLatex* latex_trg1 = new TLatex();
  latex_trg1->SetNDC(1);
  latex_trg1->SetTextSize(latex_trg1->GetTextSize()*0.8);
  latex_trg1->DrawLatex(0.59,0.635,"1 < p_{T}^{trig} < 3 GeV/c");
  latex_trg1->DrawLatex(0.59,0.57,"1 < p_{T}^{assoc} < 3 GeV/c");
  ccorr->cd(2);
  TLatex* latex_trg2 = new TLatex();
  latex_trg2->SetNDC(1);
  latex_trg2->SetTextSize(latex_trg2->GetTextSize()*0.8);
  latex_trg2->DrawLatex(0.59,0.635,"4 < p_{T}^{trig} < 5 GeV/c");
  latex_trg2->DrawLatex(0.59,0.57,"1 < p_{T}^{assoc} < 3 GeV/c");

  SaveCanvas(ccorr,"HI/UCC",Form("corr1Dfit_%s_centmin%d_centmax%d",tag.Data(),centmin,centmax));
/*
  TCanvas* ccc = new TCanvas("ccc","ccc",900,400);
  ccc->Divide(2,1);
  ccc->cd(1);
  ccc->GetPad(1)->SetLeftMargin(0.3);
  hsignal_ref_1D->GetYaxis()->SetTitleOffset(2.0);
  hsignal_ref_1D->GetYaxis()->CenterTitle();
  hsignal_ref_1D->SetAxisRange(1.5,10.5,"X");
开发者ID:SangeonPark,项目名称:RiceHIG,代码行数:67,代码来源:vn_spectra_trackHF.C

示例8: drawclosureffgamma


//.........这里部分代码省略.........
      leg_ff_pbpbsub[icent]->AddEntry(clone_hgammaffxi_pbpbmc_gen_[icent],"Mixed event","p");
      leg_ff_pbpbsub[icent]->AddEntry(clone_hgammaffxi_pbpbmc_[icent],"Reflected cone","p");
    }
    else if(icent==1)
    {
      // leg_ff_pbpbsub[icent]->AddEntry(clone_hgammaffxi_pbpbmc_[icent],"#eta cone sub","");
      leg_ff_pbpbsub[icent]->AddEntry(clone_hgammaffxi_pbpbmc_[icent],"trk p_{T}>1 GeV, R < 0.3","");
      leg_ff_pbpbsub[icent]->AddEntry(clone_hgammaffxi_pbpbmc_[icent],Form("%d>#gamma p_{T}>%d GeV",phoetmin,phoetmax),"");
    }
    else if(icent==2)
    {
      leg_ff_pbpbsub[icent]->AddEntry(clone_hgammaffxi_pbpbmc_[icent],"0.3 < |#eta^{jet}| < 1.6","");
      leg_ff_pbpbsub[icent]->AddEntry(clone_hgammaffxi_pbpbmc_[icent],"p_{T}^{jet} > 40 GeV","");
    }
    else
    {
      leg_ff_pbpbsub[icent]->AddEntry(clone_hgammaffxi_pbpbmc_[icent],"Pythia+Hydjet","");
      leg_ff_pbpbsub[icent]->AddEntry(clone_hgammaffxi_pbpbmc_[icent],"","");
    }
    leg_ff_pbpbsub[icent]->AddEntry(clone_hgammaffxi_pbpbmc_[icent],Form("%s",cents[icent].data()),"");
    leg_ff_pbpbsub[icent]->Draw();
    // c1_subpbpb[icent]->SaveAs("pbpbmc_gen_pbpbmc_etaconesubtracted_45_gamma_100.png");
    // Eta cone subtracted FF pbpbmc_gen and pbpbmc

  }
  call->cd(1);

  TH2D * axis_dummy = new TH2D("axis_dummy","",1,0.01,4.99,1,0,yaxismax);
  gStyle->SetFrameLineColor(0);
  axis_dummy->UseCurrentStyle();
  axis_dummy->Draw("FB BB A");

  TLatex * ldndxi = new TLatex(0.4,0.5,"dN/d#xi");
  ldndxi->SetTextSize(ldndxi->GetTextSize()*1.2);
  ldndxi->SetNDC();
  ldndxi->SetTextAngle(90);

  TLatex * laxis[yaxismax];
  for (int ilatex = 0; ilatex < yaxismax; ilatex++) {
    laxis[ilatex] = new TLatex(3.,ilatex-0.1,Form("%d",ilatex));
    laxis[ilatex]->SetTextSize(laxis[ilatex]->GetTextSize()*1.2);
    laxis[ilatex]->Draw();
  }
  ldndxi->Draw();

  TCanvas * callratio = new TCanvas("callratio","",1600,500);
  makeMultiPanelCanvas(callratio,6,1,0.02,0.0,-6,0.2,0.04);
  for (int icent = 0; icent < 5; icent++) {
    callratio->cd(icent+2);
    clone2_hgammaffxi_pbpbmc_gen_[icent] = (TH2D*) clone_hgammaffxi_pbpbmc_gen_[icent]->Clone(Form("clone2_hgammaffxi_pbpbmc_gen_%d_%d",centmins[icent],centmaxs[icent]));
    clone2_hgammaffxi_pbpbmc_[icent] = (TH2D*) clone_hgammaffxi_pbpbmc_[icent]->Clone(Form("clone2_hgammaffxi_pbpbmc_%d_%d",centmins[icent],centmaxs[icent]));
    clone2_hgammaffxi_pbpbmc_gen_[icent]->Divide(clone2_hgammaffxi_pbpbmc_[icent]);

    dummy2_pbpbsub[icent] = new TH2D(Form("dummy2_pbpbsub_%d_%d",centmins[icent],centmaxs[icent]),";#xi;dN/d#xi",1,0.01,4.99,1,0,yaxismax2);
    dummy2_pbpbsub[icent]->GetXaxis()->SetTitleOffset(0.8);
    dummy2_pbpbsub[icent]->GetXaxis()->CenterTitle();
    dummy2_pbpbsub[icent]->GetYaxis()->CenterTitle();
    dummy2_pbpbsub[icent]->GetXaxis()->SetTitleSize(dummy2_pbpbsub[icent]->GetXaxis()->GetTitleSize()*1.4);
    dummy2_pbpbsub[icent]->Draw();
    // clone2_hgammaffxi_pbpbmc_gen_[icent]->SetMarkerColor(kViolet);
    clone2_hgammaffxi_pbpbmc_gen_[icent]->SetMarkerColor(kBlack);
    clone2_hgammaffxi_pbpbmc_gen_[icent]->Draw("same");
    TLine * lone = new TLine(0,1,5,1);
    lone->SetLineStyle(9);
    lone->Draw();
开发者ID:velicanu,项目名称:gammajettrack,代码行数:66,代码来源:drawclosureffgamma.C

示例9: dm

void dm(int domc = 0 , int doptweight = 0 , int dotrkpt = 0 , int docent = 0 , int doaj = 0 , int doleadsubleading = 0)
{
  TFile * f1[2][2];  //! [data/mc][no pt weight/pt weight]

  f1[0][0] = new TFile("roots/v29mcgen.root");
  f1[0][1] = new TFile("roots/astdfrank_ptw1.root");
  f1[1][0] = new TFile("roots/v29mcreco.root");
  f1[1][1] = new TFile("roots/stdmc_ptw1.root");


  const int nptbins   = 3;
  const int ncentbins = 4;
  const int najbins   = 1;
  const int nptw      = 1;
  const int ndataset  = 2;
  const int njetindex = 1;


  TH2D *             sig[njetindex][nptbins][ncentbins][najbins][ndataset][nptw];
  TH2D *             bak[njetindex][nptbins][ncentbins][najbins][ndataset][nptw];
  TH2D *            corr[njetindex][nptbins][ncentbins][najbins][ndataset][nptw];
  TH1D *            proj[njetindex][nptbins][ncentbins][najbins][ndataset][nptw];
  TH2D * subtracted_corr[njetindex][nptbins][ncentbins][najbins][ndataset][nptw];
  TH2D *          result[njetindex][nptbins][ncentbins][najbins][ndataset][nptw];


  double leadingjetptlow[] =     {100,100,100,100,100,100,100,100,100};
  double leadingjetpthigh[] =    {300,300,300,300,300,300,300,300,300};
  double subleadingjetptlow[] =  {50 ,50 ,50 ,50 ,50 ,50 ,50 ,50 ,50 };
  double subleadingjetpthigh[] = {300,300,300,300,300,300,300,300,300};
  double ptasslow[] =            {1,  2  ,4  ,5  ,3  ,3  ,1  ,2  ,3  };
  double ptasshigh[] =           {2,  4  ,8  ,8  ,4  ,4  ,2  ,3  ,4  };

  int centmin[] = {0,4,12,20};
  int centmax[] = {4,12,20,40};

  float ajmin[] = { 0.00, 0.13, 0.24, 0.35 };
  float ajmax[] = { 0.13, 0.24, 0.35, 1.00 };

  TString jetname[] = { "leading" , "subleading" };
  TString ljetname[] = { "inclusive" , "subleading" };
  TString ptweight[] = { "" , "p_{T} weighted" };
  TString datamclumi[] = { "L_{int} = 129 #mub^{-1} " , "MC #hat{p}_{T}=100 embedded 377K evts" };
  TString datamc[] = { "PbPb  #sqrt{s_{NN}} = 2.76 TeV " , "" };

  for(int dataset = 0 ; dataset < ndataset ; ++dataset)
  {
    for(int ptw = 0 ; ptw < nptw ; ++ptw)
    {
      for(int ptbin = 0 ; ptbin < nptbins ; ++ptbin)
      {
        for(int cent = 0 ; cent < ncentbins ; ++cent)
        {
          for(int aj = 0 ; aj < najbins ; ++aj)
          {
            for(int jetindex = 0 ; jetindex < njetindex ; ++jetindex)
            {
              if(cent==1) cout<<Form("signal_%sjet%d_%d_ass%d_%d_cmin%d_cmax%d_ajmin%d_ajmax%d_ismc%d_isptweighted%d",jetname[jetindex].Data(),(int)leadingjetptlow[ptbin],(int)leadingjetpthigh[ptbin],(int)ptasslow[ptbin],(int)ptasshigh[ptbin],centmin[cent],centmax[cent],(int)(ajmin[aj]*100),(int)(ajmax[aj]*100),dataset,ptw)<<endl;
              sig[jetindex][ptbin][cent][aj][dataset][ptw] = (TH2D*)f1[dataset][ptw]->Get(Form("signal_%sjet%d_%d_ass%d_%d_cmin%d_cmax%d_ajmin%d_ajmax%d",jetname[jetindex].Data(),(int)leadingjetptlow[ptbin],(int)leadingjetpthigh[ptbin],(int)ptasslow[ptbin],(int)ptasshigh[ptbin],centmin[cent],centmax[cent],(int)(ajmin[aj]*100),(int)(ajmax[aj]*100)));
              bak[jetindex][ptbin][cent][aj][dataset][ptw] = (TH2D*)f1[dataset][ptw]->Get(Form("background_%sjet%d_%d_ass%d_%d_cmin%d_cmax%d_ajmin%d_ajmax%d",jetname[jetindex].Data(),(int)leadingjetptlow[ptbin],(int)leadingjetpthigh[ptbin],(int)ptasslow[ptbin],(int)ptasshigh[ptbin],centmin[cent],centmax[cent],(int)(ajmin[aj]*100),(int)(ajmax[aj]*100)));

              
              
              // if( doleadsubleading==0 ) break; //! jetindex
            }
            // if( doaj==0 ) break; //! ajbin
          }
          // if( docent==0 ) break; //! centbin
        }
        // if( dotrkpt==0 ) break;  //! ass trk pt bin
      }
      // if( doptweight==0 ) break;  //! pt weight
    }
    // if( domc==0 ) break;  //! dataset
  }
  int jetindex = 0 , ptbin = 0 , cent = 0 , aj = 0 , ptw = 0, dataset = 0;
  // cout<<Form("signal_%sjet%d_%d_ass%d_%d_cmin%d_cmax%d_ajmin%d_ajmax%d_ismc%d_isptweighted%d",jetname[jetindex].Data(),(int)leadingjetptlow[ptbin],(int)leadingjetpthigh[ptbin],(int)ptasslow[ptbin],(int)ptasshigh[ptbin],centmin[cent],centmax[cent],(int)(ajmin[aj]*100),(int)(ajmax[aj]*100),dataset,ptw)<<endl;
  
  for(int i = 0 ; i < 1 ; ++i)
  {
    //! Define the latex
    TLatex * lpreliminary = new TLatex( 0.02 , 0.03, Form("CMS Preliminary   %s   %s",datamc[dataset].Data(),datamclumi[dataset].Data()) );
    lpreliminary->SetNDC(1);
    lpreliminary->SetTextSize(lpreliminary->GetTextSize()*1.1);
    
    TLatex * lsigtitle = new TLatex( 0.0073 ,0.9557, Form("gen signal / reco signal"));
    lsigtitle->SetNDC(1);
    lsigtitle->SetTextSize(lsigtitle->GetTextSize()*1.1);
    
    // TLatex * lbaktitle = new TLatex( 0.0073 ,0.9557, Form("background %s",ljetname[jetindex].Data()));
    // lbaktitle->SetNDC(1);
    // lbaktitle->SetTextSize(lbaktitle->GetTextSize()*1.1);

    // TLatex * lcorrtitle = new TLatex( 0.0073 ,0.9557, Form("correlation function %s",ljetname[jetindex].Data()));
    // lcorrtitle->SetNDC(1);
    // lcorrtitle->SetTextSize(lcorrtitle->GetTextSize()*1.1);

    // TLatex * llrsubtitle = new TLatex( 0.0073 ,0.9557, Form("long range sub CF %s",ljetname[jetindex].Data()));
    // llrsubtitle->SetNDC(1);
    // llrsubtitle->SetTextSize(llrsubtitle->GetTextSize()*1.1);
//.........这里部分代码省略.........
开发者ID:velicanu,项目名称:UserCode,代码行数:101,代码来源:dm.C

示例10: pileup1

void pileup1(double dzmin, double dzmax)
{
  TH1D* hdz = (TH1D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/PAData_Minbias_5TeV/merged/PAData_Minbias_5TeV_MBNEW_INCLMULT_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","xyzvtxsepmin");
  TH3D* h1 = (TH3D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/PAData_Minbias_5TeV/merged/PAData_Minbias_5TeV_MBNEW_INCLMULT_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","multmaxvssecvszvtxsep"); 
  TH2D* h21 = (TH2D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/PAData_Minbias_5TeV/merged/PAData_Minbias_5TeV_MBNEW_INCLMULT_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","multmaxvssec");
  TH2D* hNvtxVsMult = (TH2D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/PAData_Minbias_5TeV/merged/PAData_Minbias_5TeV_MBNEW_INCLMULT_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","nvtxvsnmult");

  TH1D* htrk_max1 = h1->ProjectionX();
  h1->GetZaxis()->SetRange(h1->GetZaxis()->FindBin(dzmin),h1->GetZaxis()->FindBin(dzmax));
  h1->GetYaxis()->SetRange(h1->GetYaxis()->FindBin(2),h1->GetYaxis()->FindBin(50));
  TH2D* h2D1 = (TH2D*)h1->Project3DProfile("yx100");
  h2D1->Rebin2D(5,1);
  TProfile* hprof1_x = (TProfile*)h2D1->ProfileX("hprof1_x",-1,-1,"s");
  TH1D* h1D1 = (TH1D*)h2D1->ProjectionY("h1D1",13,15,"e");
/*
  TH1D* hdz = (TH1D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/HIData_Minbias_2760GeV/merged/HIData_Minbias_2760GeV_PPRereco_INCLMULT_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","xyzvtxsepmin");
  TH3D* h = (TH3D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/HIData_Minbias_2760GeV/merged/HIData_Minbias_2760GeV_PPRereco_INCLMULT_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","multmaxvssecvszvtxsep");
  TH2D* h2 = (TH2D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/HIData_Minbias_2760GeV/merged/HIData_Minbias_2760GeV_PPRereco_INCLMULT_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","multmaxvssec");
  TH2D* hNvtxVsMult = (TH2D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/HIData_Minbias_2760GeV/merged/HIData_Minbias_2760GeV_PPRereco_INCLMULT_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","nvtxvsnmult");
*/

  TH1D* hdz = (TH1D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/HydjetReco_Minbias_2760GeV/merged/HydjetReco_Minbias_2760GeV_PeripheralNew_INCLMULT_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","xyzvtxsepmin");
  TH3D* h = (TH3D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/HydjetReco_Minbias_2760GeV/merged/HydjetReco_Minbias_2760GeV_PeripheralNew_INCLMULT_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","multmaxvssecvszvtxsep");
  TH2D* h2 = (TH2D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/HydjetReco_Minbias_2760GeV/merged/HydjetReco_Minbias_2760GeV_PeripheralNew_INCLMULT_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","multmaxvssec");
  TH2D* hNvtxVsMult = (TH2D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/HydjetReco_Minbias_2760GeV/merged/HydjetReco_Minbias_2760GeV_PeripheralNew_INCLMULT_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","nvtxvsnmult");

/*
  TH1D* hdz = (TH1D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/HijingReco_Minbias_2760GeV/merged/HijingReco_Minbias_2760GeV_53x_INCLMULT_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","xyzvtxsepmin");
  TH3D* h = (TH3D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/HijingReco_Minbias_2760GeV/merged/HijingReco_Minbias_2760GeV_53x_INCLMULT_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","multmaxvssecvszvtxsep");
  TH2D* hNvtxVsMult = (TH2D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/HijingReco_Minbias_2760GeV/merged/HijingReco_Minbias_2760GeV_53x_INCLMULT_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","nvtxvsnmult");
*/
/*
  TH1D* hdz = (TH1D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/PAData_Minbias_5TeV/merged/PAData_Minbias_5TeV_MBNEW_INCLMULT_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","xyzvtxsepmin");
  TH3D* h = (TH3D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/PAData_Minbias_5TeV/merged/PAData_Minbias_5TeV_MBNEW_INCLMULT_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","multmaxvssecvszvtxsep"); 
  TH2D* h2 = (TH2D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/PAData_Minbias_5TeV/merged/PAData_Minbias_5TeV_MBNEW_INCLMULT_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","multmaxvssec");
  TH2D* hNvtxVsMult = (TH2D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/PAData_Minbias_5TeV/merged/PAData_Minbias_5TeV_MBNEW_INCLMULT_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","nvtxvsnmult");
*/
/*
  TH1D* hdz = (TH1D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/PAData_Minbias_5TeV/merged/PAData_Minbias_5TeV_HM_PromptSkim_INCLMULT220_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","xyzvtxsepmin");
  TH3D* h = (TH3D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/PAData_Minbias_5TeV/merged/PAData_Minbias_5TeV_HM_PromptSkim_INCLMULT220_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","multmaxvssecvszvtxsep"); 
  TH2D* h2 = (TH2D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/PAData_Minbias_5TeV/merged/PAData_Minbias_5TeV_HM_PromptSkim_INCLMULT220_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","multmaxvssec"); 
  TH2D* hNvtxVsMult = (TH2D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/PAData_Minbias_5TeV/merged/PAData_Minbias_5TeV_HM_PromptSkim_INCLMULT220_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","nvtxvsnmult");
*/
/*
  TH1D* hdz = (TH1D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/PAData_Minbias_5TeV/merged/PAData_Minbias_5TeV_HM_PromptRecoNew_INCLMULT220PURej2sigmaMode1_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","xyzvtxsepmin");
  TH3D* h = (TH3D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/PAData_Minbias_5TeV/merged/PAData_Minbias_5TeV_HM_PromptRecoNew_INCLMULT220PURej2sigmaMode1_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","multmaxvssecvszvtxsep"); 
  TH2D* h2 = (TH2D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/PAData_Minbias_5TeV/merged/PAData_Minbias_5TeV_HM_PromptRecoNew_INCLMULT220PURej2sigmaMode1_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","multmaxvssec"); 
  TH2D* hNvtxVsMult = (TH2D*)GetHist("/net/hisrv0001/home/davidlw/scratch1/DiHadronCorrelations/outputs_312/PAData_Minbias_5TeV/merged/PAData_Minbias_5TeV_HM_PromptRecoNew_INCLMULT220PURej2sigmaMode1_nmin-1_nmax-1_etatrg-2.4-2.4_etaass-2.4-2.4_centmin-1_centmax-1.root","nvtxvsnmult");
*/
  TH1D* htrk_max = h->ProjectionX();
  h->GetZaxis()->SetRange(h->GetZaxis()->FindBin(dzmin),h->GetZaxis()->FindBin(dzmax));
  h->GetYaxis()->SetRange(h->GetYaxis()->FindBin(2),h->GetYaxis()->FindBin(241));
//  h->Rebin3D(10,1);
  TH2D* h2D = (TH2D*)h->Project3DProfile("yx");
  h2D->Rebin2D(5,1);
  TProfile* hprof_x = (TProfile*)h2D->ProfileX("hprof_x",-1,-1,"s");
//  TH1D* h1D = (TH1D*)h2D->ProjectionY("h1D",h2D->GetXaxis()->FindBin(200),h2D->GetXaxis()->FindBin(220),"e");
  TH1D* h1D = (TH1D*)h2->ProjectionY("h1D",h2->GetXaxis()->FindBin(200),h2->GetXaxis()->FindBin(220),"e");
   
  double xx[1000];
  double yy[1000];
  for(int i=1;i<=hprof_x->GetNbinsX();i++)
  {
    yy[i-1] = hprof_x->GetBinContent(i)+2*hprof_x->GetBinError(i);
    xx[i-1] = hprof_x->GetBinCenter(i);
  }

  TGraph* xx_yy = new TGraph(hprof_x->GetNbinsX(),xx,yy);

  int ibin = hprof_x->GetXaxis()->FindBin(200);
/*
  TF1* func = new TF1("func","[0]+[1]*x",0,500);
  double par1 = (hprof_x->GetBinContent(ibin)+hprof_x->GetBinError(ibin)-hprof_x->GetBinContent(1)-hprof_x->GetBinError(1))/(hprof_x->GetBinCenter(ibin)-hprof_x->GetBinCenter(1));
  double par0 = hprof_x->GetBinContent(ibin)+hprof_x->GetBinError(ibin)-par1*hprof_x->GetBinCenter(ibin);
  func->SetParameters(par0,par1);
*/
//  TF1* func = new TF1("func","[0]+[1]*(x-[2])*(x-[2])",0,500);
//  func->SetParameters(30,-0.1,150);
  TF1* func = new TF1("func","[0]*x**[1]",0,500);
  func->SetParameters(0.1,0.5);
  func->SetParLimits(0,0,10000);
  func->SetParLimits(1,0,10000);
//  func->FixParameter(0,5); small dz
  func->FixParameter(0,2);
  xx_yy->Fit("func","NO","",10,400);

  TCanvas* cc6 = new TCanvas("cc6","cc6",550,500);
  TH2D* htmp = new TH2D("htmp",";N_{trk}^{primary};N_{trk}^{secondary}",500,0,500,50,0,50);
  htmp->Draw("");
  xx_yy->Draw("Psame");
  func->SetLineColor(2);
  func->Draw("Lsame");
  TLatex* latex = new TLatex();
  latex->SetNDC();
  latex->SetTextSize(latex->GetTextSize()*0.75);
  latex->DrawLatex(0.23,0.87,"PbPb HYDJET, 1<|dz|<2 cm");
//  SaveCanvas(cc6,"pPb/corr","NpriVsNsecProfile_2Sigma_hydjet_dz1020_ForAN");

  TCanvas* cc4 = new TCanvas("cc4","cc4",550,500);
  cc4->SetLogz();
//.........这里部分代码省略.........
开发者ID:CmsHI,项目名称:CVS_CmsHi,代码行数:101,代码来源:pileup.C

示例11: Factorization_eta_pPb


//.........这里部分代码省略.........
  makeMultiPanelCanvas(c,2,2,0.01,0.0,0.2,0.18,0.02);
  TH2D* htmp = new TH2D("htmp",";#eta^{a};#sqrt{r_{2}(-#eta^{a},-#eta^{b}) #times r_{2}(#eta^{a},#eta^{b})}",100,-0.1,2.5,100,0.601,1.06);
  fixedFontHist(htmp,1.8,2.1);
  htmp->GetXaxis()->CenterTitle();
  htmp->GetYaxis()->CenterTitle();
  htmp->GetYaxis()->SetTitleSize(htmp->GetYaxis()->GetTitleSize()*1.2);
  htmp->GetXaxis()->SetTitleSize(htmp->GetXaxis()->GetTitleSize()*1.);
  for(int jj=0;jj<4;jj++)
  {
    c->cd(jj+1);
    htmp->Draw();
    ll->Draw("Lsame");

    gr_tot[jj][1]->SetMarkerStyle(25);
    gr_tot[jj][1]->Draw("Psame");
    fit[jj][1]->Draw("Lsame");

    gr_tot[jj+5][1]->SetMarkerStyle(24);
    gr_tot[jj+5][1]->Draw("Psame");

    gr_tot[jj+10][1]->SetMarkerStyle(28);
    gr_tot[jj+10][1]->SetMarkerColor(1);
    gr_tot[jj+10][1]->Draw("Psame");

/*
    gr_tot[jj+8][1]->SetMarkerStyle(28);
    fit[jj+8][1]->SetLineStyle(9);
    gr_tot[jj+8][1]->Draw("Psame");
    fit[jj+8][1]->Draw("Lsame");
*/
  }
  TLatex* latex = new TLatex();
  latex->SetNDC();
  latex->SetTextSize(1.3*latex->GetTextSize());
  c->cd(1);
  latex->DrawLatex(0.27,0.05,histtitle[0]);
//  latex->DrawLatex(0.58,0.74,"0.3 < p_{T}^{a} < 3 GeV/c");
//  latex->DrawLatex(0.58,0.65,"p_{T}^{b} > 0 GeV/c");
  latex->DrawLatex(0.24,0.885,"CMS pPb #sqrt{s_{NN}} = 5.02 TeV");
  latex->DrawLatex(0.68,0.7,"L_{int} = 35 nb^{-1}");
  c->cd(2);
  latex->DrawLatex(0.12,0.27,"0.3 < p_{T}^{a} < 3 GeV/c");
  latex->DrawLatex(0.12,0.18,"p_{T}^{b} > 0 GeV/c");
  latex->DrawLatex(0.09,0.05,histtitle[1]);
  c->cd(4);
  latex->SetTextSize(0.9*latex->GetTextSize());
  latex->DrawLatex(0.09,0.22,histtitle[3]);
  latex->SetTextSize(latex->GetTextSize()/0.9);
  c->cd(3);
  latex->SetTextSize(0.85*latex->GetTextSize());
  latex->DrawLatex(0.27,0.22,histtitle[2]);

  TLegend* legend = new TLegend(0.25,0.18,0.62,0.39);
  legend->SetFillStyle(0);
//  legend->AddEntry(gr_tot[8][1],"4.4<#eta^{b}<5","P");
  legend->AddEntry(gr_tot[0][1],"4.4<#eta^{b}<5","P");
//  legend->AddEntry(fit[0][1],"Exponential fit","L");
  legend->AddEntry(gr_tot[10][1],"4<#eta^{b}<5","P");  
  legend->AddEntry(gr_tot[5][1],"3<#eta^{b}<4","P");
//  legend->AddEntry(fit[4][1],"Exponential fit","L");

  c->cd(1);  
  legend->Draw();

  TLine* ll = new TLine(0,1.,5.0,1.);
  TCanvas* ca = new TCanvas("ca","ca",560,500);
开发者ID:SangeonPark,项目名称:RiceHIG,代码行数:67,代码来源:Factorization_eta_pPb.C

示例12: drawcentffgamma


//.........这里部分代码省略.........

    // Eta cone subtracted FF pbpbdata and pbpbmc
    // c1_subpbpb[icent] = new TCanvas(Form("c1_subpbpb_%d_%d",centmins[icent],centmaxs[icent]));
    // call->cd(icent+2);
    call->cd(icent+2);
    dummy_pbpbsub[icent] = new TH2D(Form("dummy_pbpbsub_%d_%d",centmins[icent],centmaxs[icent]),";#xi;dN/d#xi",1,0.01,4.99,1,0,yaxismax);
    dummy_pbpbsub[icent]->GetXaxis()->SetTitleOffset(0.8);
    dummy_pbpbsub[icent]->GetXaxis()->CenterTitle();
    dummy_pbpbsub[icent]->GetYaxis()->CenterTitle();
    // if(icent!=0)
    // {
      dummy_pbpbsub[icent]->GetXaxis()->SetTitleSize(dummy_pbpbsub[icent]->GetXaxis()->GetTitleSize()*1.5);
    // }

    clone_hgammaffxi_refcone_pbpbdata_[icent] = (TH1D*) hgammaffxi_refcone_pbpbdata_[icent]->Clone(Form("clone_hgammaffxi_refcone_pbpbdata__%d_%d",centmins[icent],centmaxs[icent]));
    clone_hgammaffxi_refcone_pbpbdata_[icent]->Scale(-1);
    clone_hgammaffxi_pbpbdata_[icent] = (TH1D*) hgammaffxi_pbpbdata_[icent]->Clone(Form("clone_hgammaffxi_pbpbdata__%d_%d",centmins[icent],centmaxs[icent]));
    clone_hgammaffxi_pbpbdata_[icent]->Add(clone_hgammaffxi_refcone_pbpbdata_[icent]);

    clone_hgammaffxi_refcone_pbpbmc_[icent] = (TH1D*) hgammaffxi_refcone_pbpbmc_[icent]->Clone(Form("clone_hgammaffxi_refcone_pbpbmc__%d_%d",centmins[icent],centmaxs[icent]));
    clone_hgammaffxi_refcone_pbpbmc_[icent]->Scale(-1);
    clone_hgammaffxi_pbpbmc_[icent] = (TH1D*) hgammaffxi_pbpbmc_[icent]->Clone(Form("clone_hgammaffxi_pbpbmc__%d_%d",centmins[icent],centmaxs[icent]));
    clone_hgammaffxi_pbpbmc_[icent]->Add(clone_hgammaffxi_refcone_pbpbmc_[icent]);
    clone_hgammaffxi_pbpbmc_[icent]->SetMarkerColor(kRed);
    // fixedFontHist(dummy_pbpbsub[icent]);
    dummy_pbpbsub[icent]->Draw();
    clone_hgammaffxi_pbpbdata_[icent]->Draw("same");
    // hgammaffxi_pbpbmc_[icent]->Draw("same");
    // hgammaffxi_refcone_pbpbmc_[icent]->Draw("same");
    clone_hgammaffxi_pbpbmc_[icent]->Draw("same");
    if(icent==0)
    {
      // leg_ff_pbpbsub[icent] = new TLegend(0.25,0.697,0.875,0.92);
      leg_ff_pbpbsub[icent] = new TLegend(0.05,0.697,0.27,0.92);
      leg_ff_pbpbsub[icent]->SetTextSize(0.05*1.3);
    }
    else
    {
      leg_ff_pbpbsub[icent] = new TLegend(0,0.697,0.27,0.92);
      // leg_ff_pbpbsub[icent]->SetTextSize(0.05*1.2);
      leg_ff_pbpbsub[icent]->SetTextSize(0.05*1.3);
    }
    leg_ff_pbpbsub[icent]->SetFillColor(0);
    leg_ff_pbpbsub[icent]->SetFillStyle(0);
    leg_ff_pbpbsub[icent]->SetTextFont(42);
    if(icent==0)
    {
      leg_ff_pbpbsub[icent]->AddEntry(clone_hgammaffxi_pbpbdata_[icent],"PbPb #sqrt{s_{NN}}=5 TeV","p");
      leg_ff_pbpbsub[icent]->AddEntry(clone_hgammaffxi_pbpbmc_[icent],"Pythia+Hydjet","p");
    }
    else if(icent==1)
    {
      // leg_ff_pbpbsub[icent]->AddEntry(clone_hgammaffxi_pbpbmc_[icent],"#eta cone sub","");
      leg_ff_pbpbsub[icent]->AddEntry(clone_hgammaffxi_pbpbmc_[icent],"trk p_{T}>1 GeV, R < 0.3","");
      leg_ff_pbpbsub[icent]->AddEntry(clone_hgammaffxi_pbpbmc_[icent],"100>#gamma p_{T}>300 GeV","");
    }
    else if(icent==2)
    {
      leg_ff_pbpbsub[icent]->AddEntry(clone_hgammaffxi_pbpbmc_[icent],"0.3 < |#eta^{jet}| < 1.6","");
      leg_ff_pbpbsub[icent]->AddEntry(clone_hgammaffxi_pbpbmc_[icent],"p_{T}^{jet} > 40 GeV","");
    }
    else
    {
      leg_ff_pbpbsub[icent]->AddEntry(clone_hgammaffxi_pbpbmc_[icent],"","");
      leg_ff_pbpbsub[icent]->AddEntry(clone_hgammaffxi_pbpbmc_[icent],"","");
    }
    leg_ff_pbpbsub[icent]->AddEntry(clone_hgammaffxi_pbpbmc_[icent],Form("%s",cents[icent].data()),"");
    leg_ff_pbpbsub[icent]->Draw();
    // c1_subpbpb[icent]->SaveAs("pbpbdata_pbpbmc_etaconesubtracted_45_gamma_100.png");
    // Eta cone subtracted FF pbpbdata and pbpbmc

  }
  call->cd(1);

  TH2D * axis_dummy = new TH2D("axis_dummy","",1,0.01,4.99,1,0,yaxismax);
  gStyle->SetFrameLineColor(0);
  axis_dummy->UseCurrentStyle();
  axis_dummy->Draw("FB BB A");

  TLatex * ldndxi = new TLatex(0.4,0.5,"dN/d#xi");
  ldndxi->SetTextSize(ldndxi->GetTextSize()*1.3);
  ldndxi->SetNDC();
  ldndxi->SetTextAngle(90);

  TLatex * laxis[yaxismax];
  for (int ilatex = 0; ilatex < yaxismax; ilatex++) {
    laxis[ilatex] = new TLatex(3.,ilatex-0.1,Form("%d",ilatex));
    laxis[ilatex]->SetTextSize(laxis[ilatex]->GetTextSize()*1.3);
    laxis[ilatex]->Draw();
  }
  ldndxi->Draw();

  
  // call->cd(1);
  // TLatex * ldndxi = new TLatex(0.7,0.5,"dN/d#xi");
  // ldndxi->SetTextSize(ldndxi->GetTextSize()*1.2);
  // ldndxi->SetNDC();
  // ldndxi->SetTextAngle(90);
  // ldndxi->Draw();
}
开发者ID:velicanu,项目名称:gammajettrack,代码行数:101,代码来源:drawcentffgamma.C

示例13: xjg1step


//.........这里部分代码省略.........
  makeMultiPanelCanvas(c1,5,1,0.02,0.0,-6,0.2,0.04);


  for (int icent = 0; icent < nCentBins; icent++) {
    c1->cd(2+icent);
    xjgsignal_pbpbdata_recoreco[icent] = (TH1D*) _file0->Get(Form("xjgsignal_pbpbdata_recoreco_%d_%d",centmins[icent],centmaxs[icent]));
    xjgmixsignal_pbpbdata_recoreco[icent] = (TH1D*) _file0->Get(Form("xjgmixsignal_pbpbdata_recoreco_%d_%d",centmins[icent],centmaxs[icent]));
    phoetsignal_pbpbdata_recoreco[icent] = (TH1D*) _file0->Get(Form("phoetsignal_pbpbdata_recoreco_%d_%d",centmins[icent],centmaxs[icent]));
    xjgsideband_pbpbdata_recoreco[icent] = (TH1D*) _file0->Get(Form("xjgsideband_pbpbdata_recoreco_%d_%d",centmins[icent],centmaxs[icent]));
    xjgmixsideband_pbpbdata_recoreco[icent] = (TH1D*) _file0->Get(Form("xjgmixsideband_pbpbdata_recoreco_%d_%d",centmins[icent],centmaxs[icent]));
    phoetsideband_pbpbdata_recoreco[icent] = (TH1D*) _file0->Get(Form("phoetsideband_pbpbdata_recoreco_%d_%d",centmins[icent],centmaxs[icent]));
    h1D_xjg_ptBin1_hiBin_phoSIG_jetSIG_final_norm[icent] = (TH1D*) _fran->Get(Form("HI/h1D_xjg_ptBin1_hiBin%d_phoRAW_jetRAW_final_norm",icent+3));

    xjgsignal_pbpbdata_recoreco[icent]->Sumw2();
    xjgmixsignal_pbpbdata_recoreco[icent]->Sumw2();
    xjgsideband_pbpbdata_recoreco[icent]->Sumw2();
    xjgmixsideband_pbpbdata_recoreco[icent]->Sumw2();

    float nphosignal = phoetsignal_pbpbdata_recoreco[icent]->Integral();
    float nphosideband = phoetsideband_pbpbdata_recoreco[icent]->Integral();
    float binwidth = xjgsignal_pbpbdata_recoreco[icent]->GetBinWidth(1);

    dummy[icent] = new TH2D(Form("dummy_%d_%d",centmins[icent],centmaxs[icent]),";x_{J#gamma};1/N#gamma dN/dx_{J#gamma}",1,0.01,1.99,1,0,yaxismax);
    dummy[icent]->GetXaxis()->SetTitleOffset(0.8);
    dummy[icent]->GetXaxis()->CenterTitle();
    dummy[icent]->GetYaxis()->CenterTitle();
    dummy[icent]->GetXaxis()->SetTitleSize(dummy[icent]->GetXaxis()->GetTitleSize()*1.4);
    dummy[icent]->Draw();

    xjgsignal_pbpbdata_recoreco[icent]->Scale(1.0/(binwidth*nphosignal));
    xjgmixsignal_pbpbdata_recoreco[icent]->Scale(1.0/(binwidth*nphosignal));
    // xjgmixsignal_pbpbdata_recoreco[icent]->Draw("same");
    h1D_xjg_ptBin1_hiBin_phoSIG_jetSIG_final_norm[icent]->SetMarkerStyle(24);
    h1D_xjg_ptBin1_hiBin_phoSIG_jetSIG_final_norm[icent]->SetMarkerColor(kRed);
    xjgsignal_pbpbdata_recoreco[icent]->Divide(h1D_xjg_ptBin1_hiBin_phoSIG_jetSIG_final_norm[icent]);
    xjgsignal_pbpbdata_recoreco[icent]->Draw("same");
    // h1D_xjg_ptBin1_hiBin_phoSIG_jetSIG_final_norm[icent]->Draw("same");

    if(icent==0)
    {
      leg[icent] = new TLegend(0.03,0.697,0.3,0.92);
    }
    else
    {
      leg[icent] = new TLegend(0,0.697,0.27,0.92);
    }
    leg[icent]->SetTextSize(0.05*1.3);
    leg[icent]->SetFillColor(0);
    leg[icent]->SetFillStyle(0);
    leg[icent]->SetTextFont(42);
    if(icent==0)
    {
      leg[icent]->AddEntry(xjgsignal_pbpbdata_recoreco[icent],"PbPb #sqrt{s_{NN}}=5 TeV","p");
      leg[icent]->AddEntry(h1D_xjg_ptBin1_hiBin_phoSIG_jetSIG_final_norm[icent],"HIN-16-002","p");
    }
    else if(icent==1)
    {
      leg[icent]->AddEntry(xjgsignal_pbpbdata_recoreco[icent],Form("%d>#gamma p_{T}>%d GeV",phoetmin,phoetmax),"");
      leg[icent]->AddEntry(xjgsignal_pbpbdata_recoreco[icent],"#sigma_{I#eta#eta}<0.1","");
    }
    else if(icent==2)
    {
      leg[icent]->AddEntry(xjgsignal_pbpbdata_recoreco[icent],"|#eta^{jet}| < 1.6","");
      leg[icent]->AddEntry(xjgsignal_pbpbdata_recoreco[icent],Form("p_{T}^{jet} > %d GeV",jetptmin),"");
    }
    else if(icent==3)
    {
      leg[icent]->AddEntry(xjgsignal_pbpbdata_recoreco[icent],"","");
      leg[icent]->AddEntry(xjgsignal_pbpbdata_recoreco[icent],"","");
    }
    leg[icent]->AddEntry(xjgsignal_pbpbdata_recoreco[icent],Form("%s",cents[icent].data()),"");

    leg[icent]->Draw();
  }

  c1->cd(1);
  TH2D * axis_dummy = new TH2D("axis_dummy","",1,0.01,1.99,1,0,yaxismax);
  gStyle->SetFrameLineColor(0);
  axis_dummy->UseCurrentStyle();
  axis_dummy->Draw("FB BB A");

  TLatex * ldndxi = new TLatex(0.4,0.27,"1/N#gamma dN/dx_{J#gamma} Raw Signal");
  ldndxi->SetTextSize(ldndxi->GetTextSize()*1.2);
  ldndxi->SetNDC();
  ldndxi->SetTextAngle(90);
  ldndxi->Draw();

  // float labelspace = yaxismax / 4.0;
  const int nlabels = 5;
  float fylabels[] = {0,0.5,1,1.5,2};
  string sylabels[] = {"0",".5","1","1.5","2"};
  TLatex * laxis[nlabels];
  for (int ilatex = 0; ilatex < nlabels; ilatex++) {
    laxis[ilatex] = new TLatex(0.9,fylabels[ilatex]-0.1,Form("%s",sylabels[ilatex].data()));
    laxis[ilatex]->SetTextSize(laxis[ilatex]->GetTextSize()*1.3);
    laxis[ilatex]->Draw();
  }

  c1->SaveAs("xjg_step1_allsubtractions.png");
}
开发者ID:velicanu,项目名称:gammajettrack,代码行数:101,代码来源:xjg1step.C


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