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

Comparing UserCode/cbrown/Development/Plotting/Modules/ExclusionPlot.C (file contents):
Revision 1.3 by buchmann, Fri Mar 23 10:49:23 2012 UTC vs.
Revision 1.9 by buchmann, Mon Apr 30 08:39:44 2012 UTC

# Line 2 | Line 2
2   #include <vector>
3   #include <sys/stat.h>
4   #include <sstream>
5 + #include <assert.h>
6  
7   #include <TCut.h>
8   #include <TLatex.h>
# Line 41 | Line 42 | float indentedmargin=0.16;
42  
43   bool drawefficiencydesertline=false;
44  
45 + bool wrongwaytodothis=true;
46 +
47   string xsecfilename;
48  
49 +
50   void set_range(TH2F *histo, int scantype, bool pushoutlabels);
51   void smooth_line(TGraph *gr);
52 + void draw_diagonal_xchange(int scantype, std::string scanx);
53   TH2F* adjust_histo(TH2F *oldhist, TH2F *refhisto);
54   TGraph* get_mSUGRA_exclusion_line(TH2F *exclusionhisto, int scantype);
55   TGraph* thin_line(TGraph *gr);
56   TGraph *MarcosExclusionLine(TH2F *exclusionshape, int scantype);
57 + TH2F* get_XS(string filename, string mass, TH2F *histo);
58 +
59 + float getSMSxs(float mlsp,float mglu) {
60 +  TH2F *refh  =  new TH2F("ReferenceHisto","ReferenceHisto",(int)((mgluend-mglustart)/mglustep+1),mglustart-0.5*mglustep,mgluend+0.5*mglustep,int((mLSPend-mLSPstart)/mLSPstep+1),mLSPstart-0.5*mLSPstep,mLSPend+0.5*mLSPstep);
61 +  refh->SetBinContent(refh->FindBin(mglu,mlsp),1);//only compute the cross section for our point
62 +  TFile *xsecfile = new TFile((PlottingSetup::cbafbasedir+"/"+PlottingSetup::SMSReferenceXSFile).c_str());
63 +  if(xsecfile->IsZombie()) {
64 +      write_error(__FUNCTION__,"Cross section file is invalid!!!!");
65 +      return -1;
66 +  }
67 +  xsecfile->Close();
68 +  delete xsecfile;
69 +  TH2F *xsec = adjust_histo(get_XS(PlottingSetup::cbafbasedir+"/"+PlottingSetup::SMSReferenceXSFile,"gluino",refh),refh);
70 +  int GlobalBin = xsec->FindBin(mglu,mlsp);
71 +  float refxs=xsec->GetBinContent(GlobalBin);
72 +  delete refh;
73 +  delete xsec;
74 +  return refxs;
75 + }
76  
77   void write_SMS_text(int scantype, std::string& scanx, float xpos = 0.22 ) {
78    string legT5zz="pp #rightarrow  #tilde{g} #tilde{g}, #tilde{g} #rightarrow 2j + #chi^{0}_{2}, #chi^{0}_{2} #rightarrow Z #chi^{0}_{1}";
# Line 73 | Line 97 | void write_SMS_text(int scantype, std::s
97    //  if(scantype==PlottingSetup::GMSB) title3->Draw("same");
98   }
99  
100 + void draw_diagonal_xchange(int scantype, std::string scanx = "" ) {
101 +  // Line marking the diagonal
102 +  TLine *line;
103 +  float verticaloffset=0.0;
104 +  if(scantype==PlottingSetup::GMSB) verticaloffset=75.0;
105 +  line = new TLine(50.+75.0, 50.0+verticaloffset, 1200., 1200.0-75.0+verticaloffset);
106 +  line->SetLineStyle(7);
107 +  line->SetLineWidth(4);
108 +  //line->Draw("same"); // Do not draw: draw the other one instead
109 +  
110 +  // Add a dashed line to indicate where x changes
111 +  float offset = 0.;
112 +  if ( 0 == scanx.compare("0.5") ) { offset = 91.2/0.5; }
113 +  else if ( 0 == scanx.compare("0.25") ) { offset = 91.2/0.25; }
114 +  else if ( 0 == scanx.compare("0.75") ) { offset = 91.2/0.75; }
115 +  else if ( scantype==PlottingSetup::GMSB) { offset = 0; };
116 +  
117 +  if ( offset>0. ) {
118 +    line->DrawLine(50+offset, 50.0, 1175., 1175.0-offset);
119 +  }else if ( scantype==PlottingSetup::GMSB ) {
120 +    line->DrawLine(100, 100, 1175., 1175.0-offset);
121 + }
122 + }
123 +
124   void fill_with_text(TGraph *real, TGraph *down, TGraph *up, TVirtualPad *can, int scantype, std::string scanx = "") {
125    can->cd();
126    float xpos_of_text = 0.22;
127    TLegend* this_leg = new TLegend(xpos_of_text,0.6,0.38,0.75);
128 +  //TLegend* this_leg = new TLegend(xpos_of_text,0.55,0.45,0.75,"n_{jets} #geq 3"); // this was the style of the paper.
129    this_leg->SetFillColor(0);
130    this_leg->SetBorderSize(0);
131    this_leg->SetTextSize(0.035);
132 +  //this_leg->SetTextSize(0.04); // paper style.
133    if(scantype==PlottingSetup::SMS||scantype==PlottingSetup::GMSB) {
134      //this_leg->AddEntry(real,"#sigma^{prod} = #sigma^{NLO-QCD}" , "l");
135      //this_leg->AddEntry(up,"#sigma^{prod} = 3 #times #sigma^{NLO-QCD}" , "l");
# Line 92 | Line 142 | void fill_with_text(TGraph *real, TGraph
142    }
143      
144    this_leg->Draw();
145 <
145 >  TText *title = write_text(xpos_of_text+0.005,0.52,"JZB");
146 >  title->SetTextSize(0.04);
147 >  title->SetTextAlign(13);
148 >  title->SetTextFont(62);
149 >  title->Draw();
150 >  
151    write_SMS_text( scantype, scanx, xpos_of_text );
152    
153   //  //string legT5zz="pp #rightarrow  #tilde{g} #tilde{g}, #tilde{g} #rightarrow 2j + #chi^{0}_{1}, #chi^{0}_{1} #rightarrow Z + #tilde{G}";
# Line 113 | Line 168 | void fill_with_text(TGraph *real, TGraph
168   //  title3->SetTextColor(kRed);
169   ////  if(scantype==PlottingSetup::GMSB) title3->Draw("same");
170    DrawPrelim();
171 <  TLine *line;
117 <  float verticaloffset=0.0;
118 <  if(scantype==PlottingSetup::GMSB) verticaloffset=75.0;
119 <  line = new TLine(50.+75.0, 50.0+verticaloffset, 1200., 1200.0-75.0+verticaloffset);
120 <  line->SetLineStyle(2);
121 <  line->SetLineWidth(2);
122 <  line->Draw("same");
171 >  draw_diagonal_xchange( scantype, scanx );
172   }
173  
174   TH2F* prep_histo(TH2F *oldhist, int scantype) {///DONE
# Line 158 | Line 207 | TH2F* make_exclusion_shape(TH2F *excl, i
207    }
208    exclusion->SetLineColor(kBlue);
209    exclusion->SetLineWidth(2);
210 +  //exclusion->SetLineWidth(4); // paper style
211    exclusion->SetLineStyle(isprimary);
212    return exclusion;
213   }
# Line 236 | Line 286 | bool fail(double xs, double xsLimit) {re
286  
287   void get_Marias_exclusion_line(TH2F *limit_ref, float pointsX[200], float pointsY[200], int &ixNew, int &counter, int &foundDiag) {
288   // part of Mariarosaria's getRefXsecGraph function
239  double refMult = 3.0;
289    bool enough = false;
290    Int_t  nBinX= limit_ref->GetXaxis()->GetNbins();
291    Int_t  nBinY= limit_ref->GetYaxis()->GetNbins();
# Line 247 | Line 296 | void get_Marias_exclusion_line(TH2F *lim
296        if(limit_ref->GetBinContent(i,j)==0) continue;
297        if( limit_ref->GetBinContent(i,j)>0. && limit_ref->GetBinContent(i,j)<=1.) {
298          double xsLimitAbove = limit_ref->GetBinContent(i, j+1);
250        double xsLimitBelow = limit_ref->GetBinContent(i, j-1);
299  
300          double xsLimit = limit_ref->GetBinContent(i, j);
301          if((fail(1.0,xsLimitAbove)) && (!fail(1.0,xsLimit)) ) {
# Line 349 | Line 397 | TGraph *MarcosExclusionLine(TH2F *exclus
397    }
398    realgraph->SetLineColor(TColor::GetColor("#151515")); //nice black
399    realgraph->SetLineWidth(2);
400 +  //realgraph->SetLineWidth(4);//paper style
401  
402    return realgraph;
403   }
# Line 409 | Line 458 | void make_SMS_exclusion(TH2F *rawlimits,
458    TCanvas *finalcanvas = new TCanvas("finalcanvas","finalcanvas");
459    finalcanvas->SetLogz(1);
460    finalcanvas->cd();
461 <  finalcanvas->SetRightMargin(0.1);
413 < //  limits->Draw("COLZ");
461 >  limits->Draw("COLZ");
462  
463  
464    TLine *desertline;
465    if(drawefficiencydesertline) {
466          desertline = new TLine(375,50,1200,875);
467          desertline->SetLineWidth(3);
468 +        //desertline->SetLineWidth(4); // paper style
469          desertline->SetLineColor(kBlack);
470          desertline->Draw("same");
471    }
472  
473 <  TH2F *emptyh = new TH2F("emptyh","emptyh",1,1,2,1,1,2);
425 <  
426 <  SugarCoatThis(finalcanvas,10,emptyh,exclline);
427 < //  exclline->Draw("c");
473 >  exclline->Draw("c");
474  
475   //  fill_with_text(exclline,excllined3,excllinet3,finalcanvas,scantype,scanx);
476    stringstream real;
# Line 459 | Line 505 | TH1* getHisto(char * filename, char* his
505    if(!file0) return hpt_;
506    TDirectory *dir;
507    TH2D * hMuPt;
462  TH1* H;
508  
509    if(dirName == "0") {
510      hMuPt = (TH2D*) file0->Get(histoName);
# Line 592 | Line 637 | TGraph* get_mSUGRA_exclusion_line(TH2F *
637    for(int i=1;i<exclusionhisto->GetNbinsX();i++) {
638      pair<float,float> anything = find_point(exclusionhisto,i);
639      pair<float,float> intthing = find_interpolated_point(exclusionhisto,i);
595    float value=anything.second;
640      if(intthing.second>anything.second) anything.second=intthing.second;
641      if(anything.second>100&&anything.second<1500) points.push_back(anything);
642    }
# Line 610 | Line 654 | TGraph* get_mSUGRA_exclusion_line(TH2F *
654    float lastx2=0;
655    float lasty2=0;
656    
657 <  for(int i=0;i<points.size();i++) {
657 >  for(int i=0;i<(int)points.size();i++) {
658      xpoints[i]=points[i].first;
659      spoints[i]=points[i].second;
660      if(scantype==PlottingSetup::mSUGRA) {
661 <        if(i>1&&i<points.size()-1) spoints[i]=(1.0/3.0)*(points[i-1].second+points[i].second+points[i+1].second);
662 <        if(i>2&&i<points.size()-2) spoints[i]=(1.0/5.0)*(points[i-2].second+points[i-1].second+points[i].second+points[i+1].second+points[i+2].second);
663 <        if(i>3&&i<points.size()-3) spoints[i]=(1.0/7.0)*(points[i-3].second+points[i-2].second+points[i-1].second+points[i].second+points[i+1].second+points[i+2].second+points[i+3].second);
661 >        if(i>1&&i<(int)points.size()-1) spoints[i]=(1.0/3.0)*(points[i-1].second+points[i].second+points[i+1].second);
662 >        if(i>2&&i<(int)points.size()-2) spoints[i]=(1.0/5.0)*(points[i-2].second+points[i-1].second+points[i].second+points[i+1].second+points[i+2].second);
663 >        if(i>3&&i<(int)points.size()-3) spoints[i]=(1.0/7.0)*(points[i-3].second+points[i-2].second+points[i-1].second+points[i].second+points[i+1].second+points[i+2].second+points[i+3].second);
664      }
665  
666      bool usethispoint=true;
# Line 634 | Line 678 | TGraph* get_mSUGRA_exclusion_line(TH2F *
678          pointcounter++;
679      }
680    }
681 <  for(int i=pointcounter;i<points.size();i++) graph->SetPoint(i,lastx,lasty);
681 >  for(int i=pointcounter;i<=(int)points.size();i++) graph->SetPoint(i,lastx,lasty);
682    if(scantype==PlottingSetup::GMSB||scantype==PlottingSetup::SMS) {
683          //The final point will be a continuation of the last one, towards the diagonal
684          float x,y;
# Line 646 | Line 690 | TGraph* get_mSUGRA_exclusion_line(TH2F *
690    return graph;
691   }
692  
693 < void draw_mSUGRA_exclusion(TH2F *crosssection, TH2F *limitmap, TH2F *expmap, TH2F *expplusmap, TH2F *expminusmap, TH2F *exp2plusmap, TH2F *exp2minusmap) {
693 > TH2F* cast_into_shape(TH2F *origin, TH2F *reference) {
694 >  TH2F *newh = (TH2F*)reference->Clone(origin->GetName());
695 >  for(int ix=1;ix<=reference->GetNbinsX();ix++) {
696 >    for(int iy=1;iy<=reference->GetNbinsY();iy++) {
697 > //      reference->SetBinContent(ix,iy,origin->GetBinContent(ix,iy));
698 >      newh->SetBinContent(ix,iy,origin->GetBinContent(ix,iy));
699 >    }
700 >  }
701 >  return newh;
702 > }
703 >
704 > void draw_mSUGRA_exclusion(TH2F *ocrosssection, TH2F *oFilterEfficiency, TH2F *oabsXS, TH2F *limitmap, TH2F *expmap, TH2F *expplusmap, TH2F *expminusmap, TH2F *exp2plusmap, TH2F *exp2minusmap) {
705 >  TH2F *crosssection = (TH2F*)ocrosssection->Clone("crosssection");
706 > //  TH2F *limitmap = (TH2F*)olimitmap->Clone(((string)olimitmap->GetName()+"clone").c_str());
707    TH2F *cleanhisto = (TH2F*)limitmap->Clone("clean");
708    for(int ix=1;ix<=cleanhisto->GetNbinsX();ix++) {
709      for(int iy=1;iy<=cleanhisto->GetNbinsY();iy++) {
710        cleanhisto->SetBinContent(ix,iy,0);
711      }
712    }
713 +  
714 +  
715 +  TH2F *FilterEfficiency;
716 +  TH2F *absXS;
717 +
718 +  
719 +  
720 +  
721 +  write_warning(__FUNCTION__,"You'll want to switch off 'wrongwaytodothis')");
722 +  
723 +  if(wrongwaytodothis) {
724 +    //this part is the one you want to remove.
725 +    TFile *Efficiencies = new TFile("FilterEfficiencyv3.root");
726 +    FilterEfficiency = cast_into_shape((TH2F*) Efficiencies->Get("FilterEfficiency"),limitmap);
727 +    assert(FilterEfficiency);
728 +    assert(crosssection);
729 +    absXS=(TH2F*)crosssection->Clone("absXS");
730 +    crosssection->Multiply(FilterEfficiency);
731 +  } else {
732 +    //this part is the one you want to keep!
733 +    FilterEfficiency=(TH2F*)oFilterEfficiency->Clone("FilterEfficiency");
734 +    absXS=(TH2F*)oabsXS->Clone("absXS");
735 +  }
736 +    
737 +  
738  
739    TH2F *limits = (TH2F*)limitmap->Clone("limits");
740    set_range(limits,true,false);
# Line 715 | Line 797 | void draw_mSUGRA_exclusion(TH2F *crossse
797    CompleteSave(te,saveas.str());
798    delete te;
799    
800 <  TCanvas *overview = new TCanvas("overview","overview",1000,1000);
800 >  TCanvas *overview = new TCanvas("overview","overview",1500,1000);
801 >  
802    set_range(crosssection,true,false);
803    set_range(limits,true,false);
804    set_range(limitmap,true,false);
805    
806 <  TGraph *emptygraph = new TGraph(0);
724 <  
725 <  overview->Divide(2,2);
806 >  overview->Divide(3,2);
807    overview->cd(1);
808    overview->cd(1)->SetLogz(1);
809 <  crosssection->GetZaxis()->SetRangeUser(0.0001,100);
810 < //  SugarCoatThis(overview->cd(1),10,crosssection,emptygraph);
730 <  crosssection->Draw("COLZ");
809 >  absXS->GetZaxis()->SetRangeUser(0.0001,100);
810 >  absXS->Draw("COLZ");
811    TText *title0 = write_title("Cross Section");
812    title0->Draw("same");
813    overview->cd(2);
814 <  overview->cd(2)->SetLogz(1);
815 <  limits->GetZaxis()->SetRangeUser(0.1,100);
814 >  FilterEfficiency->GetZaxis()->SetRangeUser(0.01,0.7);
815 >  FilterEfficiency->Draw("COLZ");
816 >  TText *title0aa = write_title("Filter #epsilon");
817 >  title0aa->Draw("same");
818 >  overview->cd(3);
819 >  overview->cd(3)->SetLogz(1);
820 >  crosssection->GetZaxis()->SetRangeUser(0.0001,100);
821 >  crosssection->Draw("COLZ");
822 >  TText *title0a = write_title("Filter #epsilon x Cross Section");
823 >  title0a->Draw("same");
824 >  
825 >  overview->cd(4);
826 >  overview->cd(4)->SetLogz(1);
827 >  limits->GetZaxis()->SetRangeUser(0.01,100);
828    limits->Draw("COLZ");
829    TText *title1 = write_title("Cross Section Upper Limit");
830    title1->Draw("same");
831 <  overview->cd(3);
831 >  overview->cd(5);
832    limitmap->Draw("COLZ");
833    TText *title2 = write_title("UL/XS");
834    title2->Draw("same");
835    observed->Draw("c");
836 <  overview->cd(4);
837 <  overview->cd(4)->SetRightMargin(standardmargin);
836 >  overview->cd(6);
837 >  overview->cd(6)->SetRightMargin(standardmargin);
838   //  decorate_mSUGRA(cleanhisto,overview->cd(4),expected,expected2,observed);
839 <  SugarCoatThis(overview->cd(4),10,noh,observed);
839 >  SugarCoatThis(overview->cd(6),10,noh,observed);
840   //  observed->Draw("c");
841    stringstream saveas2;
842    if((int)((string)limitmap->GetName()).find("limitmap")>0) saveas2 << "Limits/exclusion_overview_for_JZB_geq_" << ((string)limitmap->GetName()).substr(((string)limitmap->GetName()).find("limitmap")+8,10);
# Line 752 | Line 844 | void draw_mSUGRA_exclusion(TH2F *crossse
844    CompleteSave(overview,saveas2.str());
845    delete overview;
846    delete noh;
847 <
847 >  delete crosssection;
848 >  delete absXS;
849 >  delete FilterEfficiency;
850    
851   }
852  
# Line 799 | Line 893 | Int_t get_exclusion_region_color(double
893  
894   float findmaxentry(vector<TH2F*> histos, int i, int j) {
895    float max = histos[0]->GetBinContent(i,j);
896 <  for(int k=0;k<histos.size();k++) {
896 >  for(int k=0;k<(int)histos.size();k++) {
897      float entry = histos[k]->GetBinContent(i,j);
898      if(entry>=max) max=entry;
899    }
# Line 815 | Line 909 | TH2F *make_best_limits(vector<TH2F*> exp
909    }
910    if(explimits.size()==0) {
911      write_warning(__FUNCTION__,"There are no expected limits! Will compute best limits based on observed limits! (WATCH OUT THIS IS DISCOURAGED!");
912 <    for(int i=0;i<obslimits.size();i++) explimits.push_back(obslimits[i]);
912 >    for(int i=0;i<(int)obslimits.size();i++) explimits.push_back(obslimits[i]);
913    }
914    TH2F *bestlimit=(TH2F*)obslimits[0]->Clone("bestlimits");
915    TH2F *bestexplimit=(TH2F*)obslimits[0]->Clone("bestexplimits");
# Line 830 | Line 924 | TH2F *make_best_limits(vector<TH2F*> exp
924        float min=findmaxentry(explimits,i,j);
925        float omin=obslimits[0]->GetBinContent(i,j);
926        int source=0;
927 <      for(int k=0;k<explimits.size();k++) {
927 >      for(int k=0;k<(int)explimits.size();k++) {
928          float currlim=explimits[k]->GetBinContent(i,j);
929          if(currlim<=min&&currlim>0) {
930            min=currlim;
# Line 863 | Line 957 | TH2F *make_best_limits(vector<TH2F*> exp
957    bestlimitsource->Draw("COL");
958    gPad->Update();
959    TLegend *sourceleg = new TLegend(0.2,0.5,0.55,0.75);
960 <  for(int i=0;i<explimits.size();i++) {
960 >  for(int i=0;i<(int)explimits.size();i++) {
961      stringstream legendentry;
962      legendentry << i+1 << " = " << give_nice_source_label(explimits[i]->GetName());
963      Int_t currcol=get_exclusion_region_color(i+1,bestlimitsource);
# Line 901 | Line 995 | void create_exclusion_plots(vector<TH2F*
995      }
996      xsecfile->Close();
997    }
998 <  if(scantype!=PlottingSetup::mSUGRA) for(int i=0;i<limits.size();i++) limits[i]->Scale(1./0.19); // because for T5zz we forced one z to decay leptonically
998 >  if(scantype!=PlottingSetup::mSUGRA) for(int i=0;i<(int)limits.size();i++) limits[i]->Scale(1./0.19); // because for T5zz we forced one z to decay leptonically
999      
1000    vector<TH2F*> explimits;
1001    vector<TH2F*> exp1mlimits;
# Line 911 | Line 1005 | void create_exclusion_plots(vector<TH2F*
1005    vector<TH2F*> obslimits;
1006    vector<TH2F*> flipmaps;
1007    vector<TH2F*> crosssections;
1008 <  
1009 <  for(int ilim=0;ilim<limits.size();ilim++) {
1008 >  vector<TH2F*> AbsCrossSection;
1009 >  vector<TH2F*> FilterEfficiencies;
1010 >  for(int ilim=0;ilim<(int)limits.size();ilim++) {
1011      if(TString(limits[ilim]->GetName()).Contains("_explimitmap")) explimits.push_back(limits[ilim]);
1012      if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_exp1plimitmap")) exp1plimits.push_back(limits[ilim]);
1013      if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_exp1mlimitmap")) exp1mlimits.push_back(limits[ilim]);
1014      if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_exp2plimitmap")) exp2plimits.push_back(limits[ilim]);
1015      if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_exp2mlimitmap")) exp2mlimits.push_back(limits[ilim]);
1016 <    if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_XS")) crosssections.push_back(limits[ilim]);
1016 > //    if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_XS")) crosssections.push_back(limits[ilim]);
1017 >    if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_absXS")) AbsCrossSection.push_back(limits[ilim]);
1018 >    if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_FilterEfficiency")) FilterEfficiencies.push_back(limits[ilim]);
1019 >    if(wrongwaytodothis) {
1020 >      if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_XS")) AbsCrossSection.push_back(limits[ilim]);
1021 >      if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_absXS")) crosssections  .push_back(limits[ilim]);
1022 >      if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_XS")) FilterEfficiencies.push_back(limits[ilim]);
1023 >    }
1024      if(TString(limits[ilim]->GetName()).Contains("_limitmap")) obslimits.push_back(limits[ilim]);
1025   //    if(TString(limits[ilim]->GetName()).Contains("_limitflipmap")) flipmaps.push_back(limits[ilim]);
1026    }
1027      
1028 + cout << "Size: " << AbsCrossSection.size() << endl;
1029    TH2F *xsec;
1030    if(scantype!=PlottingSetup::mSUGRA) xsec = adjust_histo(get_XS(xsecfilename,"gluino",limits[0]),limits[0]);
1031    vector<TH2F*> bestexplimits;
1032    TH2F *bestlimits = make_best_limits(explimits,obslimits,scantype, scanx, exp1mlimits, exp1plimits, exp2mlimits, exp2plimits, bestexplimits);
1033    bestlimits->GetZaxis()->SetRangeUser(limits_lower_bound,limits_upper_bound);
1034  
1035 <  for(int ilim=0;ilim<limits.size();ilim++) {
1035 >  for(int ilim=0;ilim<(int)limits.size();ilim++) {
1036      limits[ilim]->GetZaxis()->SetRangeUser(limits_lower_bound,limits_upper_bound);
1037    }
1038    
1039    if(scantype!=PlottingSetup::mSUGRA) {
1040 <    for(int ilim=0;ilim<obslimits.size();ilim++) make_SMS_exclusion(obslimits[ilim],xsec,scantype,scanx);
1040 >    for(int ilim=0;ilim<(int)obslimits.size();ilim++) make_SMS_exclusion(obslimits[ilim],xsec,scantype,scanx);
1041      make_SMS_exclusion(bestlimits,xsec,scantype,scanx);
1042    } else {
1043 <    for(int ilim=0;ilim<obslimits.size();ilim++) {
1044 <      draw_mSUGRA_exclusion(crosssections[0], obslimits[ilim], explimits[ilim], exp1mlimits[ilim], exp1plimits[ilim], exp2mlimits[ilim], exp2plimits[ilim]);
1043 >    for(int ilim=0;ilim<(int)obslimits.size();ilim++) {
1044 >      draw_mSUGRA_exclusion(crosssections[0],FilterEfficiencies[0],AbsCrossSection[0],obslimits[ilim], explimits[ilim], exp1mlimits[ilim], exp1plimits[ilim], exp2mlimits[ilim], exp2plimits[ilim]);
1045      }
1046 <    draw_mSUGRA_exclusion(crosssections[0], bestlimits, bestexplimits[0], bestexplimits[1], bestexplimits[2], bestexplimits[3], bestexplimits[4]);
1046 >    draw_mSUGRA_exclusion(crosssections[0],FilterEfficiencies[0],AbsCrossSection[0],bestlimits, bestexplimits[0], bestexplimits[1], bestexplimits[2], bestexplimits[3], bestexplimits[4]);
1047    }
1048    delete bestlimits;
1049   }
# Line 953 | Line 1056 | void smooth_line_once(TGraph *gr) {
1056    int sign=1;
1057    for(int i=0;i<gr->GetN();i++) {
1058      Double_t x,y,x1,y1,x2,y2;
956    bool turning=false;
1059      gr->GetPoint(i,x,y);
1060      gr->GetPoint(i+1,x1,y1);//need to handle exception here
1061      gr->GetPoint(i-1,x2,y2);//need to handle exception here
# Line 980 | Line 1082 | void smooth_line(TGraph *gr) {
1082   void set_range(TH2F *histo, int scantype, bool pushoutyz=false) {
1083    gStyle->SetPadLeftMargin(0.18);
1084    gStyle->SetPadRightMargin(0.19);
1085 +  // histo->GetXaxis()->SetLabelSize(0.035); //paper style
1086 +  // histo->GetYaxis()->SetLabelSize(0.035); //paper style
1087    if(scantype==PlottingSetup::mSUGRA) {
1088      histo->GetXaxis()->SetRangeUser(0,PlottingSetup::m0end);
1089      histo->GetYaxis()->SetRangeUser(0,PlottingSetup::m12end);
# Line 1088 | Line 1192 | void process_syst_plot(TH2F *rhisto,stri
1192      TPRegexp pat("\\d+$");
1193      size_t index = name.Index(pat,0);
1194      string cut = string("JZB > ")+(name(index,name.Length()-index).Data())+" GeV";
1195 +    //string cut = string("#splitline{JZB > ")+(name(index,name.Length()-index).Data())+" GeV}{n_{jets} #geq 3}"; //paper style
1196      TText *text = write_text(xpos_of_text,0.73,cut);
1197      text->SetTextAlign(11);
1198      text->SetTextSize(0.035);
1199      text->Draw();
1200 +    draw_diagonal_xchange( scantype, scanx );
1201    }
1202    
1203    CompleteSave(can,(saveto+(string)histo->GetName()));
# Line 1103 | Line 1209 | void process_syst_plot(TH2F *rhisto,stri
1209  
1210   void make_all_syst_plots(vector<TH2F*> all_histos,int scantype,std::string& scanx) {
1211    string saveto="Systematics/";
1212 <  for(int iplot=0;iplot<all_histos.size();iplot++) {
1212 >  for(int iplot=0;iplot<(int)all_histos.size();iplot++) {
1213        process_syst_plot(all_histos[iplot],saveto,scantype,scanx);
1214    }
1215   }
1216  
1217   void process_file(TFile* file, float stdmargin) {
1218    standardmargin=stdmargin;
1219 <  xsecfilename="reference_xSec_SMS-new.root";
1219 >  xsecfilename=PlottingSetup::cbafbasedir+"/"+PlottingSetup::SMSReferenceXSFile;
1220  
1221    // can receive a file with systematics and limits mixed, or a file with systematics only , or a file with limits only.
1222    TIter nextkey(file->GetListOfKeys());
# Line 1141 | Line 1247 | void process_file(TFile* file, float std
1247        if(name.Contains("exclusionmap")) is_limit=true;
1248        if(name.Contains("crosssectionmap")) is_limit=true;
1249        if(name.Contains("XS")) is_limit=true;
1250 +      if(name.Contains("absXS")) is_limit=true;
1251        if(name.Contains("limitflipmap")) is_limit=true;
1252  
1253        if(name.Contains("sysjes")) is_systematic=true;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines