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


C++ TCanvas::Modified方法代码示例

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


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

示例1: proj_npe_7


//.........这里部分代码省略.........
   2371.061,
   2594.067,
   2630.891,
   2704.654,
   2727.792,
   2773.388,
   2784.73,
   2845.592,
   2924.958,
   3198.695};
   Double_t _fy8[40] = {
   2.75,
   2.65,
   2.65,
   2.7,
   2.35,
   2.45,
   140.25,
   2.65,
   2.15,
   2.55,
   2.35,
   2.45,
   2.3,
   2.5,
   2.65,
   4.05,
   2.55,
   2.5,
   2.35,
   2.25,
   2.6,
   2.7,
   2.7,
   2.6,
   2.4,
   2.35,
   2.8,
   2.55,
   2.35,
   2.8,
   2.4,
   2.35,
   2.6,
   2.6,
   2.45,
   2.45,
   2.65,
   2.55,
   2.55,
   2.65};
   TGraph *graph = new TGraph(40,_fx8,_fy8);
   graph->SetName("");
   graph->SetTitle("npe values of flashes in event: 7");
   graph->SetFillColor(1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#0000ff");
   graph->SetMarkerColor(ci);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_Graph8 = new TH1F("Graph_Graph8","npe values of flashes in event: 7",100,-2006.917,3671.932);
   Graph_Graph8->SetMinimum(0);
   Graph_Graph8->SetMaximum(154.06);
   Graph_Graph8->SetDirectory(0);
   Graph_Graph8->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph8->SetLineColor(ci);
   Graph_Graph8->GetXaxis()->SetTitle("flash_t");
   Graph_Graph8->GetXaxis()->SetLabelFont(42);
   Graph_Graph8->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph8->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph8->GetXaxis()->SetTitleFont(42);
   Graph_Graph8->GetYaxis()->SetTitle("flash_npe");
   Graph_Graph8->GetYaxis()->SetLabelFont(42);
   Graph_Graph8->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph8->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph8->GetYaxis()->SetTitleFont(42);
   Graph_Graph8->GetZaxis()->SetLabelFont(42);
   Graph_Graph8->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph8->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph8->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph8);
   
   graph->Draw("ap");
   
   TPaveText *pt = new TPaveText(0.1823077,0.9368947,0.8176923,0.995,"blNDC");
   pt->SetName("title");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetFillStyle(0);
   pt->SetTextFont(42);
   TText *AText = pt->AddText("npe values of flashes in event: 7");
   pt->Draw();
   c->Modified();
   c->cd();
   c->SetSelected(c);
}
开发者ID:nikihowe,项目名称:flash,代码行数:101,代码来源:proj_npe_7.C

示例2: METopt


//.........这里部分代码省略.........
   METopt40->SetMarkerStyle(21);
   METopt40->GetXaxis()->SetTitle("METopt");
   METopt40->GetXaxis()->SetLabelFont(42);
   METopt40->GetXaxis()->SetLabelSize(0.035);
   METopt40->GetXaxis()->SetTitleSize(0.035);
   METopt40->GetXaxis()->SetTitleFont(42);
   METopt40->GetYaxis()->SetTitle("Events/pb");
   METopt40->GetYaxis()->SetLabelFont(42);
   METopt40->GetYaxis()->SetLabelSize(0.035);
   METopt40->GetYaxis()->SetTitleSize(0.035);
   METopt40->GetYaxis()->SetTitleFont(42);
   METopt40->GetZaxis()->SetLabelFont(42);
   METopt40->GetZaxis()->SetLabelSize(0.035);
   METopt40->GetZaxis()->SetTitleSize(0.035);
   METopt40->GetZaxis()->SetTitleFont(42);
   METopt->Add(METopt,"");
   METopt->Draw("nostack");
   
   TPaveText *pt = new TPaveText(0.398046,0.9342857,0.601954,0.995,"blNDC");
   pt->SetName("title");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetFillStyle(0);
   pt->SetTextFont(42);
   TText *AText = pt->AddText("METopt");
   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("METopt","METopt_QCD","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("METopt","METopt_WJetsToLNu","lp");

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

   ci = TColor::GetColor("#00ffff");
   entry->SetMarkerColor(ci);
   entry->SetMarkerStyle(20);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("METopt","METopt_ZJetsToNuNu","lp");

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

   ci = TColor::GetColor("#ffcc00");
   entry->SetMarkerColor(ci);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("METopt","METopt_signal","lp");

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

   ci = TColor::GetColor("#ff0000");
   entry->SetMarkerColor(ci);
   entry->SetMarkerStyle(20);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("METopt","METopt_ttbar","lp");

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

   ci = TColor::GetColor("#0000ff");
   entry->SetMarkerColor(ci);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   METopt->Modified();
   METopt->cd();
   METopt->SetSelected(METopt);
}
开发者ID:delgadoandrea,项目名称:CMSSW_7_4_6_patch6,代码行数:101,代码来源:METopt.C

示例3: DarkSusy_mH_125_mGammaD_2000_cT_1000_LHE_Higgs_m


//.........这里部分代码省略.........
    h_higgs_M12->GetYaxis()->SetTitleOffset(1.3);
    h_higgs_M12->GetYaxis()->SetTitleFont(42);
    h_higgs_M12->GetZaxis()->SetLabelFont(42);
    h_higgs_M12->GetZaxis()->SetLabelOffset(0.007);
    h_higgs_M12->GetZaxis()->SetTitleSize(0.06);
    h_higgs_M12->GetZaxis()->SetTitleFont(42);
    h_higgs_M12->Draw("SAMEHIST");

    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}} = 1000 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);
    leg->SetTextSize(0.045);
    leg->SetLineColor(1);
    leg->SetLineStyle(1);
    leg->SetLineWidth(1);
    leg->SetFillColor(0);
    leg->SetFillStyle(0);
    entry=leg->AddEntry("NULL","CMS Simulation (LHE) 14 TeV","h");
    entry->SetLineColor(1);
    entry->SetLineStyle(1);
    entry->SetLineWidth(1);
    entry->SetMarkerColor(1);
    entry->SetMarkerStyle(21);
    entry->SetMarkerSize(1);
    entry->SetTextFont(42);
    leg->Draw();

    TH1F *h_higgs_M_dummy13 = new TH1F("h_higgs_M_dummy13","h_higgs_M_dummy",220,80.5,300.5);
    h_higgs_M_dummy13->SetMaximum(1.5);
    h_higgs_M_dummy13->SetLineStyle(0);
    h_higgs_M_dummy13->SetMarkerStyle(20);
    h_higgs_M_dummy13->GetXaxis()->SetTitle("Mass of h [GeV]");
    h_higgs_M_dummy13->GetXaxis()->SetMoreLogLabels();
    h_higgs_M_dummy13->GetXaxis()->SetNdivisions(10);
    h_higgs_M_dummy13->GetXaxis()->SetLabelFont(42);
    h_higgs_M_dummy13->GetXaxis()->SetLabelOffset(0.007);
    h_higgs_M_dummy13->GetXaxis()->SetLabelSize(0.03);
    h_higgs_M_dummy13->GetXaxis()->SetTitleSize(0.06);
    h_higgs_M_dummy13->GetXaxis()->SetTitleOffset(0.95);
    h_higgs_M_dummy13->GetXaxis()->SetTitleFont(42);
    h_higgs_M_dummy13->GetYaxis()->SetTitle("Fraction of events / 1 GeV");
    h_higgs_M_dummy13->GetYaxis()->SetLabelFont(42);
    h_higgs_M_dummy13->GetYaxis()->SetLabelOffset(0.007);
    h_higgs_M_dummy13->GetYaxis()->SetTitleSize(0.06);
    h_higgs_M_dummy13->GetYaxis()->SetTitleOffset(1.35);
    h_higgs_M_dummy13->GetYaxis()->SetTitleFont(42);
    h_higgs_M_dummy13->GetZaxis()->SetLabelFont(42);
    h_higgs_M_dummy13->GetZaxis()->SetLabelOffset(0.007);
    h_higgs_M_dummy13->GetZaxis()->SetTitleSize(0.06);
    h_higgs_M_dummy13->GetZaxis()->SetTitleFont(42);
    h_higgs_M_dummy13->Draw("same");

    TH1F *h_higgs_M14 = new TH1F("h_higgs_M14","h_higgs_M",10,120.5,130.5);
    h_higgs_M14->SetBinContent(5,1);
    h_higgs_M14->SetBinError(5,0.003535556);
    h_higgs_M14->SetEntries(79999);
    h_higgs_M14->SetDirectory(0);

    ci = TColor::GetColor("#0000ff");
    h_higgs_M14->SetLineColor(ci);
    h_higgs_M14->SetLineWidth(2);
    h_higgs_M14->SetMarkerStyle(20);
    h_higgs_M14->GetXaxis()->SetMoreLogLabels();
    h_higgs_M14->GetXaxis()->SetLabelFont(42);
    h_higgs_M14->GetXaxis()->SetLabelOffset(0.007);
    h_higgs_M14->GetXaxis()->SetTitleSize(0.06);
    h_higgs_M14->GetXaxis()->SetTitleOffset(0.95);
    h_higgs_M14->GetXaxis()->SetTitleFont(42);
    h_higgs_M14->GetYaxis()->SetLabelFont(42);
    h_higgs_M14->GetYaxis()->SetLabelOffset(0.007);
    h_higgs_M14->GetYaxis()->SetTitleSize(0.06);
    h_higgs_M14->GetYaxis()->SetTitleOffset(1.3);
    h_higgs_M14->GetYaxis()->SetTitleFont(42);
    h_higgs_M14->GetZaxis()->SetLabelFont(42);
    h_higgs_M14->GetZaxis()->SetLabelOffset(0.007);
    h_higgs_M14->GetZaxis()->SetTitleSize(0.06);
    h_higgs_M14->GetZaxis()->SetTitleFont(42);
    h_higgs_M14->Draw("SAMEHIST");
    cnv->Modified();
    cnv->cd();
    cnv->SetSelected(cnv);
}
开发者ID:tahuang1991,项目名称:MuJetAnalysis,代码行数:101,代码来源:DarkSusy_mH_125_mGammaD_2000_cT_1000_LHE_Higgs_m.C

示例4: METJets


//.........这里部分代码省略.........
   METJets30->SetMarkerStyle(21);
   METJets30->GetXaxis()->SetTitle("METJets");
   METJets30->GetXaxis()->SetLabelFont(42);
   METJets30->GetXaxis()->SetLabelSize(0.035);
   METJets30->GetXaxis()->SetTitleSize(0.035);
   METJets30->GetXaxis()->SetTitleFont(42);
   METJets30->GetYaxis()->SetTitle("Events/pb");
   METJets30->GetYaxis()->SetLabelFont(42);
   METJets30->GetYaxis()->SetLabelSize(0.035);
   METJets30->GetYaxis()->SetTitleSize(0.035);
   METJets30->GetYaxis()->SetTitleFont(42);
   METJets30->GetZaxis()->SetLabelFont(42);
   METJets30->GetZaxis()->SetLabelSize(0.035);
   METJets30->GetZaxis()->SetTitleSize(0.035);
   METJets30->GetZaxis()->SetTitleFont(42);
   METJets->Add(METJets,"");
   METJets->Draw("nostack");
   
   TPaveText *pt = new TPaveText(0.3872701,0.94,0.6127299,0.995,"blNDC");
   pt->SetName("title");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetFillStyle(0);
   pt->SetTextFont(42);
   TText *AText = pt->AddText("METJets");
   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("METJets","METJets_QCD","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("METJets","METJets_WJetsToLNu","lp");

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

   ci = TColor::GetColor("#00ffff");
   entry->SetMarkerColor(ci);
   entry->SetMarkerStyle(20);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("METJets","METJets_ZJetsToNuNu","lp");

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

   ci = TColor::GetColor("#ffcc00");
   entry->SetMarkerColor(ci);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("METJets","METJets_signal","lp");

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

   ci = TColor::GetColor("#ff0000");
   entry->SetMarkerColor(ci);
   entry->SetMarkerStyle(20);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("METJets","METJets_ttbar","lp");

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

   ci = TColor::GetColor("#0000ff");
   entry->SetMarkerColor(ci);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   METJets->Modified();
   METJets->cd();
   METJets->SetSelected(METJets);
}
开发者ID:delgadoandrea,项目名称:CMSSW_7_4_6_patch6,代码行数:101,代码来源:METJets.C

示例5: DarkSusy_mH_125_mGammaD_2000_cT_0_LHE_gammaD_Sorted_cT_Z_lab


//.........这里部分代码省略.........
   h_gammaD_1_cT_Z_lab69->GetZaxis()->SetLabelFont(42);
   h_gammaD_1_cT_Z_lab69->GetZaxis()->SetLabelOffset(0.007);
   h_gammaD_1_cT_Z_lab69->GetZaxis()->SetTitleSize(0.06);
   h_gammaD_1_cT_Z_lab69->GetZaxis()->SetTitleFont(42);
   h_gammaD_1_cT_Z_lab69->Draw("same");
   
   TH1F *h_gammaD_2_cT_Z_lab70 = new TH1F("h_gammaD_2_cT_Z_lab70","h_gammaD_2_cT_Z_lab",10,0,10);
   h_gammaD_2_cT_Z_lab70->SetBinContent(1,1);
   h_gammaD_2_cT_Z_lab70->SetEntries(79999);

   ci = TColor::GetColor("#ff0000");
   h_gammaD_2_cT_Z_lab70->SetLineColor(ci);
   h_gammaD_2_cT_Z_lab70->SetLineWidth(2);
   h_gammaD_2_cT_Z_lab70->SetMarkerStyle(20);
   h_gammaD_2_cT_Z_lab70->GetXaxis()->SetLabelFont(42);
   h_gammaD_2_cT_Z_lab70->GetXaxis()->SetLabelOffset(0.007);
   h_gammaD_2_cT_Z_lab70->GetXaxis()->SetTitleSize(0.06);
   h_gammaD_2_cT_Z_lab70->GetXaxis()->SetTitleOffset(0.95);
   h_gammaD_2_cT_Z_lab70->GetXaxis()->SetTitleFont(42);
   h_gammaD_2_cT_Z_lab70->GetYaxis()->SetLabelFont(42);
   h_gammaD_2_cT_Z_lab70->GetYaxis()->SetLabelOffset(0.007);
   h_gammaD_2_cT_Z_lab70->GetYaxis()->SetTitleSize(0.06);
   h_gammaD_2_cT_Z_lab70->GetYaxis()->SetTitleOffset(1.3);
   h_gammaD_2_cT_Z_lab70->GetYaxis()->SetTitleFont(42);
   h_gammaD_2_cT_Z_lab70->GetZaxis()->SetLabelFont(42);
   h_gammaD_2_cT_Z_lab70->GetZaxis()->SetLabelOffset(0.007);
   h_gammaD_2_cT_Z_lab70->GetZaxis()->SetTitleSize(0.06);
   h_gammaD_2_cT_Z_lab70->GetZaxis()->SetTitleFont(42);
   h_gammaD_2_cT_Z_lab70->Draw("same");
   
   TLegend *leg = new TLegend(0.46,0.6744444,0.6955556,0.7644444,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("h_gammaD_1_cT_Z_lab","1st dark photon (leading p_{T})","L");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(2);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("h_gammaD_2_cT_Z_lab","2nd dark photon","L");

   ci = TColor::GetColor("#ff0000");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(2);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   
   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);
   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}} = 0 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);
   leg->SetTextSize(0.045);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(0);
   entry=leg->AddEntry("NULL","CMS Simulation (LHE) 14 TeV","h");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   cnv->Modified();
   cnv->cd();
   cnv->SetSelected(cnv);
}
开发者ID:tahuang1991,项目名称:MuJetAnalysis,代码行数:101,代码来源:DarkSusy_mH_125_mGammaD_2000_cT_0_LHE_gammaD_Sorted_cT_Z_lab.C

示例6: AnalysisSparse

void AnalysisSparse(Bool_t save_output = kFALSE)
{
  gStyle->SetGridColor(kGray);
  //  TString tmpstr(fname);
  //  if (tmpstr.Contains("data")) {
  //    Printf("!!! Real Data !!!");
  //    mc = kFALSE;
  //  }
  TString gtitle = Form("Monte Carlo, %s", graph_name.Data());
  grapht = graph_name.Data();
  Double_t grx[999], gry[999], gry2[999], gry3[999], gry4[999],
    gry_eff[999], gry_fix[999], grxE[999];
  Double_t gry22[999], gry22E[999], grx22E[999];
  Double_t gry_true[999], gry_true_eff[999], gry_true_effE[999];
  TH1::AddDirectory(kFALSE);
  TFile::SetCacheFileDir(gSystem->HomeDirectory());
  TFile *f = TFile::Open(fname.Data(), "CACHEREAD");
  if (!f) return;
  TList *l; f->GetObject(lname.Data(), l);
  if (!l) return;
  Int_t bf[999], bl[999];
  Int_t nn = FindExactRange(((THnSparse *)(l->FindObject(s1name.Data())))->
                            Projection(1), del_step, bf, bl);
  //  Int_t nn = FindRange5(bf, bl);
  Bool_t binhaluska = kFALSE;
  if (binAnders) {
    nn = 8;
    bf[0] = 6;bf[1] =  9;bf[2] = 11;bf[3] = 16;bf[4] = 21;bf[5] = 26;
    bl[0] = 8;bl[1] = 10;bl[2] = 15;bl[3] = 20;bl[4] = 25;bl[5] = 30;

    bf[6] = 31;bf[7] = 41;
    bl[6] = 40;bl[7] = 50;
  }
  Printf("number of intervals = %d =>", nn);

  Int_t count = 0;
  Double_t ptmean = 0, value = 0;
  Int_t fitStatus = -1;
  gStyle->SetOptStat(0);
  TCanvas *c = new TCanvas("c", "Signal & Background");
  c->Divide(5, 5); c->Modified(); c->Draw();
  TCanvas *c2 = (TCanvas *)c->DrawClone("c2");
  c2->SetTitle("Phi mesons (raw)"); c2->Modified(); c2->Draw();
  TCanvas *c3, *c4;
  if (mc) {
    c3 = (TCanvas *)c->DrawClone("c3");
    c3->SetTitle("Phi mesons (gen)"); c3->Modified(); c3->Draw();
    c4 = (TCanvas *)c->DrawClone("c4");
    c4->SetTitle("Phi mesons (true)"); c4->Modified(); c4->Draw();
  }

  for (Int_t i = 0; i < nn; i++) {
    c->cd(count + 1)->SetGrid();
    h1 = (TH1D *)PullHisto(l, s1name.Data(), bf[i], bl[i], ptmean);
    h1->SetLineColor(kRed);
    h1->GetXaxis()->SetTitle("inv. mass, GeV/c^2");
    h1->Draw("hist");

    h3_p = (TH1D *)PullHisto(l, s3name_p.Data(), bf[i], bl[i], ptmean);
    h3_m = (TH1D *)PullHisto(l, s3name_m.Data(), bf[i], bl[i], ptmean);
    // !!!!!!!!!!!!!!!!!!!!!!!!
    if (count==0) h3_p = h1;
    // !!!!!!!!!!!!!!!!!!!!!!!!
    else {
      h3_p->Add(h3_m);
      //      h3_p->Add((TH1D *)PullHisto(l, smix.Data(), bf[i], bl[i], ptmean));
      //      h3_p->Add((TH1D *)PullHisto(l, smixpp.Data(), bf[i], bl[i], ptmean));
      //      h3_p->Add((TH1D *)PullHisto(l, smixmm.Data(), bf[i], bl[i], ptmean));
      Norm(h1, h3_p, norm[0], norm[1]);
    }
    h3_p->SetLineColor(kBlue);
    h3_p->Draw("hist, same");

    if (mc) {
      c3->cd(count + 1)->SetGrid();
      Printf("%s", s1namegen.Data());
      hg = (TH1D *)PullHisto(l, s1namegen.Data(), bf[i], bl[i], ptmean);
      hg->SetLineColor(kMagenta);
      hg->GetXaxis()->SetTitle("inv. mass, GeV/c^2");
      hg->Draw("hist");
      c4->cd(count + 1)->SetGrid();
      ht = (TH1D *)PullHisto(l, s1nametrue.Data(), bf[i], bl[i], ptmean);
      ht->SetLineColor(kMagenta-5);
      ht->GetXaxis()->SetTitle("inv. mass, GeV/c^2");
      ht->Draw("hist");
    }
    c2->cd(count + 1)->SetGrid();
    TH1 *hh = (TH1 *)h1->Clone("hh");
    hh->SetLineColor(kRed+1);
    hh->Add(h3_p, -1);
    /// !!!!!!!!!!!!!!!!!!!!!!
    //////////    if ((ilist == 3) && (count < 2)) hh->Reset();
    // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    hh->Draw("hist");

    // !!!!!!!!!!!!!!!!!!
    ff->SetParameters(0.1, 1.02, 0.004, -25000., 0., 0., 0.);
    ff->SetLineColor(hh->GetLineColor());
    ff->SetLineWidth(1);
    //    ff->SetLineStyle(kDashed);
//.........这里部分代码省略.........
开发者ID:musinsky,项目名称:bordel,代码行数:101,代码来源:Sparse_MC.C

示例7: long_Ay_nu_01


//.........这里部分代码省略.........
  gr->Fit(theFit);
  theFit->Draw("same");
  TMultiGraph* mgrThry = new TMultiGraph("Theory","G_{E}^{n}");
  TLegend *legThry = new TLegend(.54,.3,.875,.6,"","brNDC");

  wgr = mgrThry;
  wlg = legThry;

  // the theory
  wlg->SetBorderSize(0); // turn off border
  wlg->SetFillStyle(0);
  
  f = theoryfiles1;
  gr=0;
  while ( f && f->filename ) {
    gr=OneGraph(f);
    if (gr) {
      TGraphAsymmErrors *egr = dynamic_cast<TGraphAsymmErrors*>(gr);
      if (egr && egr->GetN()>1 && egr->GetEYhigh() && egr->GetEYhigh()[1]>0) {
	gr = toerror_band(egr);
	gr->SetFillStyle(3000+f->style);
      }
      if (f->lnpt) {
	wgr->Add(gr,f->lnpt);
	wlg->AddEntry(gr,f->label,f->lnpt);
      }
      else if (gr->GetMarkerStyle()>=20) {
	wgr->Add(gr,"p");
	wlg->AddEntry(gr,f->label,"p");
      }	
      else {
	wgr->Add(gr,"l");
	wlg->AddEntry(gr,f->label,"l");
      }
    }
    f++;
  }

//  genf->Draw("same");
  mgrThry->Draw("c");
//  galster->Draw("same");
//  bbba05->Draw("same");
//  legThry->AddEntry(genf,"F_{2}/F_{1} #propto ln^{2}(Q^{2}/#Lambda^{2})/Q^{2}","l");
//  legThry->AddEntry(galster,"Galster fit","l");
//  legThry->AddEntry(bbba05,"BBBA05","l");
//  legThry->Draw();
//  legDta->Draw();
  
  // draw a line at 1
  cn->Modified();

  cn->Update();
  cn->SaveAs(Form("%s.eps",psfile));
  cn->SaveAs(Form("%s.root",psfile));
  gSystem->Exec(Form("./replace_symbols.pl %s.eps",psfile));

  return;  // LEAVING HERE

  // now an overlay, hopefully matching dimensions

  // remove everything but the graph
  cn->Update();
  TList *clist = cn->GetListOfPrimitives();
  TFrame* frame = cn->GetFrame();
  for (int i=0; i<clist->GetSize(); ) {
    if (clist->At(i) != frame) {
      clist->RemoveAt(i);
    } else i++;
  }
  // draw markers in the corners
  TMarker *mkr = new TMarker(frame->GetX1(),frame->GetY1(),2);
  mkr->Draw();
  mkr = new TMarker(frame->GetX2(),frame->GetY1(),2);
  mkr->Draw();
  mkr = new TMarker(frame->GetX1(),frame->GetY2(),2);
  mkr->Draw();
  mkr = new TMarker(frame->GetX2(),frame->GetY2(),2);
  mkr->Draw();
  frame->SetLineColor(10);
  cn->Update();

  datafile_t miller = { "figure_input/Miller/lattice.GEn.rtf","Miller",
			"[0]","[1]","[1]-[3]","[2]-[1]",0,0,1,3,"F" };

  gr = OneGraph(&miller);
  TGraphAsymmErrors* egr = dynamic_cast<TGraphAsymmErrors*>(gr);
  if (egr && egr->GetEYhigh() && egr->GetEYhigh()[egr->GetN()/2]>0) {
    gr = toerror_band(egr);
    gr->SetLineStyle(1);
    gr->SetFillColor(gr->GetLineColor());
    gr->SetFillStyle(3000+miller.style);
  }
  
  gr->Draw("F");

  cn->Update();
  cn->SaveAs("gen_Miller_Overlay.eps");
  cn->SaveAs("gen_Miller_Overlay.root");
  
}
开发者ID:ellie-long,项目名称:analysis-scripts,代码行数:101,代码来源:long_Ay_nu_01.C

示例8: DarkSusy_mH_125_mGammaD_2000_cT_1000_LHE_nD_pT


//.........这里部分代码省略.........
    h_nD_2_pT36->SetBinError(36,0.003775047);
    h_nD_2_pT36->SetBinError(37,0.002837535);
    h_nD_2_pT36->SetBinError(38,0.002275028);
    h_nD_2_pT36->SetBinError(39,0.001475018);
    h_nD_2_pT36->SetBinError(40,0.0009500119);
    h_nD_2_pT36->SetBinError(41,0.0004875061);
    h_nD_2_pT36->SetBinError(42,6.250078e-05);
    h_nD_2_pT36->SetEntries(79999);
    h_nD_2_pT36->SetDirectory(0);

    ci = TColor::GetColor("#ff0000");
    h_nD_2_pT36->SetLineColor(ci);
    h_nD_2_pT36->SetLineWidth(2);
    h_nD_2_pT36->SetMarkerStyle(20);
    h_nD_2_pT36->GetXaxis()->SetLabelFont(42);
    h_nD_2_pT36->GetXaxis()->SetLabelOffset(0.007);
    h_nD_2_pT36->GetXaxis()->SetTitleSize(0.06);
    h_nD_2_pT36->GetXaxis()->SetTitleOffset(0.95);
    h_nD_2_pT36->GetXaxis()->SetTitleFont(42);
    h_nD_2_pT36->GetYaxis()->SetLabelFont(42);
    h_nD_2_pT36->GetYaxis()->SetLabelOffset(0.007);
    h_nD_2_pT36->GetYaxis()->SetTitleSize(0.06);
    h_nD_2_pT36->GetYaxis()->SetTitleOffset(1.3);
    h_nD_2_pT36->GetYaxis()->SetTitleFont(42);
    h_nD_2_pT36->GetZaxis()->SetLabelFont(42);
    h_nD_2_pT36->GetZaxis()->SetLabelOffset(0.007);
    h_nD_2_pT36->GetZaxis()->SetTitleSize(0.06);
    h_nD_2_pT36->GetZaxis()->SetTitleFont(42);
    h_nD_2_pT36->Draw("SAME");

    TLegend *leg = new TLegend(0.46,0.6744444,0.6955556,0.7644444,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("h_nD_1_pT","1st n_{D} (leading p_{T})","L");

    ci = TColor::GetColor("#0000ff");
    entry->SetLineColor(ci);
    entry->SetLineStyle(1);
    entry->SetLineWidth(2);
    entry->SetMarkerColor(1);
    entry->SetMarkerStyle(21);
    entry->SetMarkerSize(1);
    entry->SetTextFont(42);
    entry=leg->AddEntry("h_nD_2_pT","2nd n_{D}","L");

    ci = TColor::GetColor("#ff0000");
    entry->SetLineColor(ci);
    entry->SetLineStyle(1);
    entry->SetLineWidth(2);
    entry->SetMarkerColor(1);
    entry->SetMarkerStyle(21);
    entry->SetMarkerSize(1);
    entry->SetTextFont(42);
    leg->Draw();

    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);
    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}} = 1000 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);
    leg->SetTextSize(0.045);
    leg->SetLineColor(1);
    leg->SetLineStyle(1);
    leg->SetLineWidth(1);
    leg->SetFillColor(0);
    leg->SetFillStyle(0);
    entry=leg->AddEntry("NULL","CMS Simulation (LHE) 14 TeV","h");
    entry->SetLineColor(1);
    entry->SetLineStyle(1);
    entry->SetLineWidth(1);
    entry->SetMarkerColor(1);
    entry->SetMarkerStyle(21);
    entry->SetMarkerSize(1);
    entry->SetTextFont(42);
    leg->Draw();
    cnv->Modified();
    cnv->cd();
    cnv->SetSelected(cnv);
}
开发者ID:tahuang1991,项目名称:MuJetAnalysis,代码行数:101,代码来源:DarkSusy_mH_125_mGammaD_2000_cT_1000_LHE_nD_pT.C

示例9: TracktoLCTX_2015all_sameYrange


//.........这里部分代码省略.........
   TracktoLCTX_6__114->SetBinContent(93,0.005594552);
   TracktoLCTX_6__114->SetBinContent(94,0.001748298);
   TracktoLCTX_6__114->SetBinContent(95,0.002797276);
   TracktoLCTX_6__114->SetBinContent(96,0.004895233);
   TracktoLCTX_6__114->SetBinContent(97,0.003146936);
   TracktoLCTX_6__114->SetBinContent(98,0.002097957);
   TracktoLCTX_6__114->SetBinContent(99,0.003846255);
   TracktoLCTX_6__114->SetBinContent(100,0.003146936);
   TracktoLCTX_6__114->SetBinContent(101,0.06888293);
   TracktoLCTX_6__114->SetEntries(1328499);
   TracktoLCTX_6__114->SetStats(0);

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

   ci = TColor::GetColor("#0000ff");
   TracktoLCTX_6__114->SetMarkerColor(ci);
   TracktoLCTX_6__114->GetXaxis()->SetTitle("cm");
   TracktoLCTX_6__114->GetYaxis()->SetTitle("scaled number of entries");
   TracktoLCTX_6__114->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("TracktoLCTX_1","ME11A: mean:-0.0cm;RMS:4.7cm","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("TracktoLCTX_2","ME11B: mean:-0.0cm;RMS:4.6cm","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("TracktoLCTX_3","ME12+13: mean:0.0cm;RMS:3.5cm","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("TracktoLCTX_4","ME2: mean:0.0cm;RMS:4.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("TracktoLCTX_5","ME3: mean:0.1cm;RMS:2.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("TracktoLCTX_6","ME4: mean:0.0cm;RMS:2.3cm","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.945,0.3062097,0.995,"blNDC");
   pt->SetName("title");
   pt->SetBorderSize(1);
   pt->SetFillColor(0);
   TText *AText = pt->AddText("TracktoLCTX");
   pt->Draw();
   TracktoLCTX->Modified();
   TracktoLCTX->cd();
   TracktoLCTX->SetSelected(TracktoLCTX);
}
开发者ID:senka,项目名称:CSC_eff_808,代码行数:101,代码来源:TracktoLCTX_2015all_sameYrange.C

示例10: makeStack


//.........这里部分代码省略.........
       if (xlowVec != 0) {
         for (int iBin = 1; iBin <= nBins; iBin++) hist[theHistCounter]->SetBinError  (iBin,hist[theHistCounter]->GetBinError(iBin)/hist[theHistCounter]->GetBinWidth(iBin));
         for (int iBin = 1; iBin <= nBins; iBin++) hist[theHistCounter]->SetBinContent(iBin,hist[theHistCounter]->GetBinContent(iBin)/hist[theHistCounter]->GetBinWidth(iBin));
       }
       hs -> Add(hist[theHistCounter]);
       theHistCounter++;
    }
    
  }//end loop on samples

  //Fix the legend
  for (int iHisto = theHistCounter-1; iHisto >= 0; iHisto--) {
    leg -> AddEntry(hist[iHisto], theLegends[iHisto], "f");   
  }
  
  //get the maximum to properly set the frame
  float theMax = hdata -> GetBinContent(hdata -> GetMaximumBin()) + hdata -> GetBinError(hdata -> GetMaximumBin());
  TH1* theMCSum = (TH1*) hs->GetStack()->Last();
  float theMaxMC = theMCSum->GetBinContent(theMCSum->GetMaximumBin()) + theMCSum->GetBinError(theMCSum->GetMaximumBin());
  if (theMaxMC > theMax) theMax = theMaxMC;
  
  //prepare the ratio band and plot
  TH1* theMCRatioBand = makeRatioBand(theMCSum);
  TH1* theRatioPlot = makeRatioPlot(hdata,theMCSum);
    
  TCanvas* can = new TCanvas();
  can -> SetLogy(isLog);
  
  TPad *pad1 = new TPad("pad1","top pad",0,0.30,1,1);
  pad1->SetBottomMargin(0.02);
  pad1->SetLeftMargin(0.13);
  pad1->SetLogy(isLog);
  pad1->Draw();
  TPad *pad2 = new TPad("pad2","bottom pad",0,0.0,1,0.30);
  pad2->SetTopMargin(0.02);
  pad2->SetLeftMargin(0.13);
  pad2->SetBottomMargin(0.4);
  pad2->SetGridy();
  pad2->Draw();
  
  pad1->cd();
  hs->Draw("hist");
  hdata->Draw("same,pe");
  if (drawSignal) hsignal->Draw("same,hist");
  if (drawLegend) leg->Draw("same");
  //hs->GetXaxis()->SetTitle(myAxisNameX);
  hs->GetYaxis()->SetTitle(myAxisNameY);
  hs->GetXaxis()->SetLabelSize(0.04);
  hs->GetYaxis()->SetLabelSize(0.04);
  hs->GetXaxis()->SetLabelOffset(0.025);
  hs->GetYaxis()->SetLabelOffset(0.035);
  //hs->GetXaxis()->SetTitleOffset(1.1);
  hs->GetYaxis()->SetTitleOffset(1.1);
  hs->SetMaximum(theMax);
  if (isLog) hs->SetMinimum(0.01);
  
  pad2->cd();
  theMCRatioBand->GetXaxis()->SetTitle(myAxisNameX);
  theMCRatioBand->GetXaxis()->SetTitleSize(0.16);
  theMCRatioBand->GetXaxis()->SetTitleOffset(1.1);
  theMCRatioBand->GetXaxis()->SetLabelSize(0.12);
  theMCRatioBand->GetXaxis()->SetLabelOffset(0.07);
  theMCRatioBand->GetYaxis()->SetTitle("Data/MC");
  theMCRatioBand->GetYaxis()->SetTitleSize(0.10);
  theMCRatioBand->GetYaxis()->SetTitleOffset(0.6);
  theMCRatioBand->GetYaxis()->SetLabelSize(0.06);
  theMCRatioBand->GetYaxis()->SetLabelOffset(0.03);
  theMCRatioBand->SetFillStyle(3001);
  theMCRatioBand->SetFillColor(kBlue);
  theMCRatioBand->SetLineWidth(1);
  theMCRatioBand->SetLineColor(kBlack);
  theMCRatioBand->SetMarkerSize(0.1);
  theMCRatioBand->SetMaximum(3.);
  theMCRatioBand->SetMinimum(0.);
  theMCRatioBand->Draw("E2");
  TLine *line = new TLine(xLow,1,xHigh,1);
  line->SetLineColor(kBlack);
  line->Draw("same");
  theRatioPlot->Draw("same,pe");
  
  can->cd();
  can->Modified();
  can -> SaveAs(myName + "_lep.pdf","pdf");
  can -> SaveAs(myName + "_lep.png","png");
  
  //cleanup the memory allocation
  delete theMCSum;
  delete hs;
  delete leg;
  delete hdata;
  delete pad1;
  delete pad2;
  delete can;
  delete theMCRatioBand;
  delete theRatioPlot;
  infile -> Close();
  delete infile;
  
  return;
}
开发者ID:dimatteo,项目名称:MitMonoPhoton_Backup,代码行数:101,代码来源:makePlotsLepton.C

示例11: calculateEfficiencyFromNTUPLE_withGenWeights_v4


//.........这里部分代码省略.........
  else if ( (variable_for_which_plot_eff == "pt" || variable_for_which_plot_eff == "nPV" ) && doBarrel ==false){

    // signal
    // pt/nPV endcap
    useHistograms( histVeto,     pToCutsFile, tr, false, ptOrPVEndcap, false,  pToCutsFile_EtaEndcap); 
    useHistograms( histVetoTot,  pToCutsFile, tr, true, ptOrPVEndcap, false,  pToCutsFile_EtaEndcap); 


    // BG
    // pt/nPV endcap
    useHistograms( bg_histVeto,    pToCutsFile, trBG, false, ptOrPVEndcap, true,  pToCutsFile_EtaEndcap);  
    useHistograms( bg_histVetoTot, pToCutsFile, trBG, true, ptOrPVEndcap, true,  pToCutsFile_EtaEndcap);

    
  }
  else if (variable_for_which_plot_eff == "etaSC"){

    // signal
    // etaFullRange
    useHistograms( histVeto,     pToCutsFile, tr, false, etaFullRange, false, pToCutsFile_EtaEndcap); 
    useHistograms( histVetoTot,  pToCutsFile, tr, true, etaFullRange, false, pToCutsFile_EtaEndcap);  

    // BG
    // etaFullRange
    useHistograms( bg_histVeto,    pToCutsFile, trBG, false, etaFullRange, true, pToCutsFile_EtaEndcap);
    useHistograms( bg_histVetoTot, pToCutsFile, trBG, true, etaFullRange, true, pToCutsFile_EtaEndcap); 
    
  }
  else {
    std::cout<<"\nCan't happen! \nVariable is  "<<variable_for_which_plot_eff<<"  and eta is "<< (doBarrel?"barrel":"endcap")<<std::endl;
  }

  std::cout<<"\nI'm here 6 "<<std::endl;
 
  
  TH1F *effV = (TH1F*)histVeto->Clone("effV");
  TH1F *effV_bg = (TH1F*)bg_histVeto->Clone("effV_bg");

  std::cout<<"\nI'm here 7 "<<std::endl;
  
  calculateEffAndErrors(histVeto, histVetoTot, effV);
  calculateEffAndErrors(bg_histVeto, bg_histVetoTot, effV_bg);


  std::cout<<"\nI'm here 8 "<<std::endl;
  //  Usage :
  //  histogram, color_number, variable
  //
  setHistCosmetics(effV,4, variable_for_which_plot_eff);
  setHistCosmetics(effV_bg,38, variable_for_which_plot_eff);
  

  //------------------------------------------------------------------

  //if (variable_for_which_plot_eff == "etaSC" || variable_for_which_plot_eff == "nPV")   

  effV->GetYaxis()->SetRangeUser(0.,1.);
  effV->Draw("L");
  effV_bg->Draw("Lsame");
  effV->SetLineWidth(3);
  effV_bg->SetLineWidth(3);

  TLegend *leg = new TLegend(0.35, 0.52, 0.75, 0.65);
  leg->SetFillStyle(0);
  leg->SetBorderSize(0);
  leg->AddEntry(effV, "WP Veto", "lf"); 
  leg->AddEntry((TObject*)0, "", "");
  leg->AddEntry(effV_bg, "BG WP Veto", "lf"); 
  leg->SetTextSize(0.03);
  leg->Draw("same");


  if (variable_for_which_plot_eff == "pt" ){
    if (doBarrel)
      Tl05.DrawLatex(40,1.1,"barrel electrons");
    else
      Tl05.DrawLatex(40,1.1,"endcap electrons");     
  }
  else if ( variable_for_which_plot_eff == "nPV" ){
    if (doBarrel)
      Tl05.DrawLatex(30,1.05,"barrel electrons");
    else
      Tl05.DrawLatex(30,1.05,"endcap electrons");     
  }


  c->Modified();
  c->Update();
  c->SaveAs( fileOut + ".png");
  
  effV->SetDirectory(0);
  effV_bg->SetDirectory(0);
  
  DYfile->cd();
  effV->Write("WP_Veto");
  effV_bg->Write("BG_WP_Veto");

  c->Write();
  DYfile->Close();
}
开发者ID:yangyuchul,项目名称:ElePhoNTU,代码行数:101,代码来源:calculateEfficiencyFromNTUPLE_withGenWeights_v4.C

示例12: DarkSusy_mH_125_mGammaD_2000_cT_0_LHE_dimuon_pZ


//.........这里部分代码省略.........
   h_dimuon_2_pZ125->SetBinError(95,0.0003302272);
   h_dimuon_2_pZ125->SetBinError(96,0.0003559575);
   h_dimuon_2_pZ125->SetBinError(97,0.0003270671);
   h_dimuon_2_pZ125->SetBinError(98,0.0003238761);
   h_dimuon_2_pZ125->SetBinError(99,0.0003379983);
   h_dimuon_2_pZ125->SetBinError(100,0.0003364585);
   h_dimuon_2_pZ125->SetBinError(101,0.003078468);
   h_dimuon_2_pZ125->SetEntries(79999);
   h_dimuon_2_pZ125->SetDirectory(0);

   ci = TColor::GetColor("#ff0000");
   h_dimuon_2_pZ125->SetLineColor(ci);
   h_dimuon_2_pZ125->SetLineWidth(2);
   h_dimuon_2_pZ125->SetMarkerStyle(20);
   h_dimuon_2_pZ125->GetXaxis()->SetLabelFont(42);
   h_dimuon_2_pZ125->GetXaxis()->SetLabelOffset(0.007);
   h_dimuon_2_pZ125->GetXaxis()->SetTitleSize(0.06);
   h_dimuon_2_pZ125->GetXaxis()->SetTitleOffset(0.95);
   h_dimuon_2_pZ125->GetXaxis()->SetTitleFont(42);
   h_dimuon_2_pZ125->GetYaxis()->SetLabelFont(42);
   h_dimuon_2_pZ125->GetYaxis()->SetLabelOffset(0.007);
   h_dimuon_2_pZ125->GetYaxis()->SetTitleSize(0.06);
   h_dimuon_2_pZ125->GetYaxis()->SetTitleOffset(1.3);
   h_dimuon_2_pZ125->GetYaxis()->SetTitleFont(42);
   h_dimuon_2_pZ125->GetZaxis()->SetLabelFont(42);
   h_dimuon_2_pZ125->GetZaxis()->SetLabelOffset(0.007);
   h_dimuon_2_pZ125->GetZaxis()->SetTitleSize(0.06);
   h_dimuon_2_pZ125->GetZaxis()->SetTitleFont(42);
   h_dimuon_2_pZ125->Draw("SAMEHIST");
   
   TLegend *leg = new TLegend(0.46,0.6744444,0.6955556,0.7644444,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("h_dimuon_1_pZ","1st #mu#mu (leading p_{T})","L");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(2);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("h_dimuon_2_pZ","2nd #mu#mu","L");

   ci = TColor::GetColor("#ff0000");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(2);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   
   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);
   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}} = 0 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);
   leg->SetTextSize(0.045);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(0);
   entry=leg->AddEntry("NULL","CMS Simulation (LHE) 14 TeV","h");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   cnv->Modified();
   cnv->cd();
   cnv->SetSelected(cnv);
}
开发者ID:tahuang1991,项目名称:MuJetAnalysis,代码行数:101,代码来源:DarkSusy_mH_125_mGammaD_2000_cT_0_LHE_dimuon_pZ.C

示例13: SegtoLCTY_2016B_June22all_sameYrange


//.........这里部分代码省略.........
   SegtoLCTY_6__42->SetBinContent(93,0.0006392963);
   SegtoLCTY_6__42->SetBinContent(94,0.0003653122);
   SegtoLCTY_6__42->SetBinContent(95,0.0004566402);
   SegtoLCTY_6__42->SetBinContent(96,0.0005479682);
   SegtoLCTY_6__42->SetBinContent(97,0.001004608);
   SegtoLCTY_6__42->SetBinContent(98,0.0001826561);
   SegtoLCTY_6__42->SetBinContent(99,0.0006392963);
   SegtoLCTY_6__42->SetBinContent(100,0.0006392963);
   SegtoLCTY_6__42->SetBinContent(101,0.3928932);
   SegtoLCTY_6__42->SetEntries(1102290);
   SegtoLCTY_6__42->SetStats(0);

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

   ci = TColor::GetColor("#0000ff");
   SegtoLCTY_6__42->SetMarkerColor(ci);
   SegtoLCTY_6__42->GetXaxis()->SetTitle("cm");
   SegtoLCTY_6__42->GetYaxis()->SetTitle("scaled number of entries");
   SegtoLCTY_6__42->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("SegtoLCTY_1","ME11A: mean:0.1cm;RMS:1.7cm","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("SegtoLCTY_2","ME11B: mean:0.2cm;RMS:1.6cm","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("SegtoLCTY_3","ME12+13: mean:0.5cm;RMS:1.6cm","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("SegtoLCTY_4","ME2: mean:0.2cm;RMS:1.1cm","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("SegtoLCTY_5","ME3: mean:-0.1cm;RMS:1.1cm","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("SegtoLCTY_6","ME4: mean:-0.1cm;RMS:1.2cm","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("SegtoLCTY");
   pt->Draw();
   SegtoLCTY->Modified();
   SegtoLCTY->cd();
   SegtoLCTY->SetSelected(SegtoLCTY);
}
开发者ID:senka,项目名称:CSC_eff_808,代码行数:101,代码来源:SegtoLCTY_2016B_June22all_sameYrange.C

示例14: Interpolate

void Interpolate(const TString& trigger="INEL")
{
  if (gSystem->Getenv("FWD"))
    fwd = gSystem->Getenv("FWD");
  else 
    fwd = gSystem->ExpandPathName("$ALICE_PHYSICS/PWGLF/FORWARD/analysis2");
  gROOT->SetMacroPath(Form("%s/dndeta:%s", gROOT->GetMacroPath(),fwd));

  if (!gROOT->GetClass("Drawer"))  gROOT->LoadMacro("Drawer.C+");

  TH1* h0900 = GetOne( 900, trigger);
  TH1* h2760 = GetOne(2760, trigger);
  TH1* h7000 = GetOne(7000, trigger);
  TH1* h8000 = GetOne(8000, trigger);
  Info("","900: %p 2760: %p 7000: %p 8000: %p", 
       h0900, h2760, h7000, h8000);
  Double_t e8000 = (trigger.EqualTo("INEL") ? 0.852 : 0.93);
  h8000->Scale(e8000);

  TFile* out = TFile::Open("trends.root", "RECREATE");
  THStack* sOrig = new THStack("orig", Form("pp - %s", trigger.Data()));
  sOrig->Add(h8000);
  sOrig->Add(h7000);
  sOrig->Add(h2760);
  sOrig->Add(h0900);

  TCanvas* cOrig = new TCanvas("cOrig", "Original", 1200, 1200);
  cOrig->SetTopMargin(0.01);
  cOrig->SetRightMargin(0.01);
  sOrig->Draw("nostack");
  sOrig->GetHistogram()->SetYTitle("1/#it{N} d#it{N}_{ch}/d#it{#eta}");
  sOrig->GetHistogram()->SetXTitle("#it{#eta}");
  sOrig->DrawClone("nostack");
  sOrig->Write();
  
  TLegend* l = cOrig->BuildLegend(.35, .2, .55, .6, "#sqrt{s}");
  l->SetFillColor(0);
  l->SetFillStyle(0);
  l->SetBorderSize(0);

  cOrig->Modified();
  cOrig->Update();
  cOrig->cd();
  cOrig->Write();
  Info("", "Wrote original"); 

  TCanvas* cG = new TCanvas("cG", "one", 1200, 1200);
  cG->SetTopMargin(0.01);
  cG->SetRightMargin(0.01);
  
  Info("","Creating tuple");
  TNtuple* tuple = new TNtuple("tuple", "Tuple", 
			       "eta:deta:"
			       "v0900:e0900:v2760:e2760:"
			       "v7000:e7000:v8000:e8000");
  TMultiGraph* mg = new TMultiGraph;
  Int_t n = h0900->GetNbinsX();
  Info("","Loop over bins %d", n);

  for (Int_t i = 1; i <= n; i++) {
    Info("", "Getting one bin %d,%p,%p,%p,%p,%p,%p",
	 i, h0900,h2760,h7000,h8000,mg,tuple);
    OneBin(i, h0900, h2760, h7000, h8000, mg, tuple);
  }
  mg->Draw("alp");

  cG->Modified();
  cG->Update();
  cG->cd();

  TPrincipal* p =tuple->Principal("v0900:v2760:v7000:v8000","eta<0", "npdhc");
}
开发者ID:ktf,项目名称:AliPhysics,代码行数:72,代码来源:Interpolate.C

示例15: TripleComp

void TripleComp(){

  TFile *_file1=TFile::Open("94rbSets/94rb_14_set1/094rb_14_5scan_set1.root");
  TFile *_file2=TFile::Open("94rbSets/94rb_14_set2/094rb_14_5scan_set2.root");
  TFile *_file3=TFile::Open("94rbSets/94rb_14_set3/094rb_14_5scan_set3.root");
  TFile *_file4=TFile::Open("94rbSets/94rb_14_set4/094rb_14_5scan_set4.root");
  TFile *_file5=TFile::Open("94rbSets/94rb_14_set5/094rb_14_5scan_set5.root");
  TFile *GStotal=TFile::Open("94rbFullset_totals.root");

  // TCanvas *TriComp = new TCanvas("TriComp","Comparison between the 3 detector types",800,450);
  TCanvas *TriCompBG = new TCanvas("TriCompBG","Beta-Gated comparison between the 3 detector types",800,450);
  
  THStack *hs = new THStack("hs","Gamma-Ray Detector Type Comparison");
  THStack *hsbg = new THStack("hsbg","Gamma-Ray Detector Type Beta-Gated Comparison");

  TH1D* HPGeT = new TH1D("HPGeT","Clover Energy (Totals)",8192.,0,8192.);
  TH1D* HPGeTbg = new TH1D("HPGeTbg","Clover Energy (Beta-Gated Totals)",8192.,0,8192.);

  TH1D* d2500_1 = (TH1D*) _file1->Get("d2500");  
  TH1D* d2510_1 = (TH1D*) _file1->Get("d2510");

  TH1D* d2500_2 = (TH1D*) _file2->Get("d2500");  
  TH1D* d2510_2 = (TH1D*) _file2->Get("d2510");

  TH1D* d2500_3 = (TH1D*) _file3->Get("d2500");
  TH1D* d2510_3 = (TH1D*) _file3->Get("d2510");

  TH1D* d2500_4 = (TH1D*) _file4->Get("d2500");  
  TH1D* d2510_4 = (TH1D*) _file4->Get("d2510");

  TH1D* d2500_5 = (TH1D*) _file5->Get("d2500");  
  TH1D* d2510_5 = (TH1D*) _file5->Get("d2510");

  TH1D* naiT = (TH1D*) GStotal->Get("NaITotal");  
  TH1D* naiTbg = (TH1D*) GStotal->Get("NaITotalBG");

  TH1D* shT = (TH1D*) GStotal->Get("SHTotal");  
  TH1D* shTbg = (TH1D*) GStotal->Get("SHTotalBG");

  HPGeT->Add(d2500_1);
  HPGeT->Add(d2500_2);
  HPGeT->Add(d2500_3);
  HPGeT->Add(d2500_4);
  HPGeT->Add(d2500_5);

  HPGeTbg->Add(d2510_1);
  HPGeTbg->Add(d2510_2);
  HPGeTbg->Add(d2510_3);
  HPGeTbg->Add(d2510_4);
  HPGeTbg->Add(d2510_5);

  naiT->SetLineColor(kRed);
  shT->SetLineColor(kBlack);

  naiTbg->SetLineColor(kRed);
  shTbg->SetLineColor(kBlack);

  hs->Add(HPGeT);
  hs->Add(naiT);
  hs->Add(shT);

  hsbg->Add(HPGeTbg);
  naiTbg->SetTitle("NaI Energy (Beta-Gated Totals)");
  shTbg->SetTitle("2\" HAGRiD Energy (Beta-Gated Totals)");
  hsbg->Add(naiTbg);
  hsbg->Add(shTbg);

  /* TriComp->cd();
   hs->Draw("nostack");
  
  hs->GetXaxis()->SetTitle("Energy (keV)");
  hs->GetYaxis()->SetTitle("Counts");
  hs->GetYaxis()->SetTitleOffset(1.4);
  //hs->GetXaxis()->SetRangeUser(10,1500);
  hs->SetMaximum(2000000);
  */

  TriCompBG->cd();
  hsbg->Draw("nostack");
  

  hsbg->GetYaxis()->SetTitle("Counts");
  hsbg->GetYaxis()->SetTitleOffset(1);
  
  hsbg->GetXaxis()->SetTitle("Energy (keV)");
  hsbg->GetXaxis()->SetRangeUser(0,4000);

  

  gStyle->SetOptDate(0);
  gStyle->SetOptStat(0);
  
  //  TriComp->SetLogy();
  TriCompBG->SetLogy();
  
  
  //TriComp->Modified();
  TriCompBG->Modified();
  hsbg->GetYaxis()->SetRangeUser(100,7000000);
  gPad->RedrawAxis();
//.........这里部分代码省略.........
开发者ID:tking53,项目名称:root-macros,代码行数:101,代码来源:TripleComp.C


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