THStack * FromTH1FMakeTHStack(vector<TH1F*> * histo, TString stack_name, vector<TString> * h_description, bool order_size, bool nostack, TString x_axis, TString y_axis, TH1F * data){ if((int) histo->size() != (int) h_description->size()){ Error("Histogram numbers and legend items do not match");} THStack * stack = new THStack("stack", stack_name); stack->SetTitle(""); TLegend * legend = new TLegend(0.7,0.5,0.9,0.9); legend->SetFillColor(0); Int_t h_array_size = (int) histo->size(); Int_t reorder[h_array_size]; if(order_size){ Float_t integral[h_array_size]; for(int itr = 0; itr < h_array_size; itr++){ integral[itr] = (*histo)[itr]->Integral(); } for(int itr1 = 0; itr1 < h_array_size; itr1++){ for(int itr2 = 0; itr2 < h_array_size; itr2++){ if(itr1 == itr2) continue; if(integral[itr1] < integral[itr2]){ reorder[itr1] += 1; } } } } for(int itr = 0; itr < h_array_size; itr++){ if( nostack ){ stack->Add((*histo)[reorder[itr]], "nostack"); } if(!nostack ){ stack->Add((*histo)[reorder[itr]]); } legend->AddEntry((*histo)[itr], (*h_description)[itr], "f"); } if(data != NULL){ stack->Add(data, "nostack"); legend->AddEntry(data, "Data", "p"); } return stack; }
//------------------------------------------------------------------------------ void PlotAlignmentValidation::plotSS( const std::string& options, const std::string& residType ) { if (residType == "") { plotSS( options, "ResXvsXProfile"); plotSS( options, "ResXvsYProfile"); return; } int plotLayerN = 0; // int plotRingN = 0; // bool plotPlain = false; bool plotLayers = false; // overrides plotLayerN // bool plotRings = false; // Todo: implement this? bool plotSplits = false; int plotSubDetN = 0; // if zero, plot all TRegexp layer_re("layer=[0-9]+"); Ssiz_t index, len; if (options.find("split") != std::string::npos) { plotSplits = true; } if (options.find("layers") != std::string::npos) { plotLayers = true; } if ((index = layer_re.Index(options, &len)) != -1) { if (plotLayers) { std::cerr << "Warning: option 'layers' overrides 'layer=N'" << std::endl; } else { std::string substr = options.substr(index+6, len-6); plotLayerN = atoi(substr.c_str()); } } TRegexp subdet_re("subdet=[1-6]+"); if ((index = subdet_re.Index(options, &len)) != -1) { std::string substr = options.substr(index+7, len-7); plotSubDetN = atoi(substr.c_str()); } // If layers are plotted, these are the numbers of layers for each subdetector static int numberOfLayers[6] = { 3, 2, 4, 3, 6, 9 }; setNiceStyle(); gStyle->SetOptStat(0); TCanvas c("canv", "canv", 600, 600); setCanvasStyle( c ); // todo: title, min/max, nbins? // Loop over detectors for (int iSubDet=1; iSubDet<=6; ++iSubDet) { // TEC requires special care since rings 1-4 and 5-7 are plotted separately bool isTEC = (iSubDet==6); // if subdet is specified, skip other subdets if (plotSubDetN!=0 && iSubDet!=plotSubDetN) continue; // Skips plotting too high layers if (plotLayerN > numberOfLayers[iSubDet-1]) { continue; } int minlayer = plotLayers ? 1 : plotLayerN; int maxlayer = plotLayers ? numberOfLayers[iSubDet-1] : plotLayerN; for (int layer = minlayer; layer <= maxlayer; layer++) { // two plots for TEC, skip first for (int iTEC = 0; iTEC<2; iTEC++) { if (!isTEC && iTEC==0) continue; char selection[1000]; if (!isTEC){ if (layer==0) sprintf(selection,"subDetId==%d",iSubDet); else sprintf(selection,"subDetId==%d && layer == %d",iSubDet,layer); } else{ // TEC if (iTEC==0) // rings sprintf(selection,"subDetId==%d && ring <= 4",iSubDet); else sprintf(selection,"subDetId==%d && ring > 4",iSubDet); } // Title for plot and name for the file TString subDetName; switch (iSubDet) { case 1: subDetName = "BPIX"; break; case 2: subDetName = "FPIX"; break; case 3: subDetName = "TIB"; break; case 4: subDetName = "TID"; break; case 5: subDetName = "TOB"; break; case 6: subDetName = "TEC"; break; } TString myTitle = "Surface Shape, "; myTitle += subDetName; if (layer!=0) { myTitle += TString(", layer "); myTitle += Form("%d",layer); } if (isTEC && iTEC==0) myTitle += TString(" R1-4"); if (isTEC && iTEC>0) myTitle += TString(" R5-7"); // Save plot to file std::ostringstream plotName; plotName << outputDir << "/SurfaceShape_" << subDetName << "_"; plotName << residType; if (layer!=0) plotName << "_" << "layer" << layer; if (isTEC && iTEC==0) plotName << "_" << "R1-4"; if (isTEC && iTEC>0) plotName << "_" << "R5-7"; plotName << ".eps"; // Generate histograms with selection THStack *hs = addHists(selection, residType); if (!hs || hs->GetHists()==0 || hs->GetHists()->GetSize()==0) { std::cout << "No histogram for " << subDetName << ", perhaps not enough data?" << std::endl; continue; } hs->SetTitle( myTitle ); hs->Draw("nostack PE"); // Adjust Labels TH1* firstHisto = (TH1*) hs->GetHists()->First(); TString xName = firstHisto->GetXaxis()->GetTitle(); TString yName = firstHisto->GetYaxis()->GetTitle(); hs->GetHistogram()->GetXaxis()->SetTitleColor( kBlack ); hs->GetHistogram()->GetXaxis()->SetTitle( xName ); hs->GetHistogram()->GetYaxis()->SetTitleColor( kBlack ); hs->GetHistogram()->GetYaxis()->SetTitle( yName ); // Save to file c.Update(); c.Print(plotName.str().c_str()); } } } return; }
void ttbar_looseLep2Pt_logy() { //=========Macro generated from canvas: c1/c1 //========= (Sun Dec 11 15:16:17 2016) by ROOT version6.06/01 TCanvas *c1 = new TCanvas("c1", "c1",1,1,1200,1416); gStyle->SetOptStat(0); gStyle->SetOptTitle(0); c1->SetHighLightColor(2); c1->Range(0,0,1,1); c1->SetFillColor(0); c1->SetBorderMode(0); c1->SetBorderSize(2); c1->SetTickx(1); c1->SetTicky(1); c1->SetLeftMargin(0.15); c1->SetRightMargin(0.05); c1->SetTopMargin(0.07); c1->SetBottomMargin(0.13); c1->SetFrameFillStyle(0); c1->SetFrameBorderMode(0); // ------------>Primitives in pad: pad1 TPad *pad1 = new TPad("pad1", "pad1",0,0.3,1,1); pad1->Draw(); pad1->cd(); pad1->Range(-93.75,-6.459411,531.25,2.538922); pad1->SetFillColor(0); pad1->SetBorderMode(0); pad1->SetBorderSize(2); pad1->SetLogy(); pad1->SetTickx(1); pad1->SetTicky(1); pad1->SetLeftMargin(0.15); pad1->SetRightMargin(0.05); pad1->SetTopMargin(0.07); pad1->SetBottomMargin(0); pad1->SetFrameFillStyle(0); pad1->SetFrameBorderMode(0); pad1->SetFrameFillStyle(0); pad1->SetFrameBorderMode(0); THStack *h = new THStack(); h->SetName("h"); h->SetTitle(""); h->SetMinimum(1.61613e-06); h->SetMaximum(32.94396); TH1F *h_stack_8 = new TH1F("h_stack_8","",20,0,500); h_stack_8->SetMinimum(3.472076e-07); h_stack_8->SetMaximum(81.10342); h_stack_8->SetDirectory(0); h_stack_8->SetStats(0); Int_t ci; // for color index setting TColor *color; // for color definition with alpha ci = TColor::GetColor("#000099"); h_stack_8->SetLineColor(ci); h_stack_8->GetXaxis()->SetLabelFont(42); h_stack_8->GetXaxis()->SetLabelOffset(0.007); h_stack_8->GetXaxis()->SetTitleSize(0.05); h_stack_8->GetXaxis()->SetTickLength(0.025); h_stack_8->GetXaxis()->SetTitleFont(42); h_stack_8->GetYaxis()->SetTitle("a.u./25 GeV"); h_stack_8->GetYaxis()->SetLabelFont(42); h_stack_8->GetYaxis()->SetLabelOffset(0.007); h_stack_8->GetYaxis()->SetTitleSize(0.05); h_stack_8->GetYaxis()->SetTickLength(0.025); h_stack_8->GetYaxis()->SetTitleOffset(1.5); h_stack_8->GetYaxis()->SetTitleFont(42); h_stack_8->GetZaxis()->SetLabelFont(42); h_stack_8->GetZaxis()->SetLabelOffset(0.007); h_stack_8->GetZaxis()->SetTitleSize(0.05); h_stack_8->GetZaxis()->SetTickLength(0.025); h_stack_8->GetZaxis()->SetTitleFont(42); h->SetHistogram(h_stack_8); TH1D *h_looseLep2Pt_QCD__85 = new TH1D("h_looseLep2Pt_QCD__85","",20,0,500); h_looseLep2Pt_QCD__85->SetBinContent(1,0.004168645); h_looseLep2Pt_QCD__85->SetBinContent(2,0.004299542); h_looseLep2Pt_QCD__85->SetBinContent(3,0.001765161); h_looseLep2Pt_QCD__85->SetBinContent(4,0.0008868067); h_looseLep2Pt_QCD__85->SetBinContent(6,0.0004026872); h_looseLep2Pt_QCD__85->SetBinContent(7,6.27175e-05); h_looseLep2Pt_QCD__85->SetBinError(1,0.001669574); h_looseLep2Pt_QCD__85->SetBinError(2,0.002080688); h_looseLep2Pt_QCD__85->SetBinError(3,0.001425843); h_looseLep2Pt_QCD__85->SetBinError(4,0.0005754946); h_looseLep2Pt_QCD__85->SetBinError(6,0.0004026872); h_looseLep2Pt_QCD__85->SetBinError(7,4.443558e-05); h_looseLep2Pt_QCD__85->SetEntries(25); h_looseLep2Pt_QCD__85->SetStats(0); ci = TColor::GetColor("#cccccc"); h_looseLep2Pt_QCD__85->SetFillColor(ci); h_looseLep2Pt_QCD__85->GetXaxis()->SetTitle("Sub-leading lep p_{T} [GeV]"); h_looseLep2Pt_QCD__85->GetXaxis()->SetLabelFont(42); h_looseLep2Pt_QCD__85->GetXaxis()->SetLabelOffset(0.007); h_looseLep2Pt_QCD__85->GetXaxis()->SetTitleSize(0.05); h_looseLep2Pt_QCD__85->GetXaxis()->SetTickLength(0.025); h_looseLep2Pt_QCD__85->GetXaxis()->SetTitleFont(42); h_looseLep2Pt_QCD__85->GetYaxis()->SetTitle("a.u./25 GeV"); h_looseLep2Pt_QCD__85->GetYaxis()->SetLabelFont(42); h_looseLep2Pt_QCD__85->GetYaxis()->SetLabelOffset(0.007); h_looseLep2Pt_QCD__85->GetYaxis()->SetTitleSize(0.05); h_looseLep2Pt_QCD__85->GetYaxis()->SetTickLength(0.025); h_looseLep2Pt_QCD__85->GetYaxis()->SetTitleFont(42); h_looseLep2Pt_QCD__85->GetZaxis()->SetLabelFont(42); h_looseLep2Pt_QCD__85->GetZaxis()->SetLabelOffset(0.007); h_looseLep2Pt_QCD__85->GetZaxis()->SetTitleSize(0.05); h_looseLep2Pt_QCD__85->GetZaxis()->SetTickLength(0.025); h_looseLep2Pt_QCD__85->GetZaxis()->SetTitleFont(42); h->Add(h_looseLep2Pt_QCD,""); TH1D *h_looseLep2Pt_Diboson__86 = new TH1D("h_looseLep2Pt_Diboson__86","",20,0,500); h_looseLep2Pt_Diboson__86->SetBinContent(1,0.01174144); h_looseLep2Pt_Diboson__86->SetBinContent(2,0.01187664); h_looseLep2Pt_Diboson__86->SetBinContent(3,0.004759406); h_looseLep2Pt_Diboson__86->SetBinContent(4,0.002930753); h_looseLep2Pt_Diboson__86->SetBinContent(5,0.00175143); h_looseLep2Pt_Diboson__86->SetBinContent(6,0.0008561466); h_looseLep2Pt_Diboson__86->SetBinContent(7,0.000727361); h_looseLep2Pt_Diboson__86->SetBinContent(8,0.0006566697); h_looseLep2Pt_Diboson__86->SetBinContent(9,0.0001931429); h_looseLep2Pt_Diboson__86->SetBinContent(10,0.0004155724); h_looseLep2Pt_Diboson__86->SetBinContent(11,0.0002518857); h_looseLep2Pt_Diboson__86->SetBinContent(14,0.0002218985); h_looseLep2Pt_Diboson__86->SetBinContent(15,0.0002412745); h_looseLep2Pt_Diboson__86->SetBinContent(19,0.0001695579); h_looseLep2Pt_Diboson__86->SetBinError(1,0.001495699); h_looseLep2Pt_Diboson__86->SetBinError(2,0.001560382); h_looseLep2Pt_Diboson__86->SetBinError(3,0.0009896295); h_looseLep2Pt_Diboson__86->SetBinError(4,0.0007445459); h_looseLep2Pt_Diboson__86->SetBinError(5,0.0005817517); h_looseLep2Pt_Diboson__86->SetBinError(6,0.00038167); h_looseLep2Pt_Diboson__86->SetBinError(7,0.0003371659); h_looseLep2Pt_Diboson__86->SetBinError(8,0.0003965161); h_looseLep2Pt_Diboson__86->SetBinError(9,0.0001370432); h_looseLep2Pt_Diboson__86->SetBinError(10,0.0002946848); h_looseLep2Pt_Diboson__86->SetBinError(11,0.0002518857); h_looseLep2Pt_Diboson__86->SetBinError(14,0.0002218985); h_looseLep2Pt_Diboson__86->SetBinError(15,0.0002412745); h_looseLep2Pt_Diboson__86->SetBinError(19,0.0001695579); h_looseLep2Pt_Diboson__86->SetEntries(227); h_looseLep2Pt_Diboson__86->SetStats(0); ci = TColor::GetColor("#9966cc"); h_looseLep2Pt_Diboson__86->SetFillColor(ci); h_looseLep2Pt_Diboson__86->GetXaxis()->SetTitle("Sub-leading lep p_{T} [GeV]"); h_looseLep2Pt_Diboson__86->GetXaxis()->SetLabelFont(42); h_looseLep2Pt_Diboson__86->GetXaxis()->SetLabelOffset(0.007); h_looseLep2Pt_Diboson__86->GetXaxis()->SetTitleSize(0.05); h_looseLep2Pt_Diboson__86->GetXaxis()->SetTickLength(0.025); h_looseLep2Pt_Diboson__86->GetXaxis()->SetTitleFont(42); h_looseLep2Pt_Diboson__86->GetYaxis()->SetTitle("a.u./25 GeV"); h_looseLep2Pt_Diboson__86->GetYaxis()->SetLabelFont(42); h_looseLep2Pt_Diboson__86->GetYaxis()->SetLabelOffset(0.007); h_looseLep2Pt_Diboson__86->GetYaxis()->SetTitleSize(0.05); h_looseLep2Pt_Diboson__86->GetYaxis()->SetTickLength(0.025); h_looseLep2Pt_Diboson__86->GetYaxis()->SetTitleFont(42); h_looseLep2Pt_Diboson__86->GetZaxis()->SetLabelFont(42); h_looseLep2Pt_Diboson__86->GetZaxis()->SetLabelOffset(0.007); h_looseLep2Pt_Diboson__86->GetZaxis()->SetTitleSize(0.05); h_looseLep2Pt_Diboson__86->GetZaxis()->SetTickLength(0.025); h_looseLep2Pt_Diboson__86->GetZaxis()->SetTitleFont(42); h->Add(h_looseLep2Pt_Diboson,""); TH1D *h_looseLep2Pt_ZpLjets__87 = new TH1D("h_looseLep2Pt_ZpLjets__87","",20,0,500); h_looseLep2Pt_ZpLjets__87->SetBinContent(1,0.02667925); h_looseLep2Pt_ZpLjets__87->SetBinContent(2,0.01473475); h_looseLep2Pt_ZpLjets__87->SetBinContent(3,0.003756899); h_looseLep2Pt_ZpLjets__87->SetBinContent(4,0.001254256); h_looseLep2Pt_ZpLjets__87->SetBinContent(5,0.0004467979); h_looseLep2Pt_ZpLjets__87->SetBinContent(6,0.0002317029); h_looseLep2Pt_ZpLjets__87->SetBinContent(7,0.0001188745); h_looseLep2Pt_ZpLjets__87->SetBinContent(8,5.180996e-05); h_looseLep2Pt_ZpLjets__87->SetBinContent(9,3.953698e-05); h_looseLep2Pt_ZpLjets__87->SetBinContent(10,5.25799e-05); h_looseLep2Pt_ZpLjets__87->SetBinContent(11,8.216096e-06); h_looseLep2Pt_ZpLjets__87->SetBinContent(12,1.278228e-05); h_looseLep2Pt_ZpLjets__87->SetBinContent(13,9.580175e-06); h_looseLep2Pt_ZpLjets__87->SetBinContent(14,1.588075e-06); h_looseLep2Pt_ZpLjets__87->SetBinContent(15,1.177547e-05); h_looseLep2Pt_ZpLjets__87->SetBinContent(16,1.223887e-06); h_looseLep2Pt_ZpLjets__87->SetBinContent(17,7.306459e-07); h_looseLep2Pt_ZpLjets__87->SetBinContent(20,1.45491e-06); h_looseLep2Pt_ZpLjets__87->SetBinError(1,0.0005258423); h_looseLep2Pt_ZpLjets__87->SetBinError(2,0.0003466748); h_looseLep2Pt_ZpLjets__87->SetBinError(3,0.0001526343); h_looseLep2Pt_ZpLjets__87->SetBinError(4,8.095507e-05); h_looseLep2Pt_ZpLjets__87->SetBinError(5,4.333559e-05); h_looseLep2Pt_ZpLjets__87->SetBinError(6,3.359842e-05); h_looseLep2Pt_ZpLjets__87->SetBinError(7,2.459211e-05); h_looseLep2Pt_ZpLjets__87->SetBinError(8,1.436585e-05); h_looseLep2Pt_ZpLjets__87->SetBinError(9,1.618837e-05); h_looseLep2Pt_ZpLjets__87->SetBinError(10,2.012392e-05); h_looseLep2Pt_ZpLjets__87->SetBinError(11,3.870226e-06); h_looseLep2Pt_ZpLjets__87->SetBinError(12,6.226944e-06); h_looseLep2Pt_ZpLjets__87->SetBinError(13,5.393688e-06); h_looseLep2Pt_ZpLjets__87->SetBinError(14,6.993857e-07); h_looseLep2Pt_ZpLjets__87->SetBinError(15,7.943273e-06); h_looseLep2Pt_ZpLjets__87->SetBinError(16,7.962562e-07); h_looseLep2Pt_ZpLjets__87->SetBinError(17,5.208535e-07); h_looseLep2Pt_ZpLjets__87->SetBinError(20,1.161384e-06); h_looseLep2Pt_ZpLjets__87->SetEntries(24915); h_looseLep2Pt_ZpLjets__87->SetStats(0); ci = TColor::GetColor("#3399cc"); h_looseLep2Pt_ZpLjets__87->SetFillColor(ci); h_looseLep2Pt_ZpLjets__87->GetXaxis()->SetTitle("Sub-leading lep p_{T} [GeV]"); h_looseLep2Pt_ZpLjets__87->GetXaxis()->SetLabelFont(42); h_looseLep2Pt_ZpLjets__87->GetXaxis()->SetLabelOffset(0.007); h_looseLep2Pt_ZpLjets__87->GetXaxis()->SetTitleSize(0.05); h_looseLep2Pt_ZpLjets__87->GetXaxis()->SetTickLength(0.025); h_looseLep2Pt_ZpLjets__87->GetXaxis()->SetTitleFont(42); h_looseLep2Pt_ZpLjets__87->GetYaxis()->SetTitle("a.u./25 GeV"); h_looseLep2Pt_ZpLjets__87->GetYaxis()->SetLabelFont(42); h_looseLep2Pt_ZpLjets__87->GetYaxis()->SetLabelOffset(0.007); h_looseLep2Pt_ZpLjets__87->GetYaxis()->SetTitleSize(0.05); h_looseLep2Pt_ZpLjets__87->GetYaxis()->SetTickLength(0.025); h_looseLep2Pt_ZpLjets__87->GetYaxis()->SetTitleFont(42); h_looseLep2Pt_ZpLjets__87->GetZaxis()->SetLabelFont(42); h_looseLep2Pt_ZpLjets__87->GetZaxis()->SetLabelOffset(0.007); h_looseLep2Pt_ZpLjets__87->GetZaxis()->SetTitleSize(0.05); h_looseLep2Pt_ZpLjets__87->GetZaxis()->SetTickLength(0.025); h_looseLep2Pt_ZpLjets__87->GetZaxis()->SetTitleFont(42); h->Add(h_looseLep2Pt_Z+jets,""); TH1D *h_looseLep2Pt_WpLjets__88 = new TH1D("h_looseLep2Pt_WpLjets__88","",20,0,500); h_looseLep2Pt_WpLjets__88->SetBinContent(1,0.02932453); h_looseLep2Pt_WpLjets__88->SetBinContent(2,0.006497682); h_looseLep2Pt_WpLjets__88->SetBinContent(3,0.002693998); h_looseLep2Pt_WpLjets__88->SetBinContent(4,0.001997142); h_looseLep2Pt_WpLjets__88->SetBinContent(5,0.001838293); h_looseLep2Pt_WpLjets__88->SetBinContent(6,0.0008665013); h_looseLep2Pt_WpLjets__88->SetBinContent(7,0.001024588); h_looseLep2Pt_WpLjets__88->SetBinContent(8,0.0007202847); h_looseLep2Pt_WpLjets__88->SetBinContent(9,0.0001418163); h_looseLep2Pt_WpLjets__88->SetBinContent(10,0.0002837216); h_looseLep2Pt_WpLjets__88->SetBinContent(11,0.0001795552); h_looseLep2Pt_WpLjets__88->SetBinContent(12,1.395914e-05); h_looseLep2Pt_WpLjets__88->SetBinContent(13,1.974067e-05); h_looseLep2Pt_WpLjets__88->SetBinContent(14,5.586989e-06); h_looseLep2Pt_WpLjets__88->SetBinContent(15,4.838904e-05); h_looseLep2Pt_WpLjets__88->SetBinContent(16,8.80718e-06); h_looseLep2Pt_WpLjets__88->SetBinContent(17,2.15012e-06); h_looseLep2Pt_WpLjets__88->SetBinContent(18,3.517553e-06); h_looseLep2Pt_WpLjets__88->SetBinContent(19,3.815246e-07); h_looseLep2Pt_WpLjets__88->SetBinContent(20,1.212912e-05); h_looseLep2Pt_WpLjets__88->SetBinError(1,0.001351271); h_looseLep2Pt_WpLjets__88->SetBinError(2,0.0006213388); h_looseLep2Pt_WpLjets__88->SetBinError(3,0.0004390932); h_looseLep2Pt_WpLjets__88->SetBinError(4,0.0003469893); h_looseLep2Pt_WpLjets__88->SetBinError(5,0.0003545163); h_looseLep2Pt_WpLjets__88->SetBinError(6,0.0002163202); h_looseLep2Pt_WpLjets__88->SetBinError(7,0.0002255816); h_looseLep2Pt_WpLjets__88->SetBinError(8,0.0001927611); h_looseLep2Pt_WpLjets__88->SetBinError(9,6.565621e-05); h_looseLep2Pt_WpLjets__88->SetBinError(10,0.0001456303); h_looseLep2Pt_WpLjets__88->SetBinError(11,9.307131e-05); h_looseLep2Pt_WpLjets__88->SetBinError(12,4.209394e-06); h_looseLep2Pt_WpLjets__88->SetBinError(13,1.131021e-05); h_looseLep2Pt_WpLjets__88->SetBinError(14,3.172661e-06); h_looseLep2Pt_WpLjets__88->SetBinError(15,4.146079e-05); h_looseLep2Pt_WpLjets__88->SetBinError(16,5.369418e-06); h_looseLep2Pt_WpLjets__88->SetBinError(17,8.346041e-07); h_looseLep2Pt_WpLjets__88->SetBinError(18,2.861137e-06); h_looseLep2Pt_WpLjets__88->SetBinError(19,2.949137e-07); h_looseLep2Pt_WpLjets__88->SetBinError(20,6.047119e-06); h_looseLep2Pt_WpLjets__88->SetEntries(3309); h_looseLep2Pt_WpLjets__88->SetStats(0); ci = TColor::GetColor("#66cc66"); h_looseLep2Pt_WpLjets__88->SetFillColor(ci); h_looseLep2Pt_WpLjets__88->GetXaxis()->SetTitle("Sub-leading lep p_{T} [GeV]"); h_looseLep2Pt_WpLjets__88->GetXaxis()->SetLabelFont(42); h_looseLep2Pt_WpLjets__88->GetXaxis()->SetLabelOffset(0.007); h_looseLep2Pt_WpLjets__88->GetXaxis()->SetTitleSize(0.05); h_looseLep2Pt_WpLjets__88->GetXaxis()->SetTickLength(0.025); h_looseLep2Pt_WpLjets__88->GetXaxis()->SetTitleFont(42); h_looseLep2Pt_WpLjets__88->GetYaxis()->SetTitle("a.u./25 GeV"); h_looseLep2Pt_WpLjets__88->GetYaxis()->SetLabelFont(42); h_looseLep2Pt_WpLjets__88->GetYaxis()->SetLabelOffset(0.007); h_looseLep2Pt_WpLjets__88->GetYaxis()->SetTitleSize(0.05); h_looseLep2Pt_WpLjets__88->GetYaxis()->SetTickLength(0.025); h_looseLep2Pt_WpLjets__88->GetYaxis()->SetTitleFont(42); h_looseLep2Pt_WpLjets__88->GetZaxis()->SetLabelFont(42); h_looseLep2Pt_WpLjets__88->GetZaxis()->SetLabelOffset(0.007); h_looseLep2Pt_WpLjets__88->GetZaxis()->SetTitleSize(0.05); h_looseLep2Pt_WpLjets__88->GetZaxis()->SetTickLength(0.025); h_looseLep2Pt_WpLjets__88->GetZaxis()->SetTitleFont(42); h->Add(h_looseLep2Pt_W+jets,""); TH1D *h_looseLep2Pt_TopsPoPLFcP__89 = new TH1D("h_looseLep2Pt_TopsPoPLFcP__89","",20,0,500); h_looseLep2Pt_TopsPoPLFcP__89->SetBinContent(1,0.09566986); h_looseLep2Pt_TopsPoPLFcP__89->SetBinContent(2,0.1184424); h_looseLep2Pt_TopsPoPLFcP__89->SetBinContent(3,0.0578968); h_looseLep2Pt_TopsPoPLFcP__89->SetBinContent(4,0.02776582); h_looseLep2Pt_TopsPoPLFcP__89->SetBinContent(5,0.01352875); h_looseLep2Pt_TopsPoPLFcP__89->SetBinContent(6,0.006884179); h_looseLep2Pt_TopsPoPLFcP__89->SetBinContent(7,0.003658057); h_looseLep2Pt_TopsPoPLFcP__89->SetBinContent(8,0.001948227); h_looseLep2Pt_TopsPoPLFcP__89->SetBinContent(9,0.001021047); h_looseLep2Pt_TopsPoPLFcP__89->SetBinContent(10,0.000535609); h_looseLep2Pt_TopsPoPLFcP__89->SetBinContent(11,0.000252071); h_looseLep2Pt_TopsPoPLFcP__89->SetBinContent(12,0.0001040926); h_looseLep2Pt_TopsPoPLFcP__89->SetBinContent(13,0.0002597359); h_looseLep2Pt_TopsPoPLFcP__89->SetBinContent(14,4.685411e-05); h_looseLep2Pt_TopsPoPLFcP__89->SetBinContent(15,2.316069e-05); h_looseLep2Pt_TopsPoPLFcP__89->SetBinContent(16,7.098286e-06); h_looseLep2Pt_TopsPoPLFcP__89->SetBinContent(17,1.098163e-05); h_looseLep2Pt_TopsPoPLFcP__89->SetBinContent(18,5.405239e-06); h_looseLep2Pt_TopsPoPLFcP__89->SetBinContent(19,1.254191e-05); h_looseLep2Pt_TopsPoPLFcP__89->SetBinContent(20,6.416628e-06); h_looseLep2Pt_TopsPoPLFcP__89->SetBinError(1,0.001032897); h_looseLep2Pt_TopsPoPLFcP__89->SetBinError(2,0.001159746); h_looseLep2Pt_TopsPoPLFcP__89->SetBinError(3,0.0008366751); h_looseLep2Pt_TopsPoPLFcP__89->SetBinError(4,0.0005883119); h_looseLep2Pt_TopsPoPLFcP__89->SetBinError(5,0.0003798421); h_looseLep2Pt_TopsPoPLFcP__89->SetBinError(6,0.0002961909); h_looseLep2Pt_TopsPoPLFcP__89->SetBinError(7,0.0002252512); h_looseLep2Pt_TopsPoPLFcP__89->SetBinError(8,0.0001593319); h_looseLep2Pt_TopsPoPLFcP__89->SetBinError(9,9.938102e-05); h_looseLep2Pt_TopsPoPLFcP__89->SetBinError(10,9.688184e-05); h_looseLep2Pt_TopsPoPLFcP__89->SetBinError(11,3.857011e-05); h_looseLep2Pt_TopsPoPLFcP__89->SetBinError(12,2.361438e-05); h_looseLep2Pt_TopsPoPLFcP__89->SetBinError(13,0.0001125534); h_looseLep2Pt_TopsPoPLFcP__89->SetBinError(14,1.684722e-05); h_looseLep2Pt_TopsPoPLFcP__89->SetBinError(15,1.087063e-05); h_looseLep2Pt_TopsPoPLFcP__89->SetBinError(16,7.098286e-06); h_looseLep2Pt_TopsPoPLFcP__89->SetBinError(17,7.125221e-06); h_looseLep2Pt_TopsPoPLFcP__89->SetBinError(18,3.836305e-06); h_looseLep2Pt_TopsPoPLFcP__89->SetBinError(19,8.954834e-06); h_looseLep2Pt_TopsPoPLFcP__89->SetBinError(20,4.538739e-06); h_looseLep2Pt_TopsPoPLFcP__89->SetEntries(45754); h_looseLep2Pt_TopsPoPLFcP__89->SetStats(0); ci = TColor::GetColor("#cc33cc"); h_looseLep2Pt_TopsPoPLFcP__89->SetFillColor(ci); h_looseLep2Pt_TopsPoPLFcP__89->GetXaxis()->SetTitle("Sub-leading lep p_{T} [GeV]"); h_looseLep2Pt_TopsPoPLFcP__89->GetXaxis()->SetLabelFont(42); h_looseLep2Pt_TopsPoPLFcP__89->GetXaxis()->SetLabelOffset(0.007); h_looseLep2Pt_TopsPoPLFcP__89->GetXaxis()->SetTitleSize(0.05); h_looseLep2Pt_TopsPoPLFcP__89->GetXaxis()->SetTickLength(0.025); h_looseLep2Pt_TopsPoPLFcP__89->GetXaxis()->SetTitleFont(42); h_looseLep2Pt_TopsPoPLFcP__89->GetYaxis()->SetTitle("a.u./25 GeV"); h_looseLep2Pt_TopsPoPLFcP__89->GetYaxis()->SetLabelFont(42); h_looseLep2Pt_TopsPoPLFcP__89->GetYaxis()->SetLabelOffset(0.007); h_looseLep2Pt_TopsPoPLFcP__89->GetYaxis()->SetTitleSize(0.05); h_looseLep2Pt_TopsPoPLFcP__89->GetYaxis()->SetTickLength(0.025); h_looseLep2Pt_TopsPoPLFcP__89->GetYaxis()->SetTitleFont(42); h_looseLep2Pt_TopsPoPLFcP__89->GetZaxis()->SetLabelFont(42); h_looseLep2Pt_TopsPoPLFcP__89->GetZaxis()->SetLabelOffset(0.007); h_looseLep2Pt_TopsPoPLFcP__89->GetZaxis()->SetTitleSize(0.05); h_looseLep2Pt_TopsPoPLFcP__89->GetZaxis()->SetTickLength(0.025); h_looseLep2Pt_TopsPoPLFcP__89->GetZaxis()->SetTitleFont(42); h->Add(h_looseLep2Pt_Top (LF),""); TH1D *h_looseLep2Pt_TopsPoPHFcP__90 = new TH1D("h_looseLep2Pt_TopsPoPHFcP__90","",20,0,500); h_looseLep2Pt_TopsPoPHFcP__90->SetBinContent(1,0.1041412); h_looseLep2Pt_TopsPoPHFcP__90->SetBinContent(2,0.1735886); h_looseLep2Pt_TopsPoPHFcP__90->SetBinContent(3,0.1116258); h_looseLep2Pt_TopsPoPHFcP__90->SetBinContent(4,0.06454315); h_looseLep2Pt_TopsPoPHFcP__90->SetBinContent(5,0.03441357); h_looseLep2Pt_TopsPoPHFcP__90->SetBinContent(6,0.01992067); h_looseLep2Pt_TopsPoPHFcP__90->SetBinContent(7,0.01014646); h_looseLep2Pt_TopsPoPHFcP__90->SetBinContent(8,0.005947886); h_looseLep2Pt_TopsPoPHFcP__90->SetBinContent(9,0.002876054); h_looseLep2Pt_TopsPoPHFcP__90->SetBinContent(10,0.001475723); h_looseLep2Pt_TopsPoPHFcP__90->SetBinContent(11,0.0007236292); h_looseLep2Pt_TopsPoPHFcP__90->SetBinContent(12,0.0004357554); h_looseLep2Pt_TopsPoPHFcP__90->SetBinContent(13,0.0002249375); h_looseLep2Pt_TopsPoPHFcP__90->SetBinContent(14,0.0001475853); h_looseLep2Pt_TopsPoPHFcP__90->SetBinContent(15,0.0001020681); h_looseLep2Pt_TopsPoPHFcP__90->SetBinContent(16,6.402955e-05); h_looseLep2Pt_TopsPoPHFcP__90->SetBinContent(17,1.980568e-05); h_looseLep2Pt_TopsPoPHFcP__90->SetBinContent(18,2.33998e-05); h_looseLep2Pt_TopsPoPHFcP__90->SetBinContent(20,2.517288e-05); h_looseLep2Pt_TopsPoPHFcP__90->SetBinError(1,0.001126128); h_looseLep2Pt_TopsPoPHFcP__90->SetBinError(2,0.001474884); h_looseLep2Pt_TopsPoPHFcP__90->SetBinError(3,0.001116875); h_looseLep2Pt_TopsPoPHFcP__90->SetBinError(4,0.0008934187); h_looseLep2Pt_TopsPoPHFcP__90->SetBinError(5,0.0006246887); h_looseLep2Pt_TopsPoPHFcP__90->SetBinError(6,0.0005076532); h_looseLep2Pt_TopsPoPHFcP__90->SetBinError(7,0.0003555866); h_looseLep2Pt_TopsPoPHFcP__90->SetBinError(8,0.000286312); h_looseLep2Pt_TopsPoPHFcP__90->SetBinError(9,0.0001737097); h_looseLep2Pt_TopsPoPHFcP__90->SetBinError(10,0.0001517557); h_looseLep2Pt_TopsPoPHFcP__90->SetBinError(11,6.387877e-05); h_looseLep2Pt_TopsPoPHFcP__90->SetBinError(12,5.265571e-05); h_looseLep2Pt_TopsPoPHFcP__90->SetBinError(13,3.442087e-05); h_looseLep2Pt_TopsPoPHFcP__90->SetBinError(14,2.732865e-05); h_looseLep2Pt_TopsPoPHFcP__90->SetBinError(15,2.352865e-05); h_looseLep2Pt_TopsPoPHFcP__90->SetBinError(16,1.915664e-05); h_looseLep2Pt_TopsPoPHFcP__90->SetBinError(17,1.063003e-05); h_looseLep2Pt_TopsPoPHFcP__90->SetBinError(18,1.102394e-05); h_looseLep2Pt_TopsPoPHFcP__90->SetBinError(20,1.216417e-05); h_looseLep2Pt_TopsPoPHFcP__90->SetEntries(77950); h_looseLep2Pt_TopsPoPHFcP__90->SetStats(0); ci = TColor::GetColor("#ff9900"); h_looseLep2Pt_TopsPoPHFcP__90->SetFillColor(ci); h_looseLep2Pt_TopsPoPHFcP__90->GetXaxis()->SetTitle("Sub-leading lep p_{T} [GeV]"); h_looseLep2Pt_TopsPoPHFcP__90->GetXaxis()->SetLabelFont(42); h_looseLep2Pt_TopsPoPHFcP__90->GetXaxis()->SetLabelOffset(0.007); h_looseLep2Pt_TopsPoPHFcP__90->GetXaxis()->SetTitleSize(0.05); h_looseLep2Pt_TopsPoPHFcP__90->GetXaxis()->SetTickLength(0.025); h_looseLep2Pt_TopsPoPHFcP__90->GetXaxis()->SetTitleFont(42); h_looseLep2Pt_TopsPoPHFcP__90->GetYaxis()->SetTitle("a.u./25 GeV"); h_looseLep2Pt_TopsPoPHFcP__90->GetYaxis()->SetLabelFont(42); h_looseLep2Pt_TopsPoPHFcP__90->GetYaxis()->SetLabelOffset(0.007); h_looseLep2Pt_TopsPoPHFcP__90->GetYaxis()->SetTitleSize(0.05); h_looseLep2Pt_TopsPoPHFcP__90->GetYaxis()->SetTickLength(0.025); h_looseLep2Pt_TopsPoPHFcP__90->GetYaxis()->SetTitleFont(42); h_looseLep2Pt_TopsPoPHFcP__90->GetZaxis()->SetLabelFont(42); h_looseLep2Pt_TopsPoPHFcP__90->GetZaxis()->SetLabelOffset(0.007); h_looseLep2Pt_TopsPoPHFcP__90->GetZaxis()->SetTitleSize(0.05); h_looseLep2Pt_TopsPoPHFcP__90->GetZaxis()->SetTickLength(0.025); h_looseLep2Pt_TopsPoPHFcP__90->GetZaxis()->SetTitleFont(42); h->Add(h_looseLep2Pt_Top (HF),""); h->Draw("hist"); TH1D *hsum__91 = new TH1D("hsum__91","",20,0,500); hsum__91->SetBinContent(1,0.271725); hsum__91->SetBinContent(2,0.3294396); hsum__91->SetBinContent(3,0.1824981); hsum__91->SetBinContent(4,0.09937792); hsum__91->SetBinContent(5,0.05197885); hsum__91->SetBinContent(6,0.02916189); hsum__91->SetBinContent(7,0.01573805); hsum__91->SetBinContent(8,0.009324878); hsum__91->SetBinContent(9,0.004271597); hsum__91->SetBinContent(10,0.002763206); hsum__91->SetBinContent(11,0.001415357); hsum__91->SetBinContent(12,0.0005665895); hsum__91->SetBinContent(13,0.0005139942); hsum__91->SetBinContent(14,0.000423513); hsum__91->SetBinContent(15,0.0004266677); hsum__91->SetBinContent(16,8.11589e-05); hsum__91->SetBinContent(17,3.366807e-05); hsum__91->SetBinContent(18,3.232259e-05); hsum__91->SetBinContent(19,0.0001824813); hsum__91->SetBinContent(20,4.517354e-05); hsum__91->SetBinError(1,0.003076049); hsum__91->SetBinError(2,0.003284904); hsum__91->SetBinError(3,0.002275067); hsum__91->SetBinError(4,0.001468607); hsum__91->SetBinError(5,0.001000255); hsum__91->SetBinError(6,0.0008373727); hsum__91->SetBinError(7,0.0005867939); hsum__91->SetBinError(8,0.0005494993); hsum__91->SetBinError(9,0.0002518041); hsum__91->SetBinError(10,0.0003753241); hsum__91->SetBinError(11,0.0002787325); hsum__91->SetBinError(12,5.819584e-05); hsum__91->SetBinError(13,0.0001183642); hsum__91->SetBinError(14,0.0002242324); hsum__91->SetBinError(15,0.0002463072); hsum__91->SetBinError(16,2.113829e-05); hsum__91->SetBinError(17,1.283488e-05); hsum__91->SetBinError(18,1.201793e-05); hsum__91->SetBinError(19,0.0001697944); hsum__91->SetBinError(20,1.436954e-05); hsum__91->SetEntries(65); hsum__91->SetStats(0); ci = 1187; color = new TColor(ci, 0, 0, 0, " ", 0.99); hsum__91->SetFillColor(ci); hsum__91->SetFillStyle(3003); hsum__91->SetLineWidth(0); hsum__91->GetXaxis()->SetTitle("Sub-leading lep p_{T} [GeV]"); hsum__91->GetXaxis()->SetLabelFont(42); hsum__91->GetXaxis()->SetLabelOffset(0.007); hsum__91->GetXaxis()->SetTitleSize(0.05); hsum__91->GetXaxis()->SetTickLength(0.025); hsum__91->GetXaxis()->SetTitleFont(42); hsum__91->GetYaxis()->SetTitle("a.u./25 GeV"); hsum__91->GetYaxis()->SetLabelFont(42); hsum__91->GetYaxis()->SetLabelOffset(0.007); hsum__91->GetYaxis()->SetTitleSize(0.05); hsum__91->GetYaxis()->SetTickLength(0.025); hsum__91->GetYaxis()->SetTitleFont(42); hsum__91->GetZaxis()->SetLabelFont(42); hsum__91->GetZaxis()->SetLabelOffset(0.007); hsum__91->GetZaxis()->SetTitleSize(0.05); hsum__91->GetZaxis()->SetTickLength(0.025); hsum__91->GetZaxis()->SetTitleFont(42); hsum__91->Draw("e2 same"); TH1D *h_looseLep2Pt_Data__92 = new TH1D("h_looseLep2Pt_Data__92","",20,0,500); h_looseLep2Pt_Data__92->SetBinContent(1,0.2915764); h_looseLep2Pt_Data__92->SetBinContent(2,0.3247432); h_looseLep2Pt_Data__92->SetBinContent(3,0.1760106); h_looseLep2Pt_Data__92->SetBinContent(4,0.0916329); h_looseLep2Pt_Data__92->SetBinContent(5,0.04946763); h_looseLep2Pt_Data__92->SetBinContent(6,0.02920946); h_looseLep2Pt_Data__92->SetBinContent(7,0.01620654); h_looseLep2Pt_Data__92->SetBinContent(8,0.008904174); h_looseLep2Pt_Data__92->SetBinContent(9,0.004805427); h_looseLep2Pt_Data__92->SetBinContent(10,0.002732498); h_looseLep2Pt_Data__92->SetBinContent(11,0.001837369); h_looseLep2Pt_Data__92->SetBinContent(12,0.001177801); h_looseLep2Pt_Data__92->SetBinContent(13,0.0008951286); h_looseLep2Pt_Data__92->SetBinContent(14,0.0002826722); h_looseLep2Pt_Data__92->SetBinContent(15,0.0001413361); h_looseLep2Pt_Data__92->SetBinContent(16,0.0001884481); h_looseLep2Pt_Data__92->SetBinContent(17,0.0001413361); h_looseLep2Pt_Data__92->SetBinContent(20,4.711203e-05); h_looseLep2Pt_Data__92->SetBinError(1,0.003706313); h_looseLep2Pt_Data__92->SetBinError(2,0.003911434); h_looseLep2Pt_Data__92->SetBinError(3,0.002879621); h_looseLep2Pt_Data__92->SetBinError(4,0.002077742); h_looseLep2Pt_Data__92->SetBinError(5,0.001526604); h_looseLep2Pt_Data__92->SetBinError(6,0.00117308); h_looseLep2Pt_Data__92->SetBinError(7,0.000873798); h_looseLep2Pt_Data__92->SetBinError(8,0.0006476834); h_looseLep2Pt_Data__92->SetBinError(9,0.0004758082); h_looseLep2Pt_Data__92->SetBinError(10,0.0003587945); h_looseLep2Pt_Data__92->SetBinError(11,0.0002942145); h_looseLep2Pt_Data__92->SetBinError(12,0.0002355602); h_looseLep2Pt_Data__92->SetBinError(13,0.0002053566); h_looseLep2Pt_Data__92->SetBinError(14,0.0001154004); h_looseLep2Pt_Data__92->SetBinError(15,8.160043e-05); h_looseLep2Pt_Data__92->SetBinError(16,9.422406e-05); h_looseLep2Pt_Data__92->SetBinError(17,8.160043e-05); h_looseLep2Pt_Data__92->SetBinError(20,4.711203e-05); h_looseLep2Pt_Data__92->SetEntries(21226); h_looseLep2Pt_Data__92->SetStats(0); h_looseLep2Pt_Data__92->SetLineWidth(3); h_looseLep2Pt_Data__92->SetMarkerStyle(20); h_looseLep2Pt_Data__92->SetMarkerSize(2); h_looseLep2Pt_Data__92->GetXaxis()->SetTitle("Sub-leading lep p_{T} [GeV]"); h_looseLep2Pt_Data__92->GetXaxis()->SetLabelFont(42); h_looseLep2Pt_Data__92->GetXaxis()->SetLabelOffset(0.007); h_looseLep2Pt_Data__92->GetXaxis()->SetTitleSize(0.05); h_looseLep2Pt_Data__92->GetXaxis()->SetTickLength(0.025); h_looseLep2Pt_Data__92->GetXaxis()->SetTitleFont(42); h_looseLep2Pt_Data__92->GetYaxis()->SetTitle("a.u./25 GeV"); h_looseLep2Pt_Data__92->GetYaxis()->SetLabelFont(42); h_looseLep2Pt_Data__92->GetYaxis()->SetLabelOffset(0.007); h_looseLep2Pt_Data__92->GetYaxis()->SetTitleSize(0.05); h_looseLep2Pt_Data__92->GetYaxis()->SetTickLength(0.025); h_looseLep2Pt_Data__92->GetYaxis()->SetTitleFont(42); h_looseLep2Pt_Data__92->GetZaxis()->SetLabelFont(42); h_looseLep2Pt_Data__92->GetZaxis()->SetLabelOffset(0.007); h_looseLep2Pt_Data__92->GetZaxis()->SetTitleSize(0.05); h_looseLep2Pt_Data__92->GetZaxis()->SetTickLength(0.025); h_looseLep2Pt_Data__92->GetZaxis()->SetTitleFont(42); h_looseLep2Pt_Data__92->Draw("elp same"); TLegend *leg = new TLegend(0.6,0.55,0.88,0.9,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetLineColor(1); leg->SetLineStyle(1); leg->SetLineWidth(1); leg->SetFillColor(0); leg->SetFillStyle(0); TLegendEntry *entry=leg->AddEntry("h_looseLep2Pt_Data","Data","ELP"); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(3); entry->SetMarkerColor(1); entry->SetMarkerStyle(20); entry->SetMarkerSize(2); entry->SetTextFont(42); entry=leg->AddEntry("h_looseLep2Pt_Top (HF)","Top (HF)","F"); ci = TColor::GetColor("#ff9900"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_looseLep2Pt_Top (LF)","Top (LF)","F"); ci = TColor::GetColor("#cc33cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_looseLep2Pt_W+jets","W+jets","F"); ci = TColor::GetColor("#66cc66"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_looseLep2Pt_Z+jets","Z+jets","F"); ci = TColor::GetColor("#3399cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_looseLep2Pt_Diboson","Diboson","F"); ci = TColor::GetColor("#9966cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_looseLep2Pt_QCD","QCD","F"); ci = TColor::GetColor("#cccccc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); 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.6,0.55,0.88,0.9,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetLineColor(1); leg->SetLineStyle(1); leg->SetLineWidth(1); leg->SetFillColor(0); leg->SetFillStyle(0); entry=leg->AddEntry("h_looseLep2Pt_Data","Data","ELP"); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(3); entry->SetMarkerColor(1); entry->SetMarkerStyle(20); entry->SetMarkerSize(2); entry->SetTextFont(42); entry=leg->AddEntry("h_looseLep2Pt_Top (HF)","Top (HF)","F"); ci = TColor::GetColor("#ff9900"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_looseLep2Pt_Top (LF)","Top (LF)","F"); ci = TColor::GetColor("#cc33cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_looseLep2Pt_W+jets","W+jets","F"); ci = TColor::GetColor("#66cc66"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_looseLep2Pt_Z+jets","Z+jets","F"); ci = TColor::GetColor("#3399cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_looseLep2Pt_Diboson","Diboson","F"); ci = TColor::GetColor("#9966cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_looseLep2Pt_QCD","QCD","F"); ci = TColor::GetColor("#cccccc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); leg->Draw(); TLatex * tex = new TLatex(0.18,0.85,"CMS"); tex->SetNDC(); tex->SetTextSize(0.06); tex->SetLineWidth(2); tex->Draw(); tex = new TLatex(0.28,0.85,"Preliminary"); tex->SetNDC(); tex->SetTextFont(52); tex->SetTextSize(0.06); tex->SetLineWidth(2); tex->Draw(); tex = new TLatex(0.9,0.94,"36.6 fb^{-1} (13 TeV)"); tex->SetNDC(); tex->SetTextAlign(31); tex->SetTextFont(42); tex->SetTextSize(0.04); tex->SetLineWidth(2); tex->Draw(); pad1->Modified(); c1->cd(); // ------------>Primitives in pad: pad2 TPad *pad2 = new TPad("pad2", "pad2",0,0.05,1,0.3); pad2->Draw(); pad2->cd(); pad2->Range(-93.75,-0.8914286,531.25,0.48); pad2->SetFillColor(0); pad2->SetBorderMode(0); pad2->SetBorderSize(2); pad2->SetGridy(); pad2->SetTickx(1); pad2->SetTicky(1); pad2->SetLeftMargin(0.15); pad2->SetRightMargin(0.05); pad2->SetTopMargin(0); pad2->SetBottomMargin(0.3); pad2->SetFrameFillStyle(0); pad2->SetFrameBorderMode(0); pad2->SetFrameFillStyle(0); pad2->SetFrameBorderMode(0); TH1D *ratio__93 = new TH1D("ratio__93","",20,0,500); ratio__93->SetBinContent(1,0.07305694); ratio__93->SetBinContent(2,-0.01425564); ratio__93->SetBinContent(3,-0.03554857); ratio__93->SetBinContent(4,-0.07793492); ratio__93->SetBinContent(5,-0.04831219); ratio__93->SetBinContent(6,0.00163126); ratio__93->SetBinContent(7,0.02976763); ratio__93->SetBinContent(8,-0.04511625); ratio__93->SetBinContent(9,0.1249721); ratio__93->SetBinContent(10,-0.01111317); ratio__93->SetBinContent(11,0.2981665); ratio__93->SetBinContent(12,1.078755); ratio__93->SetBinContent(13,0.741515); ratio__93->SetBinContent(14,-0.3325537); ratio__93->SetBinContent(15,-0.6687443); ratio__93->SetBinContent(16,1.321965); ratio__93->SetBinContent(17,3.197927); ratio__93->SetBinContent(18,-999); ratio__93->SetBinContent(19,-999); ratio__93->SetBinContent(20,0.04291213); ratio__93->SetBinError(1,0.0001); ratio__93->SetBinError(2,0.0001); ratio__93->SetBinError(3,0.0001); ratio__93->SetBinError(4,0.0001); ratio__93->SetBinError(5,0.0001); ratio__93->SetBinError(6,0.0001); ratio__93->SetBinError(7,0.0001); ratio__93->SetBinError(8,0.0001); ratio__93->SetBinError(9,0.0001); ratio__93->SetBinError(10,0.0001); ratio__93->SetBinError(11,0.0001); ratio__93->SetBinError(12,0.0001); ratio__93->SetBinError(13,0.0001); ratio__93->SetBinError(14,0.0001); ratio__93->SetBinError(15,0.0001); ratio__93->SetBinError(16,0.0001); ratio__93->SetBinError(17,0.0001); ratio__93->SetBinError(18,0.0001); ratio__93->SetBinError(19,0.0001); ratio__93->SetBinError(20,0.0001); ratio__93->SetMinimum(-0.48); ratio__93->SetMaximum(0.48); ratio__93->SetEntries(21246); ratio__93->SetStats(0); ratio__93->SetLineWidth(3); ratio__93->SetMarkerStyle(20); ratio__93->SetMarkerSize(2); ratio__93->GetXaxis()->SetTitle("Sub-leading lep p_{T} [GeV]"); ratio__93->GetXaxis()->SetLabelFont(43); ratio__93->GetXaxis()->SetLabelOffset(0.007); ratio__93->GetXaxis()->SetLabelSize(30); ratio__93->GetXaxis()->SetTitleSize(40); ratio__93->GetXaxis()->SetTickLength(0.025); ratio__93->GetXaxis()->SetTitleOffset(5); ratio__93->GetXaxis()->SetTitleFont(43); ratio__93->GetYaxis()->SetTitle("#frac{Data-Exp}{Exp}"); ratio__93->GetYaxis()->SetNdivisions(5); ratio__93->GetYaxis()->SetLabelFont(43); ratio__93->GetYaxis()->SetLabelOffset(0.007); ratio__93->GetYaxis()->SetLabelSize(30); ratio__93->GetYaxis()->SetTitleSize(40); ratio__93->GetYaxis()->SetTickLength(0.025); ratio__93->GetYaxis()->SetTitleOffset(2.5); ratio__93->GetYaxis()->SetTitleFont(43); ratio__93->GetZaxis()->SetLabelFont(42); ratio__93->GetZaxis()->SetLabelOffset(0.007); ratio__93->GetZaxis()->SetTitleSize(0.05); ratio__93->GetZaxis()->SetTickLength(0.025); ratio__93->GetZaxis()->SetTitleFont(42); ratio__93->Draw("elp"); TH1D *zero__94 = new TH1D("zero__94","",20,0,500); zero__94->SetBinError(1,0.003706313); zero__94->SetBinError(2,0.003911434); zero__94->SetBinError(3,0.002879621); zero__94->SetBinError(4,0.002077742); zero__94->SetBinError(5,0.001526604); zero__94->SetBinError(6,0.00117308); zero__94->SetBinError(7,0.000873798); zero__94->SetBinError(8,0.0006476834); zero__94->SetBinError(9,0.0004758082); zero__94->SetBinError(10,0.0003587945); zero__94->SetBinError(11,0.0002942145); zero__94->SetBinError(12,0.0002355602); zero__94->SetBinError(13,0.0002053566); zero__94->SetBinError(14,0.0001154004); zero__94->SetBinError(15,8.160043e-05); zero__94->SetBinError(16,9.422406e-05); zero__94->SetBinError(17,8.160043e-05); zero__94->SetBinError(20,4.711203e-05); zero__94->SetEntries(21246); zero__94->SetStats(0); zero__94->SetLineWidth(3); zero__94->SetMarkerStyle(20); zero__94->SetMarkerSize(2); zero__94->GetXaxis()->SetTitle("Sub-leading lep p_{T} [GeV]"); zero__94->GetXaxis()->SetLabelFont(42); zero__94->GetXaxis()->SetLabelOffset(0.007); zero__94->GetXaxis()->SetTitleSize(0.05); zero__94->GetXaxis()->SetTickLength(0.025); zero__94->GetXaxis()->SetTitleFont(42); zero__94->GetYaxis()->SetTitle("a.u./25 GeV"); zero__94->GetYaxis()->SetLabelFont(42); zero__94->GetYaxis()->SetLabelOffset(0.007); zero__94->GetYaxis()->SetTitleSize(0.05); zero__94->GetYaxis()->SetTickLength(0.025); zero__94->GetYaxis()->SetTitleFont(42); zero__94->GetZaxis()->SetLabelFont(42); zero__94->GetZaxis()->SetLabelOffset(0.007); zero__94->GetZaxis()->SetTitleSize(0.05); zero__94->GetZaxis()->SetTickLength(0.025); zero__94->GetZaxis()->SetTitleFont(42); zero__94->Draw("hist same"); TH1D *sumratioup__95 = new TH1D("sumratioup__95","",20,0,500); sumratioup__95->SetBinContent(1,0.01132045); sumratioup__95->SetBinContent(2,0.009971187); sumratioup__95->SetBinContent(3,0.01246625); sumratioup__95->SetBinContent(4,0.014778); sumratioup__95->SetBinContent(5,0.01924351); sumratioup__95->SetBinContent(6,0.02871463); sumratioup__95->SetBinContent(7,0.03728504); sumratioup__95->SetBinContent(8,0.05892831); sumratioup__95->SetBinContent(9,0.05894846); sumratioup__95->SetBinContent(10,0.1358292); sumratioup__95->SetBinContent(11,0.1969344); sumratioup__95->SetBinContent(12,0.1027125); sumratioup__95->SetBinContent(13,0.2302831); sumratioup__95->SetBinContent(14,0.5294582); sumratioup__95->SetBinContent(15,0.577281); sumratioup__95->SetBinContent(16,0.2604556); sumratioup__95->SetBinContent(17,0.3812182); sumratioup__95->SetBinContent(18,0.3718119); sumratioup__95->SetBinContent(19,0.9304757); sumratioup__95->SetBinContent(20,0.3180965); sumratioup__95->SetBinError(1,0.003076049); sumratioup__95->SetBinError(2,0.003284904); sumratioup__95->SetBinError(3,0.002275067); sumratioup__95->SetBinError(4,0.001468607); sumratioup__95->SetBinError(5,0.001000255); sumratioup__95->SetBinError(6,0.0008373727); sumratioup__95->SetBinError(7,0.0005867939); sumratioup__95->SetBinError(8,0.0005494993); sumratioup__95->SetBinError(9,0.0002518041); sumratioup__95->SetBinError(10,0.0003753241); sumratioup__95->SetBinError(11,0.0002787325); sumratioup__95->SetBinError(12,5.819584e-05); sumratioup__95->SetBinError(13,0.0001183642); sumratioup__95->SetBinError(14,0.0002242324); sumratioup__95->SetBinError(15,0.0002463072); sumratioup__95->SetBinError(16,2.113829e-05); sumratioup__95->SetBinError(17,1.283488e-05); sumratioup__95->SetBinError(18,1.201793e-05); sumratioup__95->SetBinError(19,0.0001697944); sumratioup__95->SetBinError(20,1.436954e-05); sumratioup__95->SetEntries(85); sumratioup__95->SetStats(0); ci = 1187; color = new TColor(ci, 0, 0, 0, " ", 0.99); sumratioup__95->SetFillColor(ci); sumratioup__95->SetFillStyle(3003); sumratioup__95->GetXaxis()->SetTitle("Sub-leading lep p_{T} [GeV]"); sumratioup__95->GetXaxis()->SetLabelFont(42); sumratioup__95->GetXaxis()->SetLabelOffset(0.007); sumratioup__95->GetXaxis()->SetTitleSize(0.05); sumratioup__95->GetXaxis()->SetTickLength(0.025); sumratioup__95->GetXaxis()->SetTitleFont(42); sumratioup__95->GetYaxis()->SetTitle("a.u./25 GeV"); sumratioup__95->GetYaxis()->SetLabelFont(42); sumratioup__95->GetYaxis()->SetLabelOffset(0.007); sumratioup__95->GetYaxis()->SetTitleSize(0.05); sumratioup__95->GetYaxis()->SetTickLength(0.025); sumratioup__95->GetYaxis()->SetTitleFont(42); sumratioup__95->GetZaxis()->SetLabelFont(42); sumratioup__95->GetZaxis()->SetLabelOffset(0.007); sumratioup__95->GetZaxis()->SetTitleSize(0.05); sumratioup__95->GetZaxis()->SetTickLength(0.025); sumratioup__95->GetZaxis()->SetTitleFont(42); sumratioup__95->Draw("hist same"); TH1D *sumratiodown__96 = new TH1D("sumratiodown__96","",20,0,500); sumratiodown__96->SetBinContent(1,-0.01132045); sumratiodown__96->SetBinContent(2,-0.009971187); sumratiodown__96->SetBinContent(3,-0.01246625); sumratiodown__96->SetBinContent(4,-0.014778); sumratiodown__96->SetBinContent(5,-0.01924351); sumratiodown__96->SetBinContent(6,-0.02871463); sumratiodown__96->SetBinContent(7,-0.03728504); sumratiodown__96->SetBinContent(8,-0.05892831); sumratiodown__96->SetBinContent(9,-0.05894846); sumratiodown__96->SetBinContent(10,-0.1358292); sumratiodown__96->SetBinContent(11,-0.1969344); sumratiodown__96->SetBinContent(12,-0.1027125); sumratiodown__96->SetBinContent(13,-0.2302831); sumratiodown__96->SetBinContent(14,-0.5294582); sumratiodown__96->SetBinContent(15,-0.577281); sumratiodown__96->SetBinContent(16,-0.2604556); sumratiodown__96->SetBinContent(17,-0.3812182); sumratiodown__96->SetBinContent(18,-0.3718119); sumratiodown__96->SetBinContent(19,-0.9304757); sumratiodown__96->SetBinContent(20,-0.3180965); sumratiodown__96->SetBinError(1,0.003076049); sumratiodown__96->SetBinError(2,0.003284904); sumratiodown__96->SetBinError(3,0.002275067); sumratiodown__96->SetBinError(4,0.001468607); sumratiodown__96->SetBinError(5,0.001000255); sumratiodown__96->SetBinError(6,0.0008373727); sumratiodown__96->SetBinError(7,0.0005867939); sumratiodown__96->SetBinError(8,0.0005494993); sumratiodown__96->SetBinError(9,0.0002518041); sumratiodown__96->SetBinError(10,0.0003753241); sumratiodown__96->SetBinError(11,0.0002787325); sumratiodown__96->SetBinError(12,5.819584e-05); sumratiodown__96->SetBinError(13,0.0001183642); sumratiodown__96->SetBinError(14,0.0002242324); sumratiodown__96->SetBinError(15,0.0002463072); sumratiodown__96->SetBinError(16,2.113829e-05); sumratiodown__96->SetBinError(17,1.283488e-05); sumratiodown__96->SetBinError(18,1.201793e-05); sumratiodown__96->SetBinError(19,0.0001697944); sumratiodown__96->SetBinError(20,1.436954e-05); sumratiodown__96->SetEntries(85); sumratiodown__96->SetStats(0); ci = 1187; color = new TColor(ci, 0, 0, 0, " ", 0.99); sumratiodown__96->SetFillColor(ci); sumratiodown__96->SetFillStyle(3003); sumratiodown__96->GetXaxis()->SetTitle("Sub-leading lep p_{T} [GeV]"); sumratiodown__96->GetXaxis()->SetLabelFont(42); sumratiodown__96->GetXaxis()->SetLabelOffset(0.007); sumratiodown__96->GetXaxis()->SetTitleSize(0.05); sumratiodown__96->GetXaxis()->SetTickLength(0.025); sumratiodown__96->GetXaxis()->SetTitleFont(42); sumratiodown__96->GetYaxis()->SetTitle("a.u./25 GeV"); sumratiodown__96->GetYaxis()->SetLabelFont(42); sumratiodown__96->GetYaxis()->SetLabelOffset(0.007); sumratiodown__96->GetYaxis()->SetTitleSize(0.05); sumratiodown__96->GetYaxis()->SetTickLength(0.025); sumratiodown__96->GetYaxis()->SetTitleFont(42); sumratiodown__96->GetZaxis()->SetLabelFont(42); sumratiodown__96->GetZaxis()->SetLabelOffset(0.007); sumratiodown__96->GetZaxis()->SetTitleSize(0.05); sumratiodown__96->GetZaxis()->SetTickLength(0.025); sumratiodown__96->GetZaxis()->SetTitleFont(42); sumratiodown__96->Draw("hist same"); Double_t Graph0_fx1008[20] = { 12.5, 37.5, 62.5, 87.5, 112.5, 137.5, 162.5, 187.5, 212.5, 237.5, 262.5, 287.5, 312.5, 337.5, 362.5, 387.5, 412.5, 437.5, 462.5, 487.5}; Double_t Graph0_fy1008[20] = { 0.07305694, -0.01425564, -0.03554857, -0.07793492, -0.04831219, 0.00163126, 0.02976763, -0.04511625, 0.1249721, -0.01111317, 0.2981665, 1.078755, 0.741515, -0.3325537, -0.6687443, 1.321965, 3.197927, -999, -999, 0.04291213}; Double_t Graph0_fex1008[20] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; Double_t Graph0_fey1008[20] = { 0.01363994, 0.01187299, 0.01577891, 0.02090748, 0.02936972, 0.04022648, 0.05552135, 0.06945757, 0.1113888, 0.1298472, 0.207873, 0.415751, 0.3995309, 0.2724838, 0.1912505, 1.160983, 2.423674, 0, 0, 1.042912}; TGraphErrors *gre = new TGraphErrors(20,Graph0_fx1008,Graph0_fy1008,Graph0_fex1008,Graph0_fey1008); gre->SetName("Graph0"); gre->SetTitle("Graph"); gre->SetFillColor(1); gre->SetLineWidth(3); TH1F *Graph_Graph1008 = new TH1F("Graph_Graph1008","Graph",100,0,535); Graph_Graph1008->SetMinimum(-1099.462); Graph_Graph1008->SetMaximum(106.0838); Graph_Graph1008->SetDirectory(0); Graph_Graph1008->SetStats(0); ci = TColor::GetColor("#000099"); Graph_Graph1008->SetLineColor(ci); Graph_Graph1008->GetXaxis()->SetLabelFont(42); Graph_Graph1008->GetXaxis()->SetLabelOffset(0.007); Graph_Graph1008->GetXaxis()->SetTitleSize(0.05); Graph_Graph1008->GetXaxis()->SetTickLength(0.025); Graph_Graph1008->GetXaxis()->SetTitleFont(42); Graph_Graph1008->GetYaxis()->SetLabelFont(42); Graph_Graph1008->GetYaxis()->SetLabelOffset(0.007); Graph_Graph1008->GetYaxis()->SetTitleSize(0.05); Graph_Graph1008->GetYaxis()->SetTickLength(0.025); Graph_Graph1008->GetYaxis()->SetTitleFont(42); Graph_Graph1008->GetZaxis()->SetLabelFont(42); Graph_Graph1008->GetZaxis()->SetLabelOffset(0.007); Graph_Graph1008->GetZaxis()->SetTitleSize(0.05); Graph_Graph1008->GetZaxis()->SetTickLength(0.025); Graph_Graph1008->GetZaxis()->SetTitleFont(42); gre->SetHistogram(Graph_Graph1008); gre->Draw("pe0"); pad2->Modified(); c1->cd(); c1->Modified(); c1->cd(); c1->SetSelected(c1); }
void drawpdgstack(std::string const & which_pdg, std::string const & cname, std::string const & dr, std::string const & binning, std::string const & we = "", std::string const & op = "", std::string const & title = "", std::string const & xtitle = "", std::string const & ytitle = "", bool const pdg_sign = true) { ofile->cd(); TH1F * hist = getpdgs(which_pdg.c_str(), we); if(!hist) { std::cout << "drawpdgstack: Empty pdg hist for \"" << which_pdg << "\" with selection \"" << we << "\"\n"; return; } THStack * stack = new THStack("stack", ""); TLegend * legend = new TLegend(0.6, 0.9, 0.9, 0.6); double sig_evtsppot = 0; if(tree2) { TString draw_str = ""; draw_str += dr; draw_str += ">>h_sig"; draw_str += binning; TCanvas * canvas_pdg_temp = new TCanvas("temp"); tree2->Draw(draw_str.Data(), we.c_str(), op.c_str()); delete canvas_pdg_temp; TH1F * hist_sig = (TH1F*)gDirectory->Get("h_sig"); hist_sig->SetLineColor(1); hist_sig->SetFillColor(kRed+3); hist_sig->Scale(1. / signal_pot * run_pot); stack->Add(hist_sig); legend->AddEntry(hist_sig, ("Signal: "+to_string_with_precision(hist_sig->Integral())).c_str()); sig_evtsppot = hist_sig->Integral(); } legend->SetHeader(("Total: "+to_string_with_precision((hist->Integral()/background_pot*run_pot + sig_evtsppot))).c_str()); ((TLegendEntry*)legend->GetListOfPrimitives()->First())->SetTextAlign(22); std::vector<int> pdg_vec; for(int i = 1; i <= hist->GetNbinsX(); ++i) { if(hist->GetBinContent(i) == 0) continue; int const pdg = i+hist->GetBinLowEdge(0); if(!pdg_sign) { if(std::find(pdg_vec.begin(), pdg_vec.end(), abs(pdg)) != pdg_vec.end()) continue; pdg_vec.push_back(abs(pdg)); } TString hname = ""; hname += "h_"; hname += pdg; TString draw_str = ""; draw_str += dr; draw_str += ">>h_"; draw_str += pdg; draw_str += binning; TString weight_str = ""; weight_str += we; weight_str += "&&("; weight_str += which_pdg; weight_str += "=="; weight_str += pdg; if(!pdg_sign && pdg < 0) { weight_str += "||"; weight_str += which_pdg; weight_str += "=="; weight_str += abs(pdg); } weight_str += ")"; TCanvas * canvas_pdg_temp = new TCanvas("temp"); tree->Draw(draw_str.Data(), weight_str.Data(), op.c_str()); delete canvas_pdg_temp; int pdg_temp = pdg; if(!pdg_sign) pdg_temp = abs(pdg); pdg_stuff const & pdg_s = get_pdg_stuff(pdg_temp, pdg_sign); TH1F * hist_pdg = (TH1F*)gDirectory->Get(hname.Data()); hist_pdg->SetLineColor(1); hist_pdg->SetFillColor(pdg_s._color); hist_pdg->Scale(1. / background_pot * run_pot); stack->Add(hist_pdg); legend->AddEntry(hist_pdg, (pdg_s._particle_name+": "+to_string_with_precision(hist_pdg->Integral())).c_str()); } TCanvas * canvas = new TCanvas(cname.c_str()); stack->Draw(); stack->SetTitle(title.c_str()); stack->GetXaxis()->SetTitle(xtitle.c_str()); stack->GetXaxis()->CenterTitle(); stack->GetYaxis()->SetTitle(ytitle.c_str()); stack->GetYaxis()->CenterTitle(); legend->Draw(); canvas->Write(); delete stack; delete legend; delete canvas; delete hist; }
void plot_config_combsignal_category_monojet() { //=========Macro generated from canvas: c_0/c_0 //========= (Wed Mar 2 17:34:36 2016) by ROOT version6.07/03 TCanvas *c_0 = new TCanvas("c_0", "c_0",0,0,800,800); gStyle->SetOptStat(0); c_0->SetHighLightColor(2); c_0->Range(0,0,1,1); c_0->SetFillColor(0); c_0->SetBorderMode(0); c_0->SetBorderSize(2); c_0->SetFrameBorderMode(0); // ------------>Primitives in pad: p1 TPad *p1 = new TPad("p1", "p1",0,0.28,1,1); p1->Draw(); p1->cd(); p1->Range(99.99999,-1.766386,1100,4.975187); p1->SetFillColor(0); p1->SetBorderMode(0); p1->SetBorderSize(2); p1->SetLogy(); p1->SetBottomMargin(0.01); p1->SetFrameBorderMode(0); p1->SetFrameBorderMode(0); Double_t xAxis1[17] = {200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; TH1F *QCD_FITTY__1 = new TH1F("QCD_FITTY__1","",16, xAxis1); QCD_FITTY__1->SetBinContent(1,5.692051); QCD_FITTY__1->SetBinContent(2,0.6079234); QCD_FITTY__1->SetBinContent(3,0.1364834); QCD_FITTY__1->SetBinContent(5,0.1015811); QCD_FITTY__1->SetBinError(1,4.740265); QCD_FITTY__1->SetBinError(2,0.2887402); QCD_FITTY__1->SetBinError(3,0.1318165); QCD_FITTY__1->SetBinError(5,0.1015811); QCD_FITTY__1->SetMinimum(0.02); QCD_FITTY__1->SetMaximum(20000); QCD_FITTY__1->SetEntries(93114); TF1 *func1 = new TF1("func","[0]*(TMath::Exp(-[1]*x))",200,1000); func1->SetFillColor(19); func1->SetFillStyle(0); func1->SetLineColor(2); func1->SetLineWidth(2); func1->SetChisquare(1.944907); func1->SetNDF(14); func1->GetXaxis()->SetLabelFont(42); func1->GetXaxis()->SetLabelSize(0.035); func1->GetXaxis()->SetTitleSize(0.035); func1->GetXaxis()->SetTitleFont(42); func1->GetYaxis()->SetLabelFont(42); func1->GetYaxis()->SetLabelSize(0.035); func1->GetYaxis()->SetTitleSize(0.035); func1->GetYaxis()->SetTitleFont(42); func1->SetParameter(0,18385.94); func1->SetParError(0,68314.65); func1->SetParLimits(0,0,0); func1->SetParameter(1,0.03609646); func1->SetParError(1,0.01573978); func1->SetParLimits(1,0,0); QCD_FITTY__1->GetListOfFunctions()->Add(func1); Int_t ci; // for color index setting TColor *color; // for color definition with alpha ci = TColor::GetColor("#000099"); QCD_FITTY__1->SetLineColor(ci); QCD_FITTY__1->GetXaxis()->SetLabelFont(42); QCD_FITTY__1->GetXaxis()->SetLabelSize(0); QCD_FITTY__1->GetXaxis()->SetTitleSize(0.035); QCD_FITTY__1->GetXaxis()->SetTitleFont(42); QCD_FITTY__1->GetYaxis()->SetTitle("Events/GeV"); QCD_FITTY__1->GetYaxis()->SetLabelFont(42); QCD_FITTY__1->GetYaxis()->SetLabelSize(0.045); QCD_FITTY__1->GetYaxis()->SetTitleSize(0.05); QCD_FITTY__1->GetYaxis()->SetTitleOffset(0.9); QCD_FITTY__1->GetYaxis()->SetTitleFont(42); QCD_FITTY__1->GetZaxis()->SetLabelFont(42); QCD_FITTY__1->GetZaxis()->SetLabelSize(0.035); QCD_FITTY__1->GetZaxis()->SetTitleSize(0.035); QCD_FITTY__1->GetZaxis()->SetTitleFont(42); QCD_FITTY__1->Draw(""); THStack *bkg = new THStack(); bkg->SetName("bkg"); bkg->SetTitle(""); Double_t xAxis2[17] = {200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; TH1F *bkg_stack_1 = new TH1F("bkg_stack_1","",16, xAxis2); bkg_stack_1->SetMinimum(0.4825172); bkg_stack_1->SetMaximum(1930.069); bkg_stack_1->SetDirectory(0); bkg_stack_1->SetStats(0); ci = TColor::GetColor("#000099"); bkg_stack_1->SetLineColor(ci); bkg_stack_1->GetXaxis()->SetLabelFont(42); bkg_stack_1->GetXaxis()->SetLabelSize(0.035); bkg_stack_1->GetXaxis()->SetTitleSize(0.035); bkg_stack_1->GetXaxis()->SetTitleFont(42); bkg_stack_1->GetYaxis()->SetLabelFont(42); bkg_stack_1->GetYaxis()->SetLabelSize(0.035); bkg_stack_1->GetYaxis()->SetTitleSize(0.035); bkg_stack_1->GetYaxis()->SetTitleFont(42); bkg_stack_1->GetZaxis()->SetLabelFont(42); bkg_stack_1->GetZaxis()->SetLabelSize(0.035); bkg_stack_1->GetZaxis()->SetTitleSize(0.035); bkg_stack_1->GetZaxis()->SetTitleFont(42); bkg->SetHistogram(bkg_stack_1); Double_t xAxis3[17] = {200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; TH1F *signal_data__2 = new TH1F("signal_data__2","",16, xAxis3); signal_data__2->SetBinContent(1,3.366115); signal_data__2->SetBinContent(2,0.787499); signal_data__2->SetBinContent(3,0.1981346); signal_data__2->SetBinContent(4,0.05906976); signal_data__2->SetBinContent(5,0.02671834); signal_data__2->SetBinContent(6,0.009428909); signal_data__2->SetBinContent(7,0.003852866); signal_data__2->SetBinContent(9,0.001330514); signal_data__2->SetBinError(1,0.06263562); signal_data__2->SetBinError(2,0.03020511); signal_data__2->SetBinError(3,0.01526774); signal_data__2->SetBinError(4,0.008347501); signal_data__2->SetBinError(5,0.005865361); signal_data__2->SetBinError(6,0.003101941); signal_data__2->SetBinError(7,0.002245571); signal_data__2->SetBinError(9,0.001330514); signal_data__2->SetMinimum(0.02); signal_data__2->SetMaximum(20000); signal_data__2->SetEntries(93114); ci = TColor::GetColor("#006600"); signal_data__2->SetFillColor(ci); signal_data__2->SetLineWidth(2); signal_data__2->GetXaxis()->SetLabelFont(42); signal_data__2->GetXaxis()->SetLabelSize(0); signal_data__2->GetXaxis()->SetTitleSize(0.035); signal_data__2->GetXaxis()->SetTitleFont(42); signal_data__2->GetYaxis()->SetTitle("Events/GeV"); signal_data__2->GetYaxis()->SetLabelFont(42); signal_data__2->GetYaxis()->SetLabelSize(0.045); signal_data__2->GetYaxis()->SetTitleSize(0.05); signal_data__2->GetYaxis()->SetTitleOffset(0.9); signal_data__2->GetYaxis()->SetTitleFont(42); signal_data__2->GetZaxis()->SetLabelFont(42); signal_data__2->GetZaxis()->SetLabelSize(0.035); signal_data__2->GetZaxis()->SetTitleSize(0.035); signal_data__2->GetZaxis()->SetTitleFont(42); bkg->Add(signal_data,""); Double_t xAxis4[17] = {200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; TH1F *signal_data__3 = new TH1F("signal_data__3","",16, xAxis4); signal_data__3->SetBinContent(1,5.462509); signal_data__3->SetBinContent(2,0.8986022); signal_data__3->SetBinContent(3,0.1478233); signal_data__3->SetBinContent(4,0.02431746); signal_data__3->SetBinContent(5,0.004000308); signal_data__3->SetBinContent(6,0.0006580651); signal_data__3->SetBinContent(7,0.0001082541); signal_data__3->SetBinContent(8,1.780818e-05); signal_data__3->SetBinContent(9,2.929509e-06); signal_data__3->SetBinContent(10,4.819148e-07); signal_data__3->SetBinContent(11,7.92767e-08); signal_data__3->SetBinContent(12,1.30413e-08); signal_data__3->SetBinContent(13,2.145341e-09); signal_data__3->SetBinContent(14,3.529162e-10); signal_data__3->SetBinContent(15,5.805598e-11); signal_data__3->SetBinContent(16,9.550416e-12); signal_data__3->SetEntries(93130); ci = TColor::GetColor("#990099"); signal_data__3->SetFillColor(ci); signal_data__3->SetLineWidth(2); signal_data__3->GetXaxis()->SetLabelFont(42); signal_data__3->GetXaxis()->SetLabelSize(0); signal_data__3->GetXaxis()->SetTitleSize(0.035); signal_data__3->GetXaxis()->SetTitleFont(42); signal_data__3->GetYaxis()->SetTitle("Events/GeV"); signal_data__3->GetYaxis()->SetLabelFont(42); signal_data__3->GetYaxis()->SetLabelSize(0.045); signal_data__3->GetYaxis()->SetTitleSize(0.05); signal_data__3->GetYaxis()->SetTitleOffset(0.9); signal_data__3->GetYaxis()->SetTitleFont(42); signal_data__3->GetZaxis()->SetLabelFont(42); signal_data__3->GetZaxis()->SetLabelSize(0.035); signal_data__3->GetZaxis()->SetTitleSize(0.035); signal_data__3->GetZaxis()->SetTitleFont(42); bkg->Add(signal_data,""); Double_t xAxis5[17] = {200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; TH1F *signal_data__4 = new TH1F("signal_data__4","",16, xAxis5); signal_data__4->SetBinContent(1,11.27338); signal_data__4->SetBinContent(2,5.164269); signal_data__4->SetBinContent(3,2.134427); signal_data__4->SetBinContent(4,0.9783491); signal_data__4->SetBinContent(5,0.4964133); signal_data__4->SetBinContent(6,0.2830323); signal_data__4->SetBinContent(7,0.1401665); signal_data__4->SetBinContent(8,0.0659925); signal_data__4->SetBinContent(9,0.04940417); signal_data__4->SetBinContent(10,0.02696197); signal_data__4->SetBinContent(11,0.01117821); signal_data__4->SetBinContent(12,0.01268177); signal_data__4->SetBinContent(13,0.0008583732); signal_data__4->SetBinContent(14,0.005009577); signal_data__4->SetBinContent(15,0.001705303); signal_data__4->SetBinContent(16,0.0008942028); signal_data__4->SetBinError(1,0.1195696); signal_data__4->SetBinError(2,0.07936277); signal_data__4->SetBinError(3,0.04934242); signal_data__4->SetBinError(4,0.03261242); signal_data__4->SetBinError(5,0.02356661); signal_data__4->SetBinError(6,0.01626474); signal_data__4->SetBinError(7,0.01126338); signal_data__4->SetBinError(8,0.007697977); signal_data__4->SetBinError(9,0.007462621); signal_data__4->SetBinError(10,0.005887312); signal_data__4->SetBinError(11,0.002575424); signal_data__4->SetBinError(12,0.002793759); signal_data__4->SetBinError(13,0.0005778751); signal_data__4->SetBinError(14,0.003120235); signal_data__4->SetBinError(15,0.001219083); signal_data__4->SetBinError(16,0.0006213816); signal_data__4->SetMinimum(0.02); signal_data__4->SetMaximum(20000); signal_data__4->SetEntries(93114); ci = TColor::GetColor("#cccccc"); signal_data__4->SetFillColor(ci); signal_data__4->SetLineWidth(2); signal_data__4->GetXaxis()->SetLabelFont(42); signal_data__4->GetXaxis()->SetLabelSize(0); signal_data__4->GetXaxis()->SetTitleSize(0.035); signal_data__4->GetXaxis()->SetTitleFont(42); signal_data__4->GetYaxis()->SetTitle("Events/GeV"); signal_data__4->GetYaxis()->SetLabelFont(42); signal_data__4->GetYaxis()->SetLabelSize(0.045); signal_data__4->GetYaxis()->SetTitleSize(0.05); signal_data__4->GetYaxis()->SetTitleOffset(0.9); signal_data__4->GetYaxis()->SetTitleFont(42); signal_data__4->GetZaxis()->SetLabelFont(42); signal_data__4->GetZaxis()->SetLabelSize(0.035); signal_data__4->GetZaxis()->SetTitleSize(0.035); signal_data__4->GetZaxis()->SetTitleFont(42); bkg->Add(signal_data,""); Double_t xAxis6[17] = {200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; TH1F *signal_data__5 = new TH1F("signal_data__5","",16, xAxis6); signal_data__5->SetBinContent(1,9.395635); signal_data__5->SetBinContent(2,2.767704); signal_data__5->SetBinContent(3,0.825768); signal_data__5->SetBinContent(4,0.270995); signal_data__5->SetBinContent(5,0.1046858); signal_data__5->SetBinContent(6,0.04337157); signal_data__5->SetBinContent(7,0.006181574); signal_data__5->SetBinContent(8,0.006578597); signal_data__5->SetBinContent(9,0.002775389); signal_data__5->SetBinContent(10,0.0001472684); signal_data__5->SetBinContent(12,0.001207239); signal_data__5->SetBinError(1,0.1914438); signal_data__5->SetBinError(2,0.09748959); signal_data__5->SetBinError(3,0.05366274); signal_data__5->SetBinError(4,0.03048251); signal_data__5->SetBinError(5,0.01732507); signal_data__5->SetBinError(6,0.009830044); signal_data__5->SetBinError(7,0.002704768); signal_data__5->SetBinError(8,0.002764011); signal_data__5->SetBinError(9,0.001745024); signal_data__5->SetBinError(10,0.0001403425); signal_data__5->SetBinError(12,0.001207239); signal_data__5->SetMinimum(0.02); signal_data__5->SetMaximum(20000); signal_data__5->SetEntries(93114); ci = TColor::GetColor("#ffcc00"); signal_data__5->SetFillColor(ci); signal_data__5->SetLineWidth(2); signal_data__5->GetXaxis()->SetLabelFont(42); signal_data__5->GetXaxis()->SetLabelSize(0); signal_data__5->GetXaxis()->SetTitleSize(0.035); signal_data__5->GetXaxis()->SetTitleFont(42); signal_data__5->GetYaxis()->SetTitle("Events/GeV"); signal_data__5->GetYaxis()->SetLabelFont(42); signal_data__5->GetYaxis()->SetLabelSize(0.045); signal_data__5->GetYaxis()->SetTitleSize(0.05); signal_data__5->GetYaxis()->SetTitleOffset(0.9); signal_data__5->GetYaxis()->SetTitleFont(42); signal_data__5->GetZaxis()->SetLabelFont(42); signal_data__5->GetZaxis()->SetLabelSize(0.035); signal_data__5->GetZaxis()->SetTitleSize(0.035); signal_data__5->GetZaxis()->SetTitleFont(42); bkg->Add(signal_data,""); Double_t xAxis7[17] = {200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; TH1F *signal_data__6 = new TH1F("signal_data__6","",16, xAxis7); signal_data__6->SetBinContent(1,485.676); signal_data__6->SetBinContent(2,150.4476); signal_data__6->SetBinContent(3,48.99616); signal_data__6->SetBinContent(4,16.70447); signal_data__6->SetBinContent(5,7.399257); signal_data__6->SetBinContent(6,2.859279); signal_data__6->SetBinContent(7,1.354017); signal_data__6->SetBinContent(8,0.6687575); signal_data__6->SetBinContent(9,0.3364223); signal_data__6->SetBinContent(10,0.1512945); signal_data__6->SetBinContent(11,0.0427805); signal_data__6->SetBinContent(12,0.008073589); signal_data__6->SetBinContent(15,0.04519286); signal_data__6->SetBinError(1,5.197335); signal_data__6->SetBinError(2,2.689428); signal_data__6->SetBinError(3,1.486889); signal_data__6->SetBinError(4,0.7618376); signal_data__6->SetBinError(5,0.5645714); signal_data__6->SetBinError(6,0.2985256); signal_data__6->SetBinError(7,0.2173355); signal_data__6->SetBinError(8,0.1679533); signal_data__6->SetBinError(9,0.08155546); signal_data__6->SetBinError(10,0.07316577); signal_data__6->SetBinError(11,0.02187704); signal_data__6->SetBinError(12,0.008073589); signal_data__6->SetBinError(15,0.02937385); signal_data__6->SetMinimum(0.02); signal_data__6->SetMaximum(20000); signal_data__6->SetEntries(93114); ci = TColor::GetColor("#0066ff"); signal_data__6->SetFillColor(ci); signal_data__6->SetLineWidth(2); signal_data__6->GetXaxis()->SetLabelFont(42); signal_data__6->GetXaxis()->SetLabelSize(0); signal_data__6->GetXaxis()->SetTitleSize(0.035); signal_data__6->GetXaxis()->SetTitleFont(42); signal_data__6->GetYaxis()->SetTitle("Events/GeV"); signal_data__6->GetYaxis()->SetLabelFont(42); signal_data__6->GetYaxis()->SetLabelSize(0.045); signal_data__6->GetYaxis()->SetTitleSize(0.05); signal_data__6->GetYaxis()->SetTitleOffset(0.9); signal_data__6->GetYaxis()->SetTitleFont(42); signal_data__6->GetZaxis()->SetLabelFont(42); signal_data__6->GetZaxis()->SetLabelSize(0.035); signal_data__6->GetZaxis()->SetTitleSize(0.035); signal_data__6->GetZaxis()->SetTitleFont(42); bkg->Add(signal_data,""); Double_t xAxis8[17] = {200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; TH1F *signal_data__7 = new TH1F("signal_data__7","",16, xAxis8); signal_data__7->SetBinContent(1,691.1194); signal_data__7->SetBinContent(2,259.5456); signal_data__7->SetBinContent(3,104.7472); signal_data__7->SetBinContent(4,44.93597); signal_data__7->SetBinContent(5,20.99294); signal_data__7->SetBinContent(6,10.32105); signal_data__7->SetBinContent(7,5.277536); signal_data__7->SetBinContent(8,2.623267); signal_data__7->SetBinContent(9,1.527075); signal_data__7->SetBinContent(10,0.8305721); signal_data__7->SetBinContent(11,0.4631412); signal_data__7->SetBinContent(12,0.2500485); signal_data__7->SetBinContent(13,0.1764325); signal_data__7->SetBinContent(14,0.08449654); signal_data__7->SetBinContent(15,0.06779213); signal_data__7->SetBinContent(16,0.03614071); signal_data__7->SetBinError(1,1.220341); signal_data__7->SetBinError(2,0.7476462); signal_data__7->SetBinError(3,0.4749452); signal_data__7->SetBinError(4,0.3110437); signal_data__7->SetBinError(5,0.2123163); signal_data__7->SetBinError(6,0.1491278); signal_data__7->SetBinError(7,0.1066568); signal_data__7->SetBinError(8,0.07549773); signal_data__7->SetBinError(9,0.05746214); signal_data__7->SetBinError(10,0.04245363); signal_data__7->SetBinError(11,0.03171115); signal_data__7->SetBinError(12,0.0230028); signal_data__7->SetBinError(13,0.01935178); signal_data__7->SetBinError(14,0.01319687); signal_data__7->SetBinError(15,0.01228991); signal_data__7->SetBinError(16,0.008698386); signal_data__7->SetMinimum(0.02); signal_data__7->SetMaximum(20000); signal_data__7->SetEntries(93114); ci = TColor::GetColor("#9999ff"); signal_data__7->SetFillColor(ci); signal_data__7->SetLineWidth(2); signal_data__7->GetXaxis()->SetLabelFont(42); signal_data__7->GetXaxis()->SetLabelSize(0); signal_data__7->GetXaxis()->SetTitleSize(0.035); signal_data__7->GetXaxis()->SetTitleFont(42); signal_data__7->GetYaxis()->SetTitle("Events/GeV"); signal_data__7->GetYaxis()->SetLabelFont(42); signal_data__7->GetYaxis()->SetLabelSize(0.045); signal_data__7->GetYaxis()->SetTitleSize(0.05); signal_data__7->GetYaxis()->SetTitleOffset(0.9); signal_data__7->GetYaxis()->SetTitleFont(42); signal_data__7->GetZaxis()->SetLabelFont(42); signal_data__7->GetZaxis()->SetLabelSize(0.035); signal_data__7->GetZaxis()->SetTitleSize(0.035); signal_data__7->GetZaxis()->SetTitleFont(42); bkg->Add(signal_data,""); bkg->Draw("histfsame"); Double_t xAxis9[17] = {200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; TH1F *signal_data__8 = new TH1F("signal_data__8","",16, xAxis9); signal_data__8->SetBinContent(1,2.224751); signal_data__8->SetBinContent(2,1.974505); signal_data__8->SetBinContent(3,1.697419); signal_data__8->SetBinContent(4,1.381147); signal_data__8->SetBinContent(5,1.072331); signal_data__8->SetBinContent(6,0.7898172); signal_data__8->SetBinContent(7,0.6394378); signal_data__8->SetBinContent(8,0.5046116); signal_data__8->SetBinContent(9,0.4333764); signal_data__8->SetBinContent(10,0.3183351); signal_data__8->SetBinContent(11,0.2179884); signal_data__8->SetBinContent(12,0.2030754); signal_data__8->SetBinContent(13,0.1783056); signal_data__8->SetBinContent(14,0.1315356); signal_data__8->SetBinContent(15,0.08231596); signal_data__8->SetBinContent(16,0.06008587); signal_data__8->SetBinError(1,29.60662); signal_data__8->SetBinError(2,27.89184); signal_data__8->SetBinError(3,25.86084); signal_data__8->SetBinError(4,23.32749); signal_data__8->SetBinError(5,20.55477); signal_data__8->SetBinError(6,17.64052); signal_data__8->SetBinError(7,15.87257); signal_data__8->SetBinError(8,14.10025); signal_data__8->SetBinError(9,13.06715); signal_data__8->SetBinError(10,11.19929); signal_data__8->SetBinError(11,9.267548); signal_data__8->SetBinError(12,8.944927); signal_data__8->SetBinError(13,8.38167); signal_data__8->SetBinError(14,7.198961); signal_data__8->SetBinError(15,5.694953); signal_data__8->SetBinError(16,4.865577); signal_data__8->SetEntries(93114); ci = TColor::GetColor("#cc0000"); signal_data__8->SetLineColor(ci); signal_data__8->SetLineStyle(7); signal_data__8->SetLineWidth(5); signal_data__8->GetXaxis()->SetLabelFont(42); signal_data__8->GetXaxis()->SetLabelSize(0); signal_data__8->GetXaxis()->SetTitleSize(0.035); signal_data__8->GetXaxis()->SetTitleFont(42); signal_data__8->GetYaxis()->SetTitle("Events/GeV"); signal_data__8->GetYaxis()->SetLabelFont(42); signal_data__8->GetYaxis()->SetLabelSize(0.045); signal_data__8->GetYaxis()->SetTitleSize(0.05); signal_data__8->GetYaxis()->SetTitleOffset(0.9); signal_data__8->GetYaxis()->SetTitleFont(42); signal_data__8->GetZaxis()->SetLabelFont(42); signal_data__8->GetZaxis()->SetLabelSize(0.035); signal_data__8->GetZaxis()->SetTitleSize(0.035); signal_data__8->GetZaxis()->SetTitleFont(42); signal_data__8->Draw("samehist"); Double_t xAxis10[17] = {200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; TH1F *signal_data__9 = new TH1F("signal_data__9","",16, xAxis10); signal_data__9->SetBinContent(1,1206.523); signal_data__9->SetBinContent(2,419.3206); signal_data__9->SetBinContent(3,157.0381); signal_data__9->SetBinContent(4,62.94885); signal_data__9->SetBinContent(5,29.12159); signal_data__9->SetBinContent(6,13.51616); signal_data__9->SetBinContent(7,6.781754); signal_data__9->SetBinContent(8,3.364596); signal_data__9->SetBinContent(9,1.917007); signal_data__9->SetBinContent(10,1.008976); signal_data__9->SetBinContent(11,0.5170999); signal_data__9->SetBinContent(12,0.2720111); signal_data__9->SetBinContent(13,0.1772909); signal_data__9->SetBinContent(14,0.08950612); signal_data__9->SetBinContent(15,0.1146903); signal_data__9->SetBinContent(16,0.03703492); signal_data__9->SetBinError(1,7.143284); signal_data__9->SetBinError(2,2.809285); signal_data__9->SetBinError(3,1.568227); signal_data__9->SetBinError(4,0.8241403); signal_data__9->SetBinError(5,0.6123951); signal_data__9->SetBinError(6,0.3342565); signal_data__9->SetBinError(7,0.2423832); signal_data__9->SetBinError(8,0.1843234); signal_data__9->SetBinError(9,0.1000685); signal_data__9->SetBinError(10,0.08479517); signal_data__9->SetBinError(11,0.03861133); signal_data__9->SetBinError(12,0.02456775); signal_data__9->SetBinError(13,0.01936041); signal_data__9->SetBinError(14,0.01356072); signal_data__9->SetBinError(15,0.03186457); signal_data__9->SetBinError(16,0.008720552); signal_data__9->SetMinimum(0.02); signal_data__9->SetMaximum(20000); signal_data__9->SetEntries(93114); signal_data__9->SetFillColor(1); signal_data__9->SetFillStyle(3144); ci = TColor::GetColor("#000099"); signal_data__9->SetLineColor(ci); signal_data__9->SetMarkerSize(0); signal_data__9->GetXaxis()->SetLabelFont(42); signal_data__9->GetXaxis()->SetLabelSize(0); signal_data__9->GetXaxis()->SetTitleSize(0.035); signal_data__9->GetXaxis()->SetTitleFont(42); signal_data__9->GetYaxis()->SetTitle("Events/GeV"); signal_data__9->GetYaxis()->SetLabelFont(42); signal_data__9->GetYaxis()->SetLabelSize(0.045); signal_data__9->GetYaxis()->SetTitleSize(0.05); signal_data__9->GetYaxis()->SetTitleOffset(0.9); signal_data__9->GetYaxis()->SetTitleFont(42); signal_data__9->GetZaxis()->SetLabelFont(42); signal_data__9->GetZaxis()->SetLabelSize(0.035); signal_data__9->GetZaxis()->SetTitleSize(0.035); signal_data__9->GetZaxis()->SetTitleFont(42); signal_data__9->Draw("E2same"); Double_t xAxis11[17] = {200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; TH1F *signal_data__10 = new TH1F("signal_data__10","",16, xAxis11); signal_data__10->SetBinContent(1,1215.98); signal_data__10->SetBinContent(2,401.4); signal_data__10->SetBinContent(3,141.34); signal_data__10->SetBinContent(4,56.42); signal_data__10->SetBinContent(5,24.04); signal_data__10->SetBinContent(6,10.98); signal_data__10->SetBinContent(7,5.44); signal_data__10->SetBinContent(8,2.62); signal_data__10->SetBinContent(9,1.7); signal_data__10->SetBinContent(10,0.8); signal_data__10->SetBinContent(11,0.38); signal_data__10->SetBinContent(12,0.26); signal_data__10->SetBinContent(13,0.14); signal_data__10->SetBinContent(14,0.06); signal_data__10->SetBinContent(15,0.06); signal_data__10->SetBinContent(16,0.02); signal_data__10->SetBinError(1,4.931491); signal_data__10->SetBinError(2,2.833373); signal_data__10->SetBinError(3,1.681309); signal_data__10->SetBinError(4,1.062262); signal_data__10->SetBinError(5,0.6933974); signal_data__10->SetBinError(6,0.468615); signal_data__10->SetBinError(7,0.3298485); signal_data__10->SetBinError(8,0.2289105); signal_data__10->SetBinError(9,0.1843909); signal_data__10->SetBinError(10,0.1264911); signal_data__10->SetBinError(11,0.08717798); signal_data__10->SetBinError(12,0.07211103); signal_data__10->SetBinError(13,0.05291503); signal_data__10->SetBinError(14,0.03464102); signal_data__10->SetBinError(15,0.03464102); signal_data__10->SetBinError(16,0.02); signal_data__10->SetMinimum(0.02); signal_data__10->SetMaximum(20000); signal_data__10->SetEntries(93098); signal_data__10->SetMarkerStyle(20); signal_data__10->SetMarkerSize(0.9); signal_data__10->GetXaxis()->SetLabelFont(42); signal_data__10->GetXaxis()->SetLabelSize(0); signal_data__10->GetXaxis()->SetTitleSize(0.035); signal_data__10->GetXaxis()->SetTitleFont(42); signal_data__10->GetYaxis()->SetTitle("Events/GeV"); signal_data__10->GetYaxis()->SetLabelFont(42); signal_data__10->GetYaxis()->SetLabelSize(0.045); signal_data__10->GetYaxis()->SetTitleSize(0.05); signal_data__10->GetYaxis()->SetTitleOffset(0.9); signal_data__10->GetYaxis()->SetTitleFont(42); signal_data__10->GetZaxis()->SetLabelFont(42); signal_data__10->GetZaxis()->SetLabelSize(0.035); signal_data__10->GetZaxis()->SetTitleSize(0.035); signal_data__10->GetZaxis()->SetTitleFont(42); signal_data__10->Draw("same"); TLegend *leg = new TLegend(0.43,0.41,0.88,0.89,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetLineColor(1); leg->SetLineStyle(1); leg->SetLineWidth(1); leg->SetFillColor(0); leg->SetFillStyle(1001); TLegendEntry *entry=leg->AddEntry("signal_data","Data","PEL"); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(20); entry->SetMarkerSize(0.9); entry->SetTextFont(42); entry=leg->AddEntry("signal_data","Z(#rightarrow #nu#nu)+jets","F"); ci = TColor::GetColor("#9999ff"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(2); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("signal_data","W(#rightarrow l#nu)+jets","F"); ci = TColor::GetColor("#0066ff"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(2); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("signal_data","top","F"); ci = TColor::GetColor("#ffcc00"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(2); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("signal_data","Dibosons","F"); ci = TColor::GetColor("#cccccc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(2); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("signal_data","QCD","F"); ci = TColor::GetColor("#990099"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(2); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("signal_data","Z(#rightarrow ll)+jets","F"); ci = TColor::GetColor("#006600"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(2); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("signal_data","#splitline{Vector Mediator}{m_{med}=1 TeV, m_{DM}=10 GeV}","L"); ci = TColor::GetColor("#cc0000"); entry->SetLineColor(ci); entry->SetLineStyle(7); entry->SetLineWidth(5); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); leg->Draw(); Double_t xAxis12[17] = {200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; TH1F *QCD_FITTY_copy__11 = new TH1F("QCD_FITTY_copy__11","",16, xAxis12); QCD_FITTY_copy__11->SetBinContent(1,5.692051); QCD_FITTY_copy__11->SetBinContent(2,0.6079234); QCD_FITTY_copy__11->SetBinContent(3,0.1364834); QCD_FITTY_copy__11->SetBinContent(5,0.1015811); QCD_FITTY_copy__11->SetBinError(1,4.740265); QCD_FITTY_copy__11->SetBinError(2,0.2887402); QCD_FITTY_copy__11->SetBinError(3,0.1318165); QCD_FITTY_copy__11->SetBinError(5,0.1015811); QCD_FITTY_copy__11->SetMinimum(0.02); QCD_FITTY_copy__11->SetMaximum(20000); QCD_FITTY_copy__11->SetEntries(93114); QCD_FITTY_copy__11->SetDirectory(0); TF1 *func2 = new TF1("func","[0]*(TMath::Exp(-[1]*x))",200,1000); func2->SetFillColor(19); func2->SetFillStyle(0); func2->SetLineColor(2); func2->SetLineWidth(2); func2->SetChisquare(1.944907); func2->SetNDF(14); func2->GetXaxis()->SetLabelFont(42); func2->GetXaxis()->SetLabelSize(0.035); func2->GetXaxis()->SetTitleSize(0.035); func2->GetXaxis()->SetTitleFont(42); func2->GetYaxis()->SetLabelFont(42); func2->GetYaxis()->SetLabelSize(0.035); func2->GetYaxis()->SetTitleSize(0.035); func2->GetYaxis()->SetTitleFont(42); func2->SetParameter(0,18385.94); func2->SetParError(0,68314.65); func2->SetParLimits(0,0,0); func2->SetParameter(1,0.03609646); func2->SetParError(1,0.01573978); func2->SetParLimits(1,0,0); QCD_FITTY_copy__11->GetListOfFunctions()->Add(func2); ci = TColor::GetColor("#000099"); QCD_FITTY_copy__11->SetLineColor(ci); QCD_FITTY_copy__11->GetXaxis()->SetLabelFont(42); QCD_FITTY_copy__11->GetXaxis()->SetLabelSize(0); QCD_FITTY_copy__11->GetXaxis()->SetTitleSize(0.035); QCD_FITTY_copy__11->GetXaxis()->SetTitleFont(42); QCD_FITTY_copy__11->GetYaxis()->SetTitle("Events/GeV"); QCD_FITTY_copy__11->GetYaxis()->SetLabelFont(42); QCD_FITTY_copy__11->GetYaxis()->SetLabelSize(0.045); QCD_FITTY_copy__11->GetYaxis()->SetTitleSize(0.05); QCD_FITTY_copy__11->GetYaxis()->SetTitleOffset(0.9); QCD_FITTY_copy__11->GetYaxis()->SetTitleFont(42); QCD_FITTY_copy__11->GetZaxis()->SetLabelFont(42); QCD_FITTY_copy__11->GetZaxis()->SetLabelSize(0.035); QCD_FITTY_copy__11->GetZaxis()->SetTitleSize(0.035); QCD_FITTY_copy__11->GetZaxis()->SetTitleFont(42); QCD_FITTY_copy__11->Draw("sameaxis"); TLatex * tex = new TLatex(0.17,0.82,"#bf{CMS}"); tex->SetNDC(); tex->SetTextFont(42); tex->SetLineWidth(2); tex->Draw(); tex = new TLatex(0.72,0.92,"19.7 fb^{-1} (8 TeV)"); tex->SetNDC(); tex->SetTextFont(42); tex->SetTextSize(0.04); tex->SetLineWidth(2); tex->Draw(); p1->Modified(); c_0->cd(); // ------------>Primitives in pad: p2 TPad *p2 = new TPad("p2", "p2",0,0.068,1,0.28); p2->Draw(); p2->cd(); p2->Range(99.99999,0.03045454,1100,1.825909); p2->SetFillColor(0); p2->SetBorderMode(0); p2->SetBorderSize(2); p2->SetTopMargin(0.02); p2->SetFrameBorderMode(0); p2->SetFrameBorderMode(0); Double_t xAxis13[17] = {200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; TH1F *signal_data__12 = new TH1F("signal_data__12","",16, xAxis13); signal_data__12->SetBinContent(1,1.00803); signal_data__12->SetBinContent(2,0.9565997); signal_data__12->SetBinContent(3,0.899971); signal_data__12->SetBinContent(4,0.8959371); signal_data__12->SetBinContent(5,0.8282797); signal_data__12->SetBinContent(6,0.8123214); signal_data__12->SetBinContent(7,0.8021396); signal_data__12->SetBinContent(8,0.7786927); signal_data__12->SetBinContent(9,0.8867975); signal_data__12->SetBinContent(10,0.7928828); signal_data__12->SetBinContent(11,0.7348676); signal_data__12->SetBinContent(12,0.9558432); signal_data__12->SetBinContent(13,0.7896627); signal_data__12->SetBinContent(14,0.6703452); signal_data__12->SetBinContent(15,0.523148); signal_data__12->SetBinContent(16,0.5400309); signal_data__12->SetBinError(1,0.004088137); signal_data__12->SetBinError(2,0.006752375); signal_data__12->SetBinError(3,0.0107056); signal_data__12->SetBinError(4,0.01686848); signal_data__12->SetBinError(5,0.02389048); signal_data__12->SetBinError(6,0.03466903); signal_data__12->SetBinError(7,0.04863685); signal_data__12->SetBinError(8,0.0680347); signal_data__12->SetBinError(9,0.09618669); signal_data__12->SetBinError(10,0.1253658); signal_data__12->SetBinError(11,0.1685902); signal_data__12->SetBinError(12,0.2651032); signal_data__12->SetBinError(13,0.2984644); signal_data__12->SetBinError(14,0.387024); signal_data__12->SetBinError(15,0.3020397); signal_data__12->SetBinError(16,0.5400309); signal_data__12->SetMinimum(0.21); signal_data__12->SetMaximum(1.79); signal_data__12->SetEntries(219.6838); signal_data__12->SetMarkerStyle(20); signal_data__12->SetMarkerSize(0.9); signal_data__12->GetXaxis()->SetLabelFont(42); signal_data__12->GetXaxis()->SetLabelSize(0.12); signal_data__12->GetXaxis()->SetTitleSize(0.085); signal_data__12->GetXaxis()->SetTitleFont(42); signal_data__12->GetYaxis()->SetTitle("Data/MC"); signal_data__12->GetYaxis()->SetNdivisions(5); signal_data__12->GetYaxis()->SetLabelFont(42); signal_data__12->GetYaxis()->SetLabelSize(0.12); signal_data__12->GetYaxis()->SetTitleSize(0.12); signal_data__12->GetYaxis()->SetTitleOffset(0.3); signal_data__12->GetYaxis()->SetTitleFont(42); signal_data__12->GetZaxis()->SetLabelFont(42); signal_data__12->GetZaxis()->SetLabelSize(0.035); signal_data__12->GetZaxis()->SetTitleSize(0.035); signal_data__12->GetZaxis()->SetTitleFont(42); signal_data__12->Draw(""); Double_t xAxis14[17] = {200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; TH1F *signal_data__13 = new TH1F("signal_data__13","",16, xAxis14); signal_data__13->SetBinContent(1,1.00019); signal_data__13->SetBinContent(2,0.9993073); signal_data__13->SetBinContent(3,0.9999277); signal_data__13->SetBinContent(4,0.9996138); signal_data__13->SetBinContent(5,1.003362); signal_data__13->SetBinContent(6,0.9999514); signal_data__13->SetBinContent(7,0.999984); signal_data__13->SetBinContent(8,0.9999948); signal_data__13->SetBinContent(9,0.9999985); signal_data__13->SetBinContent(10,0.9999995); signal_data__13->SetBinContent(11,0.9999998); signal_data__13->SetBinContent(12,0.9999999); signal_data__13->SetBinContent(13,0.9999998); signal_data__13->SetBinContent(14,1); signal_data__13->SetBinContent(15,0.9999999); signal_data__13->SetBinContent(16,1); signal_data__13->SetBinError(1,0.005921683); signal_data__13->SetBinError(2,0.006694971); signal_data__13->SetBinError(3,0.009985558); signal_data__13->SetBinError(4,0.01308717); signal_data__13->SetBinError(5,0.0210996); signal_data__13->SetBinError(6,0.02472894); signal_data__13->SetBinError(7,0.03573992); signal_data__13->SetBinError(8,0.05478295); signal_data__13->SetBinError(9,0.05220027); signal_data__13->SetBinError(10,0.08404079); signal_data__13->SetBinError(11,0.07466899); signal_data__13->SetBinError(12,0.0903189); signal_data__13->SetBinError(13,0.1092014); signal_data__13->SetBinError(14,0.1515061); signal_data__13->SetBinError(15,0.2778315); signal_data__13->SetBinError(16,0.2354684); signal_data__13->SetMinimum(0.02); signal_data__13->SetMaximum(20000); signal_data__13->SetEntries(1301.711); ci = TColor::GetColor("#cccccc"); signal_data__13->SetFillColor(ci); ci = TColor::GetColor("#000099"); signal_data__13->SetLineColor(ci); signal_data__13->SetMarkerSize(0); signal_data__13->GetXaxis()->SetLabelFont(42); signal_data__13->GetXaxis()->SetLabelSize(0); signal_data__13->GetXaxis()->SetTitleSize(0.035); signal_data__13->GetXaxis()->SetTitleFont(42); signal_data__13->GetYaxis()->SetTitle("Events/GeV"); signal_data__13->GetYaxis()->SetLabelFont(42); signal_data__13->GetYaxis()->SetLabelSize(0.045); signal_data__13->GetYaxis()->SetTitleSize(0.05); signal_data__13->GetYaxis()->SetTitleOffset(0.9); signal_data__13->GetYaxis()->SetTitleFont(42); signal_data__13->GetZaxis()->SetLabelFont(42); signal_data__13->GetZaxis()->SetLabelSize(0.035); signal_data__13->GetZaxis()->SetTitleSize(0.035); signal_data__13->GetZaxis()->SetTitleFont(42); signal_data__13->Draw("sameE2"); Double_t xAxis15[17] = {200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; TH1F *signal_data__14 = new TH1F("signal_data__14","",16, xAxis15); signal_data__14->SetBinContent(1,1.00803); signal_data__14->SetBinContent(2,0.9565997); signal_data__14->SetBinContent(3,0.899971); signal_data__14->SetBinContent(4,0.8959371); signal_data__14->SetBinContent(5,0.8282797); signal_data__14->SetBinContent(6,0.8123214); signal_data__14->SetBinContent(7,0.8021396); signal_data__14->SetBinContent(8,0.7786927); signal_data__14->SetBinContent(9,0.8867975); signal_data__14->SetBinContent(10,0.7928828); signal_data__14->SetBinContent(11,0.7348676); signal_data__14->SetBinContent(12,0.9558432); signal_data__14->SetBinContent(13,0.7896627); signal_data__14->SetBinContent(14,0.6703452); signal_data__14->SetBinContent(15,0.523148); signal_data__14->SetBinContent(16,0.5400309); signal_data__14->SetBinError(1,0.004088137); signal_data__14->SetBinError(2,0.006752375); signal_data__14->SetBinError(3,0.0107056); signal_data__14->SetBinError(4,0.01686848); signal_data__14->SetBinError(5,0.02389048); signal_data__14->SetBinError(6,0.03466903); signal_data__14->SetBinError(7,0.04863685); signal_data__14->SetBinError(8,0.0680347); signal_data__14->SetBinError(9,0.09618669); signal_data__14->SetBinError(10,0.1253658); signal_data__14->SetBinError(11,0.1685902); signal_data__14->SetBinError(12,0.2651032); signal_data__14->SetBinError(13,0.2984644); signal_data__14->SetBinError(14,0.387024); signal_data__14->SetBinError(15,0.3020397); signal_data__14->SetBinError(16,0.5400309); signal_data__14->SetMinimum(0.21); signal_data__14->SetMaximum(1.79); signal_data__14->SetEntries(219.6838); signal_data__14->SetMarkerStyle(20); signal_data__14->SetMarkerSize(0.9); signal_data__14->GetXaxis()->SetLabelFont(42); signal_data__14->GetXaxis()->SetLabelSize(0.12); signal_data__14->GetXaxis()->SetTitleSize(0.085); signal_data__14->GetXaxis()->SetTitleFont(42); signal_data__14->GetYaxis()->SetTitle("Data/MC"); signal_data__14->GetYaxis()->SetNdivisions(5); signal_data__14->GetYaxis()->SetLabelFont(42); signal_data__14->GetYaxis()->SetLabelSize(0.12); signal_data__14->GetYaxis()->SetTitleSize(0.12); signal_data__14->GetYaxis()->SetTitleOffset(0.3); signal_data__14->GetYaxis()->SetTitleFont(42); signal_data__14->GetZaxis()->SetLabelFont(42); signal_data__14->GetZaxis()->SetLabelSize(0.035); signal_data__14->GetZaxis()->SetTitleSize(0.035); signal_data__14->GetZaxis()->SetTitleFont(42); signal_data__14->Draw("same"); TLine *line = new TLine(200,1,1000,1); line->SetLineColor(2); line->SetLineWidth(3); line->Draw(); Double_t xAxis16[17] = {200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; TH1F *signal_data__15 = new TH1F("signal_data__15","",16, xAxis16); signal_data__15->SetBinContent(1,1.00803); signal_data__15->SetBinContent(2,0.9565997); signal_data__15->SetBinContent(3,0.899971); signal_data__15->SetBinContent(4,0.8959371); signal_data__15->SetBinContent(5,0.8282797); signal_data__15->SetBinContent(6,0.8123214); signal_data__15->SetBinContent(7,0.8021396); signal_data__15->SetBinContent(8,0.7786927); signal_data__15->SetBinContent(9,0.8867975); signal_data__15->SetBinContent(10,0.7928828); signal_data__15->SetBinContent(11,0.7348676); signal_data__15->SetBinContent(12,0.9558432); signal_data__15->SetBinContent(13,0.7896627); signal_data__15->SetBinContent(14,0.6703452); signal_data__15->SetBinContent(15,0.523148); signal_data__15->SetBinContent(16,0.5400309); signal_data__15->SetBinError(1,0.004088137); signal_data__15->SetBinError(2,0.006752375); signal_data__15->SetBinError(3,0.0107056); signal_data__15->SetBinError(4,0.01686848); signal_data__15->SetBinError(5,0.02389048); signal_data__15->SetBinError(6,0.03466903); signal_data__15->SetBinError(7,0.04863685); signal_data__15->SetBinError(8,0.0680347); signal_data__15->SetBinError(9,0.09618669); signal_data__15->SetBinError(10,0.1253658); signal_data__15->SetBinError(11,0.1685902); signal_data__15->SetBinError(12,0.2651032); signal_data__15->SetBinError(13,0.2984644); signal_data__15->SetBinError(14,0.387024); signal_data__15->SetBinError(15,0.3020397); signal_data__15->SetBinError(16,0.5400309); signal_data__15->SetMinimum(0.21); signal_data__15->SetMaximum(1.79); signal_data__15->SetEntries(219.6838); signal_data__15->SetMarkerStyle(20); signal_data__15->SetMarkerSize(0.9); signal_data__15->GetXaxis()->SetLabelFont(42); signal_data__15->GetXaxis()->SetLabelSize(0.12); signal_data__15->GetXaxis()->SetTitleSize(0.085); signal_data__15->GetXaxis()->SetTitleFont(42); signal_data__15->GetYaxis()->SetTitle("Data/MC"); signal_data__15->GetYaxis()->SetNdivisions(5); signal_data__15->GetYaxis()->SetLabelFont(42); signal_data__15->GetYaxis()->SetLabelSize(0.12); signal_data__15->GetYaxis()->SetTitleSize(0.12); signal_data__15->GetYaxis()->SetTitleOffset(0.3); signal_data__15->GetYaxis()->SetTitleFont(42); signal_data__15->GetZaxis()->SetLabelFont(42); signal_data__15->GetZaxis()->SetLabelSize(0.035); signal_data__15->GetZaxis()->SetTitleSize(0.035); signal_data__15->GetZaxis()->SetTitleFont(42); signal_data__15->Draw("same"); Double_t xAxis17[17] = {200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; TH1F *signal_data_copy__16 = new TH1F("signal_data_copy__16","",16, xAxis17); signal_data_copy__16->SetBinContent(1,1.00803); signal_data_copy__16->SetBinContent(2,0.9565997); signal_data_copy__16->SetBinContent(3,0.899971); signal_data_copy__16->SetBinContent(4,0.8959371); signal_data_copy__16->SetBinContent(5,0.8282797); signal_data_copy__16->SetBinContent(6,0.8123214); signal_data_copy__16->SetBinContent(7,0.8021396); signal_data_copy__16->SetBinContent(8,0.7786927); signal_data_copy__16->SetBinContent(9,0.8867975); signal_data_copy__16->SetBinContent(10,0.7928828); signal_data_copy__16->SetBinContent(11,0.7348676); signal_data_copy__16->SetBinContent(12,0.9558432); signal_data_copy__16->SetBinContent(13,0.7896627); signal_data_copy__16->SetBinContent(14,0.6703452); signal_data_copy__16->SetBinContent(15,0.523148); signal_data_copy__16->SetBinContent(16,0.5400309); signal_data_copy__16->SetBinError(1,0.004088137); signal_data_copy__16->SetBinError(2,0.006752375); signal_data_copy__16->SetBinError(3,0.0107056); signal_data_copy__16->SetBinError(4,0.01686848); signal_data_copy__16->SetBinError(5,0.02389048); signal_data_copy__16->SetBinError(6,0.03466903); signal_data_copy__16->SetBinError(7,0.04863685); signal_data_copy__16->SetBinError(8,0.0680347); signal_data_copy__16->SetBinError(9,0.09618669); signal_data_copy__16->SetBinError(10,0.1253658); signal_data_copy__16->SetBinError(11,0.1685902); signal_data_copy__16->SetBinError(12,0.2651032); signal_data_copy__16->SetBinError(13,0.2984644); signal_data_copy__16->SetBinError(14,0.387024); signal_data_copy__16->SetBinError(15,0.3020397); signal_data_copy__16->SetBinError(16,0.5400309); signal_data_copy__16->SetMinimum(0.21); signal_data_copy__16->SetMaximum(1.79); signal_data_copy__16->SetEntries(219.6838); signal_data_copy__16->SetDirectory(0); signal_data_copy__16->SetMarkerStyle(20); signal_data_copy__16->SetMarkerSize(0.9); signal_data_copy__16->GetXaxis()->SetLabelFont(42); signal_data_copy__16->GetXaxis()->SetLabelSize(0.12); signal_data_copy__16->GetXaxis()->SetTitleSize(0.085); signal_data_copy__16->GetXaxis()->SetTitleFont(42); signal_data_copy__16->GetYaxis()->SetTitle("Data/MC"); signal_data_copy__16->GetYaxis()->SetNdivisions(5); signal_data_copy__16->GetYaxis()->SetLabelFont(42); signal_data_copy__16->GetYaxis()->SetLabelSize(0.12); signal_data_copy__16->GetYaxis()->SetTitleSize(0.12); signal_data_copy__16->GetYaxis()->SetTitleOffset(0.3); signal_data_copy__16->GetYaxis()->SetTitleFont(42); signal_data_copy__16->GetZaxis()->SetLabelFont(42); signal_data_copy__16->GetZaxis()->SetLabelSize(0.035); signal_data_copy__16->GetZaxis()->SetTitleSize(0.035); signal_data_copy__16->GetZaxis()->SetTitleFont(42); signal_data_copy__16->Draw("sameaxis"); p2->Modified(); c_0->cd(); tex = new TLatex(0.72,0.02,"E_{T}^{miss} (GeV)"); tex->SetNDC(); tex->SetTextFont(42); tex->SetTextSize(0.04); tex->SetLineWidth(2); tex->Draw(); c_0->Modified(); c_0->cd(); c_0->SetSelected(c_0); }
// *************************************** // // this is a function that takes a set of // // histograms and draws them on a canvas // // in a stack, returning the canvas // // just for MC- no ratio and no data. // // This one includes syst and stat or just // // stat errors // // *************************************** // TCanvas* drawPlots::plot_MC_noRatio_wError(std::vector<TH1D*> histos, std::vector<std::string> names, std::string axisName, TH1D* signal, TH1D* errDown, TH1D* errUp){ const unsigned int MAINPLOT_WIDTH = 800; const unsigned int MAINPLOT_HEIGHT = 600; TCanvas* canvas = new TCanvas("canvas","canvas",0,0,MAINPLOT_WIDTH,MAINPLOT_HEIGHT); canvas->SetMargin(0.,0.,0.,0.); canvas->cd(); double main_y_max = -99; double main_y_min = -99; double main_x_max = -99; double main_x_min = -99; for(int a=0; a<histos.size(); a++){ GetAxisLimits(histos[a], main_x_min, main_x_max, main_y_min, main_y_max); } // create main pad TPad* mainPad = new TPad("main","main",0.,0.,1.,1.); mainPad->SetMargin(0.15,0.05,0.15,.05); // left, right, bottom, top mainPad->Draw(); mainPad->cd(); SetAtlasStyle(); THStack* Stack = new THStack(); std::string title = std::string(";") + axisName + ";Events"; Stack->SetTitle(title.c_str()); for(int b=0; b<histos.size(); b++){ histos[b]->SetLineColor(1); histos[b]->SetFillColor(tools::setColor(names[b])); Stack->Add(histos[b]); } main_y_max = main_y_max*1.5; Stack->SetMaximum(main_y_max); Stack->Draw("hist"); errDown->Draw("E2same"); errUp->Draw("E2Same"); signal->SetLineStyle(2); signal->SetLineColor(kRed); signal->Draw("hist same"); TLegend* leg = new TLegend(0.7,0.7,0.93,0.9); leg->SetFillStyle(0); leg->SetBorderSize(0); leg->AddEntry(signal, "Signal", "f"); for(int q=0; q<histos.size(); q++){ leg->AddEntry(histos[q], names[q].c_str(), "f"); } leg->Draw("lpe"); ATLAS_LABEL(0.2,0.85,1); char text[]="#sqrt{s}=8 TeV"; myText(0.2,0.7,1,text); return canvas; }
// *************************************** // // this is a function that takes a set of // // histograms and draws them on a canvas // // in a stack, returning the canvas. // // It also plots the signal as a dashed // // line and the data with a ratio at the // // the bottom of data/allBackgrounds // // *************************************** // TCanvas* drawPlots::plotAll(std::vector<TH1D*> histos, std::vector<std::string> names, std::string axisName, TH1D* signal, TH1D* data, TH1D* errDown, TH1D* errUp, bool isSignalRegion, bool doLogAxis){ const unsigned int MAINPLOT_WIDTH = 800; const unsigned int MAINPLOT_HEIGHT = 500; const unsigned int RATIOPLOT_HEIGHT = 125; const unsigned int OFFSET = 10; //LUKE: Title offset and title size are proportional in //root, so you have to change them together, //this makes me a sad panda const double RATIOPLOT_YAXIS_TITLE_OFFSET = 0.4; const double RATIOPLOT_YAXIS_TITLE_SIZE = 0.14; const double RATIOPLOT_YAXIS_TICK_LENGTH = 0.01; const double RATIOPLOT_YAXIS_LABEL_SIZE = 0.15; const double RATIOPLOT_XAXIS_TITLE_OFFSET = 0.9; const double RATIOPLOT_XAXIS_TITLE_SIZE = 0.2; const double RATIOPLOT_XAXIS_TICK_LENGTH = 0.05; const double RATIOPLOT_XAXIS_LABEL_SIZE = 0.2; const double CANVAS_HEIGHT = MAINPLOT_HEIGHT+RATIOPLOT_HEIGHT+OFFSET; TCanvas* canvas = new TCanvas("canvas","canvas",0,0,MAINPLOT_WIDTH,CANVAS_HEIGHT); canvas->SetMargin(0.,0.,0.,0.); canvas->Clear(); canvas->cd(); // create main pad const double mainPad_ylow = (CANVAS_HEIGHT - MAINPLOT_HEIGHT)/CANVAS_HEIGHT; const double mainPad_yhigh = 1.; const double pad_margin_left = 0.15; const double pad_margin_right = 0.05; double main_y_max = -99; double main_y_min = -99; double main_x_max = -99; double main_x_min = -99; for(int a=0; a<histos.size(); a++){ if(histos[a]){ if(histos[a]->GetEntries()> 0.){ GetAxisLimits(histos[a], main_x_min, main_x_max, main_y_min, main_y_max); } } } if(data){ int maxBinData = data->GetMaximumBin(); double dataYmax = data->GetBinContent(maxBinData); if(dataYmax > main_y_max) main_y_max = dataYmax; } // create main pad TPad* mainPad = new TPad("main","main",0.,mainPad_ylow,1.,mainPad_yhigh); mainPad->SetMargin(pad_margin_left,pad_margin_right,0.,.05); // left, right, bottom, top mainPad->Draw(); mainPad->cd(); SetAtlasStyle(); if(doLogAxis)mainPad->SetLogy(); // clone signal or data because one should exist for each plot TH1D* allBackgrounds; bool gotSomething=false; if(signal) allBackgrounds = (TH1D*)signal->Clone("all_backgrounds"); else if(data) allBackgrounds = (TH1D*)data->Clone("all_backgrounds"); else{ for(int b=0; b<histos.size(); b++){ if(histos[b] && !gotSomething){ allBackgrounds = (TH1D*)histos[b]->Clone("all_backgrounds"); gotSomething=true; } } } // set all bins to zero so that you can add all histograms to it for(int i=0; i<=allBackgrounds->GetNbinsX()+1; i++) allBackgrounds->SetBinContent(i,0); THStack* Stack = new THStack(); std::string title = std::string(";") + axisName + ";Events"; Stack->SetTitle(title.c_str()); for(int b=0; b<histos.size(); b++){ if(histos[b]){ if(histos[b]->GetEntries() > 0.){ histos[b]->SetLineColor(1); histos[b]->SetFillColor(tools::setColor(names[b])); Stack->Add(histos[b]); for(int j=0; j<=allBackgrounds->GetNbinsX()+1; j++){ double binContent=allBackgrounds->GetBinContent(j)+histos[b]->GetBinContent(j); allBackgrounds->SetBinContent(j,binContent); } } } } TH1D* backgroundsForRatio = (TH1D*)allBackgrounds->Clone("bkgds_for_ratio"); if(doLogAxis){ main_y_max = main_y_max*10; if(Stack->GetMinimum()>.1) Stack->SetMinimum(.1); } else main_y_max = main_y_max*1.4; Stack->SetMaximum(main_y_max); Stack->Draw("hist"); errDown->Draw("E2same"); errUp->Draw("E2Same"); // make error histograms for the ratio plot TH1D* ratioErrDown = (TH1D*) errDown->Clone("ratio_error_down"); TH1D* ratioErrUp = (TH1D*) errUp->Clone("ratio_error_up"); ratioErrDown->Divide(backgroundsForRatio); ratioErrUp->Divide(backgroundsForRatio); if(!isSignalRegion && data) data->Draw("e same"); if(signal){ signal->SetLineStyle(2); signal->SetLineColor(kRed); signal->SetLineWidth(5); signal->Draw("hist same"); } TLegend* leg = new TLegend(0.8,0.65,0.95,0.9); leg->SetFillStyle(0); leg->SetBorderSize(0); if(signal) leg->AddEntry(signal, "Signal", "l"); if(!isSignalRegion) leg->AddEntry(data, "Data"); for(int q=0; q<histos.size(); q++){ if(histos[q]){ if(histos[q]->GetEntries() > 0.) leg->AddEntry(histos[q], names[q].c_str(), "f"); } } leg->Draw("lpe"); ATLAS_LABEL(0.2,0.85,1); char text[]="#sqrt{s}=8 TeV"; myText(0.6,0.75,1,.04, text); char text_L[]="#int L dt = 20.3 fb^{-1}"; myText(0.6, 0.85,1, .04, text_L); char inText[100]; int t; if(signal) t=sprintf(inText, "N_{Signal} = %.1f", signal->Integral(0,signal->GetNbinsX()+1)); else t=sprintf(inText, "N_{Signal} = %.1f", 0.); myText(0.2, 0.75, 1, .04, inText); double back_int = allBackgrounds->Integral(0,allBackgrounds->GetNbinsX()+1); if(back_int > 10000.) t=sprintf(inText, "N_{Bkgd} = %.3e", back_int); else t=sprintf(inText, "N_{Bkgd} = %.1f", back_int); myText(0.2, 0.7, 1, .04, inText); if(!isSignalRegion){ if(data) t=sprintf(inText, "N_{Data} = %.0f", data->Integral(0,data->GetNbinsX()+1)); else t=sprintf(inText, "N_{Data} = %.0f", 0.); myText(0.2, 0.65, 1, .04, inText); } canvas->cd(); // Draw Ratio plot double ratio_max = 1.6; double ratio_min = 0.4; const double x_axis_size = 0.4; const double ratio_pad_height = RATIOPLOT_HEIGHT/CANVAS_HEIGHT; double pad_xlow = 0.,pad_xhigh = 1.; double pad_ylow = OFFSET/CANVAS_HEIGHT,pad_yhigh = ratio_pad_height; const char* pad_name = "pad"; TPad* pad4ratio = new TPad(pad_name,pad_name,pad_xlow,pad_ylow,pad_xhigh,pad_yhigh); pad4ratio->SetMargin(pad_margin_left,pad_margin_right,x_axis_size,0.); pad4ratio->Draw(); pad4ratio->cd(); TH1D* ratioPlot; if(data) ratioPlot = (TH1D*)data->Clone("ratio"); else if(signal) ratioPlot = (TH1D*)signal->Clone("ratio"); // if there is no data then use signal for axis ratioPlot->SetTitle(""); ratioPlot->GetYaxis()->SetTitle("Data/MC"); ratioPlot->GetXaxis()->SetTitle(axisName.c_str()); if(data){ ratioPlot->Divide(allBackgrounds); // here change ratio_min and ratio_max if the ratio plot is quite flat double maxDeviation=0; double tempDev=0; for(int ibin=1; ibin<=allBackgrounds->GetNbinsX(); ibin++){ tempDev = std::abs(ratioPlot->GetBinContent(ibin)-1.); if(tempDev > maxDeviation) maxDeviation = tempDev; } if(maxDeviation < 0.1){ ratio_max = 1.12; ratio_min = 0.88; } else if(maxDeviation < 0.2){ ratio_max = 1.25; ratio_min = .75; } ratioPlot->SetMinimum(ratio_min); ratioPlot->SetMaximum(ratio_max); } ratioPlot->GetXaxis()->SetLabelSize(RATIOPLOT_XAXIS_LABEL_SIZE); ratioPlot->GetXaxis()->SetTickLength(RATIOPLOT_XAXIS_TICK_LENGTH); ratioPlot->GetYaxis()->SetLabelSize(RATIOPLOT_YAXIS_LABEL_SIZE); ratioPlot->GetYaxis()->SetTickLength(RATIOPLOT_YAXIS_TICK_LENGTH); ratioPlot->GetYaxis()->SetNdivisions(3); ratioPlot->GetYaxis()->SetTitleSize(RATIOPLOT_YAXIS_TITLE_SIZE); ratioPlot->GetYaxis()->SetTitleOffset(RATIOPLOT_YAXIS_TITLE_OFFSET); ratioPlot->GetXaxis()->SetTitleSize(RATIOPLOT_XAXIS_TITLE_SIZE); ratioPlot->GetXaxis()->SetTitleOffset(RATIOPLOT_XAXIS_TITLE_OFFSET); if(!isSignalRegion && data){ ratioPlot->Draw(); // plot horizontal line at y=1 TF1* horizontal = new TF1("horizontal","pol1",-10000,10000); horizontal->SetParameter(0,1.); horizontal->SetParameter(1,0.); horizontal->SetLineColor(kBlack); horizontal->SetLineStyle(2); horizontal->SetLineWidth(1); horizontal->Draw("same"); ratioErrDown->Draw("E2same"); ratioErrUp->Draw("E2same"); }else if(isSignalRegion){ ratioPlot->Draw("axis"); char text[]="DATA IS BLINDED HERE"; myText(0.4,0.6,1,.2,text); }else{ // in this case it is not the signal region but there is no data ratioPlot->Draw("axis"); char text[]="NO DATA"; myText(0.4,0.6,1,.2,text); } return canvas; }
TCanvas* plotHists(vector<TH1*> histogramsToPlot, vector<TString> histogramLabels, TString title="", TString xTitle="", TString yTitle="", bool areaNormalize=false) { //************************************************* // Variables bool plotLogY = true; // false = no log; true = log vector<int> histColors; histColors.push_back(kBlack); // change colors as you like histColors.push_back(kBlue); histColors.push_back(kRed); histColors.push_back(kGreen-1); float histLineWidth = 2.0; bool useMarkers = true; // search online for TAttMarker vector<int> histMarkerStyles; // to see all available markers histMarkerStyles.push_back( 20 ); histMarkerStyles.push_back( 22 ); histMarkerStyles.push_back( 21 ); histMarkerStyles.push_back( 23 ); float histMarkerSize = 0.9; int plotWidth=600; int plotHeight=600; // END of Variables //************************************************* // Create the canvas TCanvas *c1 = new TCanvas("c1", "c1",0,0,plotWidth,plotHeight); // Turn off stats box gStyle->SetOptStat(0); // Create copies of histograms provided // and area normalize, if requested vector<TH1*> hists; for (int i=0; i<histogramsToPlot.size(); i++) { hists.push_back( (TH1*)histogramsToPlot[i]->Clone() ); if (areaNormalize) { Double_t integral = hists[i]->Integral(); if (integral>0.0) hists[i]->Scale(1/integral); } } // Set histogram plotting variables // and add them to the histogram stack & legend THStack *tempStack = new THStack(); TLegend *infoBox = new TLegend(0.65, 0.70, 0.90, 0.85, ""); for (int i=0; i<histogramsToPlot.size(); i++) { hists[i]->SetLineColor(histColors[i]); hists[i]->SetLineWidth(histLineWidth); if (useMarkers) { hists[i]->SetMarkerStyle(histMarkerStyles[i]); hists[i]->SetMarkerColor(histColors[i]); hists[i]->SetMarkerSize(histMarkerSize); } infoBox->AddEntry(hists[i],histogramLabels[i],"LP"); tempStack->Add(hists[i]); } // Draw the stack of histograms tempStack->Draw("nostack"); // Set title/label sizes and offsets tempStack->GetXaxis()->SetTitleOffset(0.9); tempStack->GetYaxis()->SetTitleOffset(1.2); tempStack->GetXaxis()->SetLabelSize(0.04); tempStack->GetYaxis()->SetLabelSize(0.05); tempStack->GetXaxis()->SetTitleSize(0.06); tempStack->GetYaxis()->SetTitleSize(0.05); // Set axis titles tempStack->SetTitle(title+";"+xTitle+";"+yTitle); // Draw legend as long as the labels aren't empty infoBox->SetShadowColor(0); // 0 = transparent infoBox->SetLineColor(0); infoBox->SetFillStyle(0); if (histogramLabels[0]!="") { infoBox->Draw(); } c1->SetLogy(plotLogY); return c1; }
void plot(int mass) { double myQCDRelUncert = 0.038; double myEWKRelUncert = 0.131; double myFakesRelUncert = 0.238; double delta = 1.4; double br = 0.05; bool debug = false; bool log = false; double ymin = 0.001; double ymax = 48; static bool bMessage = false; if (!bMessage) { cout << "Values used as relative uncertainty (please check):" << endl; cout << " QCD: " << myQCDRelUncert << endl; cout << " EWK genuine tau: " << myEWKRelUncert << endl; cout << " EWK fake tau: " << myFakesRelUncert << endl << endl; bMessage = true; } cout << "Processing mass point: " << mass << " GeV/c2" << endl; gStyle->SetOptFit(1); gStyle->SetOptStat(0); gStyle->SetOptTitle(0); gStyle->SetTitleFont(43, "xyz"); gStyle->SetTitleSize(33, "xyz"); gStyle->SetLabelFont(43, "xyz"); gStyle->SetLabelSize(27, "xyz"); //std::string infile = "EPS_data_nodeltaphi/hplus_100.root"; //std::string infile = "EPS_data_deltaphi160/hplus_100.root"; std::stringstream s; s << "lands_histograms_hplushadronic_m" << mass << ".root"; std::string infile = s.str(); // Canvas TCanvas *myCanvas = new TCanvas("myCanvas", "",0,0,600,600); myCanvas->SetHighLightColor(2); myCanvas->Range(0,0,1,1); myCanvas->SetFillColor(0); myCanvas->SetBorderMode(0); myCanvas->SetBorderSize(2); if (log) myCanvas->SetLogy(); myCanvas->SetTickx(1); myCanvas->SetTicky(1); myCanvas->SetLeftMargin(0.16); myCanvas->SetRightMargin(0.05); myCanvas->SetTopMargin(0.05); myCanvas->SetBottomMargin(0.08); myCanvas->SetFrameFillStyle(0); myCanvas->SetFrameBorderMode(0); myCanvas->SetFrameFillStyle(0); myCanvas->SetFrameBorderMode(0); myCanvas->cd(); Int_t ci; TFile* f = TFile::Open(infile.c_str()); s.str(""); s << "HW" << mass << "_1"; TH1* hw = (TH1*)f->Get(s.str().c_str()); s.str(""); s << "HH" << mass << "_1"; TH1* hh = (TH1*)f->Get(s.str().c_str()); TH1* data = (TH1*)f->Get("data_obs"); data->SetLineWidth(2); data->SetMarkerStyle(20); data->SetMarkerSize(1.2); TH1* ewktau = (TH1*)f->Get("EWK_Tau"); ci = TColor::GetColor("#993399"); ewktau->SetFillColor(ci); ewktau->SetLineWidth(0); TH1* ewkDY = (TH1*)f->Get("EWK_DYx"); TH1* ewkVV = (TH1*)f->Get("EWK_VVx"); ewktau->Add(ewkDY); ewktau->Add(ewkVV); //TH1* qcd = (TH1*)f->Get("QCDInv"); TH1* qcd = (TH1*)f->Get("QCD"); ci = TColor::GetColor("#ffcc33"); qcd->SetFillColor(ci); qcd->SetLineWidth(0); TH1* fakett = (TH1*)f->Get("fake_tt"); ci = TColor::GetColor("#669900"); fakett->SetFillColor(ci); fakett->SetLineWidth(0); TH1* fakeW = (TH1*)f->Get("fake_W"); ci = TColor::GetColor("#cc3300"); fakeW->SetFillColor(ci); fakeW->SetLineWidth(0); TH1* faket = (TH1*)f->Get("fake_t"); TH1F *hFrame = new TH1F("hFrame","",20,0,400); hFrame->SetMinimum(ymin); if (log) hFrame->SetMaximum(ymax*1.5); else hFrame->SetMaximum(ymax); hFrame->SetDirectory(0); hFrame->SetStats(0); hFrame->SetLineStyle(0); hFrame->SetMarkerStyle(20); hFrame->SetXTitle("Transverse mass (#tau jet, E_{T}^{miss}), (GeV/c^{2})"); if (paperStatus) hFrame->SetXTitle("Transverse mass (#tau_{h}, E_{T}^{miss}), (GeV/c^{2})"); hFrame->SetYTitle("Events / 20 GeV/c^{2}"); hFrame->GetXaxis()->SetTitleSize(0); hFrame->GetXaxis()->SetLabelSize(0); hFrame->GetYaxis()->SetTitleFont(43); hFrame->GetYaxis()->SetTitleSize(27); hFrame->GetYaxis()->SetTitleOffset(1.3); // signal hh->Scale(br*br); hw->Scale(2*br*(1.0-br)); TH1* signal = (TH1*)hh->Clone(); signal->Add(hw); ci = TColor::GetColor("#ff3399"); signal->SetLineColor(ci); signal->SetLineStyle(2); signal->SetLineWidth(2); // Fakes TH1* fakes = (TH1*)(fakett->Clone()); fakes->Add(fakeW); fakes->Add(faket); // stacked backgrounds THStack *exp = new THStack(); exp->SetName("exp"); exp->SetTitle("exp"); exp->Add(fakes); exp->Add(ewktau); exp->Add(qcd); exp->Add(signal); TH1* hExpBkg = (TH1*)fakes->Clone(); hExpBkg->Add(ewktau); hExpBkg->Add(qcd); // uncertainty TH1* uncert = (TH1*)fakeW->Clone(); uncert->Add(fakett); uncert->Add(ewktau); uncert->Add(qcd); uncert->SetFillColor(1); uncert->SetFillStyle(3344); uncert->SetLineColor(0); uncert->SetLineStyle(0); uncert->SetLineWidth(0); TH1* hExpBkgTotalUncert = (TH1*)uncert->Clone(); hExpBkgTotalUncert->SetFillStyle(3354); TH1* hAgreement = (TH1*)data->Clone(); hAgreement->Divide(hExpBkg); TGraphErrors* hAgreementRelUncert = new TGraphErrors(hAgreement->GetNbinsX()); hAgreementRelUncert->SetLineWidth(2); hAgreementRelUncert->SetLineColor(kBlack); for (int i = 1; i <= hFrame->GetNbinsX(); ++i) { double myQCDTotalUncert = TMath::Power(qcd->GetBinError(i), 2) + TMath::Power(qcd->GetBinContent(i)*myQCDRelUncert, 2); double myEWKTotalUncert = TMath::Power(ewktau->GetBinError(i), 2) + TMath::Power(ewktau->GetBinContent(i)*myEWKRelUncert, 2); double myFakesTotalUncert = TMath::Power(fakes->GetBinError(i), 2) + TMath::Power(fakes->GetBinContent(i)*myFakesRelUncert, 2); hExpBkgTotalUncert->SetBinError(i, TMath::Sqrt(myQCDTotalUncert + myEWKTotalUncert + myFakesTotalUncert)); if (hExpBkg->GetBinContent(i) > 0) { hAgreementRelUncert->SetPoint(i-1, hExpBkg->GetBinCenter(i), data->GetBinContent(i) / hExpBkg->GetBinContent(i)); double myUncertData = 0; if (data->GetBinContent(i) > 0) myUncertData = TMath::Power(data->GetBinError(i) / data->GetBinContent(i), 2); double myUncertBkg = (myQCDTotalUncert + myEWKTotalUncert + myFakesTotalUncert) / TMath::Power(hExpBkg->GetBinContent(i), 2); hAgreementRelUncert->SetPointError(i-1, 0, data->GetBinContent(i) / hExpBkg->GetBinContent(i) * TMath::Sqrt(myUncertData + myUncertBkg)); } else { hAgreementRelUncert->SetPoint(i-1, hExpBkg->GetBinCenter(i), 0); hAgreementRelUncert->SetPointError(i-1, 0, 0); } if (debug) { cout << "Point: " << hAgreementRelUncert->GetX()[i-1]-10 << "-" << hAgreementRelUncert->GetX()[i-1]+10 << " GeV/c2, agreement: " << hAgreementRelUncert->GetY()[i-1] << ", uncert: " << hAgreement->GetBinError(i) << ", " << hAgreementRelUncert->GetErrorY(i-1) << endl; cout << " bkg. stat. uncert. " << hExpBkg->GetBinError(i) << " (i.e. " << hExpBkg->GetBinError(i) / hExpBkg->GetBinContent(i) * 100.0 << " %)" << ", stat+syst uncert. " << TMath::Sqrt(myQCDTotalUncert + myEWKTotalUncert + myFakesTotalUncert) << " (i.e. " << TMath::Sqrt(myQCDTotalUncert + myEWKTotalUncert + myFakesTotalUncert) / hExpBkg->GetBinContent(i) * 100.0 << " %)" << endl; } } // Agreement pad TPad* pad = new TPad("ratiopad","ratiopad",0.,0.,1.,.3); pad->Draw(); pad->cd(); pad->Range(0,0,1,1); pad->SetFillColor(0); pad->SetFillStyle(4000); pad->SetBorderMode(0); pad->SetBorderSize(2); pad->SetTickx(1); pad->SetTicky(1); pad->SetLeftMargin(0.16); pad->SetRightMargin(0.05); pad->SetTopMargin(0); pad->SetBottomMargin(0.34); pad->SetFrameFillStyle(0); pad->SetFrameBorderMode(0); // Plot here ratio if (1.0-delta > 0) hAgreement->SetMinimum(1.0-delta); else hAgreement->SetMinimum(0.); hAgreement->SetMaximum(1.0+delta); hAgreement->GetXaxis()->SetLabelOffset(0.007); hAgreement->GetXaxis()->SetLabelFont(43); hAgreement->GetXaxis()->SetLabelSize(27); hAgreement->GetYaxis()->SetLabelFont(43); hAgreement->GetYaxis()->SetLabelSize(27); hAgreement->GetYaxis()->SetLabelOffset(0.007); hAgreement->GetYaxis()->SetNdivisions(505); hAgreement->GetXaxis()->SetTitleFont(43); hAgreement->GetYaxis()->SetTitleFont(43); hAgreement->GetXaxis()->SetTitleSize(33); hAgreement->GetYaxis()->SetTitleSize(33); hAgreement->SetTitleSize(27, "xyz"); hAgreement->GetXaxis()->SetTitleOffset(3.2); hAgreement->GetYaxis()->SetTitleOffset(1.3); hAgreement->SetXTitle(hFrame->GetXaxis()->GetTitle()); hAgreement->SetYTitle("Data/#Sigmabkg"); hAgreement->Draw("e2"); // Plot line at zero TH1* hAgreementLine = dynamic_cast<TH1*>(hAgreement->Clone()); for (int i = 1; i <= hAgreementLine->GetNbinsX(); ++i) { hAgreementLine->SetBinContent(i,1.0); hAgreementLine->SetBinError(i,0.0); } hAgreementLine->SetLineColor(kRed); hAgreementLine->SetLineWidth(2); hAgreementLine->SetLineStyle(3); hAgreementLine->Draw("hist same"); hAgreement->Draw("same"); hAgreementRelUncert->Draw("[]"); pad->RedrawAxis(); myCanvas->cd(); TPad* plotpad = new TPad("plotpad", "plotpad",0,0.3,1.,1.); plotpad->Draw(); plotpad->cd(); plotpad->Range(0,0,1,1); plotpad->SetFillColor(0); plotpad->SetFillStyle(4000); plotpad->SetBorderMode(0); plotpad->SetBorderSize(2); //if (logy) // plotpad->SetLogy(); plotpad->SetTickx(1); plotpad->SetTicky(1); plotpad->SetLeftMargin(0.16); plotpad->SetRightMargin(0.05); plotpad->SetTopMargin(0.065); plotpad->SetBottomMargin(0.0); plotpad->SetFrameFillStyle(0); plotpad->SetFrameBorderMode(0); hFrame->GetXaxis()->SetTitleSize(0); hFrame->GetXaxis()->SetLabelSize(0); hFrame->GetYaxis()->SetTitleFont(43); hFrame->GetYaxis()->SetTitleSize(33); hFrame->GetYaxis()->SetTitleOffset(1.3); // Draw objects hFrame->Draw(); exp->Draw("hist same"); uncert->Draw("E2 same"); hExpBkgTotalUncert->Draw("E2 same"); // Data data->Draw("same"); //signal->Draw("same"); TLegend *leg = new TLegend(0.53,0.6,0.87,0.91,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetTextFont(63); leg->SetTextSize(18); leg->SetLineColor(1); leg->SetLineStyle(1); leg->SetLineWidth(1); leg->SetFillColor(kWhite); //leg->SetFillStyle(4000); // enabling this will cause the plot to be erased from the pad TLegendEntry* entry = leg->AddEntry(data, "Data", "P"); s.str(""); s << "with H^{#pm}#rightarrow#tau^{#pm}#nu"; entry = leg->AddEntry(signal, s.str().c_str(), "L"); entry = leg->AddEntry(qcd, "QCD (meas.)", "F"); entry = leg->AddEntry(ewktau, "EWK genuine #tau (meas.)", "F"); entry = leg->AddEntry(fakes, "EWK fake #tau (MC)", "F"); entry = leg->AddEntry(uncert, "stat. uncert.", "F"); entry = leg->AddEntry(hExpBkgTotalUncert, "stat. #oplus syst. uncert.", "F"); leg->Draw(); string myTitle = "CMS Preliminary"; if (paperStatus) myTitle = "CMS"; TLatex *tex = new TLatex(0.62,0.945,myTitle.c_str()); tex->SetNDC(); tex->SetTextFont(43); tex->SetTextSize(27); tex->SetLineWidth(2); tex->Draw(); tex = new TLatex(0.2,0.945,"#sqrt{s} = 7 TeV"); tex->SetNDC(); tex->SetTextFont(43); tex->SetTextSize(27); tex->SetLineWidth(2); tex->Draw(); tex = new TLatex(0.43,0.945,"2.2 fb^{-1}"); tex->SetNDC(); tex->SetTextFont(43); tex->SetTextSize(27); tex->SetLineWidth(2); tex->Draw(); s.str(""); s << "m_{H^{#pm}} = " << mass << " GeV/c^{2}"; tex = new TLatex(0.28,0.865,s.str().c_str()); tex->SetNDC(); tex->SetTextFont(63); tex->SetTextSize(20); tex->SetLineWidth(2); tex->Draw(); s.str(""); s << "BR(t#rightarrowbH^{#pm})=" << setprecision(2) << br; tex = new TLatex(0.28,0.805,s.str().c_str()); tex->SetNDC(); tex->SetTextFont(63); tex->SetTextSize(20); tex->SetLineWidth(2); tex->Draw(); plotpad->RedrawAxis(); plotpad->Modified(); s.str(""); s << "mT_datadriven_m" << mass << ".png"; myCanvas->Print(s.str().c_str()); s.str(""); s << "mT_datadriven_m" << mass << ".C"; myCanvas->Print(s.str().c_str()); s.str(""); s << "mT_datadriven_m" << mass << ".eps"; myCanvas->Print(s.str().c_str()); }
void stackPlotter::plotStack(const TString& key, legendposition legpos) { if(debug) std::cout << "stackPlotter::plotStack" << std::endl; std::vector<std::pair<Int_t,TH1*> > legEntries = stacksLegEntries_[key]; if(legEntries.size()<1) return; TCanvas *c = new TCanvas(key,key,800,600); TLegend *leg = new TLegend(0.75,0.75,0.95,0.95); //will be overwritten by style! THStack *stack = new THStack(); //determine legend position TBI (add all histos, look at mean and max values etc) //float max=stack->GetMaximum(); //unfortunately no mean function also not filled, yet. //needs another loop on histos TH1 * h=(TH1 *) legEntries.at(0).second->Clone(); for(size_t i=1;i<legEntries.size();i++){ h->Add(legEntries.at(i).second); } // int maxbin=h->GetMaximumBin(); //int minbin=h->GetMinimumBin(); // float ymax=h->GetBinContent(maxbin); //float ymin=h->GetBinContent(minbin); //pass this to the style functions delete h; //gStyle->SetOptTitle(0);//no title for(size_t i=0; i < legEntries.size(); i++) { TString legName = legEntries.at(i).second->GetName(); if(legName == "") continue; applyStyleToTH1(legEntries.at(i).second,legpos); stack->Add(legEntries.at(i).second,"HIST"); stack->SetTitle("");//legEntries.at(i).second->GetTitle()); stack->SetName(legEntries.at(i).second->GetTitle()); //mirror entry for legend leg->AddEntry(legEntries.at(legEntries.size()-1-i).second, legEntries.at(legEntries.size()-1-i).second->GetName(), "F"); } // draw plot and legend c->cd(); applyStyleToCanvas(c,legpos); stack->Draw(); stack->GetXaxis()->SetTitle(legEntries.at(0).second->GetXaxis()->GetTitle()); stack->GetYaxis()->SetTitle(legEntries.at(0).second->GetYaxis()->GetTitle()); applyStyleToAxis(stack,legpos); applyStyleToLegend(leg,legpos); stack->Draw(); leg->Draw(); //c->BuildLegend(); // save and exit if(saveplots_) { c->SaveAs(outdir_+"/"+key+".pdf"); c->SaveAs(outdir_+"/"+key+".png"); } if(savecanvases_ && outfile_) { outfile_->cd(); c->Write(); } delete stack; delete leg; delete c; }
void ttbar_nJet() { //=========Macro generated from canvas: c1/c1 //========= (Sun Dec 11 15:16:19 2016) by ROOT version6.06/01 TCanvas *c1 = new TCanvas("c1", "c1",1,1,1200,1416); gStyle->SetOptStat(0); gStyle->SetOptTitle(0); c1->SetHighLightColor(2); c1->Range(0,0,1,1); c1->SetFillColor(0); c1->SetBorderMode(0); c1->SetBorderSize(2); c1->SetTickx(1); c1->SetTicky(1); c1->SetLeftMargin(0.15); c1->SetRightMargin(0.05); c1->SetTopMargin(0.07); c1->SetBottomMargin(0.13); c1->SetFrameFillStyle(0); c1->SetFrameBorderMode(0); // ------------>Primitives in pad: pad1 TPad *pad1 = new TPad("pad1", "pad1",0,0.3,1,1); pad1->Draw(); pad1->cd(); pad1->Range(-2.1875,0,9.0625,0.5878968); pad1->SetFillColor(0); pad1->SetBorderMode(0); pad1->SetBorderSize(2); pad1->SetTickx(1); pad1->SetTicky(1); pad1->SetLeftMargin(0.15); pad1->SetRightMargin(0.05); pad1->SetTopMargin(0.07); pad1->SetBottomMargin(0); pad1->SetFrameFillStyle(0); pad1->SetFrameBorderMode(0); pad1->SetFrameFillStyle(0); pad1->SetFrameBorderMode(0); THStack *h = new THStack(); h->SetName("h"); h->SetTitle(""); h->SetMinimum(0); h->SetMaximum(0.5207086); TH1F *h_stack_19 = new TH1F("h_stack_19","",9,-0.5,8.5); h_stack_19->SetMinimum(0); h_stack_19->SetMaximum(0.546744); h_stack_19->SetDirectory(0); h_stack_19->SetStats(0); Int_t ci; // for color index setting TColor *color; // for color definition with alpha ci = TColor::GetColor("#000099"); h_stack_19->SetLineColor(ci); h_stack_19->GetXaxis()->SetLabelFont(42); h_stack_19->GetXaxis()->SetLabelOffset(0.007); h_stack_19->GetXaxis()->SetTitleSize(0.05); h_stack_19->GetXaxis()->SetTickLength(0.025); h_stack_19->GetXaxis()->SetTitleFont(42); h_stack_19->GetYaxis()->SetTitle("a.u."); h_stack_19->GetYaxis()->SetLabelFont(42); h_stack_19->GetYaxis()->SetLabelOffset(0.007); h_stack_19->GetYaxis()->SetTitleSize(0.05); h_stack_19->GetYaxis()->SetTickLength(0.025); h_stack_19->GetYaxis()->SetTitleOffset(1.5); h_stack_19->GetYaxis()->SetTitleFont(42); h_stack_19->GetZaxis()->SetLabelFont(42); h_stack_19->GetZaxis()->SetLabelOffset(0.007); h_stack_19->GetZaxis()->SetTitleSize(0.05); h_stack_19->GetZaxis()->SetTickLength(0.025); h_stack_19->GetZaxis()->SetTitleFont(42); h->SetHistogram(h_stack_19); TH1D *h_nJet_QCD__217 = new TH1D("h_nJet_QCD__217","",9,-0.5,8.5); h_nJet_QCD__217->SetBinContent(2,0.001991738); h_nJet_QCD__217->SetBinContent(3,0.0005078625); h_nJet_QCD__217->SetBinContent(4,0.006489724); h_nJet_QCD__217->SetBinContent(5,0.001899386); h_nJet_QCD__217->SetBinContent(6,0.000696849); h_nJet_QCD__217->SetBinError(2,0.001424948); h_nJet_QCD__217->SetBinError(3,0.0005078625); h_nJet_QCD__217->SetBinError(4,0.00246407); h_nJet_QCD__217->SetBinError(5,0.001037545); h_nJet_QCD__217->SetBinError(6,0.0004566736); h_nJet_QCD__217->SetEntries(25); h_nJet_QCD__217->SetStats(0); ci = TColor::GetColor("#cccccc"); h_nJet_QCD__217->SetFillColor(ci); h_nJet_QCD__217->GetXaxis()->SetTitle("N_{jet}"); h_nJet_QCD__217->GetXaxis()->SetLabelFont(42); h_nJet_QCD__217->GetXaxis()->SetLabelOffset(0.007); h_nJet_QCD__217->GetXaxis()->SetTitleSize(0.05); h_nJet_QCD__217->GetXaxis()->SetTickLength(0.025); h_nJet_QCD__217->GetXaxis()->SetTitleFont(42); h_nJet_QCD__217->GetYaxis()->SetTitle("a.u."); h_nJet_QCD__217->GetYaxis()->SetLabelFont(42); h_nJet_QCD__217->GetYaxis()->SetLabelOffset(0.007); h_nJet_QCD__217->GetYaxis()->SetTitleSize(0.05); h_nJet_QCD__217->GetYaxis()->SetTickLength(0.025); h_nJet_QCD__217->GetYaxis()->SetTitleFont(42); h_nJet_QCD__217->GetZaxis()->SetLabelFont(42); h_nJet_QCD__217->GetZaxis()->SetLabelOffset(0.007); h_nJet_QCD__217->GetZaxis()->SetTitleSize(0.05); h_nJet_QCD__217->GetZaxis()->SetTickLength(0.025); h_nJet_QCD__217->GetZaxis()->SetTitleFont(42); h->Add(h_nJet_QCD,""); TH1D *h_nJet_Diboson__218 = new TH1D("h_nJet_Diboson__218","",9,-0.5,8.5); h_nJet_Diboson__218->SetBinContent(2,0.009906449); h_nJet_Diboson__218->SetBinContent(3,0.01358602); h_nJet_Diboson__218->SetBinContent(4,0.008915388); h_nJet_Diboson__218->SetBinContent(5,0.003026678); h_nJet_Diboson__218->SetBinContent(6,0.001043565); h_nJet_Diboson__218->SetBinContent(7,0.0001748174); h_nJet_Diboson__218->SetBinContent(9,0.0001402611); h_nJet_Diboson__218->SetBinError(2,0.001411368); h_nJet_Diboson__218->SetBinError(3,0.001644099); h_nJet_Diboson__218->SetBinError(4,0.001329375); h_nJet_Diboson__218->SetBinError(5,0.0007635958); h_nJet_Diboson__218->SetBinError(6,0.0004304521); h_nJet_Diboson__218->SetBinError(7,0.0001249106); h_nJet_Diboson__218->SetBinError(9,0.0001402611); h_nJet_Diboson__218->SetEntries(227); h_nJet_Diboson__218->SetStats(0); ci = TColor::GetColor("#9966cc"); h_nJet_Diboson__218->SetFillColor(ci); h_nJet_Diboson__218->GetXaxis()->SetTitle("N_{jet}"); h_nJet_Diboson__218->GetXaxis()->SetLabelFont(42); h_nJet_Diboson__218->GetXaxis()->SetLabelOffset(0.007); h_nJet_Diboson__218->GetXaxis()->SetTitleSize(0.05); h_nJet_Diboson__218->GetXaxis()->SetTickLength(0.025); h_nJet_Diboson__218->GetXaxis()->SetTitleFont(42); h_nJet_Diboson__218->GetYaxis()->SetTitle("a.u."); h_nJet_Diboson__218->GetYaxis()->SetLabelFont(42); h_nJet_Diboson__218->GetYaxis()->SetLabelOffset(0.007); h_nJet_Diboson__218->GetYaxis()->SetTitleSize(0.05); h_nJet_Diboson__218->GetYaxis()->SetTickLength(0.025); h_nJet_Diboson__218->GetYaxis()->SetTitleFont(42); h_nJet_Diboson__218->GetZaxis()->SetLabelFont(42); h_nJet_Diboson__218->GetZaxis()->SetLabelOffset(0.007); h_nJet_Diboson__218->GetZaxis()->SetTitleSize(0.05); h_nJet_Diboson__218->GetZaxis()->SetTickLength(0.025); h_nJet_Diboson__218->GetZaxis()->SetTitleFont(42); h->Add(h_nJet_Diboson,""); TH1D *h_nJet_ZpLjets__219 = new TH1D("h_nJet_ZpLjets__219","",9,-0.5,8.5); h_nJet_ZpLjets__219->SetBinContent(2,0.008808307); h_nJet_ZpLjets__219->SetBinContent(3,0.01602806); h_nJet_ZpLjets__219->SetBinContent(4,0.01236436); h_nJet_ZpLjets__219->SetBinContent(5,0.006259341); h_nJet_ZpLjets__219->SetBinContent(6,0.002572435); h_nJet_ZpLjets__219->SetBinContent(7,0.0009920883); h_nJet_ZpLjets__219->SetBinContent(8,0.0002993959); h_nJet_ZpLjets__219->SetBinContent(9,8.98201e-05); h_nJet_ZpLjets__219->SetBinError(2,0.0003706893); h_nJet_ZpLjets__219->SetBinError(3,0.0003944594); h_nJet_ZpLjets__219->SetBinError(4,0.0003001856); h_nJet_ZpLjets__219->SetBinError(5,0.0001834367); h_nJet_ZpLjets__219->SetBinError(6,0.0001013424); h_nJet_ZpLjets__219->SetBinError(7,5.882736e-05); h_nJet_ZpLjets__219->SetBinError(8,2.500891e-05); h_nJet_ZpLjets__219->SetBinError(9,7.251011e-06); h_nJet_ZpLjets__219->SetEntries(24915); h_nJet_ZpLjets__219->SetStats(0); ci = TColor::GetColor("#3399cc"); h_nJet_ZpLjets__219->SetFillColor(ci); h_nJet_ZpLjets__219->GetXaxis()->SetTitle("N_{jet}"); h_nJet_ZpLjets__219->GetXaxis()->SetLabelFont(42); h_nJet_ZpLjets__219->GetXaxis()->SetLabelOffset(0.007); h_nJet_ZpLjets__219->GetXaxis()->SetTitleSize(0.05); h_nJet_ZpLjets__219->GetXaxis()->SetTickLength(0.025); h_nJet_ZpLjets__219->GetXaxis()->SetTitleFont(42); h_nJet_ZpLjets__219->GetYaxis()->SetTitle("a.u."); h_nJet_ZpLjets__219->GetYaxis()->SetLabelFont(42); h_nJet_ZpLjets__219->GetYaxis()->SetLabelOffset(0.007); h_nJet_ZpLjets__219->GetYaxis()->SetTitleSize(0.05); h_nJet_ZpLjets__219->GetYaxis()->SetTickLength(0.025); h_nJet_ZpLjets__219->GetYaxis()->SetTitleFont(42); h_nJet_ZpLjets__219->GetZaxis()->SetLabelFont(42); h_nJet_ZpLjets__219->GetZaxis()->SetLabelOffset(0.007); h_nJet_ZpLjets__219->GetZaxis()->SetTitleSize(0.05); h_nJet_ZpLjets__219->GetZaxis()->SetTickLength(0.025); h_nJet_ZpLjets__219->GetZaxis()->SetTitleFont(42); h->Add(h_nJet_Z+jets,""); TH1D *h_nJet_WpLjets__220 = new TH1D("h_nJet_WpLjets__220","",9,-0.5,8.5); h_nJet_WpLjets__220->SetBinContent(2,0.01228717); h_nJet_WpLjets__220->SetBinContent(3,0.01478108); h_nJet_WpLjets__220->SetBinContent(4,0.01095229); h_nJet_WpLjets__220->SetBinContent(5,0.004774536); h_nJet_WpLjets__220->SetBinContent(6,0.00183733); h_nJet_WpLjets__220->SetBinContent(7,0.0008017153); h_nJet_WpLjets__220->SetBinContent(8,0.0001693615); h_nJet_WpLjets__220->SetBinContent(9,7.928654e-05); h_nJet_WpLjets__220->SetBinError(2,0.0009957224); h_nJet_WpLjets__220->SetBinError(3,0.0009641816); h_nJet_WpLjets__220->SetBinError(4,0.0007772887); h_nJet_WpLjets__220->SetBinError(5,0.0004513384); h_nJet_WpLjets__220->SetBinError(6,0.0002602176); h_nJet_WpLjets__220->SetBinError(7,0.0001551598); h_nJet_WpLjets__220->SetBinError(8,2.724934e-05); h_nJet_WpLjets__220->SetBinError(9,1.806879e-05); h_nJet_WpLjets__220->SetEntries(3309); h_nJet_WpLjets__220->SetStats(0); ci = TColor::GetColor("#66cc66"); h_nJet_WpLjets__220->SetFillColor(ci); h_nJet_WpLjets__220->GetXaxis()->SetTitle("N_{jet}"); h_nJet_WpLjets__220->GetXaxis()->SetLabelFont(42); h_nJet_WpLjets__220->GetXaxis()->SetLabelOffset(0.007); h_nJet_WpLjets__220->GetXaxis()->SetTitleSize(0.05); h_nJet_WpLjets__220->GetXaxis()->SetTickLength(0.025); h_nJet_WpLjets__220->GetXaxis()->SetTitleFont(42); h_nJet_WpLjets__220->GetYaxis()->SetTitle("a.u."); h_nJet_WpLjets__220->GetYaxis()->SetLabelFont(42); h_nJet_WpLjets__220->GetYaxis()->SetLabelOffset(0.007); h_nJet_WpLjets__220->GetYaxis()->SetTitleSize(0.05); h_nJet_WpLjets__220->GetYaxis()->SetTickLength(0.025); h_nJet_WpLjets__220->GetYaxis()->SetTitleFont(42); h_nJet_WpLjets__220->GetZaxis()->SetLabelFont(42); h_nJet_WpLjets__220->GetZaxis()->SetLabelOffset(0.007); h_nJet_WpLjets__220->GetZaxis()->SetTitleSize(0.05); h_nJet_WpLjets__220->GetZaxis()->SetTickLength(0.025); h_nJet_WpLjets__220->GetZaxis()->SetTitleFont(42); h->Add(h_nJet_W+jets,""); TH1D *h_nJet_TopsPoPLFcP__221 = new TH1D("h_nJet_TopsPoPLFcP__221","",9,-0.5,8.5); h_nJet_TopsPoPLFcP__221->SetBinContent(2,0.008309954); h_nJet_TopsPoPLFcP__221->SetBinContent(3,0.04226496); h_nJet_TopsPoPLFcP__221->SetBinContent(4,0.08832035); h_nJet_TopsPoPLFcP__221->SetBinContent(5,0.08533392); h_nJet_TopsPoPLFcP__221->SetBinContent(6,0.05734558); h_nJet_TopsPoPLFcP__221->SetBinContent(7,0.02841211); h_nJet_TopsPoPLFcP__221->SetBinContent(8,0.01180029); h_nJet_TopsPoPLFcP__221->SetBinContent(9,0.006291982); h_nJet_TopsPoPLFcP__221->SetBinError(2,0.0003851356); h_nJet_TopsPoPLFcP__221->SetBinError(3,0.0007306422); h_nJet_TopsPoPLFcP__221->SetBinError(4,0.001088888); h_nJet_TopsPoPLFcP__221->SetBinError(5,0.0009551542); h_nJet_TopsPoPLFcP__221->SetBinError(6,0.0007663072); h_nJet_TopsPoPLFcP__221->SetBinError(7,0.0005284013); h_nJet_TopsPoPLFcP__221->SetBinError(8,0.0003199885); h_nJet_TopsPoPLFcP__221->SetBinError(9,0.0002275074); h_nJet_TopsPoPLFcP__221->SetEntries(45754); h_nJet_TopsPoPLFcP__221->SetStats(0); ci = TColor::GetColor("#cc33cc"); h_nJet_TopsPoPLFcP__221->SetFillColor(ci); h_nJet_TopsPoPLFcP__221->GetXaxis()->SetTitle("N_{jet}"); h_nJet_TopsPoPLFcP__221->GetXaxis()->SetLabelFont(42); h_nJet_TopsPoPLFcP__221->GetXaxis()->SetLabelOffset(0.007); h_nJet_TopsPoPLFcP__221->GetXaxis()->SetTitleSize(0.05); h_nJet_TopsPoPLFcP__221->GetXaxis()->SetTickLength(0.025); h_nJet_TopsPoPLFcP__221->GetXaxis()->SetTitleFont(42); h_nJet_TopsPoPLFcP__221->GetYaxis()->SetTitle("a.u."); h_nJet_TopsPoPLFcP__221->GetYaxis()->SetLabelFont(42); h_nJet_TopsPoPLFcP__221->GetYaxis()->SetLabelOffset(0.007); h_nJet_TopsPoPLFcP__221->GetYaxis()->SetTitleSize(0.05); h_nJet_TopsPoPLFcP__221->GetYaxis()->SetTickLength(0.025); h_nJet_TopsPoPLFcP__221->GetYaxis()->SetTitleFont(42); h_nJet_TopsPoPLFcP__221->GetZaxis()->SetLabelFont(42); h_nJet_TopsPoPLFcP__221->GetZaxis()->SetLabelOffset(0.007); h_nJet_TopsPoPLFcP__221->GetZaxis()->SetTitleSize(0.05); h_nJet_TopsPoPLFcP__221->GetZaxis()->SetTickLength(0.025); h_nJet_TopsPoPLFcP__221->GetZaxis()->SetTitleFont(42); h->Add(h_nJet_Top (LF),""); TH1D *h_nJet_TopsPoPHFcP__222 = new TH1D("h_nJet_TopsPoPHFcP__222","",9,-0.5,8.5); h_nJet_TopsPoPHFcP__222->SetBinContent(2,0.07376031); h_nJet_TopsPoPHFcP__222->SetBinContent(3,0.1364258); h_nJet_TopsPoPHFcP__222->SetBinContent(4,0.1333122); h_nJet_TopsPoPHFcP__222->SetBinContent(5,0.09566011); h_nJet_TopsPoPHFcP__222->SetBinContent(6,0.05315604); h_nJet_TopsPoPHFcP__222->SetBinContent(7,0.02411419); h_nJet_TopsPoPHFcP__222->SetBinContent(8,0.009464359); h_nJet_TopsPoPHFcP__222->SetBinContent(9,0.004552595); h_nJet_TopsPoPHFcP__222->SetBinError(2,0.00103096); h_nJet_TopsPoPHFcP__222->SetBinError(3,0.001340864); h_nJet_TopsPoPHFcP__222->SetBinError(4,0.001254557); h_nJet_TopsPoPHFcP__222->SetBinError(5,0.001028784); h_nJet_TopsPoPHFcP__222->SetBinError(6,0.0007477547); h_nJet_TopsPoPHFcP__222->SetBinError(7,0.0004712842); h_nJet_TopsPoPHFcP__222->SetBinError(8,0.0003185909); h_nJet_TopsPoPHFcP__222->SetBinError(9,0.0001812819); h_nJet_TopsPoPHFcP__222->SetEntries(77950); h_nJet_TopsPoPHFcP__222->SetStats(0); ci = TColor::GetColor("#ff9900"); h_nJet_TopsPoPHFcP__222->SetFillColor(ci); h_nJet_TopsPoPHFcP__222->GetXaxis()->SetTitle("N_{jet}"); h_nJet_TopsPoPHFcP__222->GetXaxis()->SetLabelFont(42); h_nJet_TopsPoPHFcP__222->GetXaxis()->SetLabelOffset(0.007); h_nJet_TopsPoPHFcP__222->GetXaxis()->SetTitleSize(0.05); h_nJet_TopsPoPHFcP__222->GetXaxis()->SetTickLength(0.025); h_nJet_TopsPoPHFcP__222->GetXaxis()->SetTitleFont(42); h_nJet_TopsPoPHFcP__222->GetYaxis()->SetTitle("a.u."); h_nJet_TopsPoPHFcP__222->GetYaxis()->SetLabelFont(42); h_nJet_TopsPoPHFcP__222->GetYaxis()->SetLabelOffset(0.007); h_nJet_TopsPoPHFcP__222->GetYaxis()->SetTitleSize(0.05); h_nJet_TopsPoPHFcP__222->GetYaxis()->SetTickLength(0.025); h_nJet_TopsPoPHFcP__222->GetYaxis()->SetTitleFont(42); h_nJet_TopsPoPHFcP__222->GetZaxis()->SetLabelFont(42); h_nJet_TopsPoPHFcP__222->GetZaxis()->SetLabelOffset(0.007); h_nJet_TopsPoPHFcP__222->GetZaxis()->SetTitleSize(0.05); h_nJet_TopsPoPHFcP__222->GetZaxis()->SetTickLength(0.025); h_nJet_TopsPoPHFcP__222->GetZaxis()->SetTitleFont(42); h->Add(h_nJet_Top (HF),""); h->Draw("hist"); TH1D *hsum__223 = new TH1D("hsum__223","",9,-0.5,8.5); hsum__223->SetBinContent(2,0.1150639); hsum__223->SetBinContent(3,0.2235937); hsum__223->SetBinContent(4,0.2603543); hsum__223->SetBinContent(5,0.196954); hsum__223->SetBinContent(6,0.1166518); hsum__223->SetBinContent(7,0.05449491); hsum__223->SetBinContent(8,0.0217334); hsum__223->SetBinContent(9,0.01115394); hsum__223->SetBinError(2,0.002522403); hsum__223->SetBinError(3,0.002525467); hsum__223->SetBinError(4,0.00336047); hsum__223->SetBinError(5,0.001966634); hsum__223->SetBinError(6,0.00127208); hsum__223->SetBinError(7,0.0007378717); hsum__223->SetBinError(8,0.0004530571); hsum__223->SetBinError(9,0.0003235352); hsum__223->SetEntries(43); hsum__223->SetStats(0); ci = 1198; color = new TColor(ci, 0, 0, 0, " ", 0.99); hsum__223->SetFillColor(ci); hsum__223->SetFillStyle(3003); hsum__223->SetLineWidth(0); hsum__223->GetXaxis()->SetTitle("N_{jet}"); hsum__223->GetXaxis()->SetLabelFont(42); hsum__223->GetXaxis()->SetLabelOffset(0.007); hsum__223->GetXaxis()->SetTitleSize(0.05); hsum__223->GetXaxis()->SetTickLength(0.025); hsum__223->GetXaxis()->SetTitleFont(42); hsum__223->GetYaxis()->SetTitle("a.u."); hsum__223->GetYaxis()->SetLabelFont(42); hsum__223->GetYaxis()->SetLabelOffset(0.007); hsum__223->GetYaxis()->SetTitleSize(0.05); hsum__223->GetYaxis()->SetTickLength(0.025); hsum__223->GetYaxis()->SetTitleFont(42); hsum__223->GetZaxis()->SetLabelFont(42); hsum__223->GetZaxis()->SetLabelOffset(0.007); hsum__223->GetZaxis()->SetTitleSize(0.05); hsum__223->GetZaxis()->SetTickLength(0.025); hsum__223->GetZaxis()->SetTitleFont(42); hsum__223->Draw("e2 same"); TH1D *h_nJet_Data__224 = new TH1D("h_nJet_Data__224","",9,-0.5,8.5); h_nJet_Data__224->SetBinContent(2,0.1095355); h_nJet_Data__224->SetBinContent(3,0.2408367); h_nJet_Data__224->SetBinContent(4,0.2713182); h_nJet_Data__224->SetBinContent(5,0.1982945); h_nJet_Data__224->SetBinContent(6,0.1091115); h_nJet_Data__224->SetBinContent(7,0.04494488); h_nJet_Data__224->SetBinContent(8,0.017243); h_nJet_Data__224->SetBinContent(9,0.008715726); h_nJet_Data__224->SetBinError(2,0.00227166); h_nJet_Data__224->SetBinError(3,0.003368428); h_nJet_Data__224->SetBinError(4,0.003575241); h_nJet_Data__224->SetBinError(5,0.003056478); h_nJet_Data__224->SetBinError(6,0.002267259); h_nJet_Data__224->SetBinError(7,0.001455144); h_nJet_Data__224->SetBinError(8,0.0009013063); h_nJet_Data__224->SetBinError(9,0.0006407929); h_nJet_Data__224->SetEntries(21226); h_nJet_Data__224->SetStats(0); h_nJet_Data__224->SetLineWidth(3); h_nJet_Data__224->SetMarkerStyle(20); h_nJet_Data__224->SetMarkerSize(2); h_nJet_Data__224->GetXaxis()->SetTitle("N_{jet}"); h_nJet_Data__224->GetXaxis()->SetLabelFont(42); h_nJet_Data__224->GetXaxis()->SetLabelOffset(0.007); h_nJet_Data__224->GetXaxis()->SetTitleSize(0.05); h_nJet_Data__224->GetXaxis()->SetTickLength(0.025); h_nJet_Data__224->GetXaxis()->SetTitleFont(42); h_nJet_Data__224->GetYaxis()->SetTitle("a.u."); h_nJet_Data__224->GetYaxis()->SetLabelFont(42); h_nJet_Data__224->GetYaxis()->SetLabelOffset(0.007); h_nJet_Data__224->GetYaxis()->SetTitleSize(0.05); h_nJet_Data__224->GetYaxis()->SetTickLength(0.025); h_nJet_Data__224->GetYaxis()->SetTitleFont(42); h_nJet_Data__224->GetZaxis()->SetLabelFont(42); h_nJet_Data__224->GetZaxis()->SetLabelOffset(0.007); h_nJet_Data__224->GetZaxis()->SetTitleSize(0.05); h_nJet_Data__224->GetZaxis()->SetTickLength(0.025); h_nJet_Data__224->GetZaxis()->SetTitleFont(42); h_nJet_Data__224->Draw("elp same"); TLegend *leg = new TLegend(0.6,0.55,0.88,0.9,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetLineColor(1); leg->SetLineStyle(1); leg->SetLineWidth(1); leg->SetFillColor(0); leg->SetFillStyle(0); TLegendEntry *entry=leg->AddEntry("h_nJet_Data","Data","ELP"); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(3); entry->SetMarkerColor(1); entry->SetMarkerStyle(20); entry->SetMarkerSize(2); entry->SetTextFont(42); entry=leg->AddEntry("h_nJet_Top (HF)","Top (HF)","F"); ci = TColor::GetColor("#ff9900"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_nJet_Top (LF)","Top (LF)","F"); ci = TColor::GetColor("#cc33cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_nJet_W+jets","W+jets","F"); ci = TColor::GetColor("#66cc66"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_nJet_Z+jets","Z+jets","F"); ci = TColor::GetColor("#3399cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_nJet_Diboson","Diboson","F"); ci = TColor::GetColor("#9966cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_nJet_QCD","QCD","F"); ci = TColor::GetColor("#cccccc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); 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.6,0.55,0.88,0.9,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetLineColor(1); leg->SetLineStyle(1); leg->SetLineWidth(1); leg->SetFillColor(0); leg->SetFillStyle(0); entry=leg->AddEntry("h_nJet_Data","Data","ELP"); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(3); entry->SetMarkerColor(1); entry->SetMarkerStyle(20); entry->SetMarkerSize(2); entry->SetTextFont(42); entry=leg->AddEntry("h_nJet_Top (HF)","Top (HF)","F"); ci = TColor::GetColor("#ff9900"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_nJet_Top (LF)","Top (LF)","F"); ci = TColor::GetColor("#cc33cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_nJet_W+jets","W+jets","F"); ci = TColor::GetColor("#66cc66"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_nJet_Z+jets","Z+jets","F"); ci = TColor::GetColor("#3399cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_nJet_Diboson","Diboson","F"); ci = TColor::GetColor("#9966cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_nJet_QCD","QCD","F"); ci = TColor::GetColor("#cccccc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); leg->Draw(); TLatex * tex = new TLatex(0.18,0.85,"CMS"); tex->SetNDC(); tex->SetTextSize(0.06); tex->SetLineWidth(2); tex->Draw(); tex = new TLatex(0.28,0.85,"Preliminary"); tex->SetNDC(); tex->SetTextFont(52); tex->SetTextSize(0.06); tex->SetLineWidth(2); tex->Draw(); tex = new TLatex(0.9,0.94,"36.6 fb^{-1} (13 TeV)"); tex->SetNDC(); tex->SetTextAlign(31); tex->SetTextFont(42); tex->SetTextSize(0.04); tex->SetLineWidth(2); tex->Draw(); pad1->Modified(); c1->cd(); // ------------>Primitives in pad: pad2 TPad *pad2 = new TPad("pad2", "pad2",0,0.05,1,0.3); pad2->Draw(); pad2->cd(); pad2->Range(-2.1875,-0.8914286,9.0625,0.48); pad2->SetFillColor(0); pad2->SetBorderMode(0); pad2->SetBorderSize(2); pad2->SetGridy(); pad2->SetTickx(1); pad2->SetTicky(1); pad2->SetLeftMargin(0.15); pad2->SetRightMargin(0.05); pad2->SetTopMargin(0); pad2->SetBottomMargin(0.3); pad2->SetFrameFillStyle(0); pad2->SetFrameBorderMode(0); pad2->SetFrameFillStyle(0); pad2->SetFrameBorderMode(0); TH1D *ratio__225 = new TH1D("ratio__225","",9,-0.5,8.5); ratio__225->SetBinContent(1,-999); ratio__225->SetBinContent(2,-0.04804683); ratio__225->SetBinContent(3,0.07711744); ratio__225->SetBinContent(4,0.0421114); ratio__225->SetBinContent(5,0.006806612); ratio__225->SetBinContent(6,-0.06463963); ratio__225->SetBinContent(7,-0.1752464); ratio__225->SetBinContent(8,-0.2066128); ratio__225->SetBinContent(9,-0.2185969); ratio__225->SetBinError(1,0.0001); ratio__225->SetBinError(2,0.0001); ratio__225->SetBinError(3,0.0001); ratio__225->SetBinError(4,0.0001); ratio__225->SetBinError(5,0.0001); ratio__225->SetBinError(6,0.0001); ratio__225->SetBinError(7,0.0001); ratio__225->SetBinError(8,0.0001); ratio__225->SetBinError(9,0.0001); ratio__225->SetMinimum(-0.48); ratio__225->SetMaximum(0.48); ratio__225->SetEntries(21235); ratio__225->SetStats(0); ratio__225->SetLineWidth(3); ratio__225->SetMarkerStyle(20); ratio__225->SetMarkerSize(2); ratio__225->GetXaxis()->SetTitle("N_{jet}"); ratio__225->GetXaxis()->SetLabelFont(43); ratio__225->GetXaxis()->SetLabelOffset(0.007); ratio__225->GetXaxis()->SetLabelSize(30); ratio__225->GetXaxis()->SetTitleSize(40); ratio__225->GetXaxis()->SetTickLength(0.025); ratio__225->GetXaxis()->SetTitleOffset(5); ratio__225->GetXaxis()->SetTitleFont(43); ratio__225->GetYaxis()->SetTitle("#frac{Data-Exp}{Exp}"); ratio__225->GetYaxis()->SetNdivisions(5); ratio__225->GetYaxis()->SetLabelFont(43); ratio__225->GetYaxis()->SetLabelOffset(0.007); ratio__225->GetYaxis()->SetLabelSize(30); ratio__225->GetYaxis()->SetTitleSize(40); ratio__225->GetYaxis()->SetTickLength(0.025); ratio__225->GetYaxis()->SetTitleOffset(2.5); ratio__225->GetYaxis()->SetTitleFont(43); ratio__225->GetZaxis()->SetLabelFont(42); ratio__225->GetZaxis()->SetLabelOffset(0.007); ratio__225->GetZaxis()->SetTitleSize(0.05); ratio__225->GetZaxis()->SetTickLength(0.025); ratio__225->GetZaxis()->SetTitleFont(42); ratio__225->Draw("elp"); TH1D *zero__226 = new TH1D("zero__226","",9,-0.5,8.5); zero__226->SetBinError(2,0.00227166); zero__226->SetBinError(3,0.003368428); zero__226->SetBinError(4,0.003575241); zero__226->SetBinError(5,0.003056478); zero__226->SetBinError(6,0.002267259); zero__226->SetBinError(7,0.001455144); zero__226->SetBinError(8,0.0009013063); zero__226->SetBinError(9,0.0006407929); zero__226->SetEntries(21235); zero__226->SetStats(0); zero__226->SetLineWidth(3); zero__226->SetMarkerStyle(20); zero__226->SetMarkerSize(2); zero__226->GetXaxis()->SetTitle("N_{jet}"); zero__226->GetXaxis()->SetLabelFont(42); zero__226->GetXaxis()->SetLabelOffset(0.007); zero__226->GetXaxis()->SetTitleSize(0.05); zero__226->GetXaxis()->SetTickLength(0.025); zero__226->GetXaxis()->SetTitleFont(42); zero__226->GetYaxis()->SetTitle("a.u."); zero__226->GetYaxis()->SetLabelFont(42); zero__226->GetYaxis()->SetLabelOffset(0.007); zero__226->GetYaxis()->SetTitleSize(0.05); zero__226->GetYaxis()->SetTickLength(0.025); zero__226->GetYaxis()->SetTitleFont(42); zero__226->GetZaxis()->SetLabelFont(42); zero__226->GetZaxis()->SetLabelOffset(0.007); zero__226->GetZaxis()->SetTitleSize(0.05); zero__226->GetZaxis()->SetTickLength(0.025); zero__226->GetZaxis()->SetTitleFont(42); zero__226->Draw("hist same"); TH1D *sumratioup__227 = new TH1D("sumratioup__227","",9,-0.5,8.5); sumratioup__227->SetBinContent(2,0.02192175); sumratioup__227->SetBinContent(3,0.01129489); sumratioup__227->SetBinContent(4,0.0129073); sumratioup__227->SetBinContent(5,0.009985248); sumratioup__227->SetBinContent(6,0.01090493); sumratioup__227->SetBinContent(7,0.01354019); sumratioup__227->SetBinContent(8,0.02084612); sumratioup__227->SetBinContent(9,0.02900635); sumratioup__227->SetBinError(2,0.002522403); sumratioup__227->SetBinError(3,0.002525467); sumratioup__227->SetBinError(4,0.00336047); sumratioup__227->SetBinError(5,0.001966634); sumratioup__227->SetBinError(6,0.00127208); sumratioup__227->SetBinError(7,0.0007378717); sumratioup__227->SetBinError(8,0.0004530571); sumratioup__227->SetBinError(9,0.0003235352); sumratioup__227->SetEntries(52); sumratioup__227->SetStats(0); ci = 1198; color = new TColor(ci, 0, 0, 0, " ", 0.99); sumratioup__227->SetFillColor(ci); sumratioup__227->SetFillStyle(3003); sumratioup__227->GetXaxis()->SetTitle("N_{jet}"); sumratioup__227->GetXaxis()->SetLabelFont(42); sumratioup__227->GetXaxis()->SetLabelOffset(0.007); sumratioup__227->GetXaxis()->SetTitleSize(0.05); sumratioup__227->GetXaxis()->SetTickLength(0.025); sumratioup__227->GetXaxis()->SetTitleFont(42); sumratioup__227->GetYaxis()->SetTitle("a.u."); sumratioup__227->GetYaxis()->SetLabelFont(42); sumratioup__227->GetYaxis()->SetLabelOffset(0.007); sumratioup__227->GetYaxis()->SetTitleSize(0.05); sumratioup__227->GetYaxis()->SetTickLength(0.025); sumratioup__227->GetYaxis()->SetTitleFont(42); sumratioup__227->GetZaxis()->SetLabelFont(42); sumratioup__227->GetZaxis()->SetLabelOffset(0.007); sumratioup__227->GetZaxis()->SetTitleSize(0.05); sumratioup__227->GetZaxis()->SetTickLength(0.025); sumratioup__227->GetZaxis()->SetTitleFont(42); sumratioup__227->Draw("hist same"); TH1D *sumratiodown__228 = new TH1D("sumratiodown__228","",9,-0.5,8.5); sumratiodown__228->SetBinContent(2,-0.02192175); sumratiodown__228->SetBinContent(3,-0.01129489); sumratiodown__228->SetBinContent(4,-0.0129073); sumratiodown__228->SetBinContent(5,-0.009985248); sumratiodown__228->SetBinContent(6,-0.01090493); sumratiodown__228->SetBinContent(7,-0.01354019); sumratiodown__228->SetBinContent(8,-0.02084612); sumratiodown__228->SetBinContent(9,-0.02900635); sumratiodown__228->SetBinError(2,0.002522403); sumratiodown__228->SetBinError(3,0.002525467); sumratiodown__228->SetBinError(4,0.00336047); sumratiodown__228->SetBinError(5,0.001966634); sumratiodown__228->SetBinError(6,0.00127208); sumratiodown__228->SetBinError(7,0.0007378717); sumratiodown__228->SetBinError(8,0.0004530571); sumratiodown__228->SetBinError(9,0.0003235352); sumratiodown__228->SetEntries(52); sumratiodown__228->SetStats(0); ci = 1198; color = new TColor(ci, 0, 0, 0, " ", 0.99); sumratiodown__228->SetFillColor(ci); sumratiodown__228->SetFillStyle(3003); sumratiodown__228->GetXaxis()->SetTitle("N_{jet}"); sumratiodown__228->GetXaxis()->SetLabelFont(42); sumratiodown__228->GetXaxis()->SetLabelOffset(0.007); sumratiodown__228->GetXaxis()->SetTitleSize(0.05); sumratiodown__228->GetXaxis()->SetTickLength(0.025); sumratiodown__228->GetXaxis()->SetTitleFont(42); sumratiodown__228->GetYaxis()->SetTitle("a.u."); sumratiodown__228->GetYaxis()->SetLabelFont(42); sumratiodown__228->GetYaxis()->SetLabelOffset(0.007); sumratiodown__228->GetYaxis()->SetTitleSize(0.05); sumratiodown__228->GetYaxis()->SetTickLength(0.025); sumratiodown__228->GetYaxis()->SetTitleFont(42); sumratiodown__228->GetZaxis()->SetLabelFont(42); sumratiodown__228->GetZaxis()->SetLabelOffset(0.007); sumratiodown__228->GetZaxis()->SetTitleSize(0.05); sumratiodown__228->GetZaxis()->SetTickLength(0.025); sumratiodown__228->GetZaxis()->SetTitleFont(42); sumratiodown__228->Draw("hist same"); Double_t Graph0_fx1019[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8}; Double_t Graph0_fy1019[9] = { -999, -0.04804683, 0.07711744, 0.0421114, 0.006806612, -0.06463963, -0.1752464, -0.2066128, -0.2185969}; Double_t Graph0_fex1019[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0}; Double_t Graph0_fey1019[9] = { 0, 0.01974259, 0.01506495, 0.01373222, 0.01551874, 0.01943612, 0.02670239, 0.04147102, 0.0574499}; TGraphErrors *gre = new TGraphErrors(9,Graph0_fx1019,Graph0_fy1019,Graph0_fex1019,Graph0_fey1019); gre->SetName("Graph0"); gre->SetTitle("Graph"); gre->SetFillColor(1); gre->SetLineWidth(3); TH1F *Graph_Graph1019 = new TH1F("Graph_Graph1019","Graph",100,0,8.8); Graph_Graph1019->SetMinimum(-1098.909); Graph_Graph1019->SetMaximum(100.0014); Graph_Graph1019->SetDirectory(0); Graph_Graph1019->SetStats(0); ci = TColor::GetColor("#000099"); Graph_Graph1019->SetLineColor(ci); Graph_Graph1019->GetXaxis()->SetLabelFont(42); Graph_Graph1019->GetXaxis()->SetLabelOffset(0.007); Graph_Graph1019->GetXaxis()->SetTitleSize(0.05); Graph_Graph1019->GetXaxis()->SetTickLength(0.025); Graph_Graph1019->GetXaxis()->SetTitleFont(42); Graph_Graph1019->GetYaxis()->SetLabelFont(42); Graph_Graph1019->GetYaxis()->SetLabelOffset(0.007); Graph_Graph1019->GetYaxis()->SetTitleSize(0.05); Graph_Graph1019->GetYaxis()->SetTickLength(0.025); Graph_Graph1019->GetYaxis()->SetTitleFont(42); Graph_Graph1019->GetZaxis()->SetLabelFont(42); Graph_Graph1019->GetZaxis()->SetLabelOffset(0.007); Graph_Graph1019->GetZaxis()->SetTitleSize(0.05); Graph_Graph1019->GetZaxis()->SetTickLength(0.025); Graph_Graph1019->GetZaxis()->SetTitleFont(42); gre->SetHistogram(Graph_Graph1019); gre->Draw("pe0"); pad2->Modified(); c1->cd(); c1->Modified(); c1->cd(); c1->SetSelected(c1); }
void scatterplot() { double yPos, xPos, theta, energy = 0.; // NOTE: theta comes in degrees int numHit, pID = 0; // Initialize histograms double nEnergyMin = 10; // MeV double nEnergyMax = 510; // MeV int nEnergyBins = 50; double dEnergyBinSize = (double)(nEnergyMax - nEnergyMin) / (double)nEnergyBins; double nThetaMin = 34; // mrad double nThetaMax = 88; // mrad int nThetaBins = 50; double dThetaBinSize = (nThetaMax - nThetaMin) / nThetaBins; double nM2Min = -5000; // MeV double nM2Max = 5000; // MeV int nM2Bins = 100; double dM2BinSize = (nM2Max - nM2Min)/nM2Bins; THStack *hs = new THStack("hs","Scatterplot"); TH2F* henergythetayy = new TH2F("scatter4", // plot label "e+e- > yy", // title nThetaBins, // x num of bins nThetaMin, // x min nThetaMax, // x max nEnergyBins, // y num of bins nEnergyMin, // y min nEnergyMax); // y max henergythetayy->SetMarkerColor(kBlue); henergythetayy->SetMarkerStyle(21); henergythetayy->SetMarkerSize(1.); TFile* file = new TFile("e+e-2yyGUN.root"); TTree* Hits_Info = (TTree *)file->Get("Signal"); Hits_Info->SetBranchAddress("numHits", &numHit); Hits_Info->SetBranchAddress("energyTot", &energy); Hits_Info->SetBranchAddress("XPosition", &xPos); Hits_Info->SetBranchAddress("YPosition", &yPos); Hits_Info->SetBranchAddress("Particle_ID", &pID); Hits_Info->SetBranchAddress("Theta", &theta); // go through all entries and fill the histograms int nentries = Hits_Info->GetEntries(); for (int i=0; i<nentries; i++) { Hits_Info->GetEntry(i); if (pID == 22 && i < (XSECyy * SCAT_NORM)) { // gammas only theta*= TMath::Pi()/180; //radians cout << "M^2 is: " << mSquared(energy, theta) << endl; cout << "Energy is: " << energy << endl; henergythetayy->Fill(theta*1000, energy); } } cout << "DM2binsize is:" << dM2BinSize << endl; //henergythetayy->SetFillColor(kBlue); //hmyy->SetFillStyle(3001); henergythetayy->GetXaxis()->SetTitle("#theta"); henergythetayy->GetYaxis()->SetTitle("Energy (MeV)"); henergythetayy->GetXaxis()->CenterTitle(); henergythetayy->GetYaxis()->CenterTitle(); //hmyy->GetYaxis()->SetTitle("Photons per MeV^{2} per Second (MeV^{-2} s^{-1})"); //hmyy->GetXaxis()->CenterTitle(); //hmyy->GetYaxis()->CenterTitle(); hs->Add(henergythetayy); TFile* fileyyy = new TFile("e+e-2yyyGUN.root"); TTree* Hits_Infoyyy = (TTree *)fileyyy->Get("Signal"); Hits_Infoyyy->SetBranchAddress("numHits", &numHit); Hits_Infoyyy->SetBranchAddress("energyTot", &energy); Hits_Infoyyy->SetBranchAddress("XPosition", &xPos); Hits_Infoyyy->SetBranchAddress("YPosition", &yPos); Hits_Infoyyy->SetBranchAddress("Particle_ID", &pID); Hits_Infoyyy->SetBranchAddress("Theta", &theta); TH2F* henergythetayyy = new TH2F("scatter3", // plot label "e+e- > yyy", // title nThetaBins, // x num of bins nThetaMin, // x min nThetaMax, // x max nEnergyBins, // y num of bins nEnergyMin, // y min nEnergyMax); // y max henergythetayyy->SetMarkerColor(kRed); henergythetayyy->SetMarkerStyle(20); henergythetayyy->SetMarkerSize(1.); // go through all entries and fill the histograms nentries = Hits_Infoyyy->GetEntries(); for (int i=0; i<nentries; i++) { Hits_Infoyyy->GetEntry(i); if (pID == 22 && i < (SCAT_NORM * XSECyyy)) { // gammas only theta*= TMath::Pi()/180; //radians cout << "M^2 is: " << mSquared(energy, theta) << endl; cout << "Energy is: " << energy << endl; henergythetayyy->Fill(theta*1000, energy); } } cout << "DM2binsize is:" << dM2BinSize << endl; //henergythetayyy->SetFillColor(kRed); // hmyyy->SetFillStyle(3001); //hmyyy->GetXaxis()->SetTitle("M_{A'}^{2} (MeV^{2})"); //hmyyy->GetYaxis()->SetTitle("Photons per MeV^{2} per Second (MeV^{-2} s^{-1})"); //hmyyy->GetXaxis()->CenterTitle(); //hmyyy->GetYaxis()->CenterTitle(); henergythetayyy->GetXaxis()->SetTitle("#theta"); henergythetayyy->GetYaxis()->SetTitle("Energy (MeV)"); henergythetayy->GetXaxis()->CenterTitle(); henergythetayyy->GetYaxis()->CenterTitle(); hs->Add(henergythetayyy); /*YIMIN*/ TFile* fileyimin = new TFile("brem.root"); //This is 1000000 events so DOWNEIGHT IT: //XSECyimin = 0.1 * XSECyimin; TTree* Hits_Infoyimin = (TTree *)fileyimin->Get("Signal"); Hits_Infoyimin->SetBranchAddress("numHits", &numHit); Hits_Infoyimin->SetBranchAddress("energyTot", &energy); Hits_Infoyimin->SetBranchAddress("XPosition", &xPos); Hits_Infoyimin->SetBranchAddress("YPosition", &yPos); Hits_Infoyimin->SetBranchAddress("Particle_ID", &pID); Hits_Infoyimin->SetBranchAddress("Theta", &theta); TH2F* henergythetayimin = new TH2F("scatter1", // plot label "Bremsstrahlung", // title nThetaBins, // x num of bins nThetaMin, // x min nThetaMax, // x max nEnergyBins, // y num of bins nEnergyMin, // y min nEnergyMax); // y max henergythetayimin->SetMarkerColor(7); henergythetayimin->SetMarkerStyle(25); henergythetayimin->SetMarkerSize(1.); // go through all entries and fill the histograms nentries = Hits_Infoyimin->GetEntries(); for (int i=0; i<nentries; i++) { Hits_Infoyimin->GetEntry(i); if (pID == 22 && i < (SCAT_NORM * XSECyyy)) { // gammas only theta*= TMath::Pi()/180; //radians cout << "M^2 is: " << mSquared(energy, theta) << endl; cout << "Energy is: " << energy << endl; henergythetayimin->Fill(theta*1000, energy); } } cout << "DM2binsize is:" << dM2BinSize << endl; //henergythetayimin->SetFillColor(7); /* hmyimin->SetFillStyle(3001); hmyimin->GetXaxis()->SetTitle("M_{A'}^{2} (MeV^{2})"); hmyimin->GetYaxis()->SetTitle("Photons per MeV^{2} per Second (MeV^{-2} s^{-1})"); hmyimin->GetXaxis()->CenterTitle(); hmepluseminusy->GetYaxis()->CenterTitle(); */ henergythetayimin->GetXaxis()->SetTitle("#theta"); henergythetayimin->GetYaxis()->SetTitle("Energy (MeV)"); henergythetayimin->GetXaxis()->CenterTitle(); henergythetayimin->GetYaxis()->CenterTitle(); hs->Add(henergythetayimin); TFile* fileepluseminusy = new TFile("e+e-2e+e-yECUT0.3NOPT_2_5_1000000.root"); //This is 1000000 events so DOWNEIGHT IT: //XSECepluseminusy = 0.1 * XSECepluseminusy; TTree* Hits_Infoepluseminusy = (TTree *)fileepluseminusy->Get("Signal"); Hits_Infoepluseminusy->SetBranchAddress("numHits", &numHit); Hits_Infoepluseminusy->SetBranchAddress("energyTot", &energy); Hits_Infoepluseminusy->SetBranchAddress("XPosition", &xPos); Hits_Infoepluseminusy->SetBranchAddress("YPosition", &yPos); Hits_Infoepluseminusy->SetBranchAddress("Particle_ID", &pID); Hits_Infoepluseminusy->SetBranchAddress("Theta", &theta); TH2F* henergythetay = new TH2F("scatter2", // plot label "e+e- > e+e-y", // title nThetaBins, // x num of bins nThetaMin, // x min nThetaMax, // x max nEnergyBins, // y num of bins nEnergyMin, // y min nEnergyMax); // y max henergythetay->SetMarkerColor(kBlack); henergythetay->SetMarkerStyle(22); henergythetay->SetMarkerSize(1.); // go through all entries and fill the histograms nentries = Hits_Infoepluseminusy->GetEntries(); for (int i=0; i<nentries; i++) { Hits_Infoepluseminusy->GetEntry(i); if (pID == 22 && i < (SCAT_NORM * XSECepluseminusy)) { // gammas only theta*= TMath::Pi()/180; //radians cout << "M^2 is: " << mSquared(energy, theta) << endl; cout << "Energy is: " << energy << endl; henergythetay->Fill(theta*1000, energy); } } cout << "DM2binsize is:" << dM2BinSize << endl; //henergythetay->SetFillColor(7); /* hmepluseminusy->SetFillStyle(3001); hmepluseminusy->GetXaxis()->SetTitle("M_{A'}^{2} (MeV^{2})"); hmepluseminusy->GetYaxis()->SetTitle("Photons per MeV^{2} per Second (MeV^{-2} s^{-1})"); hmepluseminusy->GetXaxis()->CenterTitle(); hmepluseminusy->GetYaxis()->CenterTitle(); */ henergythetay->GetXaxis()->SetTitle("#theta"); henergythetay->GetYaxis()->SetTitle("Energy (MeV)"); henergythetay->GetXaxis()->CenterTitle(); henergythetay->GetYaxis()->CenterTitle(); hs->Add(henergythetay); /* //ADD YIMIN'S PLOT TFile *f = new TFile("YIMINPLOTBREM.root"); f->ls(); TH1F * hYIMIN = (TH1F*)f->Get("M^2"); hYIMIN->SetFillColor(kOrange); hYIMIN->SetTitle("Bremsstrahlung"); hYIMIN->SetFillStyle(3001); hYIMIN->GetXaxis()->SetTitle("M_{A'}^{2} (MeV^{2})"); hYIMIN->GetYaxis()->SetTitle("Photons per MeV^{2} per Second (MeV^{-2} s^{-1})"); hYIMIN->GetXaxis()->CenterTitle(); hYIMIN->GetYaxis()->CenterTitle(); hs->Add(hYIMIN); */ /********************** ADD BRIANS PLOT ********************/ /* NUM_TOT_POSITRONS = 1e+07; BIAS = 1e+04; BINNING_WEIGHT = POSITRONS_PER_SEC/(BIAS*NUM_TOT_POSITRONS); B = pow(1-pow(GAMMA_PLUS, -2.), .5); TFile* fileinelastic = new TFile("brian_1e7_pos_1e4_bias.root"); TTree* Hits_Infoinelastic = (TTree *)fileinelastic->Get("Signal"); Hits_Infoinelastic->SetBranchAddress("numHits", &numHit); Hits_Infoinelastic->SetBranchAddress("energyTot", &energy); Hits_Infoinelastic->SetBranchAddress("XPosition", &xPos); Hits_Infoinelastic->SetBranchAddress("YPosition", &yPos); Hits_Infoinelastic->SetBranchAddress("Particle_ID", &pID); Hits_Infoinelastic->SetBranchAddress("Theta", &theta); TH2F* henergythetainelastic = new TH2F("scatter", // plot label "#theta vs Energy", // title nThetaBins, // x num of bins nThetaMin, // x min nThetaMax, // x max nEnergyBins, // y num of bins nEnergyMin, // y min nEnergyMax); // y max // go through all entries and fill the histograms nentries = Hits_Infoinelastic->GetEntries(); for (int i=0; i<nentries; i++) { Hits_Infoinelastic->GetEntry(i); if (pID == 22) { // gammas only theta*= TMath::Pi()/180; //radians cout << "M^2 is: " << mSquared(energy, theta) << endl; cout << "Energy is: " << energy << endl; henergythetainelastic->Fill(theta*1000, energy); } } cout << "DM2binsize is:" << dM2BinSize << endl; henergythetainelastic->SetFillColor(kGreen); /* hminelastic->SetFillStyle(3001); hminelastic->GetXaxis()->SetTitle("M_{A'}^{2} (MeV^{2})"); hminelastic->GetYaxis()->SetTitle("Photons per MeV^{2} per Second (MeV^{-2} s^{-1})"); hminelastic->GetXaxis()->CenterTitle(); hminelastic->GetYaxis()->CenterTitle(); hs->Add(henergythetainelastic); */ // create canvas and draw histogram TCanvas* canvas = new TCanvas("canvas", "canvas", 700, 700); canvas->Divide(1,1); TPad* p; p = (TPad*)canvas->cd(1); //p->SetGrid(); //p->SetLogy(); hs->Draw("SCAT"); hs->GetXaxis()->SetTitle("#theta"); hs->GetYaxis()->SetTitle("Energy (MeV)"); hs->GetXaxis()->CenterTitle(); hs->GetYaxis()->CenterTitle(); hs->SetTitle("Scatterplot of #theta vs Energy (MeV)"); //hs->CenterTitle(); TLegend *leg = new TLegend(0.1,0.7,0.48,0.9); leg->SetHeader("Backgrounds"); leg->AddEntry(henergythetay,"e+ e- > e+ e- y","P"); leg->AddEntry(henergythetayy,"e+ e- > y y","P"); leg->AddEntry(henergythetayyy,"e+ e- > y y y","P"); leg->AddEntry(henergythetayimin,"Bremsstrahlung","P"); leg->Draw(); /* p = (TPad*)canvas->cd(4); henergythetay->Draw(); p = (TPad*)canvas->cd(3); henergythetayyy->Draw(); p = (TPad*)canvas->cd(2); henergythetayy->Draw(); */ /*p = (TPad*)canvas->cd(5); hYIMIN->Draw(); p = (TPad*)canvas->cd(6); henergythetainelastic->Draw(); /* p = (TPad*)canvas->cd(4); p->SetLogy(); p->SetGrid(); hm2->Draw();*/ }
void ttbar_jet1CSV() { //=========Macro generated from canvas: c1/c1 //========= (Sun Dec 11 15:16:19 2016) by ROOT version6.06/01 TCanvas *c1 = new TCanvas("c1", "c1",1,1,1200,1416); gStyle->SetOptStat(0); gStyle->SetOptTitle(0); c1->SetHighLightColor(2); c1->Range(0,0,1,1); c1->SetFillColor(0); c1->SetBorderMode(0); c1->SetBorderSize(2); c1->SetTickx(1); c1->SetTicky(1); c1->SetLeftMargin(0.15); c1->SetRightMargin(0.05); c1->SetTopMargin(0.07); c1->SetBottomMargin(0.13); c1->SetFrameFillStyle(0); c1->SetFrameBorderMode(0); // ------------>Primitives in pad: pad1 TPad *pad1 = new TPad("pad1", "pad1",0,0.3,1,1); pad1->Draw(); pad1->cd(); pad1->Range(-0.1875,0,1.0625,0.5424993); pad1->SetFillColor(0); pad1->SetBorderMode(0); pad1->SetBorderSize(2); pad1->SetTickx(1); pad1->SetTicky(1); pad1->SetLeftMargin(0.15); pad1->SetRightMargin(0.05); pad1->SetTopMargin(0.07); pad1->SetBottomMargin(0); pad1->SetFrameFillStyle(0); pad1->SetFrameBorderMode(0); pad1->SetFrameFillStyle(0); pad1->SetFrameBorderMode(0); THStack *h = new THStack(); h->SetName("h"); h->SetTitle(""); h->SetMinimum(0); h->SetMaximum(0.4804993); TH1F *h_stack_21 = new TH1F("h_stack_21","",10,0,1); h_stack_21->SetMinimum(0); h_stack_21->SetMaximum(0.5045243); h_stack_21->SetDirectory(0); h_stack_21->SetStats(0); Int_t ci; // for color index setting TColor *color; // for color definition with alpha ci = TColor::GetColor("#000099"); h_stack_21->SetLineColor(ci); h_stack_21->GetXaxis()->SetLabelFont(42); h_stack_21->GetXaxis()->SetLabelOffset(0.007); h_stack_21->GetXaxis()->SetTitleSize(0.05); h_stack_21->GetXaxis()->SetTickLength(0.025); h_stack_21->GetXaxis()->SetTitleFont(42); h_stack_21->GetYaxis()->SetTitle("a.u."); h_stack_21->GetYaxis()->SetLabelFont(42); h_stack_21->GetYaxis()->SetLabelOffset(0.007); h_stack_21->GetYaxis()->SetTitleSize(0.05); h_stack_21->GetYaxis()->SetTickLength(0.025); h_stack_21->GetYaxis()->SetTitleOffset(1.5); h_stack_21->GetYaxis()->SetTitleFont(42); h_stack_21->GetZaxis()->SetLabelFont(42); h_stack_21->GetZaxis()->SetLabelOffset(0.007); h_stack_21->GetZaxis()->SetTitleSize(0.05); h_stack_21->GetZaxis()->SetTickLength(0.025); h_stack_21->GetZaxis()->SetTitleFont(42); h->SetHistogram(h_stack_21); TH1D *h_jet1CSV_QCD__241 = new TH1D("h_jet1CSV_QCD__241","",10,0,1); h_jet1CSV_QCD__241->SetBinContent(1,0.001669958); h_jet1CSV_QCD__241->SetBinContent(2,0.001297151); h_jet1CSV_QCD__241->SetBinContent(3,0.0001985037); h_jet1CSV_QCD__241->SetBinContent(4,0.001317617); h_jet1CSV_QCD__241->SetBinContent(5,0.001460061); h_jet1CSV_QCD__241->SetBinContent(6,0.0005098467); h_jet1CSV_QCD__241->SetBinContent(8,9.216642e-05); h_jet1CSV_QCD__241->SetBinContent(10,0.005040257); h_jet1CSV_QCD__241->SetBinError(1,0.001015339); h_jet1CSV_QCD__241->SetBinError(2,0.0006375418); h_jet1CSV_QCD__241->SetBinError(3,0.0001985037); h_jet1CSV_QCD__241->SetBinError(4,0.0007758122); h_jet1CSV_QCD__241->SetBinError(5,0.0009604397); h_jet1CSV_QCD__241->SetBinError(6,0.0005098467); h_jet1CSV_QCD__241->SetBinError(8,9.216642e-05); h_jet1CSV_QCD__241->SetBinError(10,0.002524985); h_jet1CSV_QCD__241->SetEntries(25); h_jet1CSV_QCD__241->SetStats(0); ci = TColor::GetColor("#cccccc"); h_jet1CSV_QCD__241->SetFillColor(ci); h_jet1CSV_QCD__241->GetXaxis()->SetTitle("jet 1 CSV"); h_jet1CSV_QCD__241->GetXaxis()->SetLabelFont(42); h_jet1CSV_QCD__241->GetXaxis()->SetLabelOffset(0.007); h_jet1CSV_QCD__241->GetXaxis()->SetTitleSize(0.05); h_jet1CSV_QCD__241->GetXaxis()->SetTickLength(0.025); h_jet1CSV_QCD__241->GetXaxis()->SetTitleFont(42); h_jet1CSV_QCD__241->GetYaxis()->SetTitle("a.u."); h_jet1CSV_QCD__241->GetYaxis()->SetLabelFont(42); h_jet1CSV_QCD__241->GetYaxis()->SetLabelOffset(0.007); h_jet1CSV_QCD__241->GetYaxis()->SetTitleSize(0.05); h_jet1CSV_QCD__241->GetYaxis()->SetTickLength(0.025); h_jet1CSV_QCD__241->GetYaxis()->SetTitleFont(42); h_jet1CSV_QCD__241->GetZaxis()->SetLabelFont(42); h_jet1CSV_QCD__241->GetZaxis()->SetLabelOffset(0.007); h_jet1CSV_QCD__241->GetZaxis()->SetTitleSize(0.05); h_jet1CSV_QCD__241->GetZaxis()->SetTickLength(0.025); h_jet1CSV_QCD__241->GetZaxis()->SetTitleFont(42); h->Add(h_jet1CSV_QCD,""); TH1D *h_jet1CSV_Diboson__242 = new TH1D("h_jet1CSV_Diboson__242","",10,0,1); h_jet1CSV_Diboson__242->SetBinContent(1,0.007902013); h_jet1CSV_Diboson__242->SetBinContent(2,0.01070993); h_jet1CSV_Diboson__242->SetBinContent(3,0.004898623); h_jet1CSV_Diboson__242->SetBinContent(4,0.00384298); h_jet1CSV_Diboson__242->SetBinContent(5,0.002613524); h_jet1CSV_Diboson__242->SetBinContent(6,0.002368716); h_jet1CSV_Diboson__242->SetBinContent(7,0.001456544); h_jet1CSV_Diboson__242->SetBinContent(8,0.001323376); h_jet1CSV_Diboson__242->SetBinContent(9,0.0003980073); h_jet1CSV_Diboson__242->SetBinContent(10,0.001279463); h_jet1CSV_Diboson__242->SetBinError(1,0.001211187); h_jet1CSV_Diboson__242->SetBinError(2,0.001421911); h_jet1CSV_Diboson__242->SetBinError(3,0.0009606959); h_jet1CSV_Diboson__242->SetBinError(4,0.0008875179); h_jet1CSV_Diboson__242->SetBinError(5,0.0007683429); h_jet1CSV_Diboson__242->SetBinError(6,0.0007114388); h_jet1CSV_Diboson__242->SetBinError(7,0.0005740134); h_jet1CSV_Diboson__242->SetBinError(8,0.0005780429); h_jet1CSV_Diboson__242->SetBinError(9,0.0002452434); h_jet1CSV_Diboson__242->SetBinError(10,0.000496194); h_jet1CSV_Diboson__242->SetEntries(227); h_jet1CSV_Diboson__242->SetStats(0); ci = TColor::GetColor("#9966cc"); h_jet1CSV_Diboson__242->SetFillColor(ci); h_jet1CSV_Diboson__242->GetXaxis()->SetTitle("jet 1 CSV"); h_jet1CSV_Diboson__242->GetXaxis()->SetLabelFont(42); h_jet1CSV_Diboson__242->GetXaxis()->SetLabelOffset(0.007); h_jet1CSV_Diboson__242->GetXaxis()->SetTitleSize(0.05); h_jet1CSV_Diboson__242->GetXaxis()->SetTickLength(0.025); h_jet1CSV_Diboson__242->GetXaxis()->SetTitleFont(42); h_jet1CSV_Diboson__242->GetYaxis()->SetTitle("a.u."); h_jet1CSV_Diboson__242->GetYaxis()->SetLabelFont(42); h_jet1CSV_Diboson__242->GetYaxis()->SetLabelOffset(0.007); h_jet1CSV_Diboson__242->GetYaxis()->SetTitleSize(0.05); h_jet1CSV_Diboson__242->GetYaxis()->SetTickLength(0.025); h_jet1CSV_Diboson__242->GetYaxis()->SetTitleFont(42); h_jet1CSV_Diboson__242->GetZaxis()->SetLabelFont(42); h_jet1CSV_Diboson__242->GetZaxis()->SetLabelOffset(0.007); h_jet1CSV_Diboson__242->GetZaxis()->SetTitleSize(0.05); h_jet1CSV_Diboson__242->GetZaxis()->SetTickLength(0.025); h_jet1CSV_Diboson__242->GetZaxis()->SetTitleFont(42); h->Add(h_jet1CSV_Diboson,""); TH1D *h_jet1CSV_ZpLjets__243 = new TH1D("h_jet1CSV_ZpLjets__243","",10,0,1); h_jet1CSV_ZpLjets__243->SetBinContent(1,0.0105581); h_jet1CSV_ZpLjets__243->SetBinContent(2,0.0149804); h_jet1CSV_ZpLjets__243->SetBinContent(3,0.006136762); h_jet1CSV_ZpLjets__243->SetBinContent(4,0.003962296); h_jet1CSV_ZpLjets__243->SetBinContent(5,0.003417574); h_jet1CSV_ZpLjets__243->SetBinContent(6,0.002305365); h_jet1CSV_ZpLjets__243->SetBinContent(7,0.001793532); h_jet1CSV_ZpLjets__243->SetBinContent(8,0.001236405); h_jet1CSV_ZpLjets__243->SetBinContent(9,0.001335452); h_jet1CSV_ZpLjets__243->SetBinContent(10,0.001687921); h_jet1CSV_ZpLjets__243->SetBinError(1,0.0002993944); h_jet1CSV_ZpLjets__243->SetBinError(2,0.0003673727); h_jet1CSV_ZpLjets__243->SetBinError(3,0.0002261915); h_jet1CSV_ZpLjets__243->SetBinError(4,0.0001994505); h_jet1CSV_ZpLjets__243->SetBinError(5,0.000185805); h_jet1CSV_ZpLjets__243->SetBinError(6,0.0001426398); h_jet1CSV_ZpLjets__243->SetBinError(7,0.0001285193); h_jet1CSV_ZpLjets__243->SetBinError(8,0.0001016587); h_jet1CSV_ZpLjets__243->SetBinError(9,0.0001150635); h_jet1CSV_ZpLjets__243->SetBinError(10,0.0001437861); h_jet1CSV_ZpLjets__243->SetEntries(24915); h_jet1CSV_ZpLjets__243->SetStats(0); ci = TColor::GetColor("#3399cc"); h_jet1CSV_ZpLjets__243->SetFillColor(ci); h_jet1CSV_ZpLjets__243->GetXaxis()->SetTitle("jet 1 CSV"); h_jet1CSV_ZpLjets__243->GetXaxis()->SetLabelFont(42); h_jet1CSV_ZpLjets__243->GetXaxis()->SetLabelOffset(0.007); h_jet1CSV_ZpLjets__243->GetXaxis()->SetTitleSize(0.05); h_jet1CSV_ZpLjets__243->GetXaxis()->SetTickLength(0.025); h_jet1CSV_ZpLjets__243->GetXaxis()->SetTitleFont(42); h_jet1CSV_ZpLjets__243->GetYaxis()->SetTitle("a.u."); h_jet1CSV_ZpLjets__243->GetYaxis()->SetLabelFont(42); h_jet1CSV_ZpLjets__243->GetYaxis()->SetLabelOffset(0.007); h_jet1CSV_ZpLjets__243->GetYaxis()->SetTitleSize(0.05); h_jet1CSV_ZpLjets__243->GetYaxis()->SetTickLength(0.025); h_jet1CSV_ZpLjets__243->GetYaxis()->SetTitleFont(42); h_jet1CSV_ZpLjets__243->GetZaxis()->SetLabelFont(42); h_jet1CSV_ZpLjets__243->GetZaxis()->SetLabelOffset(0.007); h_jet1CSV_ZpLjets__243->GetZaxis()->SetTitleSize(0.05); h_jet1CSV_ZpLjets__243->GetZaxis()->SetTickLength(0.025); h_jet1CSV_ZpLjets__243->GetZaxis()->SetTitleFont(42); h->Add(h_jet1CSV_Z+jets,""); TH1D *h_jet1CSV_WpLjets__244 = new TH1D("h_jet1CSV_WpLjets__244","",10,0,1); h_jet1CSV_WpLjets__244->SetBinContent(1,0.0105647); h_jet1CSV_WpLjets__244->SetBinContent(2,0.01249913); h_jet1CSV_WpLjets__244->SetBinContent(3,0.007002216); h_jet1CSV_WpLjets__244->SetBinContent(4,0.004496839); h_jet1CSV_WpLjets__244->SetBinContent(5,0.003373536); h_jet1CSV_WpLjets__244->SetBinContent(6,0.00194438); h_jet1CSV_WpLjets__244->SetBinContent(7,0.001499895); h_jet1CSV_WpLjets__244->SetBinContent(8,0.001552581); h_jet1CSV_WpLjets__244->SetBinContent(9,0.001498434); h_jet1CSV_WpLjets__244->SetBinContent(10,0.001251066); h_jet1CSV_WpLjets__244->SetBinError(1,0.0007887323); h_jet1CSV_WpLjets__244->SetBinError(2,0.0008242009); h_jet1CSV_WpLjets__244->SetBinError(3,0.0006456304); h_jet1CSV_WpLjets__244->SetBinError(4,0.0005750342); h_jet1CSV_WpLjets__244->SetBinError(5,0.0004846149); h_jet1CSV_WpLjets__244->SetBinError(6,0.0003336262); h_jet1CSV_WpLjets__244->SetBinError(7,0.0003618074); h_jet1CSV_WpLjets__244->SetBinError(8,0.000356322); h_jet1CSV_WpLjets__244->SetBinError(9,0.000315267); h_jet1CSV_WpLjets__244->SetBinError(10,0.0002636669); h_jet1CSV_WpLjets__244->SetEntries(3309); h_jet1CSV_WpLjets__244->SetStats(0); ci = TColor::GetColor("#66cc66"); h_jet1CSV_WpLjets__244->SetFillColor(ci); h_jet1CSV_WpLjets__244->GetXaxis()->SetTitle("jet 1 CSV"); h_jet1CSV_WpLjets__244->GetXaxis()->SetLabelFont(42); h_jet1CSV_WpLjets__244->GetXaxis()->SetLabelOffset(0.007); h_jet1CSV_WpLjets__244->GetXaxis()->SetTitleSize(0.05); h_jet1CSV_WpLjets__244->GetXaxis()->SetTickLength(0.025); h_jet1CSV_WpLjets__244->GetXaxis()->SetTitleFont(42); h_jet1CSV_WpLjets__244->GetYaxis()->SetTitle("a.u."); h_jet1CSV_WpLjets__244->GetYaxis()->SetLabelFont(42); h_jet1CSV_WpLjets__244->GetYaxis()->SetLabelOffset(0.007); h_jet1CSV_WpLjets__244->GetYaxis()->SetTitleSize(0.05); h_jet1CSV_WpLjets__244->GetYaxis()->SetTickLength(0.025); h_jet1CSV_WpLjets__244->GetYaxis()->SetTitleFont(42); h_jet1CSV_WpLjets__244->GetZaxis()->SetLabelFont(42); h_jet1CSV_WpLjets__244->GetZaxis()->SetLabelOffset(0.007); h_jet1CSV_WpLjets__244->GetZaxis()->SetTitleSize(0.05); h_jet1CSV_WpLjets__244->GetZaxis()->SetTickLength(0.025); h_jet1CSV_WpLjets__244->GetZaxis()->SetTitleFont(42); h->Add(h_jet1CSV_W+jets,""); TH1D *h_jet1CSV_TopsPoPLFcP__245 = new TH1D("h_jet1CSV_TopsPoPLFcP__245","",10,0,1); h_jet1CSV_TopsPoPLFcP__245->SetBinContent(1,0.05724676); h_jet1CSV_TopsPoPLFcP__245->SetBinContent(2,0.09449115); h_jet1CSV_TopsPoPLFcP__245->SetBinContent(3,0.04295219); h_jet1CSV_TopsPoPLFcP__245->SetBinContent(4,0.02886478); h_jet1CSV_TopsPoPLFcP__245->SetBinContent(5,0.02197153); h_jet1CSV_TopsPoPLFcP__245->SetBinContent(6,0.01676184); h_jet1CSV_TopsPoPLFcP__245->SetBinContent(7,0.01344738); h_jet1CSV_TopsPoPLFcP__245->SetBinContent(8,0.01147171); h_jet1CSV_TopsPoPLFcP__245->SetBinContent(9,0.01188168); h_jet1CSV_TopsPoPLFcP__245->SetBinContent(10,0.02899011); h_jet1CSV_TopsPoPLFcP__245->SetBinError(1,0.000729733); h_jet1CSV_TopsPoPLFcP__245->SetBinError(2,0.0009659214); h_jet1CSV_TopsPoPLFcP__245->SetBinError(3,0.000703275); h_jet1CSV_TopsPoPLFcP__245->SetBinError(4,0.0005973511); h_jet1CSV_TopsPoPLFcP__245->SetBinError(5,0.0005112767); h_jet1CSV_TopsPoPLFcP__245->SetBinError(6,0.0004554214); h_jet1CSV_TopsPoPLFcP__245->SetBinError(7,0.000425343); h_jet1CSV_TopsPoPLFcP__245->SetBinError(8,0.0004081547); h_jet1CSV_TopsPoPLFcP__245->SetBinError(9,0.0004352084); h_jet1CSV_TopsPoPLFcP__245->SetBinError(10,0.0006914391); h_jet1CSV_TopsPoPLFcP__245->SetEntries(45754); h_jet1CSV_TopsPoPLFcP__245->SetStats(0); ci = TColor::GetColor("#cc33cc"); h_jet1CSV_TopsPoPLFcP__245->SetFillColor(ci); h_jet1CSV_TopsPoPLFcP__245->GetXaxis()->SetTitle("jet 1 CSV"); h_jet1CSV_TopsPoPLFcP__245->GetXaxis()->SetLabelFont(42); h_jet1CSV_TopsPoPLFcP__245->GetXaxis()->SetLabelOffset(0.007); h_jet1CSV_TopsPoPLFcP__245->GetXaxis()->SetTitleSize(0.05); h_jet1CSV_TopsPoPLFcP__245->GetXaxis()->SetTickLength(0.025); h_jet1CSV_TopsPoPLFcP__245->GetXaxis()->SetTitleFont(42); h_jet1CSV_TopsPoPLFcP__245->GetYaxis()->SetTitle("a.u."); h_jet1CSV_TopsPoPLFcP__245->GetYaxis()->SetLabelFont(42); h_jet1CSV_TopsPoPLFcP__245->GetYaxis()->SetLabelOffset(0.007); h_jet1CSV_TopsPoPLFcP__245->GetYaxis()->SetTitleSize(0.05); h_jet1CSV_TopsPoPLFcP__245->GetYaxis()->SetTickLength(0.025); h_jet1CSV_TopsPoPLFcP__245->GetYaxis()->SetTitleFont(42); h_jet1CSV_TopsPoPLFcP__245->GetZaxis()->SetLabelFont(42); h_jet1CSV_TopsPoPLFcP__245->GetZaxis()->SetLabelOffset(0.007); h_jet1CSV_TopsPoPLFcP__245->GetZaxis()->SetTitleSize(0.05); h_jet1CSV_TopsPoPLFcP__245->GetZaxis()->SetTickLength(0.025); h_jet1CSV_TopsPoPLFcP__245->GetZaxis()->SetTitleFont(42); h->Add(h_jet1CSV_Top (LF),""); TH1D *h_jet1CSV_TopsPoPHFcP__246 = new TH1D("h_jet1CSV_TopsPoPHFcP__246","",10,0,1); h_jet1CSV_TopsPoPHFcP__246->SetBinContent(1,0.03716431); h_jet1CSV_TopsPoPHFcP__246->SetBinContent(2,0.06356179); h_jet1CSV_TopsPoPHFcP__246->SetBinContent(3,0.03422285); h_jet1CSV_TopsPoPHFcP__246->SetBinContent(4,0.02759495); h_jet1CSV_TopsPoPHFcP__246->SetBinContent(5,0.02467271); h_jet1CSV_TopsPoPHFcP__246->SetBinContent(6,0.02266566); h_jet1CSV_TopsPoPHFcP__246->SetBinContent(7,0.02783972); h_jet1CSV_TopsPoPHFcP__246->SetBinContent(8,0.03184351); h_jet1CSV_TopsPoPHFcP__246->SetBinContent(9,0.05887917); h_jet1CSV_TopsPoPHFcP__246->SetBinContent(10,0.2020009); h_jet1CSV_TopsPoPHFcP__246->SetBinError(1,0.0006192109); h_jet1CSV_TopsPoPHFcP__246->SetBinError(2,0.0008097774); h_jet1CSV_TopsPoPHFcP__246->SetBinError(3,0.0006131987); h_jet1CSV_TopsPoPHFcP__246->SetBinError(4,0.0005808687); h_jet1CSV_TopsPoPHFcP__246->SetBinError(5,0.0005375401); h_jet1CSV_TopsPoPHFcP__246->SetBinError(6,0.0005302149); h_jet1CSV_TopsPoPHFcP__246->SetBinError(7,0.0006356258); h_jet1CSV_TopsPoPHFcP__246->SetBinError(8,0.0006542281); h_jet1CSV_TopsPoPHFcP__246->SetBinError(9,0.0009161931); h_jet1CSV_TopsPoPHFcP__246->SetBinError(10,0.001553901); h_jet1CSV_TopsPoPHFcP__246->SetEntries(77950); h_jet1CSV_TopsPoPHFcP__246->SetStats(0); ci = TColor::GetColor("#ff9900"); h_jet1CSV_TopsPoPHFcP__246->SetFillColor(ci); h_jet1CSV_TopsPoPHFcP__246->GetXaxis()->SetTitle("jet 1 CSV"); h_jet1CSV_TopsPoPHFcP__246->GetXaxis()->SetLabelFont(42); h_jet1CSV_TopsPoPHFcP__246->GetXaxis()->SetLabelOffset(0.007); h_jet1CSV_TopsPoPHFcP__246->GetXaxis()->SetTitleSize(0.05); h_jet1CSV_TopsPoPHFcP__246->GetXaxis()->SetTickLength(0.025); h_jet1CSV_TopsPoPHFcP__246->GetXaxis()->SetTitleFont(42); h_jet1CSV_TopsPoPHFcP__246->GetYaxis()->SetTitle("a.u."); h_jet1CSV_TopsPoPHFcP__246->GetYaxis()->SetLabelFont(42); h_jet1CSV_TopsPoPHFcP__246->GetYaxis()->SetLabelOffset(0.007); h_jet1CSV_TopsPoPHFcP__246->GetYaxis()->SetTitleSize(0.05); h_jet1CSV_TopsPoPHFcP__246->GetYaxis()->SetTickLength(0.025); h_jet1CSV_TopsPoPHFcP__246->GetYaxis()->SetTitleFont(42); h_jet1CSV_TopsPoPHFcP__246->GetZaxis()->SetLabelFont(42); h_jet1CSV_TopsPoPHFcP__246->GetZaxis()->SetLabelOffset(0.007); h_jet1CSV_TopsPoPHFcP__246->GetZaxis()->SetTitleSize(0.05); h_jet1CSV_TopsPoPHFcP__246->GetZaxis()->SetTickLength(0.025); h_jet1CSV_TopsPoPHFcP__246->GetZaxis()->SetTitleFont(42); h->Add(h_jet1CSV_Top (HF),""); h->Draw("hist"); TH1D *hsum__247 = new TH1D("hsum__247","",10,0,1); hsum__247->SetBinContent(1,0.1251058); hsum__247->SetBinContent(2,0.1975396); hsum__247->SetBinContent(3,0.09541114); hsum__247->SetBinContent(4,0.07007946); hsum__247->SetBinContent(5,0.05750894); hsum__247->SetBinContent(6,0.04655581); hsum__247->SetBinContent(7,0.04603708); hsum__247->SetBinContent(8,0.04751975); hsum__247->SetBinContent(9,0.07399275); hsum__247->SetBinContent(10,0.2402497); hsum__247->SetBinError(1,0.002031146); hsum__247->SetBinError(2,0.002198023); hsum__247->SetBinError(3,0.001516888); hsum__247->SetBinError(4,0.001566606); hsum__247->SetBinError(5,0.00152726); hsum__247->SetBinError(6,0.001177403); hsum__247->SetBinError(7,0.001030461); hsum__247->SetBinError(8,0.001036597); hsum__247->SetBinError(9,0.001096172); hsum__247->SetBinError(10,0.003099137); hsum__247->SetEntries(45); hsum__247->SetStats(0); ci = 1200; color = new TColor(ci, 0, 0, 0, " ", 0.99); hsum__247->SetFillColor(ci); hsum__247->SetFillStyle(3003); hsum__247->SetLineWidth(0); hsum__247->GetXaxis()->SetTitle("jet 1 CSV"); hsum__247->GetXaxis()->SetLabelFont(42); hsum__247->GetXaxis()->SetLabelOffset(0.007); hsum__247->GetXaxis()->SetTitleSize(0.05); hsum__247->GetXaxis()->SetTickLength(0.025); hsum__247->GetXaxis()->SetTitleFont(42); hsum__247->GetYaxis()->SetTitle("a.u."); hsum__247->GetYaxis()->SetLabelFont(42); hsum__247->GetYaxis()->SetLabelOffset(0.007); hsum__247->GetYaxis()->SetTitleSize(0.05); hsum__247->GetYaxis()->SetTickLength(0.025); hsum__247->GetYaxis()->SetTitleFont(42); hsum__247->GetZaxis()->SetLabelFont(42); hsum__247->GetZaxis()->SetLabelOffset(0.007); hsum__247->GetZaxis()->SetTitleSize(0.05); hsum__247->GetZaxis()->SetTickLength(0.025); hsum__247->GetZaxis()->SetTitleFont(42); hsum__247->Draw("e2 same"); TH1D *h_jet1CSV_Data__248 = new TH1D("h_jet1CSV_Data__248","",10,0,1); h_jet1CSV_Data__248->SetBinContent(1,0.1217846); h_jet1CSV_Data__248->SetBinContent(2,0.2002261); h_jet1CSV_Data__248->SetBinContent(3,0.09935928); h_jet1CSV_Data__248->SetBinContent(4,0.07382455); h_jet1CSV_Data__248->SetBinContent(5,0.06336568); h_jet1CSV_Data__248->SetBinContent(6,0.04781871); h_jet1CSV_Data__248->SetBinContent(7,0.04861962); h_jet1CSV_Data__248->SetBinContent(8,0.04786582); h_jet1CSV_Data__248->SetBinContent(9,0.07109206); h_jet1CSV_Data__248->SetBinContent(10,0.2260435); h_jet1CSV_Data__248->SetBinError(1,0.002395312); h_jet1CSV_Data__248->SetBinError(2,0.003071329); h_jet1CSV_Data__248->SetBinError(3,0.002163566); h_jet1CSV_Data__248->SetBinError(4,0.001864946); h_jet1CSV_Data__248->SetBinError(5,0.001727798); h_jet1CSV_Data__248->SetBinError(6,0.001500945); h_jet1CSV_Data__248->SetBinError(7,0.001513463); h_jet1CSV_Data__248->SetBinError(8,0.001501684); h_jet1CSV_Data__248->SetBinError(9,0.001830107); h_jet1CSV_Data__248->SetBinError(10,0.003263337); h_jet1CSV_Data__248->SetEntries(21226); h_jet1CSV_Data__248->SetStats(0); h_jet1CSV_Data__248->SetLineWidth(3); h_jet1CSV_Data__248->SetMarkerStyle(20); h_jet1CSV_Data__248->SetMarkerSize(2); h_jet1CSV_Data__248->GetXaxis()->SetTitle("jet 1 CSV"); h_jet1CSV_Data__248->GetXaxis()->SetLabelFont(42); h_jet1CSV_Data__248->GetXaxis()->SetLabelOffset(0.007); h_jet1CSV_Data__248->GetXaxis()->SetTitleSize(0.05); h_jet1CSV_Data__248->GetXaxis()->SetTickLength(0.025); h_jet1CSV_Data__248->GetXaxis()->SetTitleFont(42); h_jet1CSV_Data__248->GetYaxis()->SetTitle("a.u."); h_jet1CSV_Data__248->GetYaxis()->SetLabelFont(42); h_jet1CSV_Data__248->GetYaxis()->SetLabelOffset(0.007); h_jet1CSV_Data__248->GetYaxis()->SetTitleSize(0.05); h_jet1CSV_Data__248->GetYaxis()->SetTickLength(0.025); h_jet1CSV_Data__248->GetYaxis()->SetTitleFont(42); h_jet1CSV_Data__248->GetZaxis()->SetLabelFont(42); h_jet1CSV_Data__248->GetZaxis()->SetLabelOffset(0.007); h_jet1CSV_Data__248->GetZaxis()->SetTitleSize(0.05); h_jet1CSV_Data__248->GetZaxis()->SetTickLength(0.025); h_jet1CSV_Data__248->GetZaxis()->SetTitleFont(42); h_jet1CSV_Data__248->Draw("elp same"); TLegend *leg = new TLegend(0.6,0.55,0.88,0.9,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetLineColor(1); leg->SetLineStyle(1); leg->SetLineWidth(1); leg->SetFillColor(0); leg->SetFillStyle(0); TLegendEntry *entry=leg->AddEntry("h_jet1CSV_Data","Data","ELP"); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(3); entry->SetMarkerColor(1); entry->SetMarkerStyle(20); entry->SetMarkerSize(2); entry->SetTextFont(42); entry=leg->AddEntry("h_jet1CSV_Top (HF)","Top (HF)","F"); ci = TColor::GetColor("#ff9900"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_jet1CSV_Top (LF)","Top (LF)","F"); ci = TColor::GetColor("#cc33cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_jet1CSV_W+jets","W+jets","F"); ci = TColor::GetColor("#66cc66"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_jet1CSV_Z+jets","Z+jets","F"); ci = TColor::GetColor("#3399cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_jet1CSV_Diboson","Diboson","F"); ci = TColor::GetColor("#9966cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_jet1CSV_QCD","QCD","F"); ci = TColor::GetColor("#cccccc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); 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.6,0.55,0.88,0.9,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetLineColor(1); leg->SetLineStyle(1); leg->SetLineWidth(1); leg->SetFillColor(0); leg->SetFillStyle(0); entry=leg->AddEntry("h_jet1CSV_Data","Data","ELP"); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(3); entry->SetMarkerColor(1); entry->SetMarkerStyle(20); entry->SetMarkerSize(2); entry->SetTextFont(42); entry=leg->AddEntry("h_jet1CSV_Top (HF)","Top (HF)","F"); ci = TColor::GetColor("#ff9900"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_jet1CSV_Top (LF)","Top (LF)","F"); ci = TColor::GetColor("#cc33cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_jet1CSV_W+jets","W+jets","F"); ci = TColor::GetColor("#66cc66"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_jet1CSV_Z+jets","Z+jets","F"); ci = TColor::GetColor("#3399cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_jet1CSV_Diboson","Diboson","F"); ci = TColor::GetColor("#9966cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_jet1CSV_QCD","QCD","F"); ci = TColor::GetColor("#cccccc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); leg->Draw(); TLatex * tex = new TLatex(0.18,0.85,"CMS"); tex->SetNDC(); tex->SetTextSize(0.06); tex->SetLineWidth(2); tex->Draw(); tex = new TLatex(0.28,0.85,"Preliminary"); tex->SetNDC(); tex->SetTextFont(52); tex->SetTextSize(0.06); tex->SetLineWidth(2); tex->Draw(); tex = new TLatex(0.9,0.94,"36.6 fb^{-1} (13 TeV)"); tex->SetNDC(); tex->SetTextAlign(31); tex->SetTextFont(42); tex->SetTextSize(0.04); tex->SetLineWidth(2); tex->Draw(); pad1->Modified(); c1->cd(); // ------------>Primitives in pad: pad2 TPad *pad2 = new TPad("pad2", "pad2",0,0.05,1,0.3); pad2->Draw(); pad2->cd(); pad2->Range(-0.1875,-0.8914286,1.0625,0.48); pad2->SetFillColor(0); pad2->SetBorderMode(0); pad2->SetBorderSize(2); pad2->SetGridy(); pad2->SetTickx(1); pad2->SetTicky(1); pad2->SetLeftMargin(0.15); pad2->SetRightMargin(0.05); pad2->SetTopMargin(0); pad2->SetBottomMargin(0.3); pad2->SetFrameFillStyle(0); pad2->SetFrameBorderMode(0); pad2->SetFrameFillStyle(0); pad2->SetFrameBorderMode(0); TH1D *ratio__249 = new TH1D("ratio__249","",10,0,1); ratio__249->SetBinContent(1,-0.02654743); ratio__249->SetBinContent(2,0.01360023); ratio__249->SetBinContent(3,0.04138029); ratio__249->SetBinContent(4,0.05344069); ratio__249->SetBinContent(5,0.1018405); ratio__249->SetBinContent(6,0.02712655); ratio__249->SetBinContent(7,0.05609691); ratio__249->SetBinContent(8,0.007282734); ratio__249->SetBinContent(9,-0.03920245); ratio__249->SetBinContent(10,-0.05913073); ratio__249->SetBinError(1,0.0001); ratio__249->SetBinError(2,0.0001); ratio__249->SetBinError(3,0.0001); ratio__249->SetBinError(4,0.0001); ratio__249->SetBinError(5,0.0001); ratio__249->SetBinError(6,0.0001); ratio__249->SetBinError(7,0.0001); ratio__249->SetBinError(8,0.0001); ratio__249->SetBinError(9,0.0001); ratio__249->SetBinError(10,0.0001); ratio__249->SetMinimum(-0.48); ratio__249->SetMaximum(0.48); ratio__249->SetEntries(21236); ratio__249->SetStats(0); ratio__249->SetLineWidth(3); ratio__249->SetMarkerStyle(20); ratio__249->SetMarkerSize(2); ratio__249->GetXaxis()->SetTitle("jet 1 CSV"); ratio__249->GetXaxis()->SetLabelFont(43); ratio__249->GetXaxis()->SetLabelOffset(0.007); ratio__249->GetXaxis()->SetLabelSize(30); ratio__249->GetXaxis()->SetTitleSize(40); ratio__249->GetXaxis()->SetTickLength(0.025); ratio__249->GetXaxis()->SetTitleOffset(5); ratio__249->GetXaxis()->SetTitleFont(43); ratio__249->GetYaxis()->SetTitle("#frac{Data-Exp}{Exp}"); ratio__249->GetYaxis()->SetNdivisions(5); ratio__249->GetYaxis()->SetLabelFont(43); ratio__249->GetYaxis()->SetLabelOffset(0.007); ratio__249->GetYaxis()->SetLabelSize(30); ratio__249->GetYaxis()->SetTitleSize(40); ratio__249->GetYaxis()->SetTickLength(0.025); ratio__249->GetYaxis()->SetTitleOffset(2.5); ratio__249->GetYaxis()->SetTitleFont(43); ratio__249->GetZaxis()->SetLabelFont(42); ratio__249->GetZaxis()->SetLabelOffset(0.007); ratio__249->GetZaxis()->SetTitleSize(0.05); ratio__249->GetZaxis()->SetTickLength(0.025); ratio__249->GetZaxis()->SetTitleFont(42); ratio__249->Draw("elp"); TH1D *zero__250 = new TH1D("zero__250","",10,0,1); zero__250->SetBinError(1,0.002395312); zero__250->SetBinError(2,0.003071329); zero__250->SetBinError(3,0.002163566); zero__250->SetBinError(4,0.001864946); zero__250->SetBinError(5,0.001727798); zero__250->SetBinError(6,0.001500945); zero__250->SetBinError(7,0.001513463); zero__250->SetBinError(8,0.001501684); zero__250->SetBinError(9,0.001830107); zero__250->SetBinError(10,0.003263337); zero__250->SetEntries(21236); zero__250->SetStats(0); zero__250->SetLineWidth(3); zero__250->SetMarkerStyle(20); zero__250->SetMarkerSize(2); zero__250->GetXaxis()->SetTitle("jet 1 CSV"); zero__250->GetXaxis()->SetLabelFont(42); zero__250->GetXaxis()->SetLabelOffset(0.007); zero__250->GetXaxis()->SetTitleSize(0.05); zero__250->GetXaxis()->SetTickLength(0.025); zero__250->GetXaxis()->SetTitleFont(42); zero__250->GetYaxis()->SetTitle("a.u."); zero__250->GetYaxis()->SetLabelFont(42); zero__250->GetYaxis()->SetLabelOffset(0.007); zero__250->GetYaxis()->SetTitleSize(0.05); zero__250->GetYaxis()->SetTickLength(0.025); zero__250->GetYaxis()->SetTitleFont(42); zero__250->GetZaxis()->SetLabelFont(42); zero__250->GetZaxis()->SetLabelOffset(0.007); zero__250->GetZaxis()->SetTitleSize(0.05); zero__250->GetZaxis()->SetTickLength(0.025); zero__250->GetZaxis()->SetTitleFont(42); zero__250->Draw("hist same"); TH1D *sumratioup__251 = new TH1D("sumratioup__251","",10,0,1); sumratioup__251->SetBinContent(1,0.01623542); sumratioup__251->SetBinContent(2,0.011127); sumratioup__251->SetBinContent(3,0.01589844); sumratioup__251->SetBinContent(4,0.02235471); sumratioup__251->SetBinContent(5,0.02655692); sumratioup__251->SetBinContent(6,0.02529014); sumratioup__251->SetBinContent(7,0.02238329); sumratioup__251->SetBinContent(8,0.02181402); sumratioup__251->SetBinContent(9,0.01481459); sumratioup__251->SetBinContent(10,0.01289965); sumratioup__251->SetBinError(1,0.002031146); sumratioup__251->SetBinError(2,0.002198023); sumratioup__251->SetBinError(3,0.001516888); sumratioup__251->SetBinError(4,0.001566606); sumratioup__251->SetBinError(5,0.00152726); sumratioup__251->SetBinError(6,0.001177403); sumratioup__251->SetBinError(7,0.001030461); sumratioup__251->SetBinError(8,0.001036597); sumratioup__251->SetBinError(9,0.001096172); sumratioup__251->SetBinError(10,0.003099137); sumratioup__251->SetEntries(55); sumratioup__251->SetStats(0); ci = 1200; color = new TColor(ci, 0, 0, 0, " ", 0.99); sumratioup__251->SetFillColor(ci); sumratioup__251->SetFillStyle(3003); sumratioup__251->GetXaxis()->SetTitle("jet 1 CSV"); sumratioup__251->GetXaxis()->SetLabelFont(42); sumratioup__251->GetXaxis()->SetLabelOffset(0.007); sumratioup__251->GetXaxis()->SetTitleSize(0.05); sumratioup__251->GetXaxis()->SetTickLength(0.025); sumratioup__251->GetXaxis()->SetTitleFont(42); sumratioup__251->GetYaxis()->SetTitle("a.u."); sumratioup__251->GetYaxis()->SetLabelFont(42); sumratioup__251->GetYaxis()->SetLabelOffset(0.007); sumratioup__251->GetYaxis()->SetTitleSize(0.05); sumratioup__251->GetYaxis()->SetTickLength(0.025); sumratioup__251->GetYaxis()->SetTitleFont(42); sumratioup__251->GetZaxis()->SetLabelFont(42); sumratioup__251->GetZaxis()->SetLabelOffset(0.007); sumratioup__251->GetZaxis()->SetTitleSize(0.05); sumratioup__251->GetZaxis()->SetTickLength(0.025); sumratioup__251->GetZaxis()->SetTitleFont(42); sumratioup__251->Draw("hist same"); TH1D *sumratiodown__252 = new TH1D("sumratiodown__252","",10,0,1); sumratiodown__252->SetBinContent(1,-0.01623542); sumratiodown__252->SetBinContent(2,-0.011127); sumratiodown__252->SetBinContent(3,-0.01589844); sumratiodown__252->SetBinContent(4,-0.02235471); sumratiodown__252->SetBinContent(5,-0.02655692); sumratiodown__252->SetBinContent(6,-0.02529014); sumratiodown__252->SetBinContent(7,-0.02238329); sumratiodown__252->SetBinContent(8,-0.02181402); sumratiodown__252->SetBinContent(9,-0.01481459); sumratiodown__252->SetBinContent(10,-0.01289965); sumratiodown__252->SetBinError(1,0.002031146); sumratiodown__252->SetBinError(2,0.002198023); sumratiodown__252->SetBinError(3,0.001516888); sumratiodown__252->SetBinError(4,0.001566606); sumratiodown__252->SetBinError(5,0.00152726); sumratiodown__252->SetBinError(6,0.001177403); sumratiodown__252->SetBinError(7,0.001030461); sumratiodown__252->SetBinError(8,0.001036597); sumratiodown__252->SetBinError(9,0.001096172); sumratiodown__252->SetBinError(10,0.003099137); sumratiodown__252->SetEntries(55); sumratiodown__252->SetStats(0); ci = 1200; color = new TColor(ci, 0, 0, 0, " ", 0.99); sumratiodown__252->SetFillColor(ci); sumratiodown__252->SetFillStyle(3003); sumratiodown__252->GetXaxis()->SetTitle("jet 1 CSV"); sumratiodown__252->GetXaxis()->SetLabelFont(42); sumratiodown__252->GetXaxis()->SetLabelOffset(0.007); sumratiodown__252->GetXaxis()->SetTitleSize(0.05); sumratiodown__252->GetXaxis()->SetTickLength(0.025); sumratiodown__252->GetXaxis()->SetTitleFont(42); sumratiodown__252->GetYaxis()->SetTitle("a.u."); sumratiodown__252->GetYaxis()->SetLabelFont(42); sumratiodown__252->GetYaxis()->SetLabelOffset(0.007); sumratiodown__252->GetYaxis()->SetTitleSize(0.05); sumratiodown__252->GetYaxis()->SetTickLength(0.025); sumratiodown__252->GetYaxis()->SetTitleFont(42); sumratiodown__252->GetZaxis()->SetLabelFont(42); sumratiodown__252->GetZaxis()->SetLabelOffset(0.007); sumratiodown__252->GetZaxis()->SetTitleSize(0.05); sumratiodown__252->GetZaxis()->SetTickLength(0.025); sumratiodown__252->GetZaxis()->SetTitleFont(42); sumratiodown__252->Draw("hist same"); Double_t Graph0_fx1021[10] = { 0.05, 0.15, 0.25, 0.35, 0.45, 0.55, 0.65, 0.75, 0.85, 0.95}; Double_t Graph0_fy1021[10] = { -0.02654743, 0.01360023, 0.04138029, 0.05344069, 0.1018405, 0.02712655, 0.05609691, 0.007282734, -0.03920245, -0.05913073}; Double_t Graph0_fex1021[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; Double_t Graph0_fey1021[10] = { 0.01914628, 0.01554792, 0.02267624, 0.02661188, 0.03004399, 0.0322397, 0.03287486, 0.03160127, 0.0247336, 0.01358311}; TGraphErrors *gre = new TGraphErrors(10,Graph0_fx1021,Graph0_fy1021,Graph0_fex1021,Graph0_fey1021); gre->SetName("Graph0"); gre->SetTitle("Graph"); gre->SetFillColor(1); gre->SetLineWidth(3); TH1F *Graph_Graph1021 = new TH1F("Graph_Graph1021","Graph",100,0,1.04); Graph_Graph1021->SetMinimum(-0.09317367); Graph_Graph1021->SetMaximum(0.1523443); Graph_Graph1021->SetDirectory(0); Graph_Graph1021->SetStats(0); ci = TColor::GetColor("#000099"); Graph_Graph1021->SetLineColor(ci); Graph_Graph1021->GetXaxis()->SetLabelFont(42); Graph_Graph1021->GetXaxis()->SetLabelOffset(0.007); Graph_Graph1021->GetXaxis()->SetTitleSize(0.05); Graph_Graph1021->GetXaxis()->SetTickLength(0.025); Graph_Graph1021->GetXaxis()->SetTitleFont(42); Graph_Graph1021->GetYaxis()->SetLabelFont(42); Graph_Graph1021->GetYaxis()->SetLabelOffset(0.007); Graph_Graph1021->GetYaxis()->SetTitleSize(0.05); Graph_Graph1021->GetYaxis()->SetTickLength(0.025); Graph_Graph1021->GetYaxis()->SetTitleFont(42); Graph_Graph1021->GetZaxis()->SetLabelFont(42); Graph_Graph1021->GetZaxis()->SetLabelOffset(0.007); Graph_Graph1021->GetZaxis()->SetTitleSize(0.05); Graph_Graph1021->GetZaxis()->SetTickLength(0.025); Graph_Graph1021->GetZaxis()->SetTitleFont(42); gre->SetHistogram(Graph_Graph1021); gre->Draw("pe0"); pad2->Modified(); c1->cd(); c1->Modified(); c1->cd(); c1->SetSelected(c1); }
void draw_from_trees(TString var, TCut other_cuts, TString weights, TString title, int nbinsx, double xlow, double xup, TString options="plotSig:plotLog:plotData", double cut_low=-1, double cut_high=-1, TString plot_title="default") { bool plotSig = options.Contains("plotSig") && (!options.Contains("!plotSig")); bool plotLog = options.Contains("plotLog") && (!options.Contains("!plotLog")); bool plotData = options.Contains("plotData") && (!options.Contains("!plotData")); bool sigStack = options.Contains("sigStack") && (!options.Contains("!sigStack")); // Book histograms TH1D * httbar = new TH1D("ttbar" , title, nbinsx, xlow, xup); TH1D * hqcd = new TH1D("qcd" , title, nbinsx, xlow, xup); TH1D * hznn = new TH1D("znn" , title, nbinsx, xlow, xup); TH1D * hwjets = new TH1D("wjets" , title, nbinsx, xlow, xup); TH1D * hother = new TH1D("other" , title, nbinsx, xlow, xup); TH1D * hmc_exp = new TH1D("mc_exp" , title, nbinsx, xlow, xup); TH1D * hsingle_top = new TH1D("single_top" , title, nbinsx, xlow, xup); TH1D * ht1bbbb_1500_100 = new TH1D("t1bbbb_1500_100" , title, nbinsx, xlow, xup); TH1D * ht1bbbb_1000_900 = new TH1D("t1bbbb_1000_900" , title, nbinsx, xlow, xup); TH1D * ht1tttt_1500_100 = new TH1D("t1tttt_1500_100" , title, nbinsx, xlow, xup); TH1D * ht1tttt_1200_800 = new TH1D("t1tttt_1200_800" , title, nbinsx, xlow, xup); TH1D * ht1qqqq_1400_100 = new TH1D("t1qqqq_1400_100" , title, nbinsx, xlow, xup); TH1D * ht1qqqq_1000_800 = new TH1D("t1qqqq_1000_800" , title, nbinsx, xlow, xup); // Format cuts TCut cut(other_cuts); // TCut ttbar_weight("(weightppb*4000)/top_pt_weight_official"); TCut ttbar_weight("(3.17760399999999981e-05*4000)"); cout << "Filling histograms for " << var.Data() << endl; ttbar_ch->Project("ttbar",var,(cut)*ttbar_weight); qcd_ch->Project("qcd",var,cut*weights); znn_ch->Project("znn",var,cut*weights); wjets_ch->Project("wjets",var,(cut)*weights); other_ch->Project("other",var,cut*weights); single_top_ch->Project("single_top",var,cut*weights); t1bbbb_1500_100_ch->Project("t1bbbb_1500_100",var,(cut)*weights); t1bbbb_1000_900_ch->Project("t1bbbb_1000_900",var,(cut)*weights); t1tttt_1500_100_ch->Project("t1tttt_1500_100",var,(cut)*weights); t1tttt_1200_800_ch->Project("t1tttt_1200_800",var,(cut)*weights); t1qqqq_1400_100_ch->Project("t1qqqq_1400_100",var,(cut)*weights); t1qqqq_1000_800_ch->Project("t1qqqq_1000_800",var,(cut)*weights); bool addOverflow(true); Double_t e_overflow(0.), i_overflow(0.); if (addOverflow) { i_overflow=httbar->IntegralAndError(nbinsx,nbinsx+1,e_overflow); httbar->SetBinContent(nbinsx, i_overflow); httbar->SetBinError(nbinsx, e_overflow); i_overflow=hqcd->IntegralAndError(nbinsx,nbinsx+1,e_overflow); hqcd->SetBinContent(nbinsx, i_overflow); hqcd->SetBinError(nbinsx, e_overflow); i_overflow=hznn->IntegralAndError(nbinsx,nbinsx+1,e_overflow); hznn->SetBinContent(nbinsx, i_overflow); hznn->SetBinError(nbinsx, e_overflow); i_overflow=hwjets->IntegralAndError(nbinsx,nbinsx+1,e_overflow); hwjets->SetBinContent(nbinsx, i_overflow); hwjets->SetBinError(nbinsx, e_overflow); i_overflow=hsingle_top->IntegralAndError(nbinsx,nbinsx+1,e_overflow); hsingle_top->SetBinContent(nbinsx, i_overflow); hsingle_top->SetBinError(nbinsx, e_overflow); i_overflow=hother->IntegralAndError(nbinsx,nbinsx+1,e_overflow); hother->SetBinContent(nbinsx, i_overflow); hother->SetBinError(nbinsx, e_overflow); i_overflow=ht1bbbb_1500_100->IntegralAndError(nbinsx,nbinsx+1,e_overflow); ht1bbbb_1500_100->SetBinContent(nbinsx, i_overflow); ht1bbbb_1500_100->SetBinError(nbinsx, e_overflow); i_overflow=ht1bbbb_1000_900->IntegralAndError(nbinsx,nbinsx+1,e_overflow); ht1bbbb_1000_900->SetBinContent(nbinsx, i_overflow); ht1bbbb_1000_900->SetBinError(nbinsx, e_overflow); i_overflow=ht1tttt_1500_100->IntegralAndError(nbinsx,nbinsx+1,e_overflow); ht1tttt_1500_100->SetBinContent(nbinsx, i_overflow); ht1tttt_1500_100->SetBinError(nbinsx, e_overflow); i_overflow=ht1tttt_1200_800->IntegralAndError(nbinsx,nbinsx+1,e_overflow); ht1tttt_1200_800->SetBinContent(nbinsx, i_overflow); ht1tttt_1200_800->SetBinError(nbinsx, e_overflow); i_overflow=ht1qqqq_1400_100->IntegralAndError(nbinsx,nbinsx+1,e_overflow); ht1qqqq_1400_100->SetBinContent(nbinsx, i_overflow); ht1qqqq_1400_100->SetBinError(nbinsx, e_overflow); i_overflow=ht1qqqq_1000_800->IntegralAndError(nbinsx,nbinsx+1,e_overflow); ht1qqqq_1000_800->SetBinContent(nbinsx, i_overflow); ht1qqqq_1000_800->SetBinError(nbinsx, e_overflow); } // Add up MC histograms hmc_exp->Add(httbar); hmc_exp->Add(hqcd); hmc_exp->Add(hznn); hmc_exp->Add(hwjets); hmc_exp->Add(hsingle_top); hmc_exp->Add(hother); double binwidth = (xup - xlow) / nbinsx; TString ytitle = Form("Events / %.3f", binwidth); hmc_exp->GetXaxis()->SetTitle(httbar->GetXaxis()->GetTitle()); hmc_exp->GetYaxis()->SetTitle(ytitle); cout << "... DONE: add all backgrounds to mc_exp." << endl; Double_t ttbar_e(0.), qcd_e(0.), znn_e(0.), wjets_e(0.), other_e(0.), single_top_e(0.), bg_tot_e(0.), t1tttt_1500_100_e(0.); double ttbar_n(httbar->IntegralAndError(0,nbinsx+1, ttbar_e)); double qcd_n(hqcd->IntegralAndError(0,nbinsx+1, qcd_e)); double znn_n(hznn->IntegralAndError(0,nbinsx+1, znn_e)); double wjets_n(hwjets->IntegralAndError(0,nbinsx+1, wjets_e)); double other_n(hother->IntegralAndError(0,nbinsx+1, other_e)); double single_top_n(hsingle_top->IntegralAndError(0,nbinsx+1, single_top_e)); double bg_tot(hmc_exp->IntegralAndError(0,nbinsx+1, bg_tot_e)); double t1tttt_1500_100_n(ht1tttt_1500_100->IntegralAndError(0,nbinsx+1, t1tttt_1500_100_e)); printf("Counts before cut: %s\n",var.Data()); printf("&ttbar&qcd&znn&wjets&single top&other&t1bbbb_1500_100\\\\ \n"); printf("%s & %3.2f+-%3.2f & %3.2f+-%3.2f & %3.2f+-%3.2f & %3.2f+-%3.2f & %3.2f+-%3.2f & %3.2f+-%3.2f & %3.2f+-%3.2f & %3.2f+-%3.2f \\\\\n", var.Data(), ttbar_n,ttbar_e, qcd_n,qcd_e, znn_n,znn_e, wjets_n,wjets_e, single_top_n,single_top_e, other_n,other_e, // hmc_exp->GetBinContent(1), hmc_exp->GetBinError(1), bg_tot,bg_tot_e, t1tttt_1500_100_n,t1tttt_1500_100_e); cout << "... DONE: filled histograms." << endl; if (sigStack) { for (int bin(0); bin<nbinsx; bin++) { ht1bbbb_1500_100->SetBinContent(bin+1, hmc_exp->GetBinContent(bin+1)); ht1bbbb_1000_900->SetBinContent(bin+1, hmc_exp->GetBinContent(bin+1)); ht1tttt_1500_100->SetBinContent(bin+1, hmc_exp->GetBinContent(bin+1)); ht1tttt_1200_800->SetBinContent(bin+1, hmc_exp->GetBinContent(bin+1)); } } THStack * hs = new THStack("hs", ""); hs->Add(hother); hs->Add(hsingle_top); hs->Add(hwjets); hs->Add(hznn); if (httbar->Integral()>hqcd->Integral()) { hs->Add(hqcd); hs->Add(httbar); } else { hs->Add(httbar); hs->Add(hqcd); } //hs->GetYaxis()->SetTitle("Events / 5 fb^{-1}"); //hs->GetXaxis()->SetTitle(httbar->GetXaxis()->GetTitle()); // Setup histogram styles set_style(httbar, "ttbar"); set_style(hqcd, "qcd"); set_style(hznn, "znn"); set_style(hwjets, "wjets"); set_style(hother, "other"); set_style(hsingle_top, "single_top"); // Setup auxiliary histograms (ratios, errors, etc) TH1D * staterr = (TH1D *) hmc_exp->Clone("staterr"); staterr->Sumw2(); //staterr->SetFillColor(kRed); staterr->SetFillColor(kGray+3); staterr->SetMarkerSize(0); staterr->SetFillStyle(3013); // Setup legends TLegend * leg1 = new TLegend(0.48, 0.6, 0.72, 0.92); set_style(leg1,0.025); if (plotData) leg1->AddEntry(hsingle_top, "Data", "pel"); if (plotSig) { leg1->AddEntry(ht1bbbb_1500_100, "#splitline{T1bbbb}{(1500,100) GeV}", "l"); leg1->AddEntry(ht1bbbb_1000_900, "#splitline{T1bbbb}{(1000,900) GeV}", "l"); leg1->AddEntry(ht1tttt_1500_100, "#splitline{T1tttt}{(1500,100) GeV}", "l"); leg1->AddEntry(ht1tttt_1200_800, "#splitline{T1tttt}{(1200,800) GeV}", "l"); leg1->AddEntry(ht1qqqq_1400_100, "#splitline{T1qqqq}{(1400,100) GeV}", "l"); leg1->AddEntry(ht1qqqq_1000_800, "#splitline{T1qqqq}{(1000,800) GeV}", "l"); } TLegend * leg2 = new TLegend(0.72, 0.6, 0.94, 0.92); set_style(leg2,0.025); if (httbar->Integral()>hqcd->Integral()) { leg2->AddEntry(httbar, "t#bar{t}", "f"); leg2->AddEntry(hqcd, "QCD", "f"); } else { leg2->AddEntry(hqcd, "QCD", "f"); leg2->AddEntry(httbar, "t#bar{t}", "f"); } leg2->AddEntry(hznn, "Z+jets", "f"); leg2->AddEntry(hwjets, "W+jets", "f"); leg2->AddEntry(hsingle_top, "Single Top", "f"); leg2->AddEntry(hother, "Other", "f"); leg2->AddEntry(staterr, "MC uncert.", "f"); double ymax = hs->GetMaximum(); if (ht1tttt_1500_100->GetMaximum()>ymax) ymax=ht1tttt_1500_100->GetMaximum(); if (ht1bbbb_1500_100->GetMaximum()>ymax) ymax=ht1bbbb_1500_100->GetMaximum(); if (ht1qqqq_1400_100->GetMaximum()>ymax) ymax=ht1qqqq_1400_100->GetMaximum(); if(plotLog) { hs->SetMaximum(200*ymax); hs->SetMinimum(0.1); } else { hs->SetMaximum(2*ymax); if (plot_title.Contains("baseline")) hs->SetMaximum(1.3*ymax); } // Vertical lines for cuts TLine* line_low = new TLine(cut_low,0,cut_low,1.5*ymax); TLine* line_high = new TLine(cut_high,0,cut_high,1.5*ymax); set_style(line_low); set_style(line_high); // Setup canvas and pads TCanvas * c1 = new TCanvas("c1", "c1", 700, 700); TPad * pad1 = new TPad("pad1", "top pad" , 0.0, 0.3, 1.0, 1.0); TPad * pad2 = new TPad("pad2", "bottom pad", 0.0, 0.0, 1.0, 0.3); if(plotData) { pad1->SetBottomMargin(0.0); pad1->Draw(); pad2->SetTopMargin(0.0); pad2->SetBottomMargin(0.35); pad2->Draw(); pad1->cd(); pad1->SetLogy(plotLog); } else { c1->cd(); c1->SetLogy(plotLog); } // Draw hists hs->Draw("hist"); hs->SetTitle(hmc_exp->GetTitle()); hs->GetXaxis()->SetTitle(httbar->GetXaxis()->GetTitle()); hs->GetYaxis()->SetTitle(ytitle); hs->GetXaxis()->SetLabelSize(0.03); hs->GetYaxis()->SetLabelSize(0.03); if (plotData) { // hsingle_top->Draw("e1 same"); hs->GetXaxis()->SetLabelSize(0); } staterr->Draw("e2 same"); if (plotSig) { ht1bbbb_1500_100->SetLineColor(2); ht1bbbb_1500_100->SetLineWidth(4); ht1bbbb_1500_100->SetFillColor(0); ht1bbbb_1000_900->SetLineColor(2); ht1bbbb_1000_900->SetLineWidth(4); ht1bbbb_1000_900->SetLineStyle(7); ht1bbbb_1000_900->SetFillColor(0); ht1tttt_1500_100->SetLineColor(kGreen); ht1tttt_1500_100->SetLineWidth(4); ht1tttt_1500_100->SetFillColor(0); ht1tttt_1200_800->SetLineColor(kGreen); ht1tttt_1200_800->SetLineStyle(7); ht1tttt_1200_800->SetLineWidth(4); ht1tttt_1200_800->SetFillColor(0); ht1qqqq_1400_100->SetLineColor(1006); ht1qqqq_1400_100->SetLineWidth(4); ht1qqqq_1400_100->SetFillColor(0); ht1qqqq_1000_800->SetLineColor(1006); ht1qqqq_1000_800->SetLineWidth(4); ht1qqqq_1000_800->SetLineStyle(7); ht1qqqq_1000_800->SetFillColor(0); ht1bbbb_1500_100->Draw("hist same"); ht1bbbb_1000_900->Draw("hist same"); ht1tttt_1500_100->Draw("hist same"); ht1tttt_1200_800->Draw("hist same"); ht1qqqq_1400_100->Draw("hist same"); ht1qqqq_1000_800->Draw("hist same"); } if (cut_low>0) line_low->Draw("same"); if (cut_high>0) line_high->Draw("same"); // Draw legends leg1->Draw(); leg2->Draw(); TLatex * latex = new TLatex(); latex->SetNDC(); latex->SetTextAlign(12); latex->SetTextFont(62); latex->SetTextSize(0.042); latex->DrawLatex(0.19, 0.89, "CMS Simulation"); latex->SetTextSize(0.03); latex->DrawLatex(0.19, 0.84, "#sqrt{s} = 13 TeV, L = 4 fb^{-1}"); // Print cout << "MakePlots(): Printing..." << endl; c1->cd(); if (plot_title.EqualTo("default")) plot_title=plotdir+var; gPad->Print(plotdir+plot_title+".pdf"); // Clean up delete staterr; delete leg1; delete leg2; delete latex; // delete pave; delete hs; delete pad1; delete pad2; delete c1; delete httbar; delete hqcd; delete hznn; delete hwjets; delete hsingle_top; delete hother; delete hmc_exp; delete ht1bbbb_1500_100; delete ht1bbbb_1000_900; delete ht1tttt_1500_100; delete ht1tttt_1200_800; delete ht1qqqq_1400_100; delete ht1qqqq_1000_800; cout << "MakePlots(): DONE!" << endl; return; }
THStack* BasePlot::GetStack(bool isLog) { THStack* hstack = new THStack(); float binWidth = 0; for (int i=0; i<nSamples; i++) if( _hist[i] && i != iHWW) { _hist[i]->SetLineColor(sampleColor[i]); _hist[i]->SetFillColor(sampleColor[i]); _hist[i]->SetFillStyle(1001); binWidth = _hist[i]->GetBinWidth(1); hstack->Add(_hist[i]); } for (size_t i=0; i<_autreHists.size(); i++) { _autreHists[i].second->SetLineColor(autreColors[i]); _autreHists[i].second->SetFillColor(autreColors[i]); _autreHists[i].second->SetFillStyle(1001); hstack->Add(_autreHists[i].second); } hstack->Draw("GOFF"); if(_prelim) hstack->SetTitle("CMS preliminary"); else hstack->SetTitle("CMS, #sqrt{s} = 7 TeV"); Float_t theMax = hstack->GetMaximum(); Float_t theMin = hstack->GetMinimum(); if (_hist[iHWW]) { if (_hist[iHWW]->GetMaximum() > theMax) theMax = _hist[iHWW]->GetMaximum(); if (_hist[iHWW]->GetMinimum() < theMin) theMin = _hist[iHWW]->GetMinimum(); } if (_data) { Float_t dataMax = GetMaximumIncludingErrors(_data); if (dataMax > theMax) theMax = dataMax; } int sampCount = GetSampCount(); float scaleBy = 1.35 + 0.2*(sampCount>6) + 0.2*(sampCount>10) + 0.2*(sampCount>14); // Min --- only need to change if log theMin = theMin==0?0.1:theMin/10; if(isLog) hstack->SetMinimum(theMin); // Max if (_myMax != -1) { hstack->SetMaximum(_myMax); } else if (isLog) { hstack->SetMaximum(pow(10,(log(theMax)/log(10)-log(theMin)/log(10)+1)*scaleBy+log(theMin)/log(10)-1)); } else { hstack->SetMaximum(scaleBy * theMax); } if(_breakdown) { THStackAxisFonts(hstack, "y", "entries"); hstack->GetHistogram()->LabelsOption("v"); } else { THStackAxisFonts(hstack, "x", TString::Format("%s [%s]",_xLabel.Data(),_units.Data())); THStackAxisFonts(hstack, "y", TString::Format("entries / %.1f %s", binWidth,_units.Data())); if(_units.Sizeof() == 1) { THStackAxisFonts(hstack, "x", _xLabel.Data()); // THStackAxisFonts(hstack, "y", "entries"); } } return hstack; }
void ttbar_isojet1CSV() { //=========Macro generated from canvas: c1/c1 //========= (Sun Dec 11 15:16:19 2016) by ROOT version6.06/01 TCanvas *c1 = new TCanvas("c1", "c1",1,1,1200,1416); gStyle->SetOptStat(0); gStyle->SetOptTitle(0); c1->SetHighLightColor(2); c1->Range(0,0,1,1); c1->SetFillColor(0); c1->SetBorderMode(0); c1->SetBorderSize(2); c1->SetTickx(1); c1->SetTicky(1); c1->SetLeftMargin(0.15); c1->SetRightMargin(0.05); c1->SetTopMargin(0.07); c1->SetBottomMargin(0.13); c1->SetFrameFillStyle(0); c1->SetFrameBorderMode(0); // ------------>Primitives in pad: pad1 TPad *pad1 = new TPad("pad1", "pad1",0,0.3,1,1); pad1->Draw(); pad1->cd(); pad1->Range(-0.1875,0,1.0625,0.6289089); pad1->SetFillColor(0); pad1->SetBorderMode(0); pad1->SetBorderSize(2); pad1->SetTickx(1); pad1->SetTicky(1); pad1->SetLeftMargin(0.15); pad1->SetRightMargin(0.05); pad1->SetTopMargin(0.07); pad1->SetBottomMargin(0); pad1->SetFrameFillStyle(0); pad1->SetFrameBorderMode(0); pad1->SetFrameFillStyle(0); pad1->SetFrameBorderMode(0); THStack *h = new THStack(); h->SetName("h"); h->SetTitle(""); h->SetMinimum(0); h->SetMaximum(0.5570336); TH1F *h_stack_23 = new TH1F("h_stack_23","",10,0,1); h_stack_23->SetMinimum(0); h_stack_23->SetMaximum(0.5848853); h_stack_23->SetDirectory(0); h_stack_23->SetStats(0); Int_t ci; // for color index setting TColor *color; // for color definition with alpha ci = TColor::GetColor("#000099"); h_stack_23->SetLineColor(ci); h_stack_23->GetXaxis()->SetLabelFont(42); h_stack_23->GetXaxis()->SetLabelOffset(0.007); h_stack_23->GetXaxis()->SetTitleSize(0.05); h_stack_23->GetXaxis()->SetTickLength(0.025); h_stack_23->GetXaxis()->SetTitleFont(42); h_stack_23->GetYaxis()->SetTitle("a.u."); h_stack_23->GetYaxis()->SetLabelFont(42); h_stack_23->GetYaxis()->SetLabelOffset(0.007); h_stack_23->GetYaxis()->SetTitleSize(0.05); h_stack_23->GetYaxis()->SetTickLength(0.025); h_stack_23->GetYaxis()->SetTitleOffset(1.5); h_stack_23->GetYaxis()->SetTitleFont(42); h_stack_23->GetZaxis()->SetLabelFont(42); h_stack_23->GetZaxis()->SetLabelOffset(0.007); h_stack_23->GetZaxis()->SetTitleSize(0.05); h_stack_23->GetZaxis()->SetTickLength(0.025); h_stack_23->GetZaxis()->SetTitleFont(42); h->SetHistogram(h_stack_23); TH1D *h_isojet1CSV_QCD__265 = new TH1D("h_isojet1CSV_QCD__265","",10,0,1); h_isojet1CSV_QCD__265->SetBinContent(1,0.002129117); h_isojet1CSV_QCD__265->SetBinContent(2,0.001248327); h_isojet1CSV_QCD__265->SetBinContent(3,0.0006205357); h_isojet1CSV_QCD__265->SetBinContent(4,0.001430306); h_isojet1CSV_QCD__265->SetBinContent(5,0.001031553); h_isojet1CSV_QCD__265->SetBinContent(6,0.0005098467); h_isojet1CSV_QCD__265->SetBinContent(7,0.0002095089); h_isojet1CSV_QCD__265->SetBinContent(8,9.216642e-05); h_isojet1CSV_QCD__265->SetBinContent(10,0.004314199); h_isojet1CSV_QCD__265->SetBinError(1,0.001510477); h_isojet1CSV_QCD__265->SetBinError(2,0.0006911766); h_isojet1CSV_QCD__265->SetBinError(3,0.0004578373); h_isojet1CSV_QCD__265->SetBinError(4,0.0008388365); h_isojet1CSV_QCD__265->SetBinError(5,0.0008715622); h_isojet1CSV_QCD__265->SetBinError(6,0.0005098467); h_isojet1CSV_QCD__265->SetBinError(7,0.0002095089); h_isojet1CSV_QCD__265->SetBinError(8,9.216642e-05); h_isojet1CSV_QCD__265->SetBinError(10,0.002213733); h_isojet1CSV_QCD__265->SetEntries(25); h_isojet1CSV_QCD__265->SetStats(0); ci = TColor::GetColor("#cccccc"); h_isojet1CSV_QCD__265->SetFillColor(ci); h_isojet1CSV_QCD__265->GetXaxis()->SetTitle("isojet 1 CSV"); h_isojet1CSV_QCD__265->GetXaxis()->SetLabelFont(42); h_isojet1CSV_QCD__265->GetXaxis()->SetLabelOffset(0.007); h_isojet1CSV_QCD__265->GetXaxis()->SetTitleSize(0.05); h_isojet1CSV_QCD__265->GetXaxis()->SetTickLength(0.025); h_isojet1CSV_QCD__265->GetXaxis()->SetTitleFont(42); h_isojet1CSV_QCD__265->GetYaxis()->SetTitle("a.u."); h_isojet1CSV_QCD__265->GetYaxis()->SetLabelFont(42); h_isojet1CSV_QCD__265->GetYaxis()->SetLabelOffset(0.007); h_isojet1CSV_QCD__265->GetYaxis()->SetTitleSize(0.05); h_isojet1CSV_QCD__265->GetYaxis()->SetTickLength(0.025); h_isojet1CSV_QCD__265->GetYaxis()->SetTitleFont(42); h_isojet1CSV_QCD__265->GetZaxis()->SetLabelFont(42); h_isojet1CSV_QCD__265->GetZaxis()->SetLabelOffset(0.007); h_isojet1CSV_QCD__265->GetZaxis()->SetTitleSize(0.05); h_isojet1CSV_QCD__265->GetZaxis()->SetTickLength(0.025); h_isojet1CSV_QCD__265->GetZaxis()->SetTitleFont(42); h->Add(h_isojet1CSV_QCD,""); TH1D *h_isojet1CSV_Diboson__266 = new TH1D("h_isojet1CSV_Diboson__266","",10,0,1); h_isojet1CSV_Diboson__266->SetBinContent(1,0.006910874); h_isojet1CSV_Diboson__266->SetBinContent(2,0.01156259); h_isojet1CSV_Diboson__266->SetBinContent(3,0.00597142); h_isojet1CSV_Diboson__266->SetBinContent(4,0.003397186); h_isojet1CSV_Diboson__266->SetBinContent(5,0.003453268); h_isojet1CSV_Diboson__266->SetBinContent(6,0.001659304); h_isojet1CSV_Diboson__266->SetBinContent(7,0.001617052); h_isojet1CSV_Diboson__266->SetBinContent(8,0.001259235); h_isojet1CSV_Diboson__266->SetBinContent(9,0.000286628); h_isojet1CSV_Diboson__266->SetBinContent(10,0.00067562); h_isojet1CSV_Diboson__266->SetBinError(1,0.001086007); h_isojet1CSV_Diboson__266->SetBinError(2,0.001467728); h_isojet1CSV_Diboson__266->SetBinError(3,0.001077108); h_isojet1CSV_Diboson__266->SetBinError(4,0.0008370875); h_isojet1CSV_Diboson__266->SetBinError(5,0.0009085276); h_isojet1CSV_Diboson__266->SetBinError(6,0.000631351); h_isojet1CSV_Diboson__266->SetBinError(7,0.0006254813); h_isojet1CSV_Diboson__266->SetBinError(8,0.0005614698); h_isojet1CSV_Diboson__266->SetBinError(9,0.0001726014); h_isojet1CSV_Diboson__266->SetBinError(10,0.0003333104); h_isojet1CSV_Diboson__266->SetEntries(227); h_isojet1CSV_Diboson__266->SetStats(0); ci = TColor::GetColor("#9966cc"); h_isojet1CSV_Diboson__266->SetFillColor(ci); h_isojet1CSV_Diboson__266->GetXaxis()->SetTitle("isojet 1 CSV"); h_isojet1CSV_Diboson__266->GetXaxis()->SetLabelFont(42); h_isojet1CSV_Diboson__266->GetXaxis()->SetLabelOffset(0.007); h_isojet1CSV_Diboson__266->GetXaxis()->SetTitleSize(0.05); h_isojet1CSV_Diboson__266->GetXaxis()->SetTickLength(0.025); h_isojet1CSV_Diboson__266->GetXaxis()->SetTitleFont(42); h_isojet1CSV_Diboson__266->GetYaxis()->SetTitle("a.u."); h_isojet1CSV_Diboson__266->GetYaxis()->SetLabelFont(42); h_isojet1CSV_Diboson__266->GetYaxis()->SetLabelOffset(0.007); h_isojet1CSV_Diboson__266->GetYaxis()->SetTitleSize(0.05); h_isojet1CSV_Diboson__266->GetYaxis()->SetTickLength(0.025); h_isojet1CSV_Diboson__266->GetYaxis()->SetTitleFont(42); h_isojet1CSV_Diboson__266->GetZaxis()->SetLabelFont(42); h_isojet1CSV_Diboson__266->GetZaxis()->SetLabelOffset(0.007); h_isojet1CSV_Diboson__266->GetZaxis()->SetTitleSize(0.05); h_isojet1CSV_Diboson__266->GetZaxis()->SetTickLength(0.025); h_isojet1CSV_Diboson__266->GetZaxis()->SetTitleFont(42); h->Add(h_isojet1CSV_Diboson,""); TH1D *h_isojet1CSV_ZpLjets__267 = new TH1D("h_isojet1CSV_ZpLjets__267","",10,0,1); h_isojet1CSV_ZpLjets__267->SetBinContent(1,0.00997839); h_isojet1CSV_ZpLjets__267->SetBinContent(2,0.01450317); h_isojet1CSV_ZpLjets__267->SetBinContent(3,0.006432142); h_isojet1CSV_ZpLjets__267->SetBinContent(4,0.004194575); h_isojet1CSV_ZpLjets__267->SetBinContent(5,0.003727646); h_isojet1CSV_ZpLjets__267->SetBinContent(6,0.002569373); h_isojet1CSV_ZpLjets__267->SetBinContent(7,0.001898935); h_isojet1CSV_ZpLjets__267->SetBinContent(8,0.001314676); h_isojet1CSV_ZpLjets__267->SetBinContent(9,0.001323422); h_isojet1CSV_ZpLjets__267->SetBinContent(10,0.001471477); h_isojet1CSV_ZpLjets__267->SetBinError(1,0.0002843835); h_isojet1CSV_ZpLjets__267->SetBinError(2,0.0003526741); h_isojet1CSV_ZpLjets__267->SetBinError(3,0.0002379666); h_isojet1CSV_ZpLjets__267->SetBinError(4,0.0002075278); h_isojet1CSV_ZpLjets__267->SetBinError(5,0.0001971644); h_isojet1CSV_ZpLjets__267->SetBinError(6,0.0001564817); h_isojet1CSV_ZpLjets__267->SetBinError(7,0.0001321731); h_isojet1CSV_ZpLjets__267->SetBinError(8,0.0001133749); h_isojet1CSV_ZpLjets__267->SetBinError(9,0.0001162263); h_isojet1CSV_ZpLjets__267->SetBinError(10,0.0001379738); h_isojet1CSV_ZpLjets__267->SetEntries(24915); h_isojet1CSV_ZpLjets__267->SetStats(0); ci = TColor::GetColor("#3399cc"); h_isojet1CSV_ZpLjets__267->SetFillColor(ci); h_isojet1CSV_ZpLjets__267->GetXaxis()->SetTitle("isojet 1 CSV"); h_isojet1CSV_ZpLjets__267->GetXaxis()->SetLabelFont(42); h_isojet1CSV_ZpLjets__267->GetXaxis()->SetLabelOffset(0.007); h_isojet1CSV_ZpLjets__267->GetXaxis()->SetTitleSize(0.05); h_isojet1CSV_ZpLjets__267->GetXaxis()->SetTickLength(0.025); h_isojet1CSV_ZpLjets__267->GetXaxis()->SetTitleFont(42); h_isojet1CSV_ZpLjets__267->GetYaxis()->SetTitle("a.u."); h_isojet1CSV_ZpLjets__267->GetYaxis()->SetLabelFont(42); h_isojet1CSV_ZpLjets__267->GetYaxis()->SetLabelOffset(0.007); h_isojet1CSV_ZpLjets__267->GetYaxis()->SetTitleSize(0.05); h_isojet1CSV_ZpLjets__267->GetYaxis()->SetTickLength(0.025); h_isojet1CSV_ZpLjets__267->GetYaxis()->SetTitleFont(42); h_isojet1CSV_ZpLjets__267->GetZaxis()->SetLabelFont(42); h_isojet1CSV_ZpLjets__267->GetZaxis()->SetLabelOffset(0.007); h_isojet1CSV_ZpLjets__267->GetZaxis()->SetTitleSize(0.05); h_isojet1CSV_ZpLjets__267->GetZaxis()->SetTickLength(0.025); h_isojet1CSV_ZpLjets__267->GetZaxis()->SetTitleFont(42); h->Add(h_isojet1CSV_Z+jets,""); TH1D *h_isojet1CSV_WpLjets__268 = new TH1D("h_isojet1CSV_WpLjets__268","",10,0,1); h_isojet1CSV_WpLjets__268->SetBinContent(1,0.01060448); h_isojet1CSV_WpLjets__268->SetBinContent(2,0.01194981); h_isojet1CSV_WpLjets__268->SetBinContent(3,0.007295854); h_isojet1CSV_WpLjets__268->SetBinContent(4,0.004201536); h_isojet1CSV_WpLjets__268->SetBinContent(5,0.003315037); h_isojet1CSV_WpLjets__268->SetBinContent(6,0.002154035); h_isojet1CSV_WpLjets__268->SetBinContent(7,0.001704806); h_isojet1CSV_WpLjets__268->SetBinContent(8,0.001590696); h_isojet1CSV_WpLjets__268->SetBinContent(9,0.001506952); h_isojet1CSV_WpLjets__268->SetBinContent(10,0.00135957); h_isojet1CSV_WpLjets__268->SetBinError(1,0.0007760229); h_isojet1CSV_WpLjets__268->SetBinError(2,0.0008063374); h_isojet1CSV_WpLjets__268->SetBinError(3,0.0006567409); h_isojet1CSV_WpLjets__268->SetBinError(4,0.0005519722); h_isojet1CSV_WpLjets__268->SetBinError(5,0.0004860992); h_isojet1CSV_WpLjets__268->SetBinError(6,0.0003673486); h_isojet1CSV_WpLjets__268->SetBinError(7,0.0003806515); h_isojet1CSV_WpLjets__268->SetBinError(8,0.0003677212); h_isojet1CSV_WpLjets__268->SetBinError(9,0.0003252218); h_isojet1CSV_WpLjets__268->SetBinError(10,0.0002763251); h_isojet1CSV_WpLjets__268->SetEntries(3309); h_isojet1CSV_WpLjets__268->SetStats(0); ci = TColor::GetColor("#66cc66"); h_isojet1CSV_WpLjets__268->SetFillColor(ci); h_isojet1CSV_WpLjets__268->GetXaxis()->SetTitle("isojet 1 CSV"); h_isojet1CSV_WpLjets__268->GetXaxis()->SetLabelFont(42); h_isojet1CSV_WpLjets__268->GetXaxis()->SetLabelOffset(0.007); h_isojet1CSV_WpLjets__268->GetXaxis()->SetTitleSize(0.05); h_isojet1CSV_WpLjets__268->GetXaxis()->SetTickLength(0.025); h_isojet1CSV_WpLjets__268->GetXaxis()->SetTitleFont(42); h_isojet1CSV_WpLjets__268->GetYaxis()->SetTitle("a.u."); h_isojet1CSV_WpLjets__268->GetYaxis()->SetLabelFont(42); h_isojet1CSV_WpLjets__268->GetYaxis()->SetLabelOffset(0.007); h_isojet1CSV_WpLjets__268->GetYaxis()->SetTitleSize(0.05); h_isojet1CSV_WpLjets__268->GetYaxis()->SetTickLength(0.025); h_isojet1CSV_WpLjets__268->GetYaxis()->SetTitleFont(42); h_isojet1CSV_WpLjets__268->GetZaxis()->SetLabelFont(42); h_isojet1CSV_WpLjets__268->GetZaxis()->SetLabelOffset(0.007); h_isojet1CSV_WpLjets__268->GetZaxis()->SetTitleSize(0.05); h_isojet1CSV_WpLjets__268->GetZaxis()->SetTickLength(0.025); h_isojet1CSV_WpLjets__268->GetZaxis()->SetTitleFont(42); h->Add(h_isojet1CSV_W+jets,""); TH1D *h_isojet1CSV_TopsPoPLFcP__269 = new TH1D("h_isojet1CSV_TopsPoPLFcP__269","",10,0,1); h_isojet1CSV_TopsPoPLFcP__269->SetBinContent(1,0.09097508); h_isojet1CSV_TopsPoPLFcP__269->SetBinContent(2,0.09232326); h_isojet1CSV_TopsPoPLFcP__269->SetBinContent(3,0.04269338); h_isojet1CSV_TopsPoPLFcP__269->SetBinContent(4,0.02949662); h_isojet1CSV_TopsPoPLFcP__269->SetBinContent(5,0.02281892); h_isojet1CSV_TopsPoPLFcP__269->SetBinContent(6,0.01709603); h_isojet1CSV_TopsPoPLFcP__269->SetBinContent(7,0.01404044); h_isojet1CSV_TopsPoPLFcP__269->SetBinContent(8,0.009499499); h_isojet1CSV_TopsPoPLFcP__269->SetBinContent(9,0.006095059); h_isojet1CSV_TopsPoPLFcP__269->SetBinContent(10,0.003040849); h_isojet1CSV_TopsPoPLFcP__269->SetBinError(1,0.0009372855); h_isojet1CSV_TopsPoPLFcP__269->SetBinError(2,0.0009857636); h_isojet1CSV_TopsPoPLFcP__269->SetBinError(3,0.0007155424); h_isojet1CSV_TopsPoPLFcP__269->SetBinError(4,0.0005977933); h_isojet1CSV_TopsPoPLFcP__269->SetBinError(5,0.0005373378); h_isojet1CSV_TopsPoPLFcP__269->SetBinError(6,0.0004781073); h_isojet1CSV_TopsPoPLFcP__269->SetBinError(7,0.0004489056); h_isojet1CSV_TopsPoPLFcP__269->SetBinError(8,0.0003875753); h_isojet1CSV_TopsPoPLFcP__269->SetBinError(9,0.0003337873); h_isojet1CSV_TopsPoPLFcP__269->SetBinError(10,0.0003173281); h_isojet1CSV_TopsPoPLFcP__269->SetEntries(45754); h_isojet1CSV_TopsPoPLFcP__269->SetStats(0); ci = TColor::GetColor("#cc33cc"); h_isojet1CSV_TopsPoPLFcP__269->SetFillColor(ci); h_isojet1CSV_TopsPoPLFcP__269->GetXaxis()->SetTitle("isojet 1 CSV"); h_isojet1CSV_TopsPoPLFcP__269->GetXaxis()->SetLabelFont(42); h_isojet1CSV_TopsPoPLFcP__269->GetXaxis()->SetLabelOffset(0.007); h_isojet1CSV_TopsPoPLFcP__269->GetXaxis()->SetTitleSize(0.05); h_isojet1CSV_TopsPoPLFcP__269->GetXaxis()->SetTickLength(0.025); h_isojet1CSV_TopsPoPLFcP__269->GetXaxis()->SetTitleFont(42); h_isojet1CSV_TopsPoPLFcP__269->GetYaxis()->SetTitle("a.u."); h_isojet1CSV_TopsPoPLFcP__269->GetYaxis()->SetLabelFont(42); h_isojet1CSV_TopsPoPLFcP__269->GetYaxis()->SetLabelOffset(0.007); h_isojet1CSV_TopsPoPLFcP__269->GetYaxis()->SetTitleSize(0.05); h_isojet1CSV_TopsPoPLFcP__269->GetYaxis()->SetTickLength(0.025); h_isojet1CSV_TopsPoPLFcP__269->GetYaxis()->SetTitleFont(42); h_isojet1CSV_TopsPoPLFcP__269->GetZaxis()->SetLabelFont(42); h_isojet1CSV_TopsPoPLFcP__269->GetZaxis()->SetLabelOffset(0.007); h_isojet1CSV_TopsPoPLFcP__269->GetZaxis()->SetTitleSize(0.05); h_isojet1CSV_TopsPoPLFcP__269->GetZaxis()->SetTickLength(0.025); h_isojet1CSV_TopsPoPLFcP__269->GetZaxis()->SetTitleFont(42); h->Add(h_isojet1CSV_Top (LF),""); TH1D *h_isojet1CSV_TopsPoPHFcP__270 = new TH1D("h_isojet1CSV_TopsPoPHFcP__270","",10,0,1); h_isojet1CSV_TopsPoPHFcP__270->SetBinContent(1,0.01878166); h_isojet1CSV_TopsPoPHFcP__270->SetBinContent(2,0.02708098); h_isojet1CSV_TopsPoPHFcP__270->SetBinContent(3,0.01896531); h_isojet1CSV_TopsPoPHFcP__270->SetBinContent(4,0.01870601); h_isojet1CSV_TopsPoPHFcP__270->SetBinContent(5,0.01924485); h_isojet1CSV_TopsPoPHFcP__270->SetBinContent(6,0.02077131); h_isojet1CSV_TopsPoPHFcP__270->SetBinContent(7,0.02899544); h_isojet1CSV_TopsPoPHFcP__270->SetBinContent(8,0.03698897); h_isojet1CSV_TopsPoPHFcP__270->SetBinContent(9,0.07325594); h_isojet1CSV_TopsPoPHFcP__270->SetBinContent(10,0.2676551); h_isojet1CSV_TopsPoPHFcP__270->SetBinError(1,0.0004640739); h_isojet1CSV_TopsPoPHFcP__270->SetBinError(2,0.0005643558); h_isojet1CSV_TopsPoPHFcP__270->SetBinError(3,0.0004957084); h_isojet1CSV_TopsPoPHFcP__270->SetBinError(4,0.0004766015); h_isojet1CSV_TopsPoPHFcP__270->SetBinError(5,0.0004665302); h_isojet1CSV_TopsPoPHFcP__270->SetBinError(6,0.0005070097); h_isojet1CSV_TopsPoPHFcP__270->SetBinError(7,0.0006476121); h_isojet1CSV_TopsPoPHFcP__270->SetBinError(8,0.0007056579); h_isojet1CSV_TopsPoPHFcP__270->SetBinError(9,0.0009826258); h_isojet1CSV_TopsPoPHFcP__270->SetBinError(10,0.001744809); h_isojet1CSV_TopsPoPHFcP__270->SetEntries(77950); h_isojet1CSV_TopsPoPHFcP__270->SetStats(0); ci = TColor::GetColor("#ff9900"); h_isojet1CSV_TopsPoPHFcP__270->SetFillColor(ci); h_isojet1CSV_TopsPoPHFcP__270->GetXaxis()->SetTitle("isojet 1 CSV"); h_isojet1CSV_TopsPoPHFcP__270->GetXaxis()->SetLabelFont(42); h_isojet1CSV_TopsPoPHFcP__270->GetXaxis()->SetLabelOffset(0.007); h_isojet1CSV_TopsPoPHFcP__270->GetXaxis()->SetTitleSize(0.05); h_isojet1CSV_TopsPoPHFcP__270->GetXaxis()->SetTickLength(0.025); h_isojet1CSV_TopsPoPHFcP__270->GetXaxis()->SetTitleFont(42); h_isojet1CSV_TopsPoPHFcP__270->GetYaxis()->SetTitle("a.u."); h_isojet1CSV_TopsPoPHFcP__270->GetYaxis()->SetLabelFont(42); h_isojet1CSV_TopsPoPHFcP__270->GetYaxis()->SetLabelOffset(0.007); h_isojet1CSV_TopsPoPHFcP__270->GetYaxis()->SetTitleSize(0.05); h_isojet1CSV_TopsPoPHFcP__270->GetYaxis()->SetTickLength(0.025); h_isojet1CSV_TopsPoPHFcP__270->GetYaxis()->SetTitleFont(42); h_isojet1CSV_TopsPoPHFcP__270->GetZaxis()->SetLabelFont(42); h_isojet1CSV_TopsPoPHFcP__270->GetZaxis()->SetLabelOffset(0.007); h_isojet1CSV_TopsPoPHFcP__270->GetZaxis()->SetTitleSize(0.05); h_isojet1CSV_TopsPoPHFcP__270->GetZaxis()->SetTickLength(0.025); h_isojet1CSV_TopsPoPHFcP__270->GetZaxis()->SetTitleFont(42); h->Add(h_isojet1CSV_Top (HF),""); h->Draw("hist"); TH1D *hsum__271 = new TH1D("hsum__271","",10,0,1); hsum__271->SetBinContent(1,0.1393796); hsum__271->SetBinContent(2,0.1586681); hsum__271->SetBinContent(3,0.08197864); hsum__271->SetBinContent(4,0.06142623); hsum__271->SetBinContent(5,0.05359128); hsum__271->SetBinContent(6,0.0447599); hsum__271->SetBinContent(7,0.04846618); hsum__271->SetBinContent(8,0.05074524); hsum__271->SetBinContent(9,0.082468); hsum__271->SetBinContent(10,0.2785168); hsum__271->SetBinError(1,0.002288647); hsum__271->SetBinError(2,0.002167196); hsum__271->SetBinError(3,0.001617233); hsum__271->SetBinError(4,0.001528597); hsum__271->SetBinError(5,0.001538373); hsum__271->SetBinError(6,0.001141764); hsum__271->SetBinError(7,0.001103813); hsum__271->SetBinError(8,0.001058293); hsum__271->SetBinError(9,0.001107265); hsum__271->SetBinError(10,0.002872657); hsum__271->SetEntries(45); hsum__271->SetStats(0); ci = 1202; color = new TColor(ci, 0, 0, 0, " ", 0.99); hsum__271->SetFillColor(ci); hsum__271->SetFillStyle(3003); hsum__271->SetLineWidth(0); hsum__271->GetXaxis()->SetTitle("isojet 1 CSV"); hsum__271->GetXaxis()->SetLabelFont(42); hsum__271->GetXaxis()->SetLabelOffset(0.007); hsum__271->GetXaxis()->SetTitleSize(0.05); hsum__271->GetXaxis()->SetTickLength(0.025); hsum__271->GetXaxis()->SetTitleFont(42); hsum__271->GetYaxis()->SetTitle("a.u."); hsum__271->GetYaxis()->SetLabelFont(42); hsum__271->GetYaxis()->SetLabelOffset(0.007); hsum__271->GetYaxis()->SetTitleSize(0.05); hsum__271->GetYaxis()->SetTickLength(0.025); hsum__271->GetYaxis()->SetTitleFont(42); hsum__271->GetZaxis()->SetLabelFont(42); hsum__271->GetZaxis()->SetLabelOffset(0.007); hsum__271->GetZaxis()->SetTitleSize(0.05); hsum__271->GetZaxis()->SetTickLength(0.025); hsum__271->GetZaxis()->SetTitleFont(42); hsum__271->Draw("e2 same"); TH1D *h_isojet1CSV_Data__272 = new TH1D("h_isojet1CSV_Data__272","",10,0,1); h_isojet1CSV_Data__272->SetBinContent(1,0.138368); h_isojet1CSV_Data__272->SetBinContent(2,0.1592858); h_isojet1CSV_Data__272->SetBinContent(3,0.08381231); h_isojet1CSV_Data__272->SetBinContent(4,0.06152831); h_isojet1CSV_Data__272->SetBinContent(5,0.05196457); h_isojet1CSV_Data__272->SetBinContent(6,0.04475643); h_isojet1CSV_Data__272->SetBinContent(7,0.04833695); h_isojet1CSV_Data__272->SetBinContent(8,0.05059832); h_isojet1CSV_Data__272->SetBinContent(9,0.08235183); h_isojet1CSV_Data__272->SetBinContent(10,0.2789975); h_isojet1CSV_Data__272->SetBinError(1,0.002553194); h_isojet1CSV_Data__272->SetBinError(2,0.002739394); h_isojet1CSV_Data__272->SetBinError(3,0.0019871); h_isojet1CSV_Data__272->SetBinError(4,0.001702564); h_isojet1CSV_Data__272->SetBinError(5,0.001564659); h_isojet1CSV_Data__272->SetBinError(6,0.00145209); h_isojet1CSV_Data__272->SetBinError(7,0.001509057); h_isojet1CSV_Data__272->SetBinError(8,0.001543953); h_isojet1CSV_Data__272->SetBinError(9,0.001969711); h_isojet1CSV_Data__272->SetBinError(10,0.003625484); h_isojet1CSV_Data__272->SetEntries(21226); h_isojet1CSV_Data__272->SetStats(0); h_isojet1CSV_Data__272->SetLineWidth(3); h_isojet1CSV_Data__272->SetMarkerStyle(20); h_isojet1CSV_Data__272->SetMarkerSize(2); h_isojet1CSV_Data__272->GetXaxis()->SetTitle("isojet 1 CSV"); h_isojet1CSV_Data__272->GetXaxis()->SetLabelFont(42); h_isojet1CSV_Data__272->GetXaxis()->SetLabelOffset(0.007); h_isojet1CSV_Data__272->GetXaxis()->SetTitleSize(0.05); h_isojet1CSV_Data__272->GetXaxis()->SetTickLength(0.025); h_isojet1CSV_Data__272->GetXaxis()->SetTitleFont(42); h_isojet1CSV_Data__272->GetYaxis()->SetTitle("a.u."); h_isojet1CSV_Data__272->GetYaxis()->SetLabelFont(42); h_isojet1CSV_Data__272->GetYaxis()->SetLabelOffset(0.007); h_isojet1CSV_Data__272->GetYaxis()->SetTitleSize(0.05); h_isojet1CSV_Data__272->GetYaxis()->SetTickLength(0.025); h_isojet1CSV_Data__272->GetYaxis()->SetTitleFont(42); h_isojet1CSV_Data__272->GetZaxis()->SetLabelFont(42); h_isojet1CSV_Data__272->GetZaxis()->SetLabelOffset(0.007); h_isojet1CSV_Data__272->GetZaxis()->SetTitleSize(0.05); h_isojet1CSV_Data__272->GetZaxis()->SetTickLength(0.025); h_isojet1CSV_Data__272->GetZaxis()->SetTitleFont(42); h_isojet1CSV_Data__272->Draw("elp same"); TLegend *leg = new TLegend(0.6,0.55,0.88,0.9,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetLineColor(1); leg->SetLineStyle(1); leg->SetLineWidth(1); leg->SetFillColor(0); leg->SetFillStyle(0); TLegendEntry *entry=leg->AddEntry("h_isojet1CSV_Data","Data","ELP"); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(3); entry->SetMarkerColor(1); entry->SetMarkerStyle(20); entry->SetMarkerSize(2); entry->SetTextFont(42); entry=leg->AddEntry("h_isojet1CSV_Top (HF)","Top (HF)","F"); ci = TColor::GetColor("#ff9900"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_isojet1CSV_Top (LF)","Top (LF)","F"); ci = TColor::GetColor("#cc33cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_isojet1CSV_W+jets","W+jets","F"); ci = TColor::GetColor("#66cc66"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_isojet1CSV_Z+jets","Z+jets","F"); ci = TColor::GetColor("#3399cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_isojet1CSV_Diboson","Diboson","F"); ci = TColor::GetColor("#9966cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_isojet1CSV_QCD","QCD","F"); ci = TColor::GetColor("#cccccc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); 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.6,0.55,0.88,0.9,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetLineColor(1); leg->SetLineStyle(1); leg->SetLineWidth(1); leg->SetFillColor(0); leg->SetFillStyle(0); entry=leg->AddEntry("h_isojet1CSV_Data","Data","ELP"); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(3); entry->SetMarkerColor(1); entry->SetMarkerStyle(20); entry->SetMarkerSize(2); entry->SetTextFont(42); entry=leg->AddEntry("h_isojet1CSV_Top (HF)","Top (HF)","F"); ci = TColor::GetColor("#ff9900"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_isojet1CSV_Top (LF)","Top (LF)","F"); ci = TColor::GetColor("#cc33cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_isojet1CSV_W+jets","W+jets","F"); ci = TColor::GetColor("#66cc66"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_isojet1CSV_Z+jets","Z+jets","F"); ci = TColor::GetColor("#3399cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_isojet1CSV_Diboson","Diboson","F"); ci = TColor::GetColor("#9966cc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("h_isojet1CSV_QCD","QCD","F"); ci = TColor::GetColor("#cccccc"); entry->SetFillColor(ci); entry->SetFillStyle(1001); entry->SetLineColor(1); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); leg->Draw(); TLatex * tex = new TLatex(0.18,0.85,"CMS"); tex->SetNDC(); tex->SetTextSize(0.06); tex->SetLineWidth(2); tex->Draw(); tex = new TLatex(0.28,0.85,"Preliminary"); tex->SetNDC(); tex->SetTextFont(52); tex->SetTextSize(0.06); tex->SetLineWidth(2); tex->Draw(); tex = new TLatex(0.9,0.94,"36.6 fb^{-1} (13 TeV)"); tex->SetNDC(); tex->SetTextAlign(31); tex->SetTextFont(42); tex->SetTextSize(0.04); tex->SetLineWidth(2); tex->Draw(); pad1->Modified(); c1->cd(); // ------------>Primitives in pad: pad2 TPad *pad2 = new TPad("pad2", "pad2",0,0.05,1,0.3); pad2->Draw(); pad2->cd(); pad2->Range(-0.1875,-0.8914286,1.0625,0.48); pad2->SetFillColor(0); pad2->SetBorderMode(0); pad2->SetBorderSize(2); pad2->SetGridy(); pad2->SetTickx(1); pad2->SetTicky(1); pad2->SetLeftMargin(0.15); pad2->SetRightMargin(0.05); pad2->SetTopMargin(0); pad2->SetBottomMargin(0.3); pad2->SetFrameFillStyle(0); pad2->SetFrameBorderMode(0); pad2->SetFrameFillStyle(0); pad2->SetFrameBorderMode(0); TH1D *ratio__273 = new TH1D("ratio__273","",10,0,1); ratio__273->SetBinContent(1,-0.00725764); ratio__273->SetBinContent(2,0.003892779); ratio__273->SetBinContent(3,0.0223676); ratio__273->SetBinContent(4,0.001661897); ratio__273->SetBinContent(5,-0.0303539); ratio__273->SetBinContent(6,-7.754564e-05); ratio__273->SetBinContent(7,-0.002666473); ratio__273->SetBinContent(8,-0.002895236); ratio__273->SetBinContent(9,-0.001408637); ratio__273->SetBinContent(10,0.001725793); ratio__273->SetBinError(1,0.0001); ratio__273->SetBinError(2,0.0001); ratio__273->SetBinError(3,0.0001); ratio__273->SetBinError(4,0.0001); ratio__273->SetBinError(5,0.0001); ratio__273->SetBinError(6,0.0001); ratio__273->SetBinError(7,0.0001); ratio__273->SetBinError(8,0.0001); ratio__273->SetBinError(9,0.0001); ratio__273->SetBinError(10,0.0001); ratio__273->SetMinimum(-0.48); ratio__273->SetMaximum(0.48); ratio__273->SetEntries(21236); ratio__273->SetStats(0); ratio__273->SetLineWidth(3); ratio__273->SetMarkerStyle(20); ratio__273->SetMarkerSize(2); ratio__273->GetXaxis()->SetTitle("isojet 1 CSV"); ratio__273->GetXaxis()->SetLabelFont(43); ratio__273->GetXaxis()->SetLabelOffset(0.007); ratio__273->GetXaxis()->SetLabelSize(30); ratio__273->GetXaxis()->SetTitleSize(40); ratio__273->GetXaxis()->SetTickLength(0.025); ratio__273->GetXaxis()->SetTitleOffset(5); ratio__273->GetXaxis()->SetTitleFont(43); ratio__273->GetYaxis()->SetTitle("#frac{Data-Exp}{Exp}"); ratio__273->GetYaxis()->SetNdivisions(5); ratio__273->GetYaxis()->SetLabelFont(43); ratio__273->GetYaxis()->SetLabelOffset(0.007); ratio__273->GetYaxis()->SetLabelSize(30); ratio__273->GetYaxis()->SetTitleSize(40); ratio__273->GetYaxis()->SetTickLength(0.025); ratio__273->GetYaxis()->SetTitleOffset(2.5); ratio__273->GetYaxis()->SetTitleFont(43); ratio__273->GetZaxis()->SetLabelFont(42); ratio__273->GetZaxis()->SetLabelOffset(0.007); ratio__273->GetZaxis()->SetTitleSize(0.05); ratio__273->GetZaxis()->SetTickLength(0.025); ratio__273->GetZaxis()->SetTitleFont(42); ratio__273->Draw("elp"); TH1D *zero__274 = new TH1D("zero__274","",10,0,1); zero__274->SetBinError(1,0.002553194); zero__274->SetBinError(2,0.002739394); zero__274->SetBinError(3,0.0019871); zero__274->SetBinError(4,0.001702564); zero__274->SetBinError(5,0.001564659); zero__274->SetBinError(6,0.00145209); zero__274->SetBinError(7,0.001509057); zero__274->SetBinError(8,0.001543953); zero__274->SetBinError(9,0.001969711); zero__274->SetBinError(10,0.003625484); zero__274->SetEntries(21236); zero__274->SetStats(0); zero__274->SetLineWidth(3); zero__274->SetMarkerStyle(20); zero__274->SetMarkerSize(2); zero__274->GetXaxis()->SetTitle("isojet 1 CSV"); zero__274->GetXaxis()->SetLabelFont(42); zero__274->GetXaxis()->SetLabelOffset(0.007); zero__274->GetXaxis()->SetTitleSize(0.05); zero__274->GetXaxis()->SetTickLength(0.025); zero__274->GetXaxis()->SetTitleFont(42); zero__274->GetYaxis()->SetTitle("a.u."); zero__274->GetYaxis()->SetLabelFont(42); zero__274->GetYaxis()->SetLabelOffset(0.007); zero__274->GetYaxis()->SetTitleSize(0.05); zero__274->GetYaxis()->SetTickLength(0.025); zero__274->GetYaxis()->SetTitleFont(42); zero__274->GetZaxis()->SetLabelFont(42); zero__274->GetZaxis()->SetLabelOffset(0.007); zero__274->GetZaxis()->SetTitleSize(0.05); zero__274->GetZaxis()->SetTickLength(0.025); zero__274->GetZaxis()->SetTitleFont(42); zero__274->Draw("hist same"); TH1D *sumratioup__275 = new TH1D("sumratioup__275","",10,0,1); sumratioup__275->SetBinContent(1,0.01642024); sumratioup__275->SetBinContent(2,0.01365867); sumratioup__275->SetBinContent(3,0.01972749); sumratioup__275->SetBinContent(4,0.02488509); sumratioup__275->SetBinContent(5,0.02870566); sumratioup__275->SetBinContent(6,0.02550863); sumratioup__275->SetBinContent(7,0.02277492); sumratioup__275->SetBinContent(8,0.02085501); sumratioup__275->SetBinContent(9,0.01342661); sumratioup__275->SetBinContent(10,0.01031412); sumratioup__275->SetBinError(1,0.002288647); sumratioup__275->SetBinError(2,0.002167196); sumratioup__275->SetBinError(3,0.001617233); sumratioup__275->SetBinError(4,0.001528597); sumratioup__275->SetBinError(5,0.001538373); sumratioup__275->SetBinError(6,0.001141764); sumratioup__275->SetBinError(7,0.001103813); sumratioup__275->SetBinError(8,0.001058293); sumratioup__275->SetBinError(9,0.001107265); sumratioup__275->SetBinError(10,0.002872657); sumratioup__275->SetEntries(55); sumratioup__275->SetStats(0); ci = 1202; color = new TColor(ci, 0, 0, 0, " ", 0.99); sumratioup__275->SetFillColor(ci); sumratioup__275->SetFillStyle(3003); sumratioup__275->GetXaxis()->SetTitle("isojet 1 CSV"); sumratioup__275->GetXaxis()->SetLabelFont(42); sumratioup__275->GetXaxis()->SetLabelOffset(0.007); sumratioup__275->GetXaxis()->SetTitleSize(0.05); sumratioup__275->GetXaxis()->SetTickLength(0.025); sumratioup__275->GetXaxis()->SetTitleFont(42); sumratioup__275->GetYaxis()->SetTitle("a.u."); sumratioup__275->GetYaxis()->SetLabelFont(42); sumratioup__275->GetYaxis()->SetLabelOffset(0.007); sumratioup__275->GetYaxis()->SetTitleSize(0.05); sumratioup__275->GetYaxis()->SetTickLength(0.025); sumratioup__275->GetYaxis()->SetTitleFont(42); sumratioup__275->GetZaxis()->SetLabelFont(42); sumratioup__275->GetZaxis()->SetLabelOffset(0.007); sumratioup__275->GetZaxis()->SetTitleSize(0.05); sumratioup__275->GetZaxis()->SetTickLength(0.025); sumratioup__275->GetZaxis()->SetTitleFont(42); sumratioup__275->Draw("hist same"); TH1D *sumratiodown__276 = new TH1D("sumratiodown__276","",10,0,1); sumratiodown__276->SetBinContent(1,-0.01642024); sumratiodown__276->SetBinContent(2,-0.01365867); sumratiodown__276->SetBinContent(3,-0.01972749); sumratiodown__276->SetBinContent(4,-0.02488509); sumratiodown__276->SetBinContent(5,-0.02870566); sumratiodown__276->SetBinContent(6,-0.02550863); sumratiodown__276->SetBinContent(7,-0.02277492); sumratiodown__276->SetBinContent(8,-0.02085501); sumratiodown__276->SetBinContent(9,-0.01342661); sumratiodown__276->SetBinContent(10,-0.01031412); sumratiodown__276->SetBinError(1,0.002288647); sumratiodown__276->SetBinError(2,0.002167196); sumratiodown__276->SetBinError(3,0.001617233); sumratiodown__276->SetBinError(4,0.001528597); sumratiodown__276->SetBinError(5,0.001538373); sumratiodown__276->SetBinError(6,0.001141764); sumratiodown__276->SetBinError(7,0.001103813); sumratiodown__276->SetBinError(8,0.001058293); sumratiodown__276->SetBinError(9,0.001107265); sumratiodown__276->SetBinError(10,0.002872657); sumratiodown__276->SetEntries(55); sumratiodown__276->SetStats(0); ci = 1202; color = new TColor(ci, 0, 0, 0, " ", 0.99); sumratiodown__276->SetFillColor(ci); sumratiodown__276->SetFillStyle(3003); sumratiodown__276->GetXaxis()->SetTitle("isojet 1 CSV"); sumratiodown__276->GetXaxis()->SetLabelFont(42); sumratiodown__276->GetXaxis()->SetLabelOffset(0.007); sumratiodown__276->GetXaxis()->SetTitleSize(0.05); sumratiodown__276->GetXaxis()->SetTickLength(0.025); sumratiodown__276->GetXaxis()->SetTitleFont(42); sumratiodown__276->GetYaxis()->SetTitle("a.u."); sumratiodown__276->GetYaxis()->SetLabelFont(42); sumratiodown__276->GetYaxis()->SetLabelOffset(0.007); sumratiodown__276->GetYaxis()->SetTitleSize(0.05); sumratiodown__276->GetYaxis()->SetTickLength(0.025); sumratiodown__276->GetYaxis()->SetTitleFont(42); sumratiodown__276->GetZaxis()->SetLabelFont(42); sumratiodown__276->GetZaxis()->SetLabelOffset(0.007); sumratiodown__276->GetZaxis()->SetTitleSize(0.05); sumratiodown__276->GetZaxis()->SetTickLength(0.025); sumratiodown__276->GetZaxis()->SetTitleFont(42); sumratiodown__276->Draw("hist same"); Double_t Graph0_fx1023[10] = { 0.05, 0.15, 0.25, 0.35, 0.45, 0.55, 0.65, 0.75, 0.85, 0.95}; Double_t Graph0_fy1023[10] = { -0.00725764, 0.003892779, 0.0223676, 0.001661897, -0.0303539, -7.754564e-05, -0.002666473, -0.002895236, -0.001408637, 0.001725793}; Double_t Graph0_fex1023[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; Double_t Graph0_fey1023[10] = { 0.01831827, 0.01726493, 0.02423924, 0.02771721, 0.02919614, 0.03244177, 0.03113628, 0.03042557, 0.02388455, 0.01301711}; TGraphErrors *gre = new TGraphErrors(10,Graph0_fx1023,Graph0_fy1023,Graph0_fex1023,Graph0_fey1023); gre->SetName("Graph0"); gre->SetTitle("Graph"); gre->SetFillColor(1); gre->SetLineWidth(3); TH1F *Graph_Graph1023 = new TH1F("Graph_Graph1023","Graph",100,0,1.04); Graph_Graph1023->SetMinimum(-0.07016574); Graph_Graph1023->SetMaximum(0.05722253); Graph_Graph1023->SetDirectory(0); Graph_Graph1023->SetStats(0); ci = TColor::GetColor("#000099"); Graph_Graph1023->SetLineColor(ci); Graph_Graph1023->GetXaxis()->SetLabelFont(42); Graph_Graph1023->GetXaxis()->SetLabelOffset(0.007); Graph_Graph1023->GetXaxis()->SetTitleSize(0.05); Graph_Graph1023->GetXaxis()->SetTickLength(0.025); Graph_Graph1023->GetXaxis()->SetTitleFont(42); Graph_Graph1023->GetYaxis()->SetLabelFont(42); Graph_Graph1023->GetYaxis()->SetLabelOffset(0.007); Graph_Graph1023->GetYaxis()->SetTitleSize(0.05); Graph_Graph1023->GetYaxis()->SetTickLength(0.025); Graph_Graph1023->GetYaxis()->SetTitleFont(42); Graph_Graph1023->GetZaxis()->SetLabelFont(42); Graph_Graph1023->GetZaxis()->SetLabelOffset(0.007); Graph_Graph1023->GetZaxis()->SetTitleSize(0.05); Graph_Graph1023->GetZaxis()->SetTickLength(0.025); Graph_Graph1023->GetZaxis()->SetTitleFont(42); gre->SetHistogram(Graph_Graph1023); gre->Draw("pe0"); pad2->Modified(); c1->cd(); c1->Modified(); c1->cd(); c1->SetSelected(c1); }
//____________________________________________________________________ void DrawResCollection(TCollection* top, const TString& name) { TCollection* c = GetCollection(top, name, false); if (!c) return; THStack* s = GetStack(c, "all"); s->SetTitle(""); DrawInPad(fBody, 0, s, "nostack", kLogy); TLegend* l = new TLegend(.5, .75, .98, .98, "P(#it{N}_{ch})"); l->SetBorderSize(0); // l->SetBorderMode(0); l->SetFillColor(0); l->SetFillStyle(0); TIter next(s->GetHists()); TH1* h = 0; Bool_t hasTrue = false; while ((h = static_cast<TH1*>(next()))) { TString n(h->GetTitle()); if (n.BeginsWith("True")) { hasTrue = true; continue; } n.ReplaceAll("Raw P(#it{N}_{ch}) in ", ""); TLegendEntry* e = l->AddEntry("dummy", n, "p"); e->SetMarkerStyle(h->GetMarkerStyle()); } if (hasTrue) { TLegendEntry* e = l->AddEntry("dummy", "Raw", "p"); e->SetMarkerStyle(20); e->SetMarkerColor(kRed+1); e = l->AddEntry("dummy", "MC truth", "p"); e->SetMarkerStyle(24); e->SetMarkerColor(kBlue+1); e = l->AddEntry("dummy", "MC truth selected", "p"); e->SetMarkerStyle(24); e->SetMarkerColor(kOrange+1); } fBody->cd(); l->Draw(); PrintCanvas(Form("%s results", name.Data())); // return; TIter nextO(c); TObject* o = 0; while ((o = nextO())) { Double_t etaMin = 999; Double_t etaMax = 999; TCollection* bin = GetEtaBin(o, etaMin, etaMax); if (!bin) continue; fBody->Divide(2,3); DrawInPad(fBody, 1, GetH1(bin, "rawDist"), "", kLogy); DrawInPad(fBody, 1, GetH1(bin, "truthAccepted", false), "same", kSilent); DrawInPad(fBody, 1, GetH1(bin, "truth", false),"same", kSilent|kLegend); DrawInPad(fBody, 2, GetH1(bin, "coverage")); DrawInPad(fBody, 3, GetH2(bin, "corr"), "colz"); DrawInPad(fBody, 4, GetH2(bin, "response", false), "colz", kLogz|kSilent); DrawInPad(fBody, 5, GetH1(bin, "triggerVertex", false), "", kSilent); PrintCanvas(Form("%+5.1f < #eta < %+5.1f", etaMin, etaMax)); } }