• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TPaveText类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: DrawCMSLabels

// Draw statistics info above plot
void DrawCMSLabels(double lumi, double energy, double textSize) {

  //const char *text = "%2.1f #times 10^{6} clusters (fiducial) (%1.1f GeV)";
  const char *text;
  if(lumi > 10000000) {
    lumi /= 10000000;
    text = "%2.1f #times 10^{7} tracks (%1.1f GeV)";
  }
  else {
    lumi /= 1000000;
    text = "%2.1f #times 10^{6} tracks (%1.1f GeV)";
  }
    
  TPaveText *label = new TPaveText();
  label->SetX1NDC(gStyle->GetPadLeftMargin());
  label->SetY1NDC(1.0-gStyle->GetPadTopMargin());
  label->SetX2NDC(1.0-gStyle->GetPadRightMargin());
  label->SetY2NDC(1.0);
  label->SetTextFont(42);
  label->AddText(Form(text, lumi, energy));
  label->SetFillStyle(0);
  label->SetBorderSize(0);
  if (textSize!=0) label->SetTextSize(textSize);
  label->SetTextAlign(32);
  label->Draw("same");
}
开发者ID:schuetzepaul,项目名称:testbeam-analysis,代码行数:27,代码来源:plotter.C


示例2: drawMassPlot

void drawMassPlot( const std::string& dirName, const std::string& category, TH1D* h1_data, TH1D* h1_thq, TH1D* h1_ggh, TH1D* h1_vbf, TH1D* h1_wzh, TH1D* h1_tth, const std::string& suffix ) {

  DrawBase* db = new DrawBase("mgg");
  db->set_lumi(19700.);
  TFile* dummyFile = TFile::Open("dummy.root", "recreate");
  db->add_dataFile(dummyFile, "Data");


  TGraphAsymmErrors* gr_data = fitTools::getGraphPoissonErrors( h1_data, false );
  gr_data->SetMarkerStyle(20);  
  gr_data->SetMarkerSize(1.3);  

  
  h1_thq->SetFillColor(kWhite);
  h1_tth->SetFillColor(kGray);
  h1_wzh->SetFillColor(28);
  h1_vbf->SetFillColor(90);
  h1_ggh->SetFillColor(46);

  h1_thq->SetLineColor(kBlack);
  h1_tth->SetLineColor(kBlack);
  h1_wzh->SetLineColor(kBlack);
  h1_vbf->SetLineColor(kBlack);
  h1_ggh->SetLineColor(kBlack);


  TString category_tstr(category);
  bool isLeptonic = category_tstr.Contains("leptonic");

  THStack stack;
  if( !isLeptonic ) {
    stack.Add(h1_ggh);
    stack.Add(h1_vbf);
  }
  stack.Add(h1_wzh);
  stack.Add(h1_tth);
  stack.Add(h1_thq);



  std::string channelName_legend = (isLeptonic) ? "Leptonic Channel" : "Hadronic Channel";

  float yMin_leg = (isLeptonic) ? 0.9-4.*0.07 : 0.9-6.*0.07;
  TLegend* legend = new TLegend( 0.62, yMin_leg, 0.9, 0.92, channelName_legend.c_str() );
  legend->SetTextFont(42);
  legend->SetFillColor(kWhite);
  legend->SetTextSize(0.038);
  legend->SetTextColor(kBlack);
  if( useCS )
    legend->AddEntry( gr_data, "Data CS", "P" );
  else
    legend->AddEntry( gr_data, "Data", "P" );
  legend->AddEntry( h1_thq, "tHq (Ct = -1)", "F" );
  legend->AddEntry( h1_tth, "ttH (125)", "F" );
  legend->AddEntry( h1_wzh, "VH (125)", "F" );
  if( !isLeptonic ) {
    legend->AddEntry( h1_vbf, "VBF H (125)", "F" );
    legend->AddEntry( h1_ggh, "ggF H (125)", "F" );
  }


  float yMax = 0.;
  float yMax_data = h1_data->GetMaximum();
  if( yMax_data>0. ) {
    if( yMax_data < 1.5 ) yMax=3.5;
    else if( yMax_data < 2.5 ) yMax=6.;
    else                       yMax=yMax_data*2.;
  } else {
    float yMax_mc = h1_thq->GetMaximum()*1.2;
    yMax = 1.8*yMax_mc;
  }


  TH2D* h2_axes = new TH2D( "axes", "", 10, 100., 180., 10, 0., yMax);
  h2_axes->SetXTitle( "Diphoton Mass [GeV]");
  h2_axes->SetYTitle( "Events / (1 GeV)");

  TCanvas* c1 = new TCanvas("c1", "", 600, 600);
  c1->cd();


  TPaveText* labelTop = db->get_labelTop();

  h2_axes->Draw();
  legend->Draw("same");   
  labelTop->Draw("same");
  stack.Draw("histo same");

  if( BLINDED ) {
    TLine* lineBlind_low = new TLine( 115., 0., 115., yMax );
    TLine* lineBlind_hi  = new TLine( 135., 0., 135., yMax );
    lineBlind_low->SetLineColor(46);
    lineBlind_hi ->SetLineColor(46);
    lineBlind_low->SetLineStyle(2);
    lineBlind_hi ->SetLineStyle(2);
    lineBlind_low->SetLineWidth(2);
    lineBlind_hi ->SetLineWidth(2);
    lineBlind_low->Draw("same");
    lineBlind_hi ->Draw("same");
  }
//.........这里部分代码省略.........
开发者ID:pandolf,项目名称:h2gglobe,代码行数:101,代码来源:create_datacards.cpp


示例3: plotBuilding

void plotBuilding(TCanvas *canvas, TH1F **s, TH1F **r, int n,TText* te,
		  char * option, double startingY, double startingX = .1,bool fit = false, unsigned int logx=0){
  canvas->Divide(2,(n+1)/2); //this should work also for odd n
  for(int i=0; i<n;i++){
    s[i]->SetMarkerStyle(20);
    r[i]->SetMarkerStyle(21);
    s[i]->SetMarkerColor(2);
    r[i]->SetMarkerColor(4);
    s[i]->SetMarkerSize(0.7);
    r[i]->SetMarkerSize(0.7);
    s[i]->SetLineColor(1);
    r[i]->SetLineColor(1);
    s[i]->SetLineWidth(1);
    r[i]->SetLineWidth(1);

    TPad *pad=(TPad*)canvas->cd(i+1);
    setStats(s[i],r[i], -1, 0, false);
    if((logx>>i)&1)pad->SetLogx();
    // mov histo title for steps histos // this didn't work
    //if(startingY == -69) {
    //  gROOT->ForceStyle();
    //  if(i==2 || i==3) {
    //    gStyle->SetTitleX(0.91);
    //    gStyle->SetTitleY(0.01);
    //  } else {
    //    gStyle->SetTitleX(0.01);
    //    gStyle->SetTitleY(0.99);
    //  }
    //}
    r[i]->Draw();
    // mov histo title for steps histos
    if(startingY == -69 && (i==2 || i==3)) {
      if (i==2) TPaveText *pt = new TPaveText(0.01,0.00,0.7,0.06,"NDC");
      else      TPaveText *pt = new TPaveText(0.01,0.00,0.6,0.06,"NDC");
      pt->SetName("title");  // This tells the histogram to NOT display its title at all
      pt->SetBorderSize(1);
      pt->SetFillColor(0);
      text = pt->AddText(r[i]->GetTitle());
      pt->Draw();
    }
    s[i]->Draw("sames");
  }

//   //setStats(r1,s1, startingY, startingX, fit);
//   canvas->cd(1);
//   setStats(s1,r1, -1, 0, false);
//   r1->Draw();
//   s1->Draw("sames");

//   canvas->cd(2);
//   setStats(s2,r2, -1, 0, false);
//   r2->Draw();
//   s2->Draw("sames");

//   canvas->cd(3);
//   setStats(r3,s3, -1, 0, false);
//   r3->Draw();
//   s3->Draw("sames");

//   canvas->cd(4);
//   if(logx)gPad->SetLogx();
//   setStats(s4,r4, 0.6, 0.65, false);
//   r4->Draw();
//   s4->Draw("sames");

//   canvas->cd(5);
//   setStats(r5,s5, -1, 0, false);
//   r5->Draw();
//   s5->Draw("sames");


//   canvas->cd(6);
//   setStats(s6,r6, 0.6, 0.65, false);
//   r6->Draw();
//   s6->Draw("sames");
}
开发者ID:aashaqshah,项目名称:cmssw-1,代码行数:76,代码来源:IterTrackValHistoPublisher.C


示例4: style


//.........这里部分代码省略.........
  lhcbStyle->SetTitleSize(0.06,"z");
  // use bold lines and markers
  lhcbStyle->SetLineWidth(lhcbWidth);
  lhcbStyle->SetFrameLineWidth(lhcbWidth);
  lhcbStyle->SetHistLineWidth(lhcbWidth);
  lhcbStyle->SetFuncWidth(lhcbWidth);
  lhcbStyle->SetGridWidth(lhcbWidth);
  lhcbStyle->SetLineStyleString(2,"[12 12]"); // postscript dashes
  //lhcbStyle->SetMarkerStyle(15);
  lhcbStyle->SetMarkerStyle(20);
  lhcbStyle->SetMarkerSize(1.2);
  // label offsets
  lhcbStyle->SetLabelOffset(0.020);
  // by default, do not display histogram decorations:
  lhcbStyle->SetOptStat(0);
  lhcbStyle->SetOptStat(1110);  // show only nent, mean, rms
  //lhcbStyle->SetOptTitle(0);
  lhcbStyle->SetOptFit(0);
  //lhcbStyle->SetOptFit(1011); // show probability, parameters and errors
  // look of the statistics box:
  lhcbStyle->SetStatBorderSize(1);
  lhcbStyle->SetStatFont(lhcbFont);
  lhcbStyle->SetStatFontSize(0.05);
  lhcbStyle->SetStatX(0.9);
  lhcbStyle->SetStatY(0.9);
  lhcbStyle->SetStatW(0.25);
  lhcbStyle->SetStatH(0.15);
  // put tick marks on top and RHS of plots
  lhcbStyle->SetPadTickX(1);
  lhcbStyle->SetPadTickY(1);
  // histogram divisions: only 5 in x to avoid label overlaps
  lhcbStyle->SetNdivisions(505,"x");
  lhcbStyle->SetNdivisions(510,"y");
  TPaveText *lhcbName = new TPaveText(0.65,0.8,0.9,0.9,"BRNDC");
  lhcbName->SetFillColor(0);
  lhcbName->SetTextAlign(12);
  lhcbName->SetBorderSize(0);
  lhcbName->AddText("LHCb");
  // TPaveText *lhcbPrelimR = new TPaveText(0.70 - lhcbStyle->GetPadRightMargin(),
  //                                        0.80 - lhcbStyle->GetPadTopMargin(),
  //                                        0.95 - lhcbStyle->GetPadRightMargin(),
  //                                        0.85 - lhcbStyle->GetPadTopMargin(),
  //                                        "BRNDC");
  // lhcbPrelimR->SetFillColor(0);
  // lhcbPrelimR->SetTextAlign(12);
  // lhcbPrelimR->SetBorderSize(0);
  // lhcbPrelimR->AddText("#splitline{LHCb}{#scale[1.0]{Preliminary}}");
  // TPaveText *lhcbPrelimL = new TPaveText(lhcbStyle->GetPadLeftMargin() + 0.05,
  //                                        0.87 - lhcbStyle->GetPadTopMargin(),
  //                                        lhcbStyle->GetPadLeftMargin() + 0.30,
  //                                        0.95 - lhcbStyle->GetPadTopMargin(),
  //                                        "BRNDC");
  // lhcbPrelimL->SetFillColor(0);
  // lhcbPrelimL->SetTextAlign(12);
  // lhcbPrelimL->SetBorderSize(0);
  // lhcbPrelimL->AddText("#splitline{LHCb}{#scale[1.0]{Preliminary}}");
  // TPaveText *lhcb7TeVPrelimR = new TPaveText(0.70 - lhcbStyle->GetPadRightMargin(),
  //                                            0.75 - lhcbStyle->SetPadTopMargin(0.05),
  //                                            0.95 - lhcbStyle->GetPadRightMargin(),
  //                                            0.85 - lhcbStyle->SetPadTopMargin(0.05),
  //                                            "BRNDC");
  // lhcb7TeVPrelimR->SetFillColor(0);
  // lhcb7TeVPrelimR->SetTextAlign(12);
  // lhcb7TeVPrelimR->SetBorderSize(0);
  // lhcb7TeVPrelimR->AddText("#splitline{#splitline{LHCb}{Preliminary}}{#scale[0.7]{#sqrt{s} = 7 TeV Data}}");
  // TPaveText *lhcb7TeVPrelimL = new TPaveText(lhcbStyle->GetPadLeftMargin() + 0.05,
开发者ID:renqgl90,项目名称:Seeding,代码行数:67,代码来源:style.C


示例5: PlotField2D


//.........这里部分代码省略.........
      if(opt.Contains("comov"))
	hE2D[i]->GetXaxis()->SetTitle("#zeta [mm]");
      else
	hE2D[i]->GetXaxis()->SetTitle("z [mm]");
      
      if(i==0)
	hE2D[i]->GetZaxis()->SetTitle("E_{z} [GV/m]");
      else if(i==1)
	hE2D[i]->GetZaxis()->SetTitle("E_{y} [GV/m]");
      else if(i==2)
	hE2D[i]->GetZaxis()->SetTitle("E_{x} [GV/m]");
    }
    
  }


  // Change the range of z axis for the fields to be symmetric.
  Float_t Emax = hE2D[index]->GetMaximum();
  Float_t Emin = hE2D[index]->GetMinimum();
  if(Emax > TMath::Abs(Emin))
    Emin = -Emax;
  else
    Emax = -Emin;
  hE2D[index]->GetZaxis()->SetRangeUser(Emin,Emax); 

  // Plotting
  // -----------------------------------------------

  // Canvas setup
  TCanvas *C;
  if(opt.Contains("hres") && !opt.Contains("pdf")) // high resolution for plain grahics output.
    C = new TCanvas("C","2D Electric field",1000,625);
  else
    C = new TCanvas("C","2D Electric field",800,500);

  // Palettes setup
  TExec *exField  = new TExec("exField","rbowgrayPalette->cd();");
  
  // Text objects
  TPaveText *textTime = new TPaveText(0.50,0.85,0.77,0.9,"NDC");
  PlasmaGlob::SetPaveTextStyle(textTime,32); 
  char ctext[128];
  if(opt.Contains("units") && pData->GetPlasmaDensity()) 
    sprintf(ctext,"Z = %5.1f mm", 1e3 * pData->GetPlasmaSkinDepth() * Time);
  else
    sprintf(ctext,"T = %5.1f #omega_{p}^{-1}",Time);
  textTime->AddText(ctext);
 
  TPaveText *textDen = new TPaveText(0.15,0.85,0.48,0.9,"NDC");
  PlasmaGlob::SetPaveTextStyle(textDen,12); 
  textDen->SetTextColor(kOrange+10);
  if(opt.Contains("units") && pData->GetPlasmaDensity())
    sprintf(ctext,"n_{0} = %5.2f x 10^{15} / cc", 1e-6 * 1e-15 * pData->GetPlasmaDensity());
  else if(pData->GetBeamDensity() && pData->GetPlasmaDensity())
    sprintf(ctext,"n_{b}/n_{0} = %5.2f", pData->GetBeamDensity()/pData->GetPlasmaDensity());
  textDen->AddText(ctext);

  TPaveText *textWav = new TPaveText(0.12,0.78,0.45,0.83,"NDC");
  PlasmaGlob::SetPaveTextStyle(textWav,12); 
  textWav->SetTextColor(kGray+2);
  sprintf(ctext,"#lambda_{p} = %5.3f mm", 1e3 * pData->GetPlasmaWaveLength());
  textWav->AddText(ctext);

  
  // Actual Plotting!
  // ------------------------------------------------------------

  // Output file
  TString fOutName = Form("./%s/Plots/Field2D/Field2D",sim.Data());
  fOutName += Form("-%s_%i",sim.Data(),time);

  C->cd();
 
  gPad->SetFrameLineWidth(3);  

  TH2F *hFrame = (TH2F*) gROOT->FindObject("hFrame1");
  if(hFrame) delete hFrame;
  hFrame = (TH2F*) hE2D[index]->Clone("hFrame1");
  hFrame->Reset();
 
  hFrame->Draw("col");
  exField->Draw();
  hE2D[index]->Draw("colz same");
  
  gPad->Update();
  
  textTime->Draw();
  textDen->Draw();
  if(opt.Contains("units"))
    textWav->Draw();
  
  gPad->RedrawAxis(); 

  C->cd();

  // Print to a file
  PlasmaGlob::imgconv(C,fOutName,opt);
  // ---------------------------------------------------------

}
开发者ID:delaossa,项目名称:ptools,代码行数:101,代码来源:PlotField2D.C


示例6: FindSections

void FindSections(TH1D* h_rate, vector<double> &sectionBegin, vector<double> &sectionEnd, const double& begin, const double& end, const double offset, const double skip)
{
  if(begin < h_rate->GetBinLowEdge(1) || end > h_rate->GetBinLowEdge(h_rate->GetNbinsX()+1))
    {
      cerr << "Borders outside of histogram " << begin << " " <<  h_rate->GetBinLowEdge(1) << " " << end << " " << h_rate->GetBinLowEdge(h_rate->GetNbinsX()+1) << endl;
      exit(-1);
    }
  
  //Get Median
  int n = h_rate->GetXaxis()->GetNbins(); 
  //std::vector<double>  x(n);
  //h_rate->GetXaxis()->GetCenter(&x[0]);
  double * y = h_rate->GetArray();
  // exclude underflow/overflows from bin content array y
  double median = TMath::Median(n, &y[0]);

  //Define cut values (this is a bit arbitrary)
  const double cut_up = median * 1.2;
  const double cut_down = median * 0.5;
  cout << "Using cut values = " << cut_down << " < " << median << " < " << cut_up << endl;

  //Search in histogram
  const double step = h_rate->GetBinWidth(1) / 100.;
  bool in_section = false;

  for(double current = begin; current < end; current += step)
    {
      const double value = h_rate->Interpolate(current);

      //Start a section
      if (!in_section && (cut_down <= value && value <= cut_up))
        {
          sectionBegin.push_back(current+offset);
          in_section = true;
        }

      //End a section
      if (in_section && (value < cut_down || cut_up < value))
        {
          in_section = false;
          sectionEnd.push_back(current-offset);
        }
    }

  if(in_section)
    sectionEnd.push_back(end);
    
  if(sectionBegin.size() != sectionEnd.size())
    {
      cerr << "sections size error" << endl;
      exit(-1);
    }

  ostringstream name; name << "rate_" << begin << "_" << end;
  TH1D* draw = (TH1D*)(h_rate->Clone(name.str().c_str()));
  draw->GetXaxis()->SetRangeUser(begin,end);
  draw->Draw("HIST L");
  for (int i=0; i < int(sectionBegin.size()); ++i)
    {
      TBox* boxskip = new TBox(sectionBegin[i],cut_down/2.,sectionBegin[i]+skip,cut_down);
      boxskip->SetFillColor(kRed);
      boxskip->SetFillStyle(3001);
      boxskip->DrawClone();
//       TBox* box = new TBox(sectionBegin[i]+skip,cut_down/2.,sectionEnd[i],cut_down);
//       box->SetFillColor(kGreen-2);
//       box->SetFillStyle(3001);
//       box->DrawClone();
      TPaveText* txt = new TPaveText(sectionBegin[i]+skip,cut_down/2.,sectionEnd[i],cut_down,"b t l");
      ostringstream text; text << i;
      txt->AddText(text.str().c_str());
      txt->SetFillStyle(3001);
      txt->SetFillColor(kGreen-2);
      txt->Draw("SAME");
    }
  return;
}
开发者ID:cbaus,项目名称:pPbCrossSection,代码行数:76,代码来源:makePlots_vdm_ls.C


示例7: ZinvEstimate


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


     ///////////////////////////defining legend
    char Legname1[100];
    TLegend *leg[24];
    for(int k0=0;k0<24;k0++){
    sprintf(Legname1,"leg_1D%i",k0);
    leg[k0]=new TLegend(0.5,0.7,0.80,0.89);
    leg[k0]->SetTextFont(62);
    leg[k0]->SetLineColor(1);
    leg[k0]->SetLineStyle(1);
    leg[k0]->SetLineWidth(3);
    leg[k0]->SetFillColor(0);
    leg[k0]->SetFillStyle(1001);
    leg[k0]->SetShadowColor(0);
    leg[k0]->SetDrawOption(0);
    leg[k0]->SetBorderSize(0);
    leg[k0]->SetTextSize(0.03);
    }


     ///////////////////////////////ZinvMC Yield

     //TCanvas *ZinvMCYield=new TCanvas("ZinvMC","ZinvMC");
     //ZinvMCYield->SetLogy();
     h_NZinv18bin->Sumw2();
     h_NZinv18bin->SetFillColor(1);
     h_NZinv18bin->SetFillStyle(1000);
     h_NZinv18bin->GetXaxis()->SetTitle("bin Number");
     h_NZinv18bin->GetYaxis()->SetTitle("Z/Gamma Ratio");
     //h_NZinv18bin->Draw("hist");

   //////////////////////////////////////////////Calculating Zgamma Ratio start
      TPaveText *tpav1 = new TPaveText(0.1956522,0.6247818,0.729097,0.8970332,"brNDC");

    tpav1->SetBorderSize(0);
    tpav1->SetFillStyle(0);
    tpav1->SetTextAlign(11);
    tpav1->SetTextFont(42);
    tpav1->SetTextSize(0.04);
    tpav1->AddText("HT >500");
    tpav1->AddText("#gamma p_{T} > 100 ");
    tpav1->AddText("NJets >=4");
    tpav1->AddText("MHT>200");
    tpav1->AddText("Btags=0");
    tpav1->AddText("#Delta #Phi_{1,2,3,4}>(0.5,0.5,0.3,0.3)");

    TPaveText *pCMS1 = new TPaveText(0.132107,0.9308003,0.8327759,0.9923583,"brNDC");

    pCMS1->SetBorderSize(0);
    pCMS1->SetFillStyle(0);
    pCMS1->SetTextAlign(11);
    pCMS1->SetTextFont(42);
    pCMS1->SetTextSize(0.04);
    pCMS1->AddText("CMS #it{Preliminary}                      #sqrt{s}= 13 TeV");

    
    
     TCanvas *cZgammaR=new TCanvas("cZGammaR","cZGammaR");
     TH1F *h_ZgR = (TH1F*)h_NZinv18bin->Clone("h_ZgR");

     h_ZgR->Divide(h_NGJets18bin);


     cZgammaR->cd();
     h_ZgR->Draw("E2");
开发者ID:bmahakud,项目名称:RA2bSUSY,代码行数:67,代码来源:ZinvEstimate.C


示例8: main


//.........这里部分代码省略.........
  for(int i=0;i<5;++i){
    TString fibre;
    fibre.Form("%d",i); 

    if(gr_reso_vs_energy[i]){
      TCanvas* c1 = new TCanvas( "c1", "", 600, 600 );
      c1->cd();
      TH2D* h2_axes2 = new TH2D( "axes", "", 100, -0.0, 305. , 10, 0.0, 25 );
      h2_axes2->SetXTitle("Beam Energy [GeV]");
      h2_axes2->SetYTitle("Energy Resolution [%]");
      h2_axes2->Draw("");
      
      gr_reso_vs_energy[i]->SetMarkerStyle(20);
      gr_reso_vs_energy[i]->SetMarkerSize(1.6);
      gr_reso_vs_energy[i]->SetMarkerColor(kBlue);
      gr_reso_vs_energy[i]->Draw("p same");

      //              TF1 *fun= new TF1("fun","sqrt([0]*[0]/(x*x)+[1]*[1])",1, 250.+15.);
      //            TF1 *fun= new TF1("fun","sqrt([0]*[0]/x+[1]*[1])",1, 250.+15.);
            TF1 *fun= new TF1("fun",  "sqrt([0]*[0]/x+[1]*[1]+ [2]*[2]/(x*x))",1, 250+5.);
      fun->SetParameter(1, 4.);
      fun->SetParameter(0, 20.);
      fun->SetParameter(2, 20.);
      gr_reso_vs_energy[i]->Fit(fun,"RN");
      fun->SetLineWidth(1.);
      fun->SetLineColor(kBlue+2);
      fun->Draw("L same");

      TLegend* leg_neat = new TLegend(0.4, 0.92-0.06*5 , 0.8, 0.92);
      leg_neat->SetTextSize(0.038);
      std::string ene="Data fibre ";
      //  ene+=Form("%.0f",energies[i]);
      //    ene+=" GeV";
      ene+=fibre;
      if(i!=4)    leg_neat->AddEntry(gr_reso_vs_energy[i],ene.c_str(),"p");
      else leg_neat->AddEntry(gr_reso_vs_energy[i],"Data CeF_{3}","p");
      //      leg_neat->AddEntry((TObject*)0 ,Form("S =  %.2f\n%s #pm %.2f / #sqrt{E [GeV]}",fun->GetParameter(0),"%",fun->GetParError(0) ),"");
      leg_neat->AddEntry((TObject*)0 ,Form("S =  %.2f\n%s #pm %.2f",fun->GetParameter(0),"%",fun->GetParError(0) ),"");
      leg_neat->AddEntry( (TObject*)0 ,Form("C =  %.2f\n%s  #pm %.2f",(fun->GetParameter(1)) ,"%",fun->GetParError(1) ),"");
      leg_neat->AddEntry( (TObject*)0 ,Form("N =  %.2f\n%s #pm %.2f",(fun->GetParameter(2))/100 ," GeV" ,fun->GetParError(2)/100),"");
      leg_neat->SetFillColor(0);
      leg_neat->Draw("same");
      std::cout<<"parameters: S="<<fun->GetParameter(0)<<" C="<<fun->GetParameter(1)<<" N="<<fun->GetParameter(2)<<std::endl;


      c1->SaveAs(outdir+"/reso_HV1450_"+fibre+".png");
      c1->SaveAs(outdir+"/reso_HV1450_"+fibre+".pdf");
    }

    if(gr_resoMaxAmplFit_vs_energy[i]){
      TCanvas* c1 = new TCanvas( "c1", "", 600, 600 );
      c1->cd();
      TH2D* h2_axes2 = new TH2D( "axes", "", 100, -0.0, 305. , 10, 0.0, 25 );
      h2_axes2->SetXTitle("Beam Energy [GeV]");
      h2_axes2->SetYTitle("Energy Resolution [%]");
      h2_axes2->Draw("");
      
      gr_resoMaxAmplFit_vs_energy[i]->SetMarkerStyle(20);
      gr_resoMaxAmplFit_vs_energy[i]->SetMarkerSize(1.6);
      gr_resoMaxAmplFit_vs_energy[i]->SetMarkerColor(kBlue);
      gr_resoMaxAmplFit_vs_energy[i]->Draw("p same");

      //              TF1 *fun= new TF1("fun","sqrt([0]*[0]/(x*x)+[1]*[1])",1, 250.+15.);
                  TF1 *fun= new TF1("fun","sqrt([0]*[0]/x+[1]*[1])",1, 250.+15.);
      //      TF1 *fun= new TF1("fun",  "sqrt([0]*[0]/x+[1]*[1]+ [2]*[2]/(x*x))",1, 250+5.);
      fun->SetParameter(1, 4.);
      fun->SetParameter(0, 20.);
      fun->SetParameter(2, 20.);
      gr_resoMaxAmplFit_vs_energy[i]->Fit(fun,"RN");
      fun->SetLineWidth(1.);
      fun->SetLineColor(kBlue+2);
      fun->Draw("L same");


      TLegend* leg_neat = new TLegend(0.42, 0.89-0.06*3.5 , 0.85, 0.89);
      leg_neat->SetTextSize(0.038);
      std::string ene="Data fibre ";
      //  ene+=Form("%.0f",energies[i]);
      //    ene+=" GeV";
      ene+=fibre;
      if(i!=4)    leg_neat->AddEntry(gr_resoMaxAmplFit_vs_energy[i],ene.c_str(),"p");
      else leg_neat->AddEntry(gr_resoMaxAmplFit_vs_energy[i],"Data CeF_{3}","p");
      //leg_neat->AddEntry((TObject*)0 ,Form("S =  %.2f\n%s / #sqrt{E [GeV]}",fun->GetParameter(0),"%" ),"");
      leg_neat->AddEntry((TObject*)0 ,Form("S =  %.2f\n%s #pm %.2f",fun->GetParameter(0),"%",fun->GetParError(0) ),"");
      leg_neat->AddEntry( (TObject*)0 ,Form("C =  %.2f\n%s  #pm %.2f",(fun->GetParameter(1)) ,"%",fun->GetParError(1) ),"");
      //      leg_neat->AddEntry( (TObject*)0 ,Form("N =  %.2f\n%s #pm %.2f",(fun->GetParameter(2))/100 ," GeV" ,fun->GetParError(2)/100),"");

      leg_neat->SetFillColor(0);
      leg_neat->Draw("same");
      std::cout<<"parameters: S="<<fun->GetParameter(0)<<" C="<<fun->GetParameter(1)<<" N="<<fun->GetParameter(2)<<std::endl;
      TPaveText* pave = DrawTools::getLabelTop_expOnXaxis("Electron Beam");
      pave->Draw("same");

      c1->SaveAs(outdir+"/reso_maxAmplFit_HV1450_"+fibre+".png");
      c1->SaveAs(outdir+"/reso_maxAmplFit_HV1450_"+fibre+".pdf");
    }

  }
  return 0;
}
开发者ID:CeF3TB,项目名称:H4_2015,代码行数:101,代码来源:drawResolution.cpp


示例9: paraPull_alpha_FT_EFF_extrapolation_2TeV_2Lep_plots_All


//.........这里部分代码省略.........
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t _fey1023[35] = {
   0,
   0,
   0.6107108,
   1.073202,
   1.262649,
   0.9362982,
   0.9916356,
   0.9862464,
   0.9262906,
   0.7691235,
   0.9864321,
   0.9937945,
   0.9917446,
   0.9970094,
   0.9817783,
   0.9372476,
   0.9926669,
   0.9931837,
   0.9925578,
   1.005003,
   0.9933467,
   0.9932277,
   0.9929663,
   0.9927589,
   0.9912906,
   0.9909611,
   1.097757,
   0.9869836,
   0.993171,
   0.9930564,
   0.9854803,
   0.753601,
   0.7380864,
   0.9908989,
   0.785308};
   TGraphErrors *gre = new TGraphErrors(35,_fx1023,_fy1023,_fex1023,_fey1023);
   gre->SetName("");
   gre->SetTitle("");
   gre->SetFillColor(1);
   gre->SetMarkerStyle(20);
   gre->SetMarkerSize(1.2);
   
   TH1F *Graph_Graph1023 = new TH1F("Graph_Graph1023","",100,0,35.75);
   Graph_Graph1023->SetMinimum(-1.799504);
   Graph_Graph1023->SetMaximum(2.167994);
   Graph_Graph1023->SetDirectory(0);
   Graph_Graph1023->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph1023->SetLineColor(ci);
   Graph_Graph1023->GetXaxis()->SetLabelFont(42);
   Graph_Graph1023->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph1023->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph1023->GetXaxis()->SetTitleFont(42);
   Graph_Graph1023->GetYaxis()->SetLabelFont(42);
   Graph_Graph1023->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph1023->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph1023->GetYaxis()->SetTitleFont(42);
   Graph_Graph1023->GetZaxis()->SetLabelFont(42);
   Graph_Graph1023->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph1023->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph1023->GetZaxis()->SetTitleFont(42);
   gre->SetHistogram(Graph_Graph1023);
   
   gre->Draw("p");
   
   TLegend *leg = new TLegend(0.1,0.4,0.4,0.95,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextFont(72);
   leg->SetTextSize(0.015);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(0);
   leg->Draw();
   
   TPaveText *pt = new TPaveText(0.2917068,0.9341608,0.7082932,0.995,"blNDC");
   pt->SetName("title");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetFillStyle(0);
   pt->SetTextFont(42);
   TText *AText = pt->AddText("alpha_FT_EFF_extrapolation");
   pt->Draw();
   c1->Modified();
   c1->cd();
   c1->SetSelected(c1);
}
开发者ID:AlexanderMorton,项目名称:NP_Prun,代码行数:101,代码来源:paraPull_alpha_FT_EFF_extrapolation_2TeV_2Lep_plots_All.C


示例10: SegtoLCTX_2015all_sameYrange_fullIntegral_10k9k


//.........这里部分代码省略.........
   SegtoLCTX_6__96->SetBinContent(93,0.001211896);
   SegtoLCTX_6__96->SetBinContent(94,0.0009089222);
   SegtoLCTX_6__96->SetBinContent(95,0.0007574352);
   SegtoLCTX_6__96->SetBinContent(96,0.0003029741);
   SegtoLCTX_6__96->SetBinContent(97,0.0009089222);
   SegtoLCTX_6__96->SetBinContent(98,0.001060409);
   SegtoLCTX_6__96->SetBinContent(99,0.0003029741);
   SegtoLCTX_6__96->SetBinContent(100,0.0007574352);
   SegtoLCTX_6__96->SetBinContent(101,0.3356953);
   SegtoLCTX_6__96->SetEntries(1328499);
   SegtoLCTX_6__96->SetStats(0);

   ci = TColor::GetColor("#0000ff");
   SegtoLCTX_6__96->SetLineColor(ci);

   ci = TColor::GetColor("#0000ff");
   SegtoLCTX_6__96->SetMarkerColor(ci);
   SegtoLCTX_6__96->GetXaxis()->SetTitle("cm");
   SegtoLCTX_6__96->GetYaxis()->SetTitle("scaled number of entries");
   SegtoLCTX_6__96->Draw("H,same");
   
   leg = new TLegend(0.5,0.7,0.9,0.9,NULL,"brNDC");
   leg->SetBorderSize(1);
   leg->SetTextFont(62);
   leg->SetTextSize(0.02);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   entry=leg->AddEntry("SegtoLCTX_1","ME11A: mean:-0.0cm;RMS:0.9cm","l");

   ci = TColor::GetColor("#ff00ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("SegtoLCTX_2","ME11B: mean:0.0cm;RMS:1.0cm","l");

   ci = TColor::GetColor("#ff9999");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("SegtoLCTX_3","ME12+13: mean:-0.0cm;RMS:1.3cm","l");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("SegtoLCTX_4","ME2: mean:-0.0cm;RMS:1.0cm","l");

   ci = TColor::GetColor("#ff0000");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("SegtoLCTX_5","ME3: mean:-0.0cm;RMS:0.8cm","l");

   ci = TColor::GetColor("#00ff00");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("SegtoLCTX_6","ME4: mean:-0.0cm;RMS:0.8cm","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   leg->Draw();
   
   TPaveText *pt = new TPaveText(0.01,0.9390678,0.2699194,0.995,"blNDC");
   pt->SetName("title");
   pt->SetBorderSize(1);
   pt->SetFillColor(0);
   TText *AText = pt->AddText("SegtoLCTX");
   pt->Draw();
   SegtoLCTX->Modified();
   SegtoLCTX->cd();
   SegtoLCTX->SetSelected(SegtoLCTX);
}
开发者ID:senka,项目名称:CSC_eff_808,代码行数:101,代码来源:SegtoLCTX_2015all_sameYrange_fullIntegral_10k9k.C


示例11: InclusiveJets_2010


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

  //data
  d01_x01_y01_histo->Draw("E2same");
  d02_x01_y01_histo->Draw("E2same");
  d03_x01_y01_histo->Draw("E2same");
  d04_x01_y01_histo->Draw("E2same");
  d05_x01_y01_histo->Draw("E2same");

	_histo[0][0]->Draw("E1same");
	_histo[1][0]->Draw("E1same");
	_histo[2][0]->Draw("E1same");
	_histo[3][0]->Draw("E1same");
	_histo[4][0]->Draw("E1same");

//	_histo_herw[0][0]->Draw("E1same");
//	_histo_herw[1][0]->Draw("E1same");
//	_histo_herw[2][0]->Draw("E1same");
//	_histo_herw[3][0]->Draw("E1same");
//	_histo_herw[4][0]->Draw("E1same");


	_histo_pyth[0][0]->Draw("E1same");
	_histo_pyth[1][0]->Draw("E1same");
	_histo_pyth[2][0]->Draw("E1same");
	_histo_pyth[3][0]->Draw("E1same");
	_histo_pyth[4][0]->Draw("E1same");



   TLine *line = new TLine(xmin,1,xmax,1);
   line->SetLineStyle(2);
   line->Draw();

   TPaveText *pt = new TPaveText(0.17,0.79,0.37,0.95,"brNDC");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetTextAlign(12);
   pt->SetTextSize(0.03);
   text = pt->AddText("CMS 2010");
   text = pt->AddText("#sqrt{s} = 7 TeV");
   text = pt->AddText("anti-k_{T} R = 0.5");
   pt->Draw();

TLegend *leg = new TLegend(0.68,0.70,0.83,0.928);
   leg->SetBorderSize(1);
   leg->SetTextSize(0.025);
   leg->SetLineColor(0);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);

   leg->AddEntry((TH1F*)_histo[0][0],"POWHEG & Pythia6 Z2","pfl");
   leg->AddEntry((TH1F*)_histo_pyth[0][0]," Pythia6 Z2","pfl");
   leg->AddEntry((TH1F*)  d01_x01_y01_histo, "|y| <0.5 (x 10^{4})","pfl");
   leg->AddEntry((TH1F*)  d02_x01_y01_histo, "0.5 < |y| < 1.0 (x 10^{3})","pfl");
   leg->AddEntry((TH1F*)  d03_x01_y01_histo, "1.0 < |y| < 1.5 (x 10^{2})","pfl");
   leg->AddEntry((TH1F*)  d04_x01_y01_histo, "1.5 < |y| < 2.0 (x 10^{1})","pfl");
   leg->AddEntry((TH1F*)  d05_x01_y01_histo, "2.0 < |y| < 2.5 (x 10^{0})","pfl");

   leg->Draw();

//write in png file
mysubpad1 =(TPad*)c1->GetPad(0);
mysubpad1->Print("pics/InclusiveJets_xs_10.png");
mysubpad1->Print("~/DESY/ANALYSIS_NOTES/JetCrossSectionsWithPOWHEG/notes/AN-12-236/trunk/plots/InclusiveJets_xs_10.pdf");
开发者ID:rkunnawa,项目名称:Powheg_NPC,代码行数:67,代码来源:InclusiveJets_2010.C


示例12: makeplot

void makeplot(){

    
    gStyle->SetOptStat(0);
    TFile * file_1 = TFile::Open("CorrelationPlotsPerugia0PtDstarfromB5To8_ptAssall1.0to99.0_DeltaEta10.root");//file->ls();
    
    TCanvas * c = (TCanvas*)file_1->Get("cDeltaPhi");
    TH1D * h_Perugia0 = (TH1D*)c->FindObject("hCorrDeltaPhi");
    h_Perugia0->SetName("h_Perugia0");
    
    
    TFile * file_2 = TFile::Open("CorrelationPlotsPerugia2010PtDstarfromB5To8_ptAssall1.0to99.0_DeltaEta10.root");//file->ls();
    
    c = (TCanvas*)file_2->Get("cDeltaPhi");
    TH1D * h_Perugia2010 = (TH1D*)c->FindObject("hCorrDeltaPhi");
    h_Perugia2010->SetName("h_Perugia2010");
    
    
    TFile * file_3 = TFile::Open("CorrelationPlotsPerugia2011PtDstarfromB5To8_ptAssall1.0to99.0_DeltaEta10.root");//file->ls();
    
    c = (TCanvas*)file_3->Get("cDeltaPhi");
    TH1D * h_Perugia2011 = (TH1D*)c->FindObject("hCorrDeltaPhi");
    h_Perugia2011->SetName("h_Perugia2011");
    
    
    TPaveText * PaveText = new TPaveText(0.5,0.55,0.8,0.85,"NDC");
    PaveText->SetBorderSize(0);
    PaveText->SetFillColor(0);
    PaveText->SetName("pave");
    PaveText->AddText("THIS THESIS");
    PaveText->AddText(" ");
    PaveText->AddText("Comparison of Pythia templates, pp #sqrt{s} = 7 TeV");
    PaveText->AddText(" ");
    PaveText->AddText("(B #rightarrow D*^{+}) - charged particle correlations");
    
    
    
    h_Perugia0->SetMarkerStyle(20); h_Perugia2010->SetMarkerStyle(20); h_Perugia2011->SetMarkerStyle(20);
    h_Perugia0->SetMarkerColor(1); h_Perugia2010->SetMarkerColor(2); h_Perugia2011->SetMarkerColor(4);
    h_Perugia0->SetLineColor(1); h_Perugia2010->SetLineColor(2); h_Perugia2011->SetLineColor(4);
    
    
    
    TCanvas * c = new TCanvas("c","c",0,0,1000,1000);
    c->cd();
    h_Perugia0->SetTitle(";#Delta#varphi;#frac{1}{N_{D}}#frac{dN}{d#Delta#varphi}");
    h_Perugia0->GetYaxis()->SetRangeUser(0,4);
    h_Perugia0->Draw("ep");
    h_Perugia2010->Draw("sameep");
    h_Perugia2011->Draw("sameep");
    
    TLegend * legend = new TLegend(0.1,0.6,0.4,0.85);
    //  TLegend * legend = new TLegend(0.1, 1.2*DStarPeak->GetBinContent(DStarPeak->GetMaximumBin()),0.4, 1.6*DStarPeak->GetBinContent(DStarPeak->GetMaximumBin()));
    legend->SetFillColor(0);
    legend->SetTextSize(0.02);
    legend->AddEntry(h_Perugia0,"Pythia, Perugia 0 tune","lep");
    legend->AddEntry(h_Perugia2010,"Pythia, Perugia 2010 tune","lep");
    legend->AddEntry(h_Perugia2011,"Pythia, Perugia 2011 tune","lep");
    
    legend->Draw("same");
    PaveText->Draw("same");
    
    
    return;
    c->SaveAs("templates_pp.png");
   
}
开发者ID:sbjelogr,项目名称:phdthesis,代码行数:67,代码来源:makeplot.C


示例13: phimuphij1b2


//.........这里部分代码省略.........
   b2/phimuphij1b2->Add(phimuphij1b2,"");
   
   TH1D *phimuphij1b25 = new TH1D("phimuphij1b25"," #Delta_{#phi}[#mu,jet_{1}]",20,-3.141593,3.141593);
   phimuphij1b25->SetBinContent(18,1.677165e-05);
   phimuphij1b25->SetBinError(18,1.677165e-05);
   phimuphij1b25->SetEntries(1);

   ci = TColor::GetColor("#0000ff");
   phimuphij1b25->SetFillColor(ci);

   ci = TColor::GetColor("#0000ff");
   phimuphij1b25->SetLineColor(ci);

   ci = TColor::GetColor("#0000ff");
   phimuphij1b25->SetMarkerColor(ci);
   phimuphij1b25->SetMarkerStyle(21);
   phimuphij1b25->GetXaxis()->SetTitle("phimuphij1b2");
   phimuphij1b25->GetXaxis()->SetLabelFont(42);
   phimuphij1b25->GetXaxis()->SetLabelSize(0.035);
   phimuphij1b25->GetXaxis()->SetTitleSize(0.035);
   phimuphij1b25->GetXaxis()->SetTitleFont(42);
   phimuphij1b25->GetYaxis()->SetTitle("Events/pb");
   phimuphij1b25->GetYaxis()->SetLabelFont(42);
   phimuphij1b25->GetYaxis()->SetLabelSize(0.035);
   phimuphij1b25->GetYaxis()->SetTitleSize(0.035);
   phimuphij1b25->GetYaxis()->SetTitleFont(42);
   phimuphij1b25->GetZaxis()->SetLabelFont(42);
   phimuphij1b25->GetZaxis()->SetLabelSize(0.035);
   phimuphij1b25->GetZaxis()->SetTitleSize(0.035);
   phimuphij1b25->GetZaxis()->SetTitleFont(42);
   b2/phimuphij1b2->Add(phimuphij1b2,"");
   b2/phimuphij1b2->Draw("nostack");
   
   TPaveText *pt = new TPaveText(0.2910057,0.9342857,0.7089943,0.995,"blNDC");
   pt->SetName("title");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetFillStyle(0);
   pt->SetTextFont(42);
   TText *AText = pt->AddText("b2/phimuphij1b2");
   pt->Draw();
   
   TLegend *leg = new TLegend(0.54023,0.639881,0.938218,0.924107,NULL,"brNDC");
   leg->SetBorderSize(1);
   leg->SetTextSize(0.034965);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("phimuphij1b2","b2/phimuphij1b2_QCD_b2/","lp");

   ci = TColor::GetColor("#00cc00");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);

   ci = TColor::GetColor("#00cc00");
   entry->SetMarkerColor(ci);
   entry->SetMarkerStyle(22);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("phimuphij1b2","b2/phimuphij1b2_WJetsToLNu_b2/","lp");

   ci = TColor::GetColor("#00ffff");
   entry->SetLineColor(ci);
开发者ID:delgadoandrea,项目名称:CMSSW_7_4_6_patch6,代码行数:67,代码来源:phimuphij1b2.C


示例14: DrawFreeCMSLabels

void DrawFreeCMSLabels(char* text, double textSize) {

  //const char *text = "%2.1f #times 10^{6} clusters (fiducial) (%1.1f GeV)";
  //char *text = "%2.1f #times 10^{6} clusters (fiducial)";
    
  TPaveText *label = new TPaveText();
  label->SetX1NDC(gStyle->GetPadLeftMargin());
  label->SetY1NDC(1.0-gStyle->GetPadTopMargin());
  label->SetX2NDC(1.0-gStyle->GetPadRightMargin());
  label->SetY2NDC(1.0);
  label->SetTextFont(42);
  label->AddText(text);
  label->SetFillStyle(0);
  label->SetBorderSize(0);
  if (textSize!=0) label->SetTextSize(textSize);
  label->SetTextAlign(32);
  label->Draw("same");
}
开发者ID:schuetzepaul,项目名称:testbeam-analysis,代码行数:18,代码来源:plotter.C


示例15: track_pt

void track_pt(const int charge)
{
  if (charge==1)
  char  ch[20] = "plus"; 
  else if (charge==-1)
  char ch[20] = "minus";
  ofstream txtfile;
  char txtfname[100];
  char histfname[100];
  sprintf(txtfname,"pt_%s.txt",ch);
  sprintf(histfname,"pt_%s.png",ch);
  txtfile.open(txtfname);
  txtfile << fixed << setprecision(4);
  TCanvas *myCan=new TCanvas("myCan","myCan",800,600);
  gStyle->SetLineWidth(2.);
  gStyle->SetLabelSize(0.04,"xy");
  gStyle->SetTitleSize(0.05,"xy");
  gStyle->SetTitleOffset(1.1,"x");
  gStyle->SetTitleOffset(1.2,"y");
  gStyle->SetPadTopMargin(0.1);
  gStyle->SetPadRightMargin(0.1);
  gStyle->SetPadBottomMargin(0.16);
  gStyle->SetPadLeftMargin(0.12);

  myCan->SetGrid();
  TLegend* Lgd = new TLegend(.8, .25,.9,.35);
  if (charge==1){
    TFile *f_MC= new TFile("TnP_Tracking_dr030e030_MCptplus.root","read");
    TFile *f_RD= new TFile("TnP_Tracking_dr030e030_RDptplus.root","read");
  }else if (charge==-1){
    TFile *f_MC= new TFile("TnP_Tracking_dr030e030_MCptminus.root","read");
    TFile *f_RD= new TFile("TnP_Tracking_dr030e030_RDptminus.root","read");
  }
  line = new TLine(15,1,80,1);
  line->SetLineStyle(2);
  line->SetLineWidth(3);
  
  TPaveText *title = new TPaveText(.1,1,.95,.95,"NDC");
  title->SetFillStyle(0);
  title->SetBorderSize(0);
  title->SetTextSize(0.04);
  title->AddText("CMS Preliminary, 18.9 pb^{-1} at #sqrt{s}=8 TeV");

  RooDataSet *datasetMC = (RooDataSet*)f_MC->Get("tpTreeSta/eff_pt_dr030e030/fit_eff");
  cout<<"ntry: "<<datasetMC->numEntries()<<endl;
  double XMC[Nbin],XMCerrL[Nbin],XMCerrH[Nbin],YMC[Nbin],YMCerrLo[Nbin],YMCerrHi[Nbin],ErrMC[Nbin];
  for(int i(0); i<datasetMC->numEntries();i++)
  {
    const RooArgSet &pointMC=*datasetMC->get(i);
    RooRealVar &ptMC=pointMC["pt"],&effMC = pointMC["efficiency"];
    XMC[i]=ptMC.getVal();
    XMCerrL[i]=-ptMC.getAsymErrorLo();
    XMCerrH[i]=ptMC.getAsymErrorHi();
    YMC[i]=effMC.getVal();
    YMCerrLo[i]=-effMC.getAsymErrorLo 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TPckgBuf类代码示例发布时间:2022-05-31
下一篇:
C++ TPaveStats类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap