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.28 by buchmann, Wed Jan 16 17:11:23 2013 UTC vs.
Revision 1.32 by buchmann, Thu Jan 24 08:21:38 2013 UTC

# Line 1329 | Line 1329 | Double_t MarcosChi2TestX(const TH1* h1,
1329     return prob;
1330   }
1331  
1332 < void save_with_ratio(TH1F *nominator, TH1F *denominator, TVirtualPad *canvas, string savemeas, bool do_bpred_ratio=false, bool extendrange=false, string yaxistitle="ratio",TH1F *syshisto=NULL) {
1332 > void Save_With_Ratio(TH1F *nominator, TH1F *denominator, TVirtualPad *orig_canvas, string savemeas, bool do_bpred_ratio=false, bool extendrange=false, string yaxistitle="ratio",TH1F *syshisto=NULL) {
1333    //this function saves the pad being passed as well as a new one including the ratio.
1334 +  
1335 +  TVirtualPad *canvas = (TVirtualPad*) orig_canvas->Clone("TempCanvas");//otherwise the main_canvas will own our pad and destroy it upon deletion
1336    CompleteSave(canvas,savemeas);
1337 <
1337 >  
1338    float bottommargin=gStyle->GetPadBottomMargin();
1339    float canvas_height=gStyle->GetCanvasDefH();
1340    float canvas_width=gStyle->GetCanvasDefW();
# Line 1499 | Line 1501 | void save_with_ratio(TH1F *nominator, TH
1501   //  Chi2text << "KS = " << KS << endl;
1502   //cout << "Found : " << KStext.str() << endl;
1503  
1504 +  delete eratio;
1505 +  delete ratio_center;
1506 +  delete ratio;
1507    delete main_canvas;
1508   }
1509  
1510 < void save_with_ratio_and_sys_band(TH1F *nominator, TH1F *denominator, TVirtualPad *canvas, string savemeas, bool do_bpred_ratio=false, bool extendrange=false, string yaxistitle="ratio",TH1F *syshisto=NULL) {
1510 > 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) {
1511    //this function saves the pad being passed as well as a new one including the SysRatio.
1512 +  TVirtualPad *canvas = (TVirtualPad*) orig_canvas->Clone("TempCanvas");//otherwise the main_canvas will own our pad and destroy it upon deletion
1513    CompleteSave(canvas,savemeas);
1514  
1515    float bottommargin=gStyle->GetPadBottomMargin();
# Line 1632 | Line 1638 | void save_with_ratio_and_sys_band(TH1F *
1638    
1639    CompleteSave(main_canvas,savemeas+"_withSysRatio_and_Chi2");
1640    delete main_canvas;
1641 +  delete ratio;
1642   }
1643  
1644 < TH1F* CollapseStack(THStack stack,TString hname="base") {
1644 > TH1F* CollapseStack(THStack stack,TString hname="CollapsedStack") {
1645     TH1F *bhist = ((TH1F*)((stack.GetHists())->At(0)));
1646     TH1F *basehisto = (TH1F*)bhist->Clone(hname);
1647     TIter next(stack.GetHists());
# Line 1648 | Line 1655 | TH1F* CollapseStack(THStack stack,TStrin
1655     return basehisto;
1656   }
1657  
1658 < void save_with_ratio(TH1F *nominator, THStack denominator, TVirtualPad *canvas, string savemeas, bool do_bpred_ratio=false) {
1659 <  save_with_ratio(nominator, CollapseStack(denominator), canvas, savemeas, do_bpred_ratio);
1658 > void Save_With_Ratio(TH1F *nominator, THStack denominator, TVirtualPad *canvas, string savemeas, bool do_bpred_ratio=false) {
1659 >  TH1F *denominator_histo = (TH1F*) CollapseStack(denominator);
1660 >  Save_With_Ratio(nominator, denominator_histo, canvas, savemeas, do_bpred_ratio);
1661 >  delete denominator_histo;
1662   }
1663  
1664   void flag_this_change(string function, int line, int checked=0) {
# Line 1991 | Line 2000 | void FindMinMax(TGraphErrors *gr, float
2000  
2001  
2002   void CleanLegends() {
1994  cout << "----------------------- before deleting anything -----------------------" << endl;
1995  gROOT->ls();
1996  cout << "---------------------- /before deleting anything -----------------------" << endl;
1997  
2003    for(int ihist=(int)PlottingSetup::FakeHistoHeap.size()-1;ihist>=0;ihist--) {
1999    cout << "Deleting item " << ihist << endl;
2000    cout << "    " << PlottingSetup::FakeHistoHeap[ihist]->GetName() << " , " << PlottingSetup::FakeHistoHeap[ihist]->GetTitle() << endl;
2004      PlottingSetup::FakeHistoHeap[ihist]->Delete();
2005      PlottingSetup::FakeHistoHeap.pop_back();
2006    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines