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


C++ TLegend::SetLineColor方法代码示例

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


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

示例1: fitLMC_c070116_LL1_floatsigmalfixmu_nobkg


//.........这里部分代码省略.........
   20.62332,
   12.14304,
   2.199217,
   0.6133427,
   0.2223733,
   0.09598214,
   0.04688729,
   0.02511773,
   0.01445048,
   0.008799079,
   0.005611409,
   0.003718549,
   0.002545241,
   0.001790992,
   0.001290737,
   0.0009498223,
   0.0007119077,
   0.0005423525,
   0.0004192375,
   0.0003283356,
   0.0002601995,
   0.0002084266,
   0.0001685961,
   0.0001376041,
   0.0001376041};
   TGraph *graph = new TGraph(128,curvetot_fx1,curvetot_fy1);
   graph->SetName("curvetot");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_curvetot1 = new TH1F("Graph_curvetot1","Projection of totalPdf",128,4126,6214);
   Graph_curvetot1->SetMinimum(2.377504e-14);
   Graph_curvetot1->SetMaximum(3467.921);
   Graph_curvetot1->SetDirectory(0);
   Graph_curvetot1->SetStats(0);
   Graph_curvetot1->SetLineWidth(2);
   Graph_curvetot1->SetMarkerStyle(20);
   Graph_curvetot1->GetXaxis()->SetNdivisions(505);
   Graph_curvetot1->GetXaxis()->SetLabelFont(132);
   Graph_curvetot1->GetXaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetXaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetXaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetXaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetXaxis()->SetTitleFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetYaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetYaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetYaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetYaxis()->SetTitleFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetZaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetZaxis()->SetTitleOffset(1.2);
   Graph_curvetot1->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_curvetot1);
   
   graph->Draw("l");
   
开发者ID:goi42,项目名称:LbJpsipPi,代码行数:66,代码来源:fitLMC_c070116_LL1_floatsigmalfixmu_nobkg.C

示例2: DisplayBackground

void DisplayBackground(){



 gROOT->SetStyle("Plain");
 gStyle->SetOptStat(0000);
 //gStyle->SetErrorX(0) 
 gStyle->SetPadGridX(0);
 gStyle->SetPadGridY(0);
 TCanvas * c = new TCanvas("c", "c", 700,700);
 c->SetTickx(1);
 c->SetTicky(1);

 c->SetFrameFillStyle(4000);
 c->SetFrameFillColor(0);
 c->cd();

   gStyle->SetPadGridX(0);
   gStyle->SetPadGridY(0);
   gROOT->SetStyle("Plain");


  double totalLuminosity=2190; // /pb
  
  double xsec_ttbar=831.76;
  double xsec_qcd[8]={27850000,1717000,351300,31630.,6802.,1206.,120.4,25.24};

  TFile *ttbar=new TFile("Histograms_TT_TuneCUETP8M1_13TeV-amcatnlo-pythia8_Skim.root"); 	
  /*std::vector<TFile*> qcd;
  qcd.push_back(new TFile ("Histograms_QCD_HT100to200_Skim.root"));
  qcd.push_back(new TFile("Histograms_QCD_HT200to300_Skim.root"));
  qcd.push_back(new TFile("Histograms_QCD_HT300to500_Skim.root"));
  qcd.push_back(new TFile("Histograms_QCD_HT500to700_Skim.root"));
  qcd.push_back(new TFile("Histograms_QCD_HT700to1000_Skim.root"));
  qcd.push_back(new TFile("Histograms_QCD_HT1000to1500_Skim.root"));
  qcd.push_back(new TFile("Histograms_QCD_HT1500to2000_Skim.root"));
  qcd.push_back(new TFile("Histograms_QCD_HT2000toInf_Skim.root"));



  double init_ttbar=((TH1F*)ttbar->Get("Count"))->GetBinContent(1);
  double init_qcd[8];

  double scale_qcd[8];
  double scale_ttbar=totalLuminosity*xsec_ttbar/init_ttbar;

  for(int l=0; l<8;l++){
	  init_qcd[l]=((TH1F*)qcd.at(l)->Get("Count"))->GetBinContent(1);
	  scale_qcd[l]=totalLuminosity*xsec_qcd[l]/init_qcd[l];

  }	


*/


  double init_ttbar=((TH1F*)ttbar->Get("Count"))->GetBinContent(1);
  double scale_ttbar=totalLuminosity*xsec_ttbar/init_ttbar;


  TH1F * h_bkg = new TH1F("h_bkg","h_bkg",  50, 0., 2000.);
  THStack hs("hs","test stacked histograms");
  hs.SetTitle("");
  //c->cd();
  TH1F* h_mX_SB_kinFit=(TH1F*)ttbar->Get("h_mX_SB_kinFit");	
  h_mX_SB_kinFit->Scale(scale_ttbar);
  h_mX_SB_kinFit->Rebin(40);	
  h_bkg->Add(h_mX_SB_kinFit);
  h_mX_SB_kinFit->SetLineColor(kBlue+1);
  h_mX_SB_kinFit->SetFillColor(kBlue+1);

  TLegend *leg = new TLegend(0.55625,0.7321654,0.8765625,0.8603839,NULL,"brNDC");
  leg->SetBorderSize(0);
  leg->SetTextSize(0.035);
  leg->SetTextFont(42);	
  leg->SetLineColor(1);
  leg->SetLineStyle(1);
  leg->SetLineWidth(2);
  leg->SetFillColor(0);
  leg->SetFillStyle(0);



  double integral =0 ;
  integral = integral + h_mX_SB_kinFit->Integral(0, 200);
  std::cout<< "integral tt " << integral<<std::endl;

  leg->AddEntry(h_mX_SB_kinFit, "t#bar{t} ", "f");

  h_mX_SB_kinFit->Draw("");
  hs.Add(h_mX_SB_kinFit,"hist");
/*  double integralQCD =0;
  for(int m=0; m<8;m++){
	  TH1F* h_mX_SB_kinFitQ=(TH1F*)qcd.at(m)->Get("h_mX_SB_kinFit");
	  h_mX_SB_kinFitQ->Scale(scale_qcd[m]);
	  h_mX_SB_kinFitQ->Rebin(40);
	  h_bkg->Add(h_mX_SB_kinFitQ);
	  h_mX_SB_kinFitQ->Draw("same");
	  h_mX_SB_kinFitQ->SetLineColor(kRed+1);
	  h_mX_SB_kinFitQ->SetFillColor(kRed+1);
//.........这里部分代码省略.........
开发者ID:fnechans,项目名称:HbbHbb_Run2,代码行数:101,代码来源:DisplayBackground.c

示例3: result_JES_akPu4PF_

void result_JES_akPu4PF_(refpt> 75 && refpt < 120)&&(abs(refeta)<2)_Centrality()
{
//=========Macro generated from canvas: Can_result_0/
//=========  (Mon Apr 18 02:39:41 2016) by ROOT version6.02/13
   TCanvas *Can_result_0 = new TCanvas("Can_result_0", "",18,40,700,500);
   gStyle->SetOptFit(1);
   Can_result_0->Range(-18.75,0.9236134,118.75,1.043845);
   Can_result_0->SetFillColor(0);
   Can_result_0->SetBorderMode(0);
   Can_result_0->SetBorderSize(2);
   Can_result_0->SetFrameBorderMode(0);
   Can_result_0->SetFrameBorderMode(0);
   
   TMultiGraph *multigraph = new TMultiGraph();
   multigraph->SetName("name");
   multigraph->SetTitle("JES_akPu4PF");
   
   Double_t Graph_fx1001[4] = {
   5,
   20,
   40,
   75};
   Double_t Graph_fy1001[4] = {
   1.025461,
   0.982262,
   0.9644553,
   0.970611};
   Double_t Graph_fex1001[4] = {
   5,
   10,
   10,
   25};
   Double_t Graph_fey1001[4] = {
   0.001598024,
   0.0009318739,
   0.0008002418,
   0.0004502591};
   TGraphErrors *gre = new TGraphErrors(4,Graph_fx1001,Graph_fy1001,Graph_fex1001,Graph_fey1001);
   gre->SetName("Graph");
   gre->SetTitle("some title_0");
   gre->SetFillColor(1);
   gre->SetFillStyle(0);
   
   TH1F *Graph_Graph1001 = new TH1F("Graph_Graph1001","some title_0",100,0,110);
   Graph_Graph1001->SetMinimum(0.9573146);
   Graph_Graph1001->SetMaximum(1.0334);
   Graph_Graph1001->SetDirectory(0);
   Graph_Graph1001->SetStats(0);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#000099");
   Graph_Graph1001->SetLineColor(ci);
   Graph_Graph1001->GetXaxis()->SetLabelFont(42);
   Graph_Graph1001->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph1001->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph1001->GetXaxis()->SetTitleFont(42);
   Graph_Graph1001->GetYaxis()->SetLabelFont(42);
   Graph_Graph1001->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph1001->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph1001->GetYaxis()->SetTitleFont(42);
   Graph_Graph1001->GetZaxis()->SetLabelFont(42);
   Graph_Graph1001->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph1001->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph1001->GetZaxis()->SetTitleFont(42);
   gre->SetHistogram(Graph_Graph1001);
   
   multigraph->Add(gre,"");
   
   Double_t Graph_fx1002[4] = {
   5,
   20,
   40,
   75};
   Double_t Graph_fy1002[4] = {
   1.025808,
   0.9823451,
   0.964104,
   0.9707841};
   Double_t Graph_fex1002[4] = {
   5,
   10,
   10,
   25};
   Double_t Graph_fey1002[4] = {
   0.001641175,
   0.0009556419,
   0.0008206184,
   0.000461058};
   gre = new TGraphErrors(4,Graph_fx1002,Graph_fy1002,Graph_fex1002,Graph_fey1002);
   gre->SetName("Graph");
   gre->SetTitle("some title_1");
   gre->SetFillColor(1);
   gre->SetFillStyle(0);
   gre->SetLineColor(2);
   gre->SetMarkerColor(2);
   
   TH1F *Graph_Graph1002 = new TH1F("Graph_Graph1002","some title_1",100,0,110);
   Graph_Graph1002->SetMinimum(0.9568668);
   Graph_Graph1002->SetMaximum(1.033866);
//.........这里部分代码省略.........
开发者ID:Jelov,项目名称:JetEnergy_SR,代码行数:101,代码来源:result_JES_akPu4PF_(refpt>+75+&&+refpt+<+120)&&(abs(refeta)<2)_Centrality.C

示例4: v2ExpOpen_pt

void v2ExpOpen_pt(bool bSavePlots = true, 
		  float rangeYAxis    = 0.6,
		  float rangeXAxis    = 30,
                  bool  bDrawCh       = true,
		  const char* inputDir= "../macro_v2/outRoot", // the place where the input root files, with the histograms are
		  const char* figNamePrefix="v2ExpOpen_pt")
{
  gSystem->mkdir(Form("./figs/png"), kTRUE);
  gSystem->mkdir(Form("./figs/pdf"), kTRUE);
  setTDRStyle();
  //  gStyle->SetCanvasPreferGL(1);
  // read CMS graphs
  TFile *pfV2Cms_cent   = new TFile(Form("%s/NPrp_v2_pt_plotter.root",inputDir));
  
  TGraphAsymmErrors *pgV2Low  = (TGraphAsymmErrors *)pfV2Cms_cent->Get("pgV2_low");
  TGraphErrors *pgV2LowSyst   = (TGraphErrors *)pfV2Cms_cent->Get("pgV2_low_sys");
  TGraphErrors *pgV2LowP      = (TGraphErrors *)pfV2Cms_cent->Get("pgV2_low_cont");

  TGraphAsymmErrors *pgV2High = (TGraphAsymmErrors *)pfV2Cms_cent->Get("pgV2");
  TGraphErrors *pgV2HighSyst  = (TGraphErrors *)pfV2Cms_cent->Get("pgV2_sys");
  TGraphErrors *pgV2HighP     = (TGraphErrors *)pfV2Cms_cent->Get("pgV2_cont");
  
  pgV2Low->SetName("pgV2Low");
  pgV2LowSyst->SetFillColorAlpha(kViolet-9,0.5);
  pgV2High->SetName("pgV2High");
  pgV2HighSyst->SetFillColorAlpha(kOrange-9,0.5);

  // -----------------------------------------------------------------------------------------
  // ----- charged hadrons
  TGraphErrors *gChar    = new TGraphErrors(19, pTChar, v2Char, chxerr, v2CharSt);
  TGraphErrors *gChar2   = new TGraphErrors(19, pTChar, v2Char, chxerr, v2CharSt2);
  TGraphErrors *gCharSys = new TGraphErrors(19, pTChar, v2Char, chxerr2, v2CharSys);
 
  gChar->SetName("gChar");
  gChar->SetMarkerStyle(20);
  gChar->SetMarkerColor(kTeal+3);
  gChar->SetLineColor(kTeal+3);
  gChar->SetMarkerSize(1.3);
  gChar2->SetMarkerStyle(24);
  gChar2->SetMarkerColor(kTeal+4);
  gChar2->SetLineColor(kTeal+4);
  gChar2->SetMarkerSize(1.3);
 
  gCharSys->SetFillColor(kTeal-9);

  //----------- D from ALICE
  TGraphErrors *pgAlice          = new TGraphErrors(6, v2AliceX_pt, v2Alice_pt, v2AliceXl, v2AliceStat_pt);
  TGraphErrors *pgAliceSys       = new TGraphErrors(6, v2AliceX_pt, v2Alice_pt, v2AliceXl, v2AliceSyst_pt);
  TGraphAsymmErrors *pgAliceSysB = new TGraphAsymmErrors(6, v2AliceX_pt, v2Alice_pt, v2AliceXl2, v2AliceXl2, v2AliceSystBLow_pt, v2AliceSystBHigh_pt);

 
  pgAlice->SetName("pgAlice");
  pgAlice->SetMarkerStyle(kOpenSquare);
  pgAlice->SetMarkerColor(kGray+2);
  pgAlice->SetLineColor(kGray+2);
  pgAlice->SetMarkerSize(1.0);
  
  pgAliceSys->SetFillStyle(0);
  pgAliceSys->SetMarkerStyle(27);
  pgAliceSys->SetMarkerColor(kGray+2);
  pgAliceSys->SetLineColor(kGray+2);
  pgAliceSys->SetMarkerSize(1.7);

  pgAliceSysB->SetFillColor(kGray);

  // drawing
  //------------------------------------------------------------------------
  // put everything on one plot
  TH1D *phAxis_v2 = new TH1D("phAxis_v2",";p_{T} (GeV/c);v_{2}",1,0,rangeXAxis);  
  phAxis_v2->SetDirectory(0);
  phAxis_v2->GetXaxis()->CenterTitle(true);
  phAxis_v2->GetXaxis()->LabelsOption("h");
  phAxis_v2->GetYaxis()->SetRangeUser(-0.01,rangeYAxis); 
  phAxis_v2->GetYaxis()->SetTitleOffset(1.25);
 
  TCanvas *pcCombi = new TCanvas("pcCombi","pcCombi");
  phAxis_v2->Draw();
  CMS_lumi(pcCombi,12001000,0);
 
  pgAliceSysB->Draw("2");
  pgAliceSys->Draw("2");
  pgAlice->Draw("pz");
 
  if (bDrawCh) {
    gCharSys->Draw("2");
    gChar->Draw("pz");
    gChar2->Draw("p");
  }
 
  pgV2LowSyst->Draw("2");
  pgV2Low->Draw("PZ");
  pgV2LowP->Draw("P");
 
  pgV2HighSyst->Draw("2");
  pgV2High->Draw("PZ");
  pgV2HighP->Draw("P");
  
  // --------- legends ----
  TLegend *leg = new TLegend(0.2,0.77,0.7,0.89,NULL,"brNDC"); // at top center
  leg->SetBorderSize(0);
//.........这里部分代码省略.........
开发者ID:CMS-HIN-dilepton,项目名称:DimuonCADIs,代码行数:101,代码来源:v2ExpOpen_pt.C

示例5: figure2_0_generator


//.........这里部分代码省略.........
	gr_neg->Write();
	gr_diff->Write();



 //   TCanvas* c1 = new TCanvas("c1","c1");
 //   TCanvas* c2 = new TCanvas("c2","c2");
	TCanvas* c3 = new TCanvas("c3","c3",1,1,1200,600);
	c3->Divide(2,1,0.01,0.01);

	gr_neg -> SetMarkerStyle(20);
	gr_neg -> SetMarkerColor(kBlue);
	gr_pos -> SetMarkerStyle(34);	
	gr_pos -> SetMarkerColor(kRed);




	TLatex* text_a = makeLatex("CMS PbPb #sqrt{s_{NN}}=5.02TeV",0.25,0.85) ;
	//TLatex* text_b = makeLatex("185 #leq N_{trk}^{offline} < 220",0.25,0.80) ;
	TLatex* text_b = makeLatex("30-40%",0.25,0.80) ;

	TLatex* text_c = makeLatex("0.8 < p_{T} < 0.85 GeV/c",0.25,0.75) ;
	TLatex* text_d = makeLatex("|#Delta#eta| > 2",0.25,0.70) ;

	text_a->SetTextFont(42);
	text_b->SetTextFont(42);
	text_c->SetTextFont(42);
	text_d->SetTextFont(42);



	TLegend* leg = new TLegend(0.76,0.80,0.94,.88);
	leg->SetLineColor(kWhite);
	leg->SetFillColor(0);
	leg->SetFillStyle(0);
	leg->AddEntry(gr_pos, "v_{2}^{#plus}{2}","p");
	leg->AddEntry(gr_neg , "v_{2}^{#minus}{2}","p");



	c3->cd(1);
	base->Draw("");
	gr_pos->Draw("PSame");
	gr_neg->Draw("PSame");
	text_a->DrawClone("Same");
	text_b->DrawClone("Same");
	text_c->DrawClone("Same");
	text_d->DrawClone("Same");

	leg->DrawClone("Same");


    //Define a linear function
	TF1* fit1 = new TF1("f1", "[0]+x*[1]", -0.13, 0.13);

	fit1->SetLineColor(kRed);
	fit1->SetLineStyle(2);
	gr_diff->Fit(fit1,"RN0");
	fit1->Write();


	rebinned->Close();

	c3->cd(2);
开发者ID:SangeonPark,项目名称:Flow,代码行数:66,代码来源:figure2_0_generator.C

示例6: TrackClusterDistanceCut_Zuds91_neutralRecoEnergy


//.........这里部分代码省略.........
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(50,9);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(51,20);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(52,15);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(53,5);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(54,11);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(55,12);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(56,10);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(57,6);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(58,5);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(59,5);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(60,6);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(61,8);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(62,1);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(63,6);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(64,1);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(65,3);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(66,4);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(67,2);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(68,2);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(69,2);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(70,1);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(71,1);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(72,2);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(73,1);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(74,2);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(81,1);
   hist_pfoEnergyNeutralHadrons__4->SetBinContent(84,1);
   hist_pfoEnergyNeutralHadrons__4->SetEntries(10000);
   hist_pfoEnergyNeutralHadrons__4->SetStats(0);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#ff6666");
   hist_pfoEnergyNeutralHadrons__4->SetLineColor(ci);
   hist_pfoEnergyNeutralHadrons__4->SetLineWidth(2);

   ci = TColor::GetColor("#ff6666");
   hist_pfoEnergyNeutralHadrons__4->SetMarkerColor(ci);
   hist_pfoEnergyNeutralHadrons__4->SetMarkerStyle(0);
   hist_pfoEnergyNeutralHadrons__4->SetMarkerSize(1.2);
   hist_pfoEnergyNeutralHadrons__4->GetXaxis()->SetRange(1,1000);
   hist_pfoEnergyNeutralHadrons__4->GetXaxis()->SetNdivisions(506);
   hist_pfoEnergyNeutralHadrons__4->GetXaxis()->SetLabelFont(42);
   hist_pfoEnergyNeutralHadrons__4->GetXaxis()->SetLabelOffset(0.015);
   hist_pfoEnergyNeutralHadrons__4->GetXaxis()->SetLabelSize(0.06);
   hist_pfoEnergyNeutralHadrons__4->GetXaxis()->SetTitleSize(0.07);
   hist_pfoEnergyNeutralHadrons__4->GetXaxis()->SetTitleFont(42);
   hist_pfoEnergyNeutralHadrons__4->GetYaxis()->SetNdivisions(506);
   hist_pfoEnergyNeutralHadrons__4->GetYaxis()->SetLabelFont(42);
   hist_pfoEnergyNeutralHadrons__4->GetYaxis()->SetLabelOffset(0.015);
   hist_pfoEnergyNeutralHadrons__4->GetYaxis()->SetLabelSize(0.06);
   hist_pfoEnergyNeutralHadrons__4->GetYaxis()->SetTitleSize(0.07);
   hist_pfoEnergyNeutralHadrons__4->GetYaxis()->SetTitleOffset(1.2);
   hist_pfoEnergyNeutralHadrons__4->GetYaxis()->SetTitleFont(42);
   hist_pfoEnergyNeutralHadrons__4->GetZaxis()->SetLabelFont(42);
   hist_pfoEnergyNeutralHadrons__4->GetZaxis()->SetLabelOffset(0.015);
   hist_pfoEnergyNeutralHadrons__4->GetZaxis()->SetLabelSize(0.06);
   hist_pfoEnergyNeutralHadrons__4->GetZaxis()->SetTitleSize(0.07);
   hist_pfoEnergyNeutralHadrons__4->GetZaxis()->SetTitleOffset(1.2);
   hist_pfoEnergyNeutralHadrons__4->GetZaxis()->SetTitleFont(42);
   hist_pfoEnergyNeutralHadrons__4->Draw("HISTsame");
   
   TH1F *hist_pfoEnergyNeutralHadrons__5 = new TH1F("hist_pfoEnergyNeutralHadrons__5","hist_pfoEnergyNeutralHadrons",500,0,500);
   hist_pfoEnergyNeutralHadrons__5->SetBinContent(1,488);
   hist_pfoEnergyNeutralHadrons__5->SetBinContent(2,517);
   hist_pfoEnergyNeutralHadrons__5->SetBinContent(3,578);
开发者ID:oviazlo,项目名称:Presentations,代码行数:67,代码来源:TrackClusterDistanceCut_Zuds91_neutralRecoEnergy.C

示例7: DarkSusy_mH_125_mGammaD_2000_cT_10_LHE_gammaD_L_Z

void DarkSusy_mH_125_mGammaD_2000_cT_10_LHE_gammaD_L_Z()
{
//=========Macro generated from canvas: cnv/cnv
//=========  (Sun May 24 15:17:52 2015) by ROOT version6.02/05
   TCanvas *cnv = new TCanvas("cnv", "cnv",1,1,904,904);
   gStyle->SetOptFit(1);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   cnv->SetHighLightColor(2);
   cnv->Range(-10.625,-0.01311612,51.875,0.08777715);
   cnv->SetFillColor(0);
   cnv->SetBorderMode(0);
   cnv->SetBorderSize(2);
   cnv->SetTickx(1);
   cnv->SetTicky(1);
   cnv->SetLeftMargin(0.17);
   cnv->SetRightMargin(0.03);
   cnv->SetTopMargin(0.07);
   cnv->SetBottomMargin(0.13);
   cnv->SetFrameFillStyle(0);
   cnv->SetFrameBorderMode(0);
   cnv->SetFrameFillStyle(0);
   cnv->SetFrameBorderMode(0);
   
   TH1F *h_gammaD_cT_Z_lab_dummy57 = new TH1F("h_gammaD_cT_Z_lab_dummy57","h_gammaD_cT_Z_lab_dummy",5,0,50);
   h_gammaD_cT_Z_lab_dummy57->SetMaximum(0.08071462);
   h_gammaD_cT_Z_lab_dummy57->SetLineStyle(0);
   h_gammaD_cT_Z_lab_dummy57->SetMarkerStyle(20);
   h_gammaD_cT_Z_lab_dummy57->GetXaxis()->SetTitle("L_{Z} of #gamma_{D} [mm]");
   h_gammaD_cT_Z_lab_dummy57->GetXaxis()->SetLabelFont(42);
   h_gammaD_cT_Z_lab_dummy57->GetXaxis()->SetLabelOffset(0.007);
   h_gammaD_cT_Z_lab_dummy57->GetXaxis()->SetTitleSize(0.06);
   h_gammaD_cT_Z_lab_dummy57->GetXaxis()->SetTitleOffset(0.95);
   h_gammaD_cT_Z_lab_dummy57->GetXaxis()->SetTitleFont(42);
   h_gammaD_cT_Z_lab_dummy57->GetYaxis()->SetTitle("Normalized Fraction of events / 10.0 mm");
   h_gammaD_cT_Z_lab_dummy57->GetYaxis()->SetLabelFont(42);
   h_gammaD_cT_Z_lab_dummy57->GetYaxis()->SetLabelOffset(0.007);
   h_gammaD_cT_Z_lab_dummy57->GetYaxis()->SetTitleSize(0.05);
   h_gammaD_cT_Z_lab_dummy57->GetYaxis()->SetTitleOffset(1.3);
   h_gammaD_cT_Z_lab_dummy57->GetYaxis()->SetTitleFont(42);
   h_gammaD_cT_Z_lab_dummy57->GetZaxis()->SetLabelFont(42);
   h_gammaD_cT_Z_lab_dummy57->GetZaxis()->SetLabelOffset(0.007);
   h_gammaD_cT_Z_lab_dummy57->GetZaxis()->SetTitleSize(0.06);
   h_gammaD_cT_Z_lab_dummy57->GetZaxis()->SetTitleFont(42);
   h_gammaD_cT_Z_lab_dummy57->Draw("");
   
   TH1F *h_gammaD_cT_Z_lab58 = new TH1F("h_gammaD_cT_Z_lab58","h_gammaD_cT_Z_lab",5,0,50);
   h_gammaD_cT_Z_lab58->SetBinContent(1,0.04484145);
   h_gammaD_cT_Z_lab58->SetBinContent(2,0.02460945);
   h_gammaD_cT_Z_lab58->SetBinContent(3,0.01479324);
   h_gammaD_cT_Z_lab58->SetBinContent(4,0.009401793);
   h_gammaD_cT_Z_lab58->SetBinContent(5,0.006354062);
   h_gammaD_cT_Z_lab58->SetBinContent(6,0.03052218);
   h_gammaD_cT_Z_lab58->SetEntries(159998);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#0000ff");
   h_gammaD_cT_Z_lab58->SetLineColor(ci);
   h_gammaD_cT_Z_lab58->SetLineWidth(2);
   h_gammaD_cT_Z_lab58->SetMarkerStyle(20);
   h_gammaD_cT_Z_lab58->GetXaxis()->SetTitle("L_{z} of #gamma_{D} [mm]");
   h_gammaD_cT_Z_lab58->GetXaxis()->SetLabelFont(42);
   h_gammaD_cT_Z_lab58->GetXaxis()->SetLabelOffset(0.007);
   h_gammaD_cT_Z_lab58->GetXaxis()->SetTitleSize(0.06);
   h_gammaD_cT_Z_lab58->GetXaxis()->SetTitleOffset(0.95);
   h_gammaD_cT_Z_lab58->GetXaxis()->SetTitleFont(42);
   h_gammaD_cT_Z_lab58->GetYaxis()->SetTitle("Events");
   h_gammaD_cT_Z_lab58->GetYaxis()->SetLabelFont(42);
   h_gammaD_cT_Z_lab58->GetYaxis()->SetLabelOffset(0.007);
   h_gammaD_cT_Z_lab58->GetYaxis()->SetTitleSize(0.06);
   h_gammaD_cT_Z_lab58->GetYaxis()->SetTitleOffset(1.5);
   h_gammaD_cT_Z_lab58->GetYaxis()->SetTitleFont(42);
   h_gammaD_cT_Z_lab58->GetZaxis()->SetLabelFont(42);
   h_gammaD_cT_Z_lab58->GetZaxis()->SetLabelOffset(0.007);
   h_gammaD_cT_Z_lab58->GetZaxis()->SetTitleSize(0.06);
   h_gammaD_cT_Z_lab58->GetZaxis()->SetTitleFont(42);
   h_gammaD_cT_Z_lab58->Draw("same");
   
   TLegend *leg = new TLegend(0.4566667,0.82,0.7822222,0.9066667,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextSize(0.02777778);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(0);
   TLegendEntry *entry=leg->AddEntry("NULL","#splitline{pp #rightarrow h #rightarrow 2n_{1} #rightarrow 2n_{D} + 2 #gamma_{D} #rightarrow 2n_{D} + 4#mu}{#splitline{m_{h} = 125 GeV, m_{n_{1}} = 50 GeV, m_{n_{D}} = 1 GeV}{m_{#gamma_{D}} = 20 GeV, c#tau_{#gamma_{D}} = 10 mm}}","h");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   
   leg = new TLegend(0.17,0.935,0.97,1,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextAlign(22);
//.........这里部分代码省略.........
开发者ID:tahuang1991,项目名称:MuJetAnalysis,代码行数:101,代码来源:DarkSusy_mH_125_mGammaD_2000_cT_10_LHE_gammaD_L_Z.C

示例8: trigTurnOnVsPt


//.........这里部分代码省略.........
		//TH1F* htop_datat =(TH1F*) myEffNfile_Data->Get(plotlistBaseSel[i].c_str());
		//TH1F* hbot_datat = (TH1F*) myEffNfile_Data->Get(plotlistBase[i].c_str());
		
		TH1F* htop_data =(TH1F*) filelist[file]->Get(plotlistBaseSel[i].c_str())->Clone();
		TH1F* hbot_data = (TH1F*) filelist[file]->Get(plotlistBase[i].c_str())->Clone();
		
	//TH1F* htop_data =htop_datat->Clone();
	//TH1F* hbot_data =hbot_datat->Clone();
//  TH1D* htop_data = htop_2ddata->ProjectionY();
//  TH1D* hbot_data = hbot_2ddata->ProjectionY();
  //myEffNfile_Data->Close();
  std::cout << "Boom" << std::endl;
		if(i<2){
		htop_data->GetXaxis()->SetRangeUser(50,800);
			hbot_data->GetXaxis()->SetRangeUser(50,800);}
		if(i>=2){
			htop_data->GetXaxis()->SetRangeUser(50,200);
			hbot_data->GetXaxis()->SetRangeUser(50,200);}
//		htop_data->Rebin(2);
//		hbot_data->Rebin(2);

	htop_data->Draw();
  hbot_data->Draw("same");
		TH1F* ratio = (TH1F*) filelist[file]->Get(plotlistBaseSel[i].c_str())->Clone();

  ratio->Sumw2();
  ratio->Divide(hbot_data);
  //erf((m-m0)/sigma)+1)/2
/*  TF1 * f1 = new TF1("f1","(TMath::Erf((x*[0] -[1])/[2])+1.)/2.",20.,100.);
  f1->SetParameter(2,1.);
  //ratio->Fit(f1,"R");*/

  TCanvas *c1 = new TCanvas("c1","Canvas1",0,0,800,600);
  c1->SetLineColor(0);
  c1->SetFrameFillColor(0);
  c1->SetFillStyle(4000);
  c1->SetFillColor(0);   
  c1->SetBorderMode(0);
  //gStyle->SetOptStat(0);    
  c1->SetFillColor(0);
  c1->SetBorderSize(0);
  c1->SetBorderMode(0);
  c1->SetLeftMargin(0.15);
  c1->SetRightMargin(0.12);
  c1->SetTopMargin(0.12);
  c1->SetBottomMargin(0.15);
/*  gROOT->SetStyle("Plain");
  gStyle->SetOptStat(0000); //This puts in stats box
  gStyle->SetTitleBorderSize(0);
  gStyle->SetTitleX(0.5); // X position of the title box from left
  gStyle->SetTitleAlign(23);
  gStyle->SetTitleY(.975); // Y position of the title box from bottom
  gStyle->SetLabelSize(0.03,"y");
  gStyle->SetStatX(.9);
  gStyle->SetStatY(.9);
  gStyle->SetStatW(0.20);
  gStyle->SetStatFontSize(0.044);
  gStyle->SetStatColor(0);  */
  std::cout << "Boom2" << std::endl;
  TGraphAsymmErrors* eff0 = new TGraphAsymmErrors();
  std::cout << "Boom3" << std::endl;
	eff0->BayesDivide(htop_data,hbot_data);
		TF1 * f1 = new TF1("f1","(TMath::Erf((x*[0] -[1])/[2])+1.)/2.",0.,1700.);
		f1->SetParameter(2,1.);
		if (i==2) eff0->Fit(f1,"","",50,350);
		if (i==3) eff0->Fit(f1,"","",50,250);
开发者ID:clseitz,项目名称:usercode,代码行数:67,代码来源:trigTurnOnVsPt.C

示例9: Plotter_sbatb2


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

  pathDelphesEff = "/home/fynu/amertens/storage/THDM/eff_v1/"+strmH+"_"+strmA+".root";
  DelphesFile = TFile(pathDelphesEff);
  TGraph2D* myG2D = DelphesFile.Get("Graph2D");
  Double_t eff = myG2D->Interpolate(int(mA),int(mH));

  Double_t lumi = 19.7;
  cout << "efficiency : " << eff << " ratio : " << ratio << endl;
  Double_t LumiEff = eff*ratio*lumi;

  TFile* f_Sig1 = new TFile(file_path_sig1);
  TTree* tree_Sig1 = (TTree*) f_Sig1->Get("limit");

  TBranch *branch  = tree_Sig1->GetBranch("limit");
  branch->SetAddress(&limit);

  branch->GetEntry(5);
  Double_t limit_obs = limit /(0.067*LumiEff);
  branch->GetEntry(0);
  Double_t limit_m2 = limit /(0.067*LumiEff);
  branch->GetEntry(1);
  Double_t limit_m1 = limit /(0.067*LumiEff);
  branch->GetEntry(2);
  Double_t limit_exp = limit /(0.067*LumiEff);
  branch->GetEntry(3);
  Double_t limit_p1 = limit /(0.067*LumiEff);
  branch->GetEntry(4);
  Double_t limit_p2 = limit /(0.067*LumiEff);

  // Limit vs TanBeta cosba
  TString Xsec_path = "/home/fynu/amertens/Delphes/delphes/condor/xsec_H_ZA_ll_bb_tautau_tanb_cosba_"+strmH+"_"+strmA+".root";
  TFile *f4 = new TFile(Xsec_path);
  TCanvas* C_tbcba = new TCanvas("C_tbcba","C_tbcba",600,600);

  gPad->SetGrid();

  C_tbcba->SetLogy(true);
  //C_tbcba->SetRightMargin(0.17);

  TH2D* h_tbcba = f4->Get("h_HZbbXsec");

  TGraph* g_obs = getContourFilledX(h_tbcba, C_tbcba, 3, 1,3645, limit_obs);
  TGraph* g_exp = getContourFilledX(h_tbcba, C_tbcba, 3, 7,0, limit_exp);


  Double_t contours[6];
  contours[0] = limit_m2;
  contours[1] = limit_m1;
  contours[2] = limit_exp;
  contours[3] = limit_p1;
  contours[4] = limit_p2;
  h_tbcba->SetContour(5, contours);

  TH2D* finalPlot_tbcba = h_tbcba;

  Int_t colors[] = {kYellow, kGreen, kGreen, kYellow, kWhite}; // #colors >= #levels - 1
  gStyle->SetPalette((sizeof(colors)/sizeof(Int_t)), colors);

  DrawThis();

  finalPlot_tbcba->Draw("cont list same");

  cout << "limits : " << limit_m2 << endl;
  cout << "limits : " << limit_m1 << endl;
  cout << "limits : " << limit_exp << endl;
  cout << "limits : " << limit_p1 << endl;
  cout << "limits : " << limit_p2 << endl;

  cout << "limits obs : " << limit_obs << endl;

   

//  TGraph* g_obs = getContourFilledX(finalPlot_tbcba, C_tbcba, 3, 1,3004, limit_obs);
//  TGraph* g_exp = getContourFilledX(finalPlot_tbcba, C_tbcba, 3, 7,4000, limit_exp);

  g_obs->Draw("CL F same");
  g_exp->Draw("CL F same");

  DrawMasses("M_{H} = 330 GeV", "M_{A} = 100 GeV");

  TGraph* g_yellow = new TGraph();
  g_yellow->SetFillColor(kYellow);
  TGraph* g_green = new TGraph();
  g_green->SetFillColor(kGreen);



  TLegend* leg = new TLegend(0.7,0.5,0.9,0.7);
  //leg->SetHeader("#splitline{THDM type II}{#splitline{M_{H} = 378}{M_{A} = 216}}");
  leg->SetLineColor(0);
  leg->SetFillColor(0);
  leg->AddEntry(g_obs,"Obs. Excl.","F");
  leg->AddEntry(g_exp,"Exp. Excl.","l");  
  leg->AddEntry(g_green,"1-sigma","F");
  leg->AddEntry(g_yellow,"2-sigma","F");
  leg->Draw();

  gPad->RedrawAxis("g"); // for "grid lines"

}
开发者ID:AlexandreMertens,项目名称:ZAPlotters,代码行数:101,代码来源:Plotter_sbatb2.C

示例10: fit1


//.........这里部分代码省略.........
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   TGraph *graph = new TGraph(102,curvetot_fx1,curvetot_fy1);
   graph->SetName("curvetot");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_curvetot1 = new TH1F("Graph_curvetot1","Projection of totalPdf",102,4135,6115);
   Graph_curvetot1->SetMinimum(0.0011);
   Graph_curvetot1->SetMaximum(1.1);
   Graph_curvetot1->SetDirectory(0);
   Graph_curvetot1->SetStats(0);
   Graph_curvetot1->SetLineWidth(2);
   Graph_curvetot1->SetMarkerStyle(20);
   Graph_curvetot1->GetXaxis()->SetNdivisions(505);
   Graph_curvetot1->GetXaxis()->SetLabelFont(132);
   Graph_curvetot1->GetXaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetXaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetXaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetXaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetXaxis()->SetTitleFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetYaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetYaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetYaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetYaxis()->SetTitleFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetZaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetZaxis()->SetTitleOffset(1.2);
   Graph_curvetot1->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_curvetot1);
   
   graph->Draw("l");
   
开发者ID:goi42,项目名称:LbJpsipPi,代码行数:66,代码来源:fitLst1.C

示例11: Final_av_Lambda_VarCoupling_40Percent

void Final_av_Lambda_VarCoupling_40Percent()
{
//=========Macro generated from canvas: c/c
//=========  (Sat Feb 27 17:06:04 2016) by ROOT version6.04/06
   TCanvas *c = new TCanvas("c", "c",0,0,800,700);
   c->SetHighLightColor(2);
   c->Range(-0.4813593,1.36281,3.148656,6.672724);
   c->SetFillColor(0);
   c->SetBorderMode(0);
   c->SetBorderSize(2);
   c->SetLogx();
   c->SetLogy();
   c->SetTickx(1);
   c->SetTicky(1);
   c->SetLeftMargin(0.12);
   c->SetRightMargin(0.04);
   c->SetTopMargin(0.07);
   c->SetBottomMargin(0.12);
   c->SetFrameBorderMode(0);
   c->SetFrameBorderMode(0);
   
   TMultiGraph *multigraph = new TMultiGraph();
   multigraph->SetName("");
   multigraph->SetTitle("");
   
   Double_t Graph_fx1[12] = {
   1,
   10,
   100,
   400,
   700,
   1000,
   1000,
   700,
   400,
   100,
   10,
   1};
   Double_t Graph_fy1[12] = {
   881.525,
   896.549,
   871.907,
   667.806,
   471.744,
   308.777,
   382.832,
   584.437,
   826.374,
   1079.16,
   1110.85,
   1092.23};
   TGraph *graph = new TGraph(12,Graph_fx1,Graph_fy1);
   graph->SetName("Graph");
   graph->SetTitle("");

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#ffcc00");
   graph->SetFillColor(ci);

   ci = TColor::GetColor("#ff6666");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph1 = new TH1F("Graph_Graph1","",100,0.9,1099.9);
   Graph_Graph1->SetMinimum(228.5697);
   Graph_Graph1->SetMaximum(1191.057);
   Graph_Graph1->SetDirectory(0);
   Graph_Graph1->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph1->SetLineColor(ci);
   Graph_Graph1->GetXaxis()->SetLabelFont(42);
   Graph_Graph1->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph1->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph1->GetXaxis()->SetTitleFont(42);
   Graph_Graph1->GetYaxis()->SetLabelFont(42);
   Graph_Graph1->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph1->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph1->GetYaxis()->SetTitleFont(42);
   Graph_Graph1->GetZaxis()->SetLabelFont(42);
   Graph_Graph1->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph1->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph1->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph1);
   
   multigraph->Add(graph,"");
   multigraph->Draw("af");
   multigraph->GetXaxis()->SetTitle("M_{#chi} (GeV)");
   multigraph->GetXaxis()->SetRange(0,96);
   multigraph->GetXaxis()->SetLabelFont(42);
   multigraph->GetXaxis()->SetTitleSize(0.05);
   multigraph->GetXaxis()->SetTitleOffset(1.1);
   multigraph->GetXaxis()->SetTitleFont(42);
   multigraph->GetYaxis()->SetTitle("#Lambda (GeV)");
   multigraph->GetYaxis()->SetLabelFont(42);
   multigraph->GetYaxis()->SetTitleSize(0.05);
   multigraph->GetYaxis()->SetTitleOffset(1.05);
   multigraph->GetYaxis()->SetTitleFont(42);
   
//.........这里部分代码省略.........
开发者ID:cmorgoth,项目名称:PhD-Thesis,代码行数:101,代码来源:Final_AV_Lambda_WithDD_vFeb25_2015_FR.C

示例12: fitWMLL3testbkg


//.........这里部分代码省略.........
   143.0574,
   142.7781,
   142.5582,
   142.4016,
   142.3126,
   142.2955,
   142.3542,
   142.4931,
   142.7163,
   143.028,
   143.4323,
   143.9335,
   144.5356,
   145.2429,
   146.0595,
   146.9897,
   148.0375,
   149.2073,
   150.503,
   151.929,
   153.4893,
   155.1882,
   157.0298,
   159.0183,
   159.0183};
   TGraph *graph = new TGraph(102,curvetot_fx1,curvetot_fy1);
   graph->SetName("curvetot");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_curvetot1 = new TH1F("Graph_curvetot1","Projection of totalPdf",102,306,474);
   Graph_curvetot1->SetMinimum(0);
   Graph_curvetot1->SetMaximum(173.6745);
   Graph_curvetot1->SetDirectory(0);
   Graph_curvetot1->SetStats(0);
   Graph_curvetot1->SetLineWidth(2);
   Graph_curvetot1->SetMarkerStyle(20);
   Graph_curvetot1->GetXaxis()->SetNdivisions(505);
   Graph_curvetot1->GetXaxis()->SetLabelFont(132);
   Graph_curvetot1->GetXaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetXaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetXaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetXaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetXaxis()->SetTitleFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetYaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetYaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetYaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetYaxis()->SetTitleFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetZaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetZaxis()->SetTitleOffset(1.2);
   Graph_curvetot1->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_curvetot1);
   
   graph->Draw("l");
   
开发者ID:goi42,项目名称:LbJpsipPi,代码行数:66,代码来源:fitWMLL3testbkg.C

示例13: phimuphimet

void phimuphimet()
{
//=========Macro generated from canvas: phimuphimet/phimuphimet
//=========  (Fri Nov 13 11:38:57 2015) by ROOT version6.02/05
   TCanvas *phimuphimet = new TCanvas("phimuphimet", "phimuphimet",340,362,700,700);
   phimuphimet->Range(-0.3926991,-3.745915,3.534292,3.369465);
   phimuphimet->SetFillColor(0);
   phimuphimet->SetBorderMode(0);
   phimuphimet->SetBorderSize(2);
   phimuphimet->SetLogy();
   phimuphimet->SetFrameBorderMode(0);
   phimuphimet->SetFrameBorderMode(0);
   
   THStack *phimuphimet = new THStack();
   phimuphimet->SetName("phimuphimet");
   phimuphimet->SetTitle("phimuphimet");
   
   TH1F *phimuphimet_stack_18 = new TH1F("phimuphimet_stack_18","phimuphimet",10,0,3.141593);
   phimuphimet_stack_18->SetMinimum(0.0009238963);
   phimuphimet_stack_18->SetMaximum(454.9117);
   phimuphimet_stack_18->SetDirectory(0);
   phimuphimet_stack_18->SetStats(0);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#000099");
   phimuphimet_stack_18->SetLineColor(ci);
   phimuphimet_stack_18->GetXaxis()->SetTitle("phimuphimet");
   phimuphimet_stack_18->GetXaxis()->SetLabelFont(42);
   phimuphimet_stack_18->GetXaxis()->SetLabelSize(0.035);
   phimuphimet_stack_18->GetXaxis()->SetTitleSize(0.035);
   phimuphimet_stack_18->GetXaxis()->SetTitleFont(42);
   phimuphimet_stack_18->GetYaxis()->SetTitle("Events/pb");
   phimuphimet_stack_18->GetYaxis()->SetLabelFont(42);
   phimuphimet_stack_18->GetYaxis()->SetLabelSize(0.035);
   phimuphimet_stack_18->GetYaxis()->SetTitleSize(0.035);
   phimuphimet_stack_18->GetYaxis()->SetTitleFont(42);
   phimuphimet_stack_18->GetZaxis()->SetLabelFont(42);
   phimuphimet_stack_18->GetZaxis()->SetLabelSize(0.035);
   phimuphimet_stack_18->GetZaxis()->SetTitleSize(0.035);
   phimuphimet_stack_18->GetZaxis()->SetTitleFont(42);
   phimuphimet->SetHistogram(phimuphimet_stack_18);
   
   
   TH1D *phimuphimet86 = new TH1D("phimuphimet86"," #Delta_{#phi}[#mu,MET]",10,0,3.141593);
   phimuphimet86->SetBinContent(1,230.641);
   phimuphimet86->SetBinContent(2,216.3046);
   phimuphimet86->SetBinContent(3,223.2529);
   phimuphimet86->SetBinContent(4,205.0752);
   phimuphimet86->SetBinContent(5,177.4887);
   phimuphimet86->SetBinContent(6,185.6797);
   phimuphimet86->SetBinContent(7,165.8596);
   phimuphimet86->SetBinContent(8,166.2099);
   phimuphimet86->SetBinContent(9,159.2644);
   phimuphimet86->SetBinContent(10,174.5095);
   phimuphimet86->SetBinError(1,8.61142);
   phimuphimet86->SetBinError(2,8.327371);
   phimuphimet86->SetBinError(3,8.486581);
   phimuphimet86->SetBinError(4,8.129407);
   phimuphimet86->SetBinError(5,7.536633);
   phimuphimet86->SetBinError(6,7.726982);
   phimuphimet86->SetBinError(7,7.294678);
   phimuphimet86->SetBinError(8,7.302349);
   phimuphimet86->SetBinError(9,7.154931);
   phimuphimet86->SetBinError(10,7.4987);
   phimuphimet86->SetEntries(17572);

   ci = TColor::GetColor("#00cc00");
   phimuphimet86->SetFillColor(ci);

   ci = TColor::GetColor("#00cc00");
   phimuphimet86->SetLineColor(ci);

   ci = TColor::GetColor("#00cc00");
   phimuphimet86->SetMarkerColor(ci);
   phimuphimet86->SetMarkerStyle(22);
   phimuphimet86->GetXaxis()->SetTitle("phimuphimet");
   phimuphimet86->GetXaxis()->SetLabelFont(42);
   phimuphimet86->GetXaxis()->SetLabelSize(0.035);
   phimuphimet86->GetXaxis()->SetTitleSize(0.035);
   phimuphimet86->GetXaxis()->SetTitleFont(42);
   phimuphimet86->GetYaxis()->SetTitle("Events/pb");
   phimuphimet86->GetYaxis()->SetLabelFont(42);
   phimuphimet86->GetYaxis()->SetLabelSize(0.035);
   phimuphimet86->GetYaxis()->SetTitleSize(0.035);
   phimuphimet86->GetYaxis()->SetTitleFont(42);
   phimuphimet86->GetZaxis()->SetLabelFont(42);
   phimuphimet86->GetZaxis()->SetLabelSize(0.035);
   phimuphimet86->GetZaxis()->SetTitleSize(0.035);
   phimuphimet86->GetZaxis()->SetTitleFont(42);
   phimuphimet->Add(phimuphimet,"");
   
   TH1D *phimuphimet87 = new TH1D("phimuphimet87"," #Delta_{#phi}[#mu,MET]",10,0,3.141593);
   phimuphimet87->SetBinContent(1,6.11516);
   phimuphimet87->SetBinContent(2,5.535954);
   phimuphimet87->SetBinContent(3,5.331195);
   phimuphimet87->SetBinContent(4,5.298494);
   phimuphimet87->SetBinContent(5,5.612855);
   phimuphimet87->SetBinContent(6,5.975299);
   phimuphimet87->SetBinContent(7,6.323196);
//.........这里部分代码省略.........
开发者ID:delgadoandrea,项目名称:CMSSW_7_4_6_patch6,代码行数:101,代码来源:phimuphimet.C

示例14: fitLMC_c070116_LL1_floathypparamsfixmusigma_nobkg


//.........这里部分代码省略.........
   20.60332,
   12.13127,
   2.197087,
   0.6127486,
   0.2221579,
   0.0958892,
   0.0468419,
   0.02509342,
   0.01443649,
   0.008790563,
   0.005605979,
   0.003714951,
   0.002542779,
   0.001789259,
   0.001289489,
   0.0009489036,
   0.0007112191,
   0.000541828,
   0.0004188321,
   0.000328018,
   0.0002599479,
   0.0002082251,
   0.0001684331,
   0.000137471,
   0.000137471};
   TGraph *graph = new TGraph(128,curvetot_fx1,curvetot_fy1);
   graph->SetName("curvetot");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_curvetot1 = new TH1F("Graph_curvetot1","Projection of totalPdf",128,4126,6214);
   Graph_curvetot1->SetMinimum(4.58796e-11);
   Graph_curvetot1->SetMaximum(3464.555);
   Graph_curvetot1->SetDirectory(0);
   Graph_curvetot1->SetStats(0);
   Graph_curvetot1->SetLineWidth(2);
   Graph_curvetot1->SetMarkerStyle(20);
   Graph_curvetot1->GetXaxis()->SetNdivisions(505);
   Graph_curvetot1->GetXaxis()->SetLabelFont(132);
   Graph_curvetot1->GetXaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetXaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetXaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetXaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetXaxis()->SetTitleFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetYaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetYaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetYaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetYaxis()->SetTitleFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetZaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetZaxis()->SetTitleOffset(1.2);
   Graph_curvetot1->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_curvetot1);
   
   graph->Draw("l");
   
开发者ID:goi42,项目名称:LbJpsipPi,代码行数:66,代码来源:fitLMC_c070116_LL1_floathypparamsfixmusigma_nobkg.C

示例15: BtagEfficiencies

int BtagEfficiencies()
{
  // Define sample
  TFile* TTJets    = new TFile("TTJetsFall11.root" , "READ");
  TFile* WJetsHT   = new TFile("WJetsHT.root"      , "READ");
  TFile* SingleTop = new TFile("SingleTop.root"    , "READ");

  // addSample(TFile* sample, TString name)
  addSample(TTJets,    "t#bar{t}+Jets", kRed,     21, 0.9, 7);
  addSample(SingleTop, "single top",    kBlue,    20, 1.0, 7);
  addSample(WJetsHT,   "W+Jets",        kGreen+2, 23, 1.1, 7);
  //addSample(SingleTop, "single top",    kBlue,  24, 1,   7);
  //addSample(WJetsHT,   "W+Jets",        kGreen, 25, 1,   7);


  // addAlgorithm(TString name)
  addAlgorithm("TCHEM");

  // addSelectionStep(TString name, int lc, TString sn);
  addSelectionStep("", 8, "RA4b");

  // Flavors
  Flavors.push_back("B");
  Flavors.push_back("C");
  Flavors.push_back("L");

  // global settings
//   gStyle->SetCanvasColor(10);
//   gStyle->SetOptStat(0);
//   gStyle->SetPalette(1);
//   gStyle->SetTitleFillColor(0);

  setTDRStyle();

  // loop over algorithms
  for(int a=0; a<Algos.size(); ++a)
    {
      std::cout << Algos[a] << std::endl;
      
      // loop over flavor	  
      for(int flv=0; flv<(int)Flavors.size(); ++flv)
	{
	  // loop over selection steps
	  for(int s=0; s < Steps.size(); ++s)
	    {
	      std::cout << "Selection step " << Steps[s] <<  std::endl;
	       
	      // Define canvas and legend/afs/desy.de/user/n/npietsch
	      TCanvas *canvas =new TCanvas(SelectionNames[s]+"_"+Algos[a]+"_"+Flavors[flv]+"_Pt",SelectionNames[s]+"_"+Algos[a]+"_"+Flavors[flv]+"_Pt",1);

	      TLegend *leg = new TLegend(.64,.18,.91,.35);
	      leg->SetTextFont(42);
	      leg->SetFillColor(0);
	      leg->SetLineColor(1);
	      
	      TPaveText *label = new TPaveText(0.14,0.91,0.6,0.99,"NDC");
	      label->SetFillColor(0);
	      label->SetTextFont(42);
	      label->SetBorderSize(0);
	      TText *text=label->AddText("CMS Simulation, #sqrt{s}=7 TeV");
	      text->SetTextAlign(22);
	      
	      TPaveText *label2 = new TPaveText(0.33,0.23,0.53,0.33,"NDC");
	      label2->SetFillColor(0);
	      label2->SetTextFont(62);
	      label2->SetBorderSize(0);
	      TText *text2=label2->AddText("0 < |#eta| < 0.8");
	      text2->SetTextAlign(22);

	      // declare maximum and ybin
	      double Maximum=0;
	      double ybin=1;

	      // loop over files
	      for(int f=0; f<(int)Files.size(); ++f)
		{
		  TH2F* Pt_=(TH2F*)Files[f]->Get("bTagEffRA4bMu"+Algos[a]+Steps[s]+"/Num"+Flavors[flv]+"JetsPtEta");
		  TH2F* Pt2_=(TH2F*)Files[f]->Get("bTagEffRA4bEl"+Algos[a]+Steps[s]+"/Num"+Flavors[flv]+"JetsPtEta");
		  Pt_->Add(Pt2_);

		  TH2F* TaggedPt_=(TH2F*)Files[f]->Get("bTagEffRA4bMu"+Algos[a]+Steps[s]+"/Num"+Flavors[flv]+"JetsTaggedPtEta");
		  TH2F* TaggedPt2_=(TH2F*)Files[f]->Get("bTagEffRA4bEl"+Algos[a]+Steps[s]+"/Num"+Flavors[flv]+"JetsTaggedPtEta");
		  TaggedPt_->Add(TaggedPt2_);

		  TaggedPt_->Divide(Pt_);
		  
		  //--------------------------------------
		  // Draw x and y errors
		  //--------------------------------------
		  
		  // define shifts
		  double shift_=4*(f-1);
		  double shift2_=5*(f-1);
		  double shift3_=6*(f-1);
		  
		  // define array xbinsPt
		  Int_t nBins=TaggedPt_->GetNbinsX();
		  double xbinsPt[18];
		  double xbinsPtX[18];

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


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