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

Comparing UserCode/cbrown/Development/Plotting/Modules/GeneralToolBox.C (file contents):
Revision 1.35 by buchmann, Mon Feb 25 15:36:39 2013 UTC vs.
Revision 1.38 by buchmann, Tue Apr 9 14:13:51 2013 UTC

# Line 67 | Line 67 | namespace PlottingSetup {
67      bool is53reco=true;
68      bool openBox = true;
69      vector<TH1F*> FakeHistoHeap;
70 <
70 >    bool DrawMetSignalRegionMllLines=false; // whether to draw the lines in mll plots for the MET signal region
71 >    float ConsideredZWidth=20;
72   }
73  
74   bool dopng=false;
# Line 94 | Line 95 | void write_error(string funcname, string
95   void write_info(string funcname, string text);
96   string get_directory();
97   bool Contains(string wholestring, string findme);
98 + TH1F* CollapseStack(THStack stack,TString hname);
99   //-------------------------------------------------------------------------------------
100  
101   template<typename U>
# Line 597 | Line 599 | void DrawPrelim(float writelumi=generalt
599    string prel=" Preliminary";
600    if(PlottingSetup::PaperMode) prel="";
601    //prelimtext << "CMS Preliminary 2011 , #sqrt{s}= 7 TeV, L= O(1) fb^{-1}"; //temporary replacement
602 <  if(PlottingSetup::is53reco) prel += " 53X";
602 > //  if(PlottingSetup::is53reco) prel += " 53X";
603    string energy="7 TeV";
604    if(PlottingSetup::is2012) energy="8 TeV";
605    if(writelumi == 0) {
606      if(isMC) prelimtext << "CMS Simulation, #sqrt{s} = " << energy;
607      else prelimtext << "CMS" << prel << ", #sqrt{s} = " << energy;
608    } else {
609 <    if(isMC) prelimtext << "CMS Simulation, #sqrt{s} = " << energy << ", L_{int} = " << std::setprecision(3) <<writelumi<<" "<<barn<<"^{-1}";
610 <     else prelimtext << "CMS" << prel << ", #sqrt{s} = " << energy << ", L_{int} = " << std::setprecision(3) <<writelumi<<" "<<barn<<"^{-1}";
609 >    if(isMC) prelimtext << "CMS Simulation, #sqrt{s} = " << energy << ", #scale[0.6]{#int} L dt = " << std::setprecision(3) <<writelumi<<" "<<barn<<"^{-1}";
610 >     else prelimtext << "CMS" << prel << ", #sqrt{s} = " << energy << ", #scale[0.6]{#int} L dt = " << std::setprecision(3) <<writelumi<<" "<<barn<<"^{-1}";
611    }
612    TPaveText *eventSelectionPaveText = new TPaveText(0.27, 0.93,0.77, 1.0,"blNDC");
613    eventSelectionPaveText->SetFillStyle(4000);
# Line 1308 | Line 1310 | TGraphAsymmErrors* produce_ratio_graph(T
1310   }
1311  
1312  
1313 < TText* WriteSelection(int njets) {
1313 > TLatex* WriteSelection(int njets) {
1314    string sel="Loose selection";
1315 <  if(njets==3) sel="Tight selection";
1315 >  if(njets==3) sel="Low E_{T}^{miss}";
1316    assert(njets==2||njets==3);
1317 <  TText *sele = new TText(0.97,0.135,sel.c_str());
1317 >  TLatex *sele = new TLatex(0.97,0.135,sel.c_str());
1318    sele->SetNDC(true);
1319    sele->SetTextColor(TColor::GetColor("#848484"));
1320    sele->SetTextFont(42);
# Line 1477 | Line 1479 | void Save_With_Ratio(TH1F *nominator, TH
1479    oneline->SetLineStyle(2);
1480    oneline->SetLineColor(kBlue);
1481    oneline->Draw("same");
1482 +  
1483 +  if(PlottingSetup::DrawMetSignalRegionMllLines) {
1484 +    cout << "Drawing extra lines in ratio this time around ... " << endl;
1485 +    float RatioYMax=2.0;
1486 +    if(extendrange) RatioYMax=4.0;
1487 +    
1488 +    TLine *SRline   = new TLine(70,0,70,RatioYMax);
1489 +    TLine *ZLowLine = new TLine(91.2-PlottingSetup::ConsideredZWidth,0,91.2-PlottingSetup::ConsideredZWidth,RatioYMax);
1490 +    TLine *ZHiLine  = new TLine(91.2+PlottingSetup::ConsideredZWidth,0,91.2+PlottingSetup::ConsideredZWidth,RatioYMax);
1491 +  
1492 +    SRline->SetLineStyle(2);
1493 +    ZLowLine->SetLineStyle(2);
1494 +    ZHiLine->SetLineStyle(2);
1495 +    SRline->SetLineColor(kGray+2);
1496 +    ZLowLine->SetLineColor(kGray+2);
1497 +    ZHiLine->SetLineColor(kGray+2);
1498 +    SRline->Draw();
1499 +    ZLowLine->Draw();
1500 +    ZHiLine->Draw();
1501 +  }
1502 +      
1503 +
1504  
1505    Ratio_main_canvas->cd();
1506    Ratio_main_canvas->Modified();
# Line 1524 | Line 1548 | void Save_With_Ratio(TH1F *nominator, TH
1548    delete Ratio_main_canvas;
1549   }
1550  
1551 < void save_with_ratio_and_sys_band(TH1F *nominator, TH1F *denominator, TVirtualPad *orig_canvas, string savemeas, bool do_bpred_ratio=false, bool extendrange=false, string yaxistitle="ratio",TH1F *syshisto=NULL) {
1551 > void Save_With_Ratio_And_Line(TH1F *nominator, TH1F *denominator, TVirtualPad *orig_canvas, string savemeas, bool do_bpred_ratio=false, bool extendrange=false, string yaxistitle="ratio",TH1F *syshisto=NULL) {
1552 >  PlottingSetup::ConsideredZWidth=10.0;
1553 >  PlottingSetup::DrawMetSignalRegionMllLines=true;
1554 >  Save_With_Ratio(nominator, denominator, orig_canvas, savemeas, do_bpred_ratio, extendrange, yaxistitle,syshisto);
1555 >  PlottingSetup::DrawMetSignalRegionMllLines=false;
1556 > }
1557 >  
1558 > void Save_With_Ratio_And_Line(TH1F *nominator, THStack denominator, TVirtualPad *canvas, string savemeas, bool do_bpred_ratio=false) {
1559 >  TH1F *denominator_histo = (TH1F*) CollapseStack(denominator,"TemporaryStack");
1560 >  Save_With_Ratio_And_Line(nominator, denominator_histo, canvas, savemeas, do_bpred_ratio);
1561 >  delete denominator_histo;
1562 > }
1563 >
1564 > void save_with_ratio_and_sys_band(float ConsideredZWidth, TH1F *nominator, TH1F *denominator, TVirtualPad *orig_canvas, string savemeas, bool do_bpred_ratio=false, bool extendrange=false, string yaxistitle="ratio",TH1F *syshisto=NULL) {
1565    //this function saves the pad being passed as well as a new one including the SysRatio.
1566    orig_canvas->cd();
1567    orig_canvas->Update();
# Line 1623 | Line 1660 | void save_with_ratio_and_sys_band(TH1F *
1660    oneline->SetLineStyle(2);
1661    oneline->SetLineColor(kBlue);
1662    oneline->Draw("same");
1663 +  
1664 +  
1665 +  
1666 +  if(ConsideredZWidth>0.1) {
1667 +    cout << "Drawing extra lines in ratio this time around ... " << endl;
1668 +    float RatioYMax=2.0;
1669 +    if(extendrange) RatioYMax=4.0;
1670 +    
1671 +    TLine *SRline   = new TLine(70,0,70,RatioYMax);
1672 +    TLine *ZLowLine = new TLine(91.2-ConsideredZWidth,0,91.2-ConsideredZWidth,RatioYMax);
1673 +    TLine *ZHiLine  = new TLine(91.2+ConsideredZWidth,0,91.2+ConsideredZWidth,RatioYMax);
1674 +  
1675 +    SRline->SetLineStyle(2);
1676 +    ZLowLine->SetLineStyle(2);
1677 +    ZHiLine->SetLineStyle(2);
1678 +    SRline->SetLineColor(kGray+2);
1679 +    ZLowLine->SetLineColor(kGray+2);
1680 +    ZHiLine->SetLineColor(kGray+2);
1681 +    SRline->Draw();
1682 +    ZLowLine->Draw();
1683 +    ZHiLine->Draw();
1684 +  }
1685  
1686    Ratio_main_canvas->cd();
1687    Ratio_main_canvas->Modified();
# Line 1906 | Line 1965 | TPolyLine* GetFitUncertaintyShape(TF1 *f
1965    y[nPoints]=y[0];
1966    
1967    TPolyLine *l = new TPolyLine(nPoints+1,x,y);
1968 <  l->SetFillColor(TColor::GetColor("#5858FA"));
1969 <  l->SetLineColor(TColor::GetColor("#5858FA"));
1968 >  l->SetFillColor(TColor::GetColor("#A2A2FA"));
1969 >  l->SetLineColor(TColor::GetColor("#A2A2FA"));
1970    l->SetLineWidth(1);
1971    return l;
1972   }  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines