ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/cbrown/Development/Plotting/Modules/ZbTools.C
(Generate patch)

Comparing UserCode/cbrown/Development/Plotting/Modules/ZbTools.C (file contents):
Revision 1.6 by buchmann, Fri Aug 17 13:06:08 2012 UTC vs.
Revision 1.7 by buchmann, Wed Nov 7 10:30:51 2012 UTC

# Line 32 | Line 32 | namespace ZbData {
32  
33   using namespace ZbData;
34  
35 +
36 + //*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*  DELETE EVERYTHING BETWEEN THIS LINE /*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*//
37 + void SpecialCutFlow(string identifier);
38 +  
39 + //*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*            AND THIS LINE             /*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*//
40 +
41 +
42   void print_yield(TCut cut) {
43    TH1F *data  = allsamples.Draw("data",    "mll",1,0,10000000, "m_{ll} [GeV]", "events", cut,data,luminosity);
44 <  cout << "  Yields for " << (const char*) cut << endl;
45 <  cout << "     data: " << data->Integral() << endl;
46 <  THStack mcm = allsamples.DrawStack("mc", "mll",1,0,10000000, "m_{ll} [GeV]", "events", cut,mc,luminosity);
44 >  dout << "  Yields for " << (const char*) cut << endl;
45 >  dout << "     data: " << data->Integral() << endl;
46 > /*  THStack mcm = allsamples.DrawStack("mc", "mll",1,0,10000000, "m_{ll} [GeV]", "events", cut,mc,luminosity);
47    int nhists = mcm.GetHists()->GetEntries();
48 <  cout << "Going to loop over " << nhists << " histograms " << endl;
48 >  dout << "Going to loop over " << nhists << " histograms " << endl;
49    TFile *test = new TFile("test.root","RECREATE");
50    mcm.Write();
51    test->Close();
# Line 47 | Line 54 | void print_yield(TCut cut) {
54      cout << "     " << hist->GetName() << ": " << hist->Integral() << endl;
55    }
56    cout << endl << endl;
57 <  
57 >  */
58    delete data;
59   }
60  
# Line 124 | Line 131 | void print_all_b_yields() {
131    print_yield(ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000"&&"(Zb30_pfJetGoodPt[1]/pt)<0.05");
132   }  
133  
134 + void DrawEvilCutFlow() {
135 +  stringstream MegaCut;
136 +  
137 +  MegaCut << "   1*(" << (const char*) (ZplusBsel&&TCut("Zb30_pfJetGoodNumBtag>0")) << ")";
138 +  MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB) << ")";
139 +  MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB) << ")";
140 +  MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut) << ")";
141 +  MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>10&&pt<1000")) << ")";
142 +  MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>10&&pt<1000&&Zb30_alpha<0.3")) << ")";
143 +  MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>10&&pt<1000&&Zb30_alpha<0.2")) << ")";
144 +  MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>10&&pt<1000&&Zb30_alpha<0.15")) << ")";
145 +  MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>10&&pt<1000&&Zb30_alpha<0.1")) << ")";
146 +  MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>10&&pt<1000&&Zb30_alpha<0.05")) << ")";
147 +  MegaCut << " ";
148 +  
149 +  TCanvas *can = new TCanvas("can","can");
150 +  can->SetLogy(1);
151 +  TCut basecut("mll>6||mll<10");
152 +  
153 +  
154 +  
155 +  TLegend *leg = allsamples.allbglegend();
156 +  
157 +  
158 +  TH1F *data  = allsamples.Draw("data",    MegaCut.str(),11,-0.5,10.5, "", "events", basecut,data,luminosity);
159 +   THStack mcm = allsamples.DrawStack("mc", MegaCut.str(),11,-0.5,10.5, "", "events", basecut,mc,luminosity);
160 +
161 +  float runningsum=0;
162 +  for(int i=data->GetNbinsX();i>0;i--) {
163 +    runningsum+=data->GetBinContent(i);
164 +    data->SetBinContent(i,runningsum);
165 +  }
166 +  
167 +  float minimum=data->GetMaximum();
168 +  
169 +  TH1F* h;
170 +  TIter nextOF(mcm.GetHists());
171 +  while ( h = (TH1F*)nextOF() ) {
172 +    float runningsum=0;
173 +    minimum=data->GetMaximum();//done deliberately at each step so get the minimum of the last (!) contribution
174 +    for(int i=h->GetNbinsX();i>0;i--) {
175 +      runningsum+=h->GetBinContent(i);
176 +      h->SetBinContent(i,runningsum);
177 +      if(runningsum<minimum&&runningsum>0) minimum=runningsum;
178 +    }
179 +  }
180 +  
181 +  
182 +
183 +  data->SetMinimum(0.05*minimum);
184 +  can->cd(1)->SetBottomMargin(0.25);
185 +  data->GetXaxis()->SetBinLabel(1,"Pre-selection");
186 +  data->GetXaxis()->SetBinLabel(2,"Contains b jet");
187 +  data->GetXaxis()->SetBinLabel(3,"Leading jet is b-jet");
188 +  data->GetXaxis()->SetBinLabel(4,"|#eta_{b}|<1.3 ");
189 +  data->GetXaxis()->SetBinLabel(5,"|#delta#phi(b,Z)|>2.7");
190 +  data->GetXaxis()->SetBinLabel(6,"10<p_{T}^{Z}<1000 GeV");
191 +  data->GetXaxis()->SetBinLabel(7,"#alpha < 0.3");
192 +  data->GetXaxis()->SetBinLabel(8,"#alpha < 0.2");
193 +  data->GetXaxis()->SetBinLabel(9,"#alpha < 0.15");
194 +  data->GetXaxis()->SetBinLabel(10,"#alpha < 0.1");
195 +  data->GetXaxis()->SetBinLabel(11,"#alpha < 0.05");
196 +  data->GetXaxis()->LabelsOption("v");
197 +  
198 +  data->Draw("e1");
199 +  mcm.Draw("same");
200 +  data->Draw("same,e1,axis");
201 +  data->Draw("same,e1");
202 + //  data->Draw("same,TEXT");
203 +  
204 +  leg->Draw();
205 +  
206 +  DrawPrelim();
207 +  
208 +  CompleteSave(can,"CutFlow");
209 + }
210 +
211   void draw_Zb_kin_vars() {
212     draw_kin_variable("pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000",25,0,200,"Z p_{T}","Official/Zpt",1);
129
213     draw_kin_variable("Zb30_pfJetGoodPt[1]",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000",25,0,200,"Sub-Leading Jet Pt","Official/Jet2Pt",1);
214     draw_kin_variable("Zb30_pfJetGoodPt[0]",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000",25,0,200,"Leading Jet Pt (B)","Official/LeadingJetPt",1);
215     draw_kin_variable("Zb30_pfJetGoodPt[1]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000",20,0,2,"p_{T}^{J2} / p_{T}^{Z}","Official/SubLeadingJetPt_Over_ZPt",1);
216 <    draw_kin_variable("Zb30_pfJetGoodPt[1]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<50",20,0,2,"#alpha","Official/alpha_pt_10_to_50",1);
217 <    draw_kin_variable("Zb30_pfJetGoodPt[1]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>50&&pt<100",20,0,2,"#alpha","Official/alpha_50_to_100",1);
218 <    draw_kin_variable("Zb30_pfJetGoodPt[1]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>100&&pt<200",20,0,2,"#alpha","Official/alpha_pt_100_to_200",1);
219 <    draw_kin_variable("Zb30_pfJetGoodPt[1]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>200&&pt<1000",20,0,2,"#alpha","Official/alpha_pt_200_to_1000",1);
216 >   draw_kin_variable("Zb30_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<50",   20,0,2,"#alpha","Official/alpha_pt_10_to_50",1);
217 >   draw_kin_variable("Zb30_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>50&&pt<100",  20,0,2,"#alpha","Official/alpha_50_to_100",1);
218 >   draw_kin_variable("Zb30_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>100&&pt<200", 20,0,2,"#alpha","Official/alpha_pt_100_to_200",1);
219 >   draw_kin_variable("Zb30_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>200&&pt<1000",20,0,2,"#alpha","Official/alpha_pt_200_to_1000",1);
220    
221    draw_kin_variable("pfBJetDphiZ[0]",ZplusBsel&&LeadingB&&"pt>10&&pt<1000&&pfBJetDphiZ[0]>0",30,0,3.2,"#delta#phi (Z,b lead)","DeltaPhiZBlead",0);
222    
# Line 415 | Line 498 | void new_data_mc_agreement_2d() {
498  
499  
500  
501 + void compare_selection(string identifier) {
502 +  bool recognized_scenario=false;
503 +  
504 +  cout << "Running with identifier " << identifier << endl;
505 +  if(identifier=="Zb30") {
506 +      LeadingB=TCut ("Zb30_bTagProbCSVBP[0]>0.679");
507 +      EtaB=TCut("abs(Zb30_pfJetGoodEta[0])<1.3");
508 +      PhiZcut=TCut("abs(Zb30_pfJetDphiZ[0])>2.7");
509 +      recognized_scenario=true;
510 +  }
511 +  
512 +  if(identifier=="Zb2030") {
513 +      LeadingB=TCut ("Zb2030_bTagProbCSVBP[0]>0.679");
514 +      EtaB=TCut("abs(Zb2030_pfJetGoodEta[0])<1.3");
515 +      PhiZcut=TCut("abs(Zb2030_pfJetDphiZ[0])>2.7");
516 +      recognized_scenario=true;
517 +  }
518 +  
519 +  if(identifier=="Zb1530") {
520 +      LeadingB=TCut ("Zb1530_bTagProbCSVBP[0]>0.679");
521 +      EtaB=TCut("abs(Zb1530_pfJetGoodEta[0])<1.3");
522 +      PhiZcut=TCut("abs(Zb1530_pfJetDphiZ[0])>2.7");
523 +      recognized_scenario=true;
524 +  }
525 +  
526 +  if(identifier=="Zb3010") {
527 +      LeadingB=TCut ("Zb3010_bTagProbCSVBP[0]>0.679");
528 +      EtaB=TCut("abs(Zb3010_pfJetGoodEta[0])<1.3");
529 +      PhiZcut=TCut("abs(Zb3010_pfJetDphiZ[0])>2.7");
530 +      recognized_scenario=true;
531 +  }
532 +  
533 +  if(identifier=="Zb30_SecEta3") {
534 +      LeadingB=TCut ("Zb30_SecEta3_bTagProbCSVBP[0]>0.679");
535 +      EtaB=TCut("abs(Zb30_SecEta3_pfJetGoodEta[0])<1.3");
536 +      PhiZcut=TCut("abs(Zb30_SecEta3_pfJetDphiZ[0])>2.7");
537 +      recognized_scenario=true;
538 +  }
539 +  
540 +  if(identifier=="Zb30_SecEta5") {
541 +      LeadingB=TCut ("Zb30_SecEta5_bTagProbCSVBP[0]>0.679");
542 +      EtaB=TCut("abs(Zb30_SecEta5_pfJetGoodEta[0])<1.3");
543 +      PhiZcut=TCut("abs(Zb30_SecEta5_pfJetDphiZ[0])>2.7");
544 +      recognized_scenario=true;
545 +  }
546 +  
547 +  if(identifier=="Zb30_p5Clean") {
548 +      LeadingB=TCut ("Zb30_p5Clean_bTagProbCSVBP[0]>0.679");
549 +      EtaB=TCut("abs(Zb30_p5Clean_pfJetGoodEta[0])<1.3");
550 +      PhiZcut=TCut("abs(Zb30_p5Clean_pfJetDphiZ[0])>2.7");
551 +      recognized_scenario=true;
552 +  }
553 +  
554 +  if(identifier=="Zb30CHS") {
555 +      LeadingB=TCut ("Zb30CHS_bTagProbCSVBP[0]>0.679");
556 +      EtaB=TCut("abs(Zb30CHS_pfJetGoodEta[0])<1.3");
557 +      PhiZcut=TCut("abs(Zb30CHS_pfJetDphiZ[0])>2.7");
558 +      recognized_scenario=true;
559 +  }
560 +  
561 +  assert(recognized_scenario);
562 +  
563 +  cout << "Cuts: " << endl;
564 +  cout << "   " << (const char*) LeadingB << endl;
565 +  cout << "   " << (const char*) EtaB << endl;
566 +  cout << "   " << (const char*) PhiZcut << endl;
567 +  
568 +  cout << endl << endl;
569 +  
570 +  SpecialCutFlow(identifier);
571 +  draw_kin_variable("pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000",25,0,200,"Z p_{T}","Official/Zpt__"+identifier,1);
572 +  draw_kin_variable(identifier+"_pfJetGoodPt[0]",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000",40,0,200,"Leading Jet Pt (B)","Official/LeadingJetPt__"+identifier,1);
573 +  draw_kin_variable(identifier+"_pfJetGoodPt[1]",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000",40,0,200,"Sub-Leading Jet Pt [GeV]","Official/Jet2Pt__"+identifier,1);
574 +  draw_kin_variable(identifier+"_pfJetGoodPt[1]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000",20,0,2,"p_{T}^{J2} / p_{T}^{Z}","Official/SubLeadingJetPt_Over_ZPt__"+identifier,1);
575 +  draw_kin_variable(identifier+"_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<50",20,0,2,"#alpha","Official/alpha_pt_10_to_50__"+identifier,1);
576 +  draw_kin_variable(identifier+"_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>50&&pt<100",20,0,2,"#alpha","Official/alpha_50_to_100__"+identifier,1);
577 +  draw_kin_variable(identifier+"_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>100&&pt<200",20,0,2,"#alpha","Official/alpha_pt_100_to_200__"+identifier,1);
578 +  draw_kin_variable(identifier+"_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>200&&pt<1000",20,0,2,"#alpha","Official/alpha_pt_200_to_1000__"+identifier,1);
579 +  draw_kin_variable(identifier+"_pfBJetDphiZ[0]",ZplusBsel&&LeadingB&&"pt>10&&pt<1000&&pfBJetDphiZ[0]>0",30,0,3.2,"#delta#phi (Z,b lead)","DeltaPhiZBlead__"+identifier,0);
580 +  
581 +  draw_kin_variable("mpf",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut(((string)"pt>10&&pt<1000&&"+identifier+"_alpha<0.3").c_str()),20,0,2,"Z+b MPF","mpf_alpha_smaller_0p3___"+identifier,0,"#alpha<0.3, 10 GeV < p_{T}^{Z} < 1000 GeV");
582 +  draw_kin_variable(identifier+"_pfJetGoodPt[0]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut(((string)"pt>10&&pt<1000&&"+identifier+"_alpha<0.3").c_str()),20,0,2,"p_{T} b-jet / p_{T} Z","ptb_over_ptz___alpha_smaller_0p3______"+identifier,0,"#alpha<0.3, 10 GeV < p_{T}^{Z} < 1000 GeV");
583 +
584 +  
585 +  
586 +  
587 + }
588 +
589   void do_basic_ZB_analysis() {
590    TCanvas *zbcanvas = new TCanvas("zbcanvas","zbcanvas");
591    
592 < //  print_all_b_yields();
592 > //    compare_selection("Zb30_p5Clean");
593 >    compare_selection("Zb30CHS");
594 >  compare_selection("Zb30");
595 >  compare_selection("Zb2030");
596 >  compare_selection("Zb1530");
597 >  compare_selection("Zb3010");
598 >  compare_selection("Zb30_SecEta3");
599 >  compare_selection("Zb30_SecEta5"); // buggy, ntuples need to be updated
600 >  
601 >  
602 >  
603 > //    print_all_b_yields();
604   //  draw_mpf_vars();
605 <  draw_Zb_kin_vars();
605 > //  DrawEvilCutFlow();
606 >  
607 > //  draw_Zb_kin_vars();
608 >  
609 > //  new_data_mc_agreement_2d();
610    
425  new_data_mc_agreement_2d();
611    
612    delete zbcanvas;
613   }
614 +
615 +
616 +
617 +
618 + //*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*  DELETE EVERYTHING BELOW THIS LINE /*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*//
619 +
620 +
621 + const char* concatenate(string bla1, string bla2) {
622 +  stringstream bla;
623 +  bla << bla1 << bla2;
624 +  return bla.str().c_str();
625 + }
626 +
627 + void SpecialCutFlow(string identifier) {
628 +  stringstream MegaCut;
629 +  
630 +  
631 +  
632 +  MegaCut << "   1*(" << (const char*) (ZplusBsel&&TCut(concatenate(identifier,"_pfJetGoodNumBtag>0"))) << ")";
633 +  MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB) << ")";
634 +  MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB) << ")";
635 +  MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut) << ")";
636 +  MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>10&&pt<1000")) << ")";
637 +  MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>10&&pt<1000&&Zb30_alpha<0.3")) << ")";
638 +  MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>10&&pt<1000&&Zb30_alpha<0.2")) << ")";
639 +  MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>10&&pt<1000&&Zb30_alpha<0.15")) << ")";
640 +  MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>10&&pt<1000&&Zb30_alpha<0.1")) << ")";
641 +  MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>10&&pt<1000&&Zb30_alpha<0.05")) << ")";
642 +  MegaCut << " ";
643 +  
644 +  TCanvas *can = new TCanvas("can","can");
645 +  can->SetLogy(1);
646 +  TCut basecut("mll>6||mll<10");
647 +  
648 +  
649 +  
650 +  TLegend *leg = allsamples.allbglegend();
651 +  
652 +  
653 +  TH1F *data  = allsamples.Draw("data",    MegaCut.str(),11,-0.5,10.5, "", "events", basecut,data,luminosity);
654 +   THStack mcm = allsamples.DrawStack("mc", MegaCut.str(),11,-0.5,10.5, "", "events", basecut,mc,luminosity);
655 +
656 +  float runningsum=0;
657 +  for(int i=data->GetNbinsX();i>0;i--) {
658 +    runningsum+=data->GetBinContent(i);
659 +    data->SetBinContent(i,runningsum);
660 +  }
661 +  
662 +  float minimum=data->GetMaximum();
663 +  
664 +  TH1F* h;
665 +  TIter nextOF(mcm.GetHists());
666 +  
667 +  float mcsum=0;
668 +  float zb=0;
669 +  while ( h = (TH1F*)nextOF() ) {
670 +    float runningsum=0;
671 +    minimum=data->GetMaximum();//done deliberately at each step so get the minimum of the last (!) contribution
672 +    for(int i=h->GetNbinsX();i>0;i--) {
673 +      runningsum+=h->GetBinContent(i);
674 +      h->SetBinContent(i,runningsum);
675 +      if(runningsum<minimum&&runningsum>0) minimum=runningsum;
676 +    }
677 +    if(Contains(h->GetName(),"Z_b_")) {
678 +      zb=h->GetBinContent(h->GetNbinsX());
679 +    }
680 +    mcsum+=h->GetBinContent(h->GetNbinsX());
681 +  }
682 +  
683 +  
684 +
685 +  data->SetMinimum(0.05*minimum);
686 +  can->cd(1)->SetBottomMargin(0.25);
687 +  data->GetXaxis()->SetBinLabel(1,"Pre-selection");
688 +  data->GetXaxis()->SetBinLabel(2,"Contains b jet");
689 +  data->GetXaxis()->SetBinLabel(3,"Leading jet is b-jet");
690 +  data->GetXaxis()->SetBinLabel(4,"|#eta_{b}|<1.3 ");
691 +  data->GetXaxis()->SetBinLabel(5,"|#delta#phi(b,Z)|>2.7");
692 +  data->GetXaxis()->SetBinLabel(6,"10<p_{T}^{Z}<1000 GeV");
693 +  data->GetXaxis()->SetBinLabel(7,"#alpha < 0.3");
694 +  data->GetXaxis()->SetBinLabel(8,"#alpha < 0.2");
695 +  data->GetXaxis()->SetBinLabel(9,"#alpha < 0.15");
696 +  data->GetXaxis()->SetBinLabel(10,"#alpha < 0.1");
697 +  data->GetXaxis()->SetBinLabel(11,"#alpha < 0.05");
698 +  data->GetXaxis()->LabelsOption("v");
699 +  
700 +  stringstream purityinfo;
701 +  purityinfo << "Purity: " << std::setprecision(3) << 100*zb/mcsum << " %";
702 +  stringstream neventsinfo;
703 +  neventsinfo << "Nevents: " << data->GetBinContent(data->GetNbinsX());
704 +  TH1F *crap = new TH1F("crap","",1,0,1);
705 +  crap->SetLineColor(kWhite);
706 +  leg->AddEntry(crap,purityinfo.str().c_str(),"l");
707 +  leg->AddEntry(crap,neventsinfo.str().c_str(),"l");
708 +  
709 +  data->Draw("e1");
710 +  mcm.Draw("same");
711 +  data->Draw("same,e1,axis");
712 +  data->Draw("same,e1");
713 + //  data->Draw("same,TEXT");
714 +  
715 +  leg->Draw();
716 +  
717 +  DrawPrelim();
718 +  
719 +  CompleteSave(can,"CutFlow___"+identifier);
720 +  
721 +  delete crap;
722 +  delete data;
723 +  
724 +  
725 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines