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.1 by buchmann, Mon Jan 30 14:46:25 2012 UTC vs.
Revision 1.2 by buchmann, Tue Mar 20 12:54:50 2012 UTC

# Line 45 | Line 45 | string xsecfilename;
45  
46   void set_range(TH2F *histo, int scantype, bool pushoutlabels);
47   void smooth_line(TGraph *gr);
48 void decorate_mSUGRA(TH2F *cleanhisto, TVirtualPad *cvsSys,TGraph *expected,TGraph *expected2,TGraph *observed);
48   TH2F* adjust_histo(TH2F *oldhist, TH2F *refhisto);
49   TGraph* get_mSUGRA_exclusion_line(TH2F *exclusionhisto, int scantype);
50   TGraph* thin_line(TGraph *gr);
# Line 124 | Line 123 | void fill_with_text(TGraph *real, TGraph
123   }
124  
125   TH2F* prep_histo(TH2F *oldhist, int scantype) {///DONE
126 <  TH2F *histo = new TH2F(oldhist->GetName(),oldhist->GetName(),
126 >  string name=oldhist->GetName();
127 >  oldhist->SetName(((string)"unprepped"+oldhist->GetName()).c_str());
128 >  TH2F *histo = new TH2F(name.c_str(),name.c_str(),
129                           oldhist->GetNbinsX(),oldhist->GetXaxis()->GetBinLowEdge(1),oldhist->GetXaxis()->GetBinLowEdge(oldhist->GetNbinsX())+oldhist->GetXaxis()->GetBinWidth(oldhist->GetNbinsX()),
130                           oldhist->GetNbinsY(),oldhist->GetYaxis()->GetBinLowEdge(1),oldhist->GetYaxis()->GetBinLowEdge(oldhist->GetNbinsY())+oldhist->GetYaxis()->GetBinWidth(oldhist->GetNbinsY()));
131    
# Line 419 | Line 420 | void make_SMS_exclusion(TH2F *rawlimits,
420          desertline->Draw("same");
421    }
422  
423 <  fill_with_text(exclline,excllined3,excllinet3,finalcanvas,scantype,scanx);
423 >  TH2F *emptyh = (TH2F*)limits->Clone("emptyh");
424 >  for(int i=1;i<=emptyh->GetNbinsX();i++) {
425 >    for(int j=1;j<=emptyh->GetNbinsX();j++) {
426 >       emptyh->SetBinContent(i,j,0);
427 >    }
428 >  }
429 >
430 >  SugarCoatThis(finalcanvas,10,emptyh,exclline);
431 > //  exclline->Draw("c");
432 >
433 > //  fill_with_text(exclline,excllined3,excllinet3,finalcanvas,scantype,scanx);
434    stringstream real;
435    real << "Limits/final_exclusion__" << limits->GetName();
436 +  
437 +  if(Contains(limits->GetName(),"bestlimits")) {
438 +    cout << "----------> " << limits->GetName() << endl;
439 +    TFile *f = new TFile("limits.root","RECREATE");
440 +    thinexcline->SetName("ExclusionLine");
441 +    limits->SetName("UpperLimits");
442 +    limits->Write();
443 +    thinexcline->Write();
444 +    f->Close();
445 +  }
446 +  
447 +  
448    exclline->Draw("l");
449    if(drawdoubleline) thinexcline->Draw("");
450    excllinet3->Draw("");
# Line 684 | Line 707 | void draw_mSUGRA_exclusion(TH2F *crossse
707    if(draw2sigma) smooth_line(expected2);
708    
709    TCanvas *te = new TCanvas("te","te");
710 <  decorate_mSUGRA(cleanhisto,te,expected,expected2,observed);
710 > //  decorate_mSUGRA(cleanhisto,te,expected,expected2,observed);
711 >  SugarCoatThis(te,10,cleanhisto,observed);
712 > //  expected->Draw("c");
713 > //  observed->Draw("c");
714    stringstream saveas;
715    if((int)((string)limitmap->GetName()).find("limitmap")>0) saveas << "Limits/final_exclusion_for_JZB_geq_" << ((string)limitmap->GetName()).substr(((string)limitmap->GetName()).find("limitmap")+8,10);
716    else saveas << "Limits/final_exclusion_for_bestlimits";
# Line 696 | Line 722 | void draw_mSUGRA_exclusion(TH2F *crossse
722    set_range(limits,true,false);
723    set_range(limitmap,true,false);
724    
725 +  TGraph *emptygraph = new TGraph(0);
726 +  
727    overview->Divide(2,2);
728    overview->cd(1);
729    overview->cd(1)->SetLogz(1);
730    crosssection->GetZaxis()->SetRangeUser(0.0001,100);
731 + //  SugarCoatThis(overview->cd(1),10,crosssection,emptygraph);
732    crosssection->Draw("COLZ");
733    TText *title0 = write_title("Cross Section");
734    title0->Draw("same");
# Line 715 | Line 744 | void draw_mSUGRA_exclusion(TH2F *crossse
744    title2->Draw("same");
745    observed->Draw("c");
746    overview->cd(4);
747 <  decorate_mSUGRA(cleanhisto,overview->cd(4),expected,expected2,observed);
747 > //  decorate_mSUGRA(cleanhisto,overview->cd(4),expected,expected2,observed);
748 >  SugarCoatThis(overview->cd(4),10,cleanhisto,observed);
749 > //  observed->Draw("c");
750    stringstream saveas2;
751    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);
752    else saveas2 << "Limits/exclusion_overview_for_bestlimits";
# Line 801 | Line 832 | TH2F *make_best_limits(vector<TH2F*> exp
832        int source=0;
833        for(int k=0;k<explimits.size();k++) {
834          float currlim=explimits[k]->GetBinContent(i,j);
835 <        if(currlim<min&&currlim>0) {
835 >        if(currlim<=min&&currlim>0) {
836            min=currlim;
837            omin=obslimits[k]->GetBinContent(i,j);
838            source=k+1;
# Line 856 | Line 887 | TH2F *make_best_limits(vector<TH2F*> exp
887    allbestexplimits.push_back(bestexp2mlimit);
888    
889    delete canlimsource;
859  delete bestexplimit;
890    delete bestlimitsource;
891    return bestlimit;
892   }
# Line 889 | Line 919 | void create_exclusion_plots(vector<TH2F*
919      if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_exp1mlimitmap")) exp1mlimits.push_back(limits[ilim]);
920      if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_exp2plimitmap")) exp2plimits.push_back(limits[ilim]);
921      if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_exp2mlimitmap")) exp2mlimits.push_back(limits[ilim]);
922 <    if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_absolutecrosssectionmap")) crosssections.push_back(limits[ilim]);
922 >    if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_XS")) crosssections.push_back(limits[ilim]);
923      if(TString(limits[ilim]->GetName()).Contains("_limitmap")) obslimits.push_back(limits[ilim]);
924   //    if(TString(limits[ilim]->GetName()).Contains("_limitflipmap")) flipmaps.push_back(limits[ilim]);
925    }
# Line 899 | Line 929 | void create_exclusion_plots(vector<TH2F*
929    vector<TH2F*> bestexplimits;
930    TH2F *bestlimits = make_best_limits(explimits,obslimits,scantype, scanx, exp1mlimits, exp1plimits, exp2mlimits, exp2plimits, bestexplimits);
931    bestlimits->GetZaxis()->SetRangeUser(limits_lower_bound,limits_upper_bound);
932 <  
932 >
933    for(int ilim=0;ilim<limits.size();ilim++) {
934      limits[ilim]->GetZaxis()->SetRangeUser(limits_lower_bound,limits_upper_bound);
935    }
# Line 916 | Line 946 | void create_exclusion_plots(vector<TH2F*
946    delete bestlimits;
947   }
948  
919 void decorate_mSUGRA(TH2F *cleanhisto, TVirtualPad *cvsSys,TGraph *expected,TGraph *expected2,TGraph *observed) {
920  cvsSys->SetRightMargin(standardmargin);
921  Int_t tanBeta_ = 10;
922  Bool_t plotLO_ = false;
923  
924  //convert tanb value to string
925  std::stringstream tmp;
926  tmp << tanBeta_;
927  TString tanb( tmp.str() );
928
929  //set old exclusion Limits
930  TGraph* LEP_ch = set_lep_ch(tanBeta_);
931  TGraph* LEP_sl = set_lep_sl(tanBeta_);//slepton curve
932  TGraph* TEV_sg_cdf = set_tev_sg_cdf(tanBeta_);//squark gluino cdf
933  TGraph* TEV_sg_d0 = set_tev_sg_d0(tanBeta_);//squark gluino d0
934  TGraph* stau   = set_tev_stau(tanBeta_);//stau
935  TGraph* NoEWSB = set_NoEWSB(tanBeta_);
936
937  TGraph* TEV_sn_d0_1 = set_sneutrino_d0_1(tanBeta_);
938  TGraph* TEV_sn_d0_2 = set_sneutrino_d0_2(tanBeta_);
939
940  //constant ssqquark and gluino lines
941  TF1* lnsq[10];
942  TF1* lngl[10];
943  
944  TLatex* sq_text[10];
945  TLatex* gl_text[10];
946  
947  for(int i = 0; i < 6; i++){
948    lnsq[i] = constant_squark(tanBeta_,i);
949    sq_text[i] = constant_squark_text(i,*lnsq[i],tanBeta_);
950    lngl[i] = constant_gluino(tanBeta_,i);
951    gl_text[i] = constant_gluino_text(i,*lngl[i]);
952  }
953
954  //Legends
955  TLegend* legst  = makeStauLegend(0.05,tanBeta_);
956  TLegend* legNoEWSB  = makeNoEWSBLegend(0.05,tanBeta_);
957  TLegend* legexp = makeExpLegend( *TEV_sg_cdf,*TEV_sg_d0,*LEP_ch,*LEP_sl,*TEV_sn_d0_1,0.035,tanBeta_);
958
959  TEV_sn_d0_1->SetLineWidth(1);
960  TEV_sn_d0_2->SetLineWidth(1);
961  TEV_sg_d0->SetLineWidth(1);
962  
963  double m0min = 0;
964  if (tanBeta_ == 50) m0min=200;
965  TH2F* hist = new TH2F("h","h",100,m0min,1000,100,120,700);
966  hist->Draw();  
967  hist->GetXaxis()->SetTitle("m_{0} [GeV]");
968  hist->GetXaxis()->CenterTitle();
969  hist->GetYaxis()->SetTitle("m_{1/2} [GeV]");
970  hist->GetYaxis()->CenterTitle();
971  hist->GetXaxis()->SetTitleSize(0.04);
972  hist->GetYaxis()->SetTitleSize(0.04);
973  hist->GetXaxis()->SetTitleOffset(1.2);
974  hist->GetYaxis()->SetTitleOffset(1.5);
975  hist->GetXaxis()->SetNdivisions(506);
976  hist->GetYaxis()->SetNdivisions(506);
977
978  int col[]={2,3,4};
979
980  TLegend* myleg;
981
982  if( plotLO_ ) myleg = new TLegend(0.3,0.65,0.65,0.8,NULL,"brNDC");
983  else          myleg = new TLegend(0.25,0.76,0.44,0.91,NULL,"brNDC");
984
985  myleg->SetFillColor(0);
986  myleg->SetShadowColor(0);
987  myleg->SetTextSize(0.04);
988  myleg->SetBorderSize(0);
989
990  //constant squark and gluino mass contours
991  for (int it=0;it<5;it++) {  
992    lngl[it]->Draw("same");  
993    lnsq[it]->Draw("same");
994    sq_text[it]->Draw();
995    gl_text[it]->Draw();
996  }
997  
998 //exclusion limits previous experiments
999  if(tanBeta_ == 3){
1000    TEV_sn_d0_1->Draw("fsame");
1001    TEV_sn_d0_2->Draw("fsame");
1002  }
1003  LEP_ch->Draw("fsame");
1004  if (tanBeta_ != 50) LEP_sl->Draw("fsame");
1005
1006  //remove CDF/D0 excluded regions
1007  TEV_sg_cdf->Draw("fsame");
1008  TEV_sg_d0->Draw("same");  
1009  TEV_sg_d0->Draw("fsame");
1010
1011  //other labels
1012  Double_t xpos = 0;
1013  Double_t xposi = 0;
1014  Double_t ypos = 0;
1015  if(tanBeta_ == 50) xposi = 100;
1016  if(tanBeta_ == 50) xpos = 200;
1017  if(tanBeta_ == 50) ypos = -10;
1018
1019  TString text_tanBeta;
1020  text_tanBeta =  "tan#beta = "+tanb+",  A_{0} = 0,  #mu > 0";
1021  TLatex* cmssmpars = new TLatex(/*530.+xpos,690.+ypos-130*/150,650,text_tanBeta);
1022
1023  cmssmpars->SetTextSize(0.03);
1024  cmssmpars->Draw("same");
1025
1026  TLatex* lep_chargino = new TLatex(250,135,"LEP2 #tilde{#chi}_{1}^{#pm}");
1027  lep_chargino->SetTextSize(0.03);
1028  lep_chargino->SetTextFont(42);
1029
1030  TLatex* lep_slepton = new TLatex(26,190,"LEP2 #tilde{#font[12]{l}}^{#pm}");
1031  lep_slepton->SetTextSize(0.03);
1032  lep_slepton->SetTextAngle(-83);
1033  lep_slepton->SetTextFont(42);
1034
1035  if(draw2sigma) expected2->Draw("f");
1036  expected->SetLineColor(expected->GetFillColor());
1037  expected2->SetLineColor(expected2->GetFillColor());
1038  expected->Draw("f");
1039  observed->Draw("c");
1040  
1041  stau->Draw("fsame");
1042  NoEWSB->Draw("fsame");
1043
1044  legexp->AddEntry(observed,"Observed limit","l");
1045  legexp->AddEntry(expected,"Expected 1#sigma limit","f");
1046  if(draw2sigma) legexp->AddEntry(expected2,"Expected 2#sigma limit","f");
1047  legexp->SetY1(0.60);
1048  legexp->SetX1(0.55);
1049  legexp->Draw();
1050  legst->Draw();
1051
1052  hist->Draw("sameaxis");
1053  cvsSys->RedrawAxis();
1054  cvsSys->Update();
1055  DrawPrelim();
1056 }
949  
950   void smooth_line_once(TGraph *gr) {
951    //going to smooth graph
# Line 1090 | Line 982 | void set_range(TH2F *histo, int scantype
982    gStyle->SetPadLeftMargin(0.18);
983    gStyle->SetPadRightMargin(0.19);
984    if(scantype==PlottingSetup::mSUGRA) {
985 <    histo->GetXaxis()->SetRangeUser(0,2000);
986 <    histo->GetYaxis()->SetRangeUser(0,800);
985 >    histo->GetXaxis()->SetRangeUser(0,PlottingSetup::m0end);
986 >    histo->GetYaxis()->SetRangeUser(0,PlottingSetup::m12end);
987      histo->GetXaxis()->SetTitle("m_{0} [GeV]");
988      histo->GetYaxis()->SetTitle("m_{1/2} [GeV]");
989 <    histo->GetXaxis()->SetRangeUser(0,2000);
989 >    histo->GetXaxis()->SetRangeUser(0,PlottingSetup::m0end);
990      histo->GetXaxis()->SetNdivisions(504,true);
991    }
992    if(scantype==PlottingSetup::SMS) {
# Line 1219 | Line 1111 | void make_all_syst_plots(vector<TH2F*> a
1111  
1112   void process_file(TFile* file, float stdmargin) {
1113    standardmargin=stdmargin;
1114 <  xsecfilename="reference_xSec_SMS.root";
1114 >  xsecfilename="reference_xSec_SMS-new.root";
1115  
1116    // can receive a file with systematics and limits mixed, or a file with systematics only , or a file with limits only.
1117    TIter nextkey(file->GetListOfKeys());
# Line 1249 | Line 1141 | void process_file(TFile* file, float std
1141        if(name.Contains("exp2mlimitmap")) is_limit=true;
1142        if(name.Contains("exclusionmap")) is_limit=true;
1143        if(name.Contains("crosssectionmap")) is_limit=true;
1144 <      if(name.Contains("absolutecrosssectionmap")) is_limit=true;
1144 >      if(name.Contains("XS")) is_limit=true;
1145        if(name.Contains("limitflipmap")) is_limit=true;
1146  
1147        if(name.Contains("sysjes")) is_systematic=true;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines