TCanvas* CommandMSUGRA(TString plotName_X,Int_t tanBeta_, Bool_t plotLO_){
  
  gStyle->SetOptTitle(0);
  gStyle->SetOptStat(0);
  gStyle->SetPalette(1); 
  gStyle->SetTextFont(42);
  gStyle->SetFrameBorderMode(0);

  //convert tanb value to string
  std::stringstream tmp;
  tmp << tanBeta_;
  std::cout << "my tan beta is " << tanBeta_ << std::endl;
  TString tanb( tmp.str() );
  
  
  // Output file
  //std::cout << " create " << plotName_X << std::endl;
  //TFile* output = new TFile( plotName_X, "RECREATE" );
  //if ( !output || output->IsZombie() ) { std::cout << " zombie alarm output is a zombie " << std::endl; }
  

  //set old exclusion Limits
  TGraph* LEP_ch = set_lep_ch(tanBeta_);
  TGraph* LEP_sl = set_lep_sl(tanBeta_);//slepton curve
  TGraph* TEV_sg_cdf = set_tev_sg_cdf(tanBeta_);//squark gluino cdf
  TGraph* TEV_sg_d0 = set_tev_sg_d0(tanBeta_);//squark gluino d0
  //  TGraph* TEV_tlp_cdf = set_tev_tlp_cdf(tanBeta_);//trilepton cdf
  //  TGraph* TEV_tlp_d0 = set_tev_tlp_d0(tanBeta_);//trilepton d0
  TGraph* stau   = set_tev_stau(tanBeta_);//stau 
  TGraph* NoEWSB = set_NoEWSB(tanBeta_); 

  TGraph* TEV_sn_d0_1 = set_sneutrino_d0_1(tanBeta_);
  TGraph* TEV_sn_d0_2 = set_sneutrino_d0_2(tanBeta_);

  //constant ssqquark and gluino lines
  TF1* lnsq[10];
  TF1* lngl[10];
  
  TLatex* sq_text[10];
  TLatex* gl_text[10];

  
  for(int i = 0; i < 6; i++){
    lnsq[i] = constant_squark(tanBeta_,i);
    sq_text[i] = constant_squark_text(i,*lnsq[i],tanBeta_);
    lngl[i] = constant_gluino(tanBeta_,i);
    gl_text[i] = constant_gluino_text(i,*lngl[i]);
  }
  

  //Legends
  TLegend* legst  = makeStauLegend(0.05,tanBeta_);
  TLegend* legNoEWSB  = makeNoEWSBLegend(0.05,tanBeta_);
  TLegend* legexp = makeExpLegend( *TEV_sg_cdf,*TEV_sg_d0,*LEP_ch,*LEP_sl,*TEV_sn_d0_1,0.035,tanBeta_);
  
 
  //make Canvas
  TCanvas* cvsSys = new TCanvas("cvsnm","cvsnm",0,0,800,600);
  gStyle->SetOptTitle(0);
  cvsSys->SetFillColor(0);
  cvsSys->GetPad(0)->SetRightMargin(0.07);
  cvsSys->Range(-120.5298,26.16437,736.0927,750);
  //  cvsSys->Range(-50.5298,26.16437,736.0927,500);
  cvsSys->SetFillColor(0);
  cvsSys->SetBorderMode(0);
  cvsSys->GetPad(0)->SetBorderMode(0);
  cvsSys->GetPad(0)->SetBorderSize(2);
  cvsSys->GetPad(0)->SetLeftMargin(0.1407035);
  cvsSys->GetPad(0)->SetTopMargin(0.08);
  cvsSys->GetPad(0)->SetBottomMargin(0.13);

  cvsSys->SetTitle("tan#beta="+tanb);
 
  //output->cd();
  
//and now  the exclusion limits


  TGraph* SSdilep;
  TGraphErrors* OSdilep;
  TGraphErrors* RA1;

  TGraphErrors* RA1_old;
  TGraphErrors* RA5_old;
  TGraphErrors* RA6_old;


  
  if (tanBeta_ == 10) {
    std::cout << "tanb ==10" << std::endl;
    //SSdilep = SSdilep_NLO();
    //OSdilep = OSdilep_NLO();
    //RA1 = RA1_NLO();

    //RA1_old = getRA1Observed_NLO_tanBeta10();
    //RA5_old = getRA5Observed_NLO_tanBeta10();
    //RA6_old = getRA6Observed_NLO_tanBeta10();

  }



  double m0min = 0;
  if (tanBeta_ == 50) m0min=200;
  //TH2D* hist = new TH2D("h","h",100,m0min,1000,100,120,700);
  TH2D* hist = new TH2D("h","h",100,m0min,2000,100,120,700);
  hist->Draw();  
  hist->GetXaxis()->SetTitle("m_{0} (GeV)");
  hist->GetYaxis()->SetTitle("m_{1/2} (GeV)");
  hist->GetXaxis()->SetTitleOffset(.9);
  hist->GetXaxis()->SetTitleSize(0.06);
  hist->GetYaxis()->SetTitleOffset(1.0);
  hist->GetYaxis()->SetTitleSize(0.06);

  hist->GetXaxis()->SetNdivisions(506);
  //  if (tanBeta_ == 50)  hist->GetXaxis()->SetNdivisions(504);
  hist->GetYaxis()->SetNdivisions(506);

  int col[]={2,3,4};



  //TLegend* myleg;

  //if( plotLO_ ) myleg = new TLegend(0.3,0.65,0.65,0.8,NULL,"brNDC");
  //else          myleg = new TLegend(0.25,0.76,0.44,0.91,NULL,"brNDC");


  //myleg->SetFillColor(0); 
  //myleg->SetShadowColor(0);
  //myleg->SetTextSize(0.04);
  //myleg->SetBorderSize(0);

  //TLegendEntry *entry=myleg->AddEntry("RA1","2011 Limits","l");
  //entry->SetLineColor(1);
  //entry->SetLineStyle(1);
  //entry->SetLineWidth(3);

  //entry=myleg->AddEntry("sRA1","2010 Limits","l");
  //entry->SetLineColor(1);
  //entry->SetLineStyle(2);
  //entry->SetLineWidth(3);

  
  //constant squark and gluino mass contours
  for (int it=0;it<5;it++) {   
    lngl[it]->Draw("same");   
    lnsq[it]->Draw("same");
    sq_text[it]->Draw();
    gl_text[it]->Draw();
  }
  

  //exclusion limits previous experiments
  if(tanBeta_ == 3){
    TEV_sn_d0_1->Draw("fsame");
    TEV_sn_d0_2->Draw("fsame");
  }
  LEP_ch->Draw("fsame");
  if (tanBeta_ != 50) LEP_sl->Draw("fsame");

  //remove CDF/D0 excluded regions
  TEV_sg_cdf->Draw("fsame");
  TEV_sg_d0->Draw("same");  
  TEV_sg_d0->Draw("fsame");


  //other labels
  Double_t xpos = 0;
  Double_t xposi = 0;
  Double_t ypos = 0;
  if(tanBeta_ == 50) xposi = 100;
  if(tanBeta_ == 50) xpos = 200;
  if(tanBeta_ == 50) ypos = -10;
  
  //TLatex* lumilabel = new TLatex(750 +xposi + 100,767.-154,"#sqrt{s} = 7 TeV, #scale[0.65]{#int}Ldt = 0.98 fb^{-1}");
  //TLatex* lumilabel = new TLatex(450,767.-154+100,"#sqrt{s} = 7 TeV,   Ldt = 1 fb^{-1}");
  TLatex* lumilabel = new TLatex(0,720.,"3.2 fb^{-1}, #sqrt{s} = 7 TeV");
  //TLatex* integral_symbol = new TLatex(577 +xposi + 100,767.-145+100,"#int");

  lumilabel->SetTextSize(0.05);
  //integral_symbol->SetTextSize(0.03);
  lumilabel->Draw("same");
  //integral_symbol->Draw("same");

  //TLatex* cmslabel = new TLatex(10.,767.-154+100,"               ");
  //TLatex* cmslabel = new TLatex(10.,767.-154+100,"CMS Preliminary");
  //cmslabel->SetTextSize(0.05);
  //cmslabel->Draw("same");

  TString text_tanBeta;
  text_tanBeta =  "tan#beta = "+tanb+",  A_{0} = 0,  #mu > 0";
  TLatex* cmssmpars = new TLatex(200,650,text_tanBeta);

  cmssmpars->SetTextSize(0.04);
  cmssmpars->Draw("same");

  TLatex* lep_chargino = new TLatex(250,135,"LEP2 #tilde{#chi}_{1}^{#pm}");
  lep_chargino->SetTextSize(0.03);
  lep_chargino->SetTextFont(42);
  //  lep_chargino->Draw("same");

  TLatex* lep_slepton = new TLatex(26,190,"LEP2 #tilde{#font[12]{l}}^{#pm}");
  lep_slepton->SetTextSize(0.03);
  lep_slepton->SetTextAngle(-83);
  lep_slepton->SetTextFont(42);
  //  lep_slepton->Draw("same");



  //LM points
  TMarker* LM0 = new TMarker(200.,160.,20);
  TMarker* LM1 = new TMarker(60.,250.,20);
  TMarker* LM3 = new TMarker(330.,240.,20);
  TMarker* LM6 = new TMarker(80.,400.,20);
    
  LM0->SetMarkerSize(1.2);
  LM1->SetMarkerSize(1.2);
    
  TLatex* tLM0 = new TLatex(205.,160.," LM0");
  tLM0->SetTextSize(0.035);
    
  TLatex* tLM1 = new TLatex(80.,245.,"LM1");
  tLM1->SetTextSize(0.035);
  
  //TLatex* tLM3 = new TLatex(350.,235.,"LM3 (tan#beta=20)");
  TLatex* tLM3 = new TLatex(350.,235.,"LM3");
  tLM3->SetTextSize(0.035);
  
  TLatex* tLM6 = new TLatex(100.,395.,"LM6");
  tLM6->SetTextSize(0.035);
  
  //  if (tanBeta_ != 50){
  //  LM0->Draw("same");   
  //  tLM0->Draw("same");
  //  LM1->Draw("same");   
  //  tLM1->Draw("same");
  // }

  /*
  if (tanBeta_ == 10){ 
    LM1->Draw("same");
    tLM1->Draw("same");
    LM3->Draw("same");
    tLM3->Draw("same");
    LM6->Draw("same");
    tLM6->Draw("same");
  }
  */



  //stau=LSP contour
  stau->Draw("fsame");
  NoEWSB->Draw("fsame");
 
  //legends
  legexp->Draw();
  legst->Draw();
  //legNoEWSB->Draw();
  //myleg->Draw();

  hist->Draw("sameaxis");
  cvsSys->RedrawAxis();
  cvsSys->Update();
  //cvsSys->Write();
  
  // plots are made here
  //if( plotLO_ ){
  //  cvsSys->SaveAs("ExclusionLimit_tanb"+tanb+"_LO.pdf");
  //  cvsSys->SaveAs("ExclusionLimit_tanb"+tanb+"_LO.png");
  //}else{
  //  cvsSys->SaveAs("ExclusionLimit_tanb"+tanb+".eps");
  //  cvsSys->SaveAs("ExclusionLimit_tanb"+tanb+".pdf");
  //  cvsSys->SaveAs("ExclusionLimit_tanb"+tanb+".png");
  //}                 
  
  return cvsSys;
  //output->Write();
  //output->Close();
  //delete output; 
  
}
Example #2
0
void CommandMSUGRA(TString plotName_,Int_t tanBeta_, Bool_t plotLO_){
  gROOT->SetStyle("CMS");//jmt specific
  gROOT->ForceStyle();

  gStyle->SetOptTitle(0);
  gStyle->SetOptStat(0);
  gStyle->SetPalette(1); 
  gStyle->SetTextFont(42);
  gStyle->SetFrameBorderMode(0);

  //convert tanb value to string
  std::stringstream tmp;
  tmp << tanBeta_;
  TString tanb( tmp.str() );
  
  
  // Output file
  std::cout << " create " << plotName_ << std::endl;
  TFile* output = new TFile( plotName_, "RECREATE" );
  if ( !output || output->IsZombie() ) { std::cout << " zombie alarm output is a zombie " << std::endl; }
  

  //set old exclusion Limits
  TGraph* LEP_ch = set_lep_ch(tanBeta_);
  TGraph* LEP_sl = set_lep_sl(tanBeta_);//slepton curve
  TGraph* TEV_sg_cdf = set_tev_sg_cdf(tanBeta_);//squark gluino cdf
  TGraph* TEV_sg_d0 = set_tev_sg_d0(tanBeta_);//squark gluino d0
  //  TGraph* TEV_tlp_cdf = set_tev_tlp_cdf(tanBeta_);//trilepton cdf
  //  TGraph* TEV_tlp_d0 = set_tev_tlp_d0(tanBeta_);//trilepton d0
  TGraph* stau   = set_tev_stau(tanBeta_);//stau 
  TGraph* NoEWSB = set_NoEWSB(tanBeta_); 

  TGraph* TEV_sn_d0_1 = set_sneutrino_d0_1(tanBeta_);
  TGraph* TEV_sn_d0_2 = set_sneutrino_d0_2(tanBeta_);

  int nPoints = nSusyGridPoints();
  double m0[nPoints],m12[nPoints],squarkMass[nPoints],gluinoMass[nPoints];

  susyGrid(m0,m12,squarkMass,gluinoMass);

  TGraph2D* squarkMasses = new TGraph2D("squarkMasses","",nPoints,m0,m12,squarkMass);
  TGraph2D* gluinoMasses = new TGraph2D("gluinoMasses","",nPoints,m0,m12,gluinoMass);

  TH2D* gluinoMassPlot = gluinoMasses->GetHistogram();
  TH2D* squarkMassPlot = squarkMasses->GetHistogram();

  //constant ssqquark and gluino lines
  TF1* lnsq[15];
  TF1* lngl[15];

  TGraph* lnsq_40[15];
  TGraph* lngl_40[15];
  
  TLatex* sq_text[15];
  TLatex* gl_text[15];

  TLatex* sq_40_text[15];
  TLatex* gl_40_text[15];

  for(int i = 1; i < 15; i++){
    //lnsq[i] = constant_squark(tanBeta_,i);
    //sq_text[i] = constant_squark_text(i,*lnsq[i],tanBeta_);
    //lngl[i] = constant_gluino(tanBeta_,i);
    //gl_text[i] = constant_gluino_text(i,*lngl[i]);
    lnsq_40[i] = constant_mass(i*250,squarkMasses);
    lngl_40[i] = constant_mass(i*250,gluinoMasses);
    sq_40_text[i] = constant_squark_text_tanBeta40(i*250,lnsq_40[i]);
    gl_40_text[i] = constant_gluino_text_tanBeta40(i*250,lngl_40[i]);;
  }


  //Legends
  TLegend* legst  = makeStauLegend(0.05,tanBeta_);
  TLegend* legNoEWSB  = makeNoEWSBLegend(0.05,tanBeta_);
  TLegend* legexp = makeExpLegend( *TEV_sg_cdf,*TEV_sg_d0,*LEP_ch,*LEP_sl,*TEV_sn_d0_1,0.035,tanBeta_);
  
 
  //make Canvas
  TCanvas* cvsSys = new TCanvas("cvsnm","cvsnm",0,0,800,600);
  gStyle->SetOptTitle(0);
  cvsSys->SetFillColor(0);
  cvsSys->GetPad(0)->SetRightMargin(0.07);
  cvsSys->Range(-120.5298,26.16437,736.0927,750);
  //  cvsSys->Range(-50.5298,26.16437,736.0927,500);
  cvsSys->SetFillColor(0);
  cvsSys->SetBorderMode(0);
  cvsSys->GetPad(0)->SetBorderMode(0);
  cvsSys->GetPad(0)->SetBorderSize(2);
  cvsSys->GetPad(0)->SetLeftMargin(0.1407035);
  cvsSys->GetPad(0)->SetTopMargin(0.08);
  cvsSys->GetPad(0)->SetBottomMargin(0.13);

  cvsSys->SetTitle("tan#beta="+tanb);
 
  output->cd();
  
//and now  the exclusion limits


  TGraph* SSdilep;
  TGraphErrors* OSdilep;
  TGraphErrors* RA1;

  TGraphErrors* RA1_old;
  TGraphErrors* RA5_old;
  TGraphErrors* RA6_old;

  TGraph* RA2b_1b_loose;
  TGraph* RA2b_1b_tight;
  TGraph* RA2b_2b_loose;
  TGraph* RA2b_2b_tight;

  TGraph* RA2b_1b_loose_exp;
  TGraph* RA2b_1b_tight_exp;
  TGraph* RA2b_2b_loose_exp;
  TGraph* RA2b_2b_tight_exp;

  TGraph* RA2b_1b_loose_exp_p;
  TGraph* RA2b_1b_tight_exp_p;
  TGraph* RA2b_2b_loose_exp_p;
  TGraph* RA2b_2b_tight_exp_p;

  TGraph* RA2b_1b_loose_exp_m;
  TGraph* RA2b_1b_tight_exp_m;
  TGraph* RA2b_2b_loose_exp_m;
  TGraph* RA2b_2b_tight_exp_m;

  TGraph* RA2b_1b_loose_shade;
  TGraph* RA2b_1b_tight_shade;
  TGraph* RA2b_2b_loose_shade;
  TGraph* RA2b_2b_tight_shade;

  TSpline3* RA1_tb40 =getCLs1080ObsNLOtb40();

  if (tanBeta_ == 10) {
    SSdilep = SSdilep_NLO();
    OSdilep = OSdilep_NLO();
    RA1 = RA1_NLO();

    RA1_old = getRA1Observed_NLO_tanBeta10();
    RA5_old = getRA5Observed_NLO_tanBeta10();
    RA6_old = getRA6Observed_NLO_tanBeta10();

  }
  if(tanBeta_ == 40)
    {
//       RA2b_1b_loose = RA2b_limit("an-scanplot-unblind-tb40-withcontam-ge1b-loose.root", "hsusyscanExcluded");
//       RA2b_2b_loose = RA2b_limit("an-scanplot-unblind-tb40-withcontam-ge2b-loose.root", "hsusyscanExcluded");
//       RA2b_1b_tight = RA2b_limit("an-scanplot-unblind-tb40-withcontam-ge1b-tight.root", "hsusyscanExcluded");
//       RA2b_2b_tight = RA2b_limit("an-scanplot-unblind-tb40-withcontam-ge2b-tight.root", "hsusyscanExcluded");
//       RA2b_1b_loose = RA2b_limit("/afs/cern.ch/user/o/owen/public/RA2b/clsplots-tb40-ge1bloose.root", "hcls");
//       RA2b_2b_loose = RA2b_limit("/afs/cern.ch/user/o/owen/public/RA2b/clsplots-tb40-ge2bloose.root", "hcls");
//       RA2b_1b_tight = RA2b_limit("/afs/cern.ch/user/o/owen/public/RA2b/clsplots-tb40-ge1btight.root", "hcls");
//       RA2b_2b_tight = RA2b_limit("/afs/cern.ch/user/o/owen/public/RA2b/clsplots-tb40-ge2btight.root", "hcls");

/* 
     TString ra2bfile= "RA2b_tb40_exclusion.25Sep.root";
      RA2b_1b_loose = RA2b_limit(ra2bfile,"curve4_ge1bloose");
      RA2b_1b_tight = RA2b_limit(ra2bfile,"curve4_ge1btight");
      RA2b_2b_loose = RA2b_limit(ra2bfile,"curve4_ge2bloose");
      RA2b_2b_tight = RA2b_limit(ra2bfile,"curve4_ge2btight");

      RA2b_1b_loose_exp = RA2b_limit(ra2bfile,"curve4_1bloose_exp");
      RA2b_1b_tight_exp = RA2b_limit(ra2bfile,"curve4_1btight_exp");
      RA2b_2b_loose_exp = RA2b_limit(ra2bfile,"curve4_2bloose_exp");
      RA2b_2b_tight_exp = RA2b_limit(ra2bfile,"curve4_2btight_exp");

      RA2b_1b_loose_exp_p = RA2b_limit(ra2bfile,"curve4_1bloose_exp_plus");
      RA2b_1b_tight_exp_p = RA2b_limit(ra2bfile,"curve4_1btight_exp_plus");
      RA2b_2b_loose_exp_p = RA2b_limit(ra2bfile,"curve4_2bloose_exp_plus");
      RA2b_2b_tight_exp_p = RA2b_limit(ra2bfile,"curve4_2btight_exp_plus");

      RA2b_1b_loose_exp_m = RA2b_limit(ra2bfile,"curve4_1bloose_exp_minus");
      RA2b_1b_tight_exp_m = RA2b_limit(ra2bfile,"curve4_1btight_exp_minus");
      RA2b_2b_loose_exp_m = RA2b_limit(ra2bfile,"curve4_2bloose_exp_minus");
      RA2b_2b_tight_exp_m = RA2b_limit(ra2bfile,"curve4_2btight_exp_minus");
*/
      RA2b_1b_loose = get_RA2b_1bloose();
      RA2b_1b_tight = get_RA2b_1btight();
      RA2b_2b_loose = get_RA2b_2bloose();
      RA2b_2b_tight = get_RA2b_2btight();

      RA2b_1b_loose_exp = get_RA2b_1bloose_exp();
      RA2b_1b_tight_exp = get_RA2b_1btight_exp();
      RA2b_2b_loose_exp = get_RA2b_2bloose_exp();
      RA2b_2b_tight_exp = get_RA2b_2btight_exp();
    
      RA2b_1b_loose_exp_p = get_RA2b_1bloose_exp_p();
      RA2b_1b_tight_exp_p = get_RA2b_1btight_exp_p();
      RA2b_2b_loose_exp_p = get_RA2b_2bloose_exp_p();
      RA2b_2b_tight_exp_p = get_RA2b_2btight_exp_p();

      RA2b_1b_loose_exp_m = get_RA2b_1bloose_exp_m();
      RA2b_1b_tight_exp_m = get_RA2b_1btight_exp_m();
      RA2b_2b_loose_exp_m = get_RA2b_2bloose_exp_m();
      RA2b_2b_tight_exp_m = get_RA2b_2btight_exp_m();
   
      cout<<"Getting the shaded regions"<<endl;
      RA2b_1b_loose_shade = getShadedRegion(RA2b_1b_loose_exp_p,RA2b_1b_loose_exp_m);
      RA2b_1b_tight_shade = getShadedRegion(RA2b_1b_tight_exp_p,RA2b_1b_tight_exp_m);
      RA2b_2b_loose_shade = getShadedRegion(RA2b_2b_loose_exp_p,RA2b_2b_loose_exp_m);
      RA2b_2b_tight_shade = getShadedRegion(RA2b_2b_tight_exp_p,RA2b_2b_tight_exp_m);
      cout<<"DONE Getting the shaded regions"<<endl;
    }



  double m0min = 0;
  if (tanBeta_ == 40) m0min=400; 
  TH2D* hist = new TH2D("h","h",100,m0min,2000,100,120,700);
  hist->Draw();  
  hist->GetXaxis()->SetTitle("m_{0} [GeV]");
  hist->GetYaxis()->SetTitle("m_{1/2} [GeV]");
  hist->GetXaxis()->SetTitleOffset(.9);
  hist->GetXaxis()->SetTitleSize(0.06);
  hist->GetYaxis()->SetTitleOffset(1.0);
  hist->GetYaxis()->SetTitleSize(0.06);

  hist->GetXaxis()->SetNdivisions(506);
  //  if (tanBeta_ == 50)  hist->GetXaxis()->SetNdivisions(504);
  hist->GetYaxis()->SetNdivisions(506);

  int col[]={2,3,4};

  //SSdilep->SetLineColor(kGreen+2);
  //SSdilep->SetLineStyle(1);
  //SSdilep->SetLineWidth(3);
  //
  //OSdilep->SetLineColor(kCyan+2);
  //OSdilep->SetLineStyle(1);
  //OSdilep->SetLineWidth(3);
  //
  //RA1->SetLineColor(kRed+2);
  //RA1->SetLineStyle(1);
  //RA1->SetLineWidth(3);
  RA1_tb40->SetLineColor(kBlack);
  RA1_tb40->SetLineStyle(7);
  RA1_tb40->SetLineWidth(3);
  RA1_tb40->SetName("RA1_tb40");
  //
  //TSpline3 *sRA1 = new TSpline3("sRA1",RA1_old);
  //sRA1->SetLineColor(kRed+2);
  ////sRA1->SetLineStyle(5);
  //sRA1->SetLineStyle(2);
  //sRA1->SetLineWidth(3);
  //
  //RA5_old->SetLineColor(kGreen+2);
  ////RA5_old->SetLineStyle(5);
  //RA5_old->SetLineStyle(2);
  //RA5_old->SetLineWidth(3);
  //
  //RA6_old->SetLineColor(kCyan+2);
  ////RA6_old->SetLineStyle(1);
  //RA6_old->SetLineStyle(2);
  //RA6_old->SetLineWidth(3);

  if (RA2bmode.Contains("all")) {
  RA2b_1b_loose->SetLineColor(kRed+2);
  RA2b_1b_loose->SetLineStyle(2);
  RA2b_1b_loose->SetLineWidth(3);
         
  RA2b_1b_tight->SetLineColor(kRed+2);
  RA2b_1b_tight->SetLineStyle(1);
  RA2b_1b_tight->SetLineWidth(3);
         
  RA2b_2b_loose->SetLineColor(kGreen+2);
  RA2b_2b_loose->SetLineStyle(2);
  RA2b_2b_loose->SetLineWidth(3);
         
  RA2b_2b_tight->SetLineColor(kGreen+2);
  RA2b_2b_tight->SetLineStyle(1);
  RA2b_2b_tight->SetLineWidth(3);
  }
  else {
  RA2b_1b_loose->SetLineColor(kRed);
  RA2b_1b_loose->SetLineStyle(1);
  RA2b_1b_loose->SetLineWidth(3);
         
  RA2b_1b_tight->SetLineColor(kRed);
  RA2b_1b_tight->SetLineStyle(1);
  RA2b_1b_tight->SetLineWidth(3);
         
  RA2b_2b_loose->SetLineColor(kRed);
  RA2b_2b_loose->SetLineStyle(1);
  RA2b_2b_loose->SetLineWidth(3);
         
  RA2b_2b_tight->SetLineColor(kRed);
  RA2b_2b_tight->SetLineStyle(1);
  RA2b_2b_tight->SetLineWidth(3);

  RA2b_1b_loose_exp->SetLineColor(kBlue);
  RA2b_2b_loose_exp->SetLineColor(kBlue);
  RA2b_1b_tight_exp->SetLineColor(kBlue);
  RA2b_2b_tight_exp->SetLineColor(kBlue);

  RA2b_1b_loose_exp->SetLineStyle(5);
  RA2b_2b_loose_exp->SetLineStyle(5);
  RA2b_1b_tight_exp->SetLineStyle(5);
  RA2b_2b_tight_exp->SetLineStyle(5);

  RA2b_1b_loose_exp->SetLineWidth(3);
  RA2b_2b_loose_exp->SetLineWidth(3);
  RA2b_1b_tight_exp->SetLineWidth(3);
  RA2b_2b_tight_exp->SetLineWidth(3);

  int acolor=kCyan+2;
  RA2b_1b_loose_exp_p->SetLineColor(acolor);
  RA2b_2b_loose_exp_p->SetLineColor(acolor);
  RA2b_1b_tight_exp_p->SetLineColor(acolor);
  RA2b_2b_tight_exp_p->SetLineColor(acolor);

  RA2b_1b_loose_exp_p->SetLineStyle(1);
  RA2b_2b_loose_exp_p->SetLineStyle(1);
  RA2b_1b_tight_exp_p->SetLineStyle(1);
  RA2b_2b_tight_exp_p->SetLineStyle(1);

  RA2b_1b_loose_exp_p->SetLineWidth(3);
  RA2b_2b_loose_exp_p->SetLineWidth(3);
  RA2b_1b_tight_exp_p->SetLineWidth(3);
  RA2b_2b_tight_exp_p->SetLineWidth(3);

  RA2b_1b_loose_exp_m->SetLineColor(acolor);
  RA2b_2b_loose_exp_m->SetLineColor(acolor);
  RA2b_1b_tight_exp_m->SetLineColor(acolor);
  RA2b_2b_tight_exp_m->SetLineColor(acolor);

  RA2b_1b_loose_exp_m->SetLineStyle(1);
  RA2b_2b_loose_exp_m->SetLineStyle(1);
  RA2b_1b_tight_exp_m->SetLineStyle(1);
  RA2b_2b_tight_exp_m->SetLineStyle(1);

  RA2b_1b_loose_exp_m->SetLineWidth(3);
  RA2b_2b_loose_exp_m->SetLineWidth(3);
  RA2b_1b_tight_exp_m->SetLineWidth(3);
  RA2b_2b_tight_exp_m->SetLineWidth(3);

  RA2b_1b_tight_shade->SetFillStyle(fillstyle);
  RA2b_1b_tight_shade->SetFillColor(acolor);

  RA2b_1b_loose_shade->SetFillStyle(fillstyle);
  RA2b_1b_loose_shade->SetFillColor(acolor);

  RA2b_2b_tight_shade->SetFillStyle(fillstyle);
  RA2b_2b_tight_shade->SetFillColor(acolor);

  RA2b_2b_loose_shade->SetFillStyle(fillstyle);
  RA2b_2b_loose_shade->SetFillColor(acolor);

  }
  
  TLegend* myleg;

  float leg_x1=0.39+0.23;
  float leg_y1=0.65+0.05;
  float leg_x2= 0.55+0.25;
  float leg_y2= 0.84+0.05;

  if (RA2bmode.Contains("all")) {
    leg_y1 -= 0.1;
  }

  if( plotLO_ ) myleg = new TLegend(0.3,0.65,0.65,0.8,NULL,"brNDC");
  else          myleg = new TLegend(leg_x1,leg_y1,leg_x2,leg_y2,NULL,"brNDC");


  myleg->SetFillColor(0); 
  myleg->SetShadowColor(0);
  myleg->SetTextSize(0.04);
  myleg->SetBorderSize(0);

  TLegendEntry *entry=0;
//   entry= myleg->AddEntry("ge1bLoose","LEP2 #tilde{#chi}_{1}^{#pm}","f");

//   entry->SetFillColor(3);
//   entry->SetLineColor(3);
//   entry->SetFillStyle(1001);


  if (RA2bmode.Contains("all")) {
    entry= myleg->AddEntry("ge1bLoose","#geq 1b Loose","l");
    entry->SetLineColor(1);
    entry->SetLineStyle(2);
    entry->SetLineWidth(3);
    entry->SetLineColor(kRed+2);
    entry->SetTextColor(kRed+2);
    
    entry=myleg->AddEntry("ge2bLoose","#geq 2b Loose","l");
    entry->SetLineColor(1);
    entry->SetLineStyle(2);
    entry->SetLineWidth(3);
    entry->SetLineColor(kGreen+2);
    entry->SetTextColor(kGreen+2);
    
    entry=myleg->AddEntry("ge1bTight","#geq 1b Tight","l");
    entry->SetLineColor(1);
    entry->SetLineStyle(1);
    entry->SetLineWidth(3);
    entry->SetLineColor(kRed+2);
    entry->SetTextColor(kRed+2);
    
    entry=myleg->AddEntry("ge2bTight","#geq 2b Tight","l");
    entry->SetLineColor(1);
    entry->SetLineStyle(1);
    entry->SetLineWidth(3);
    entry->SetLineColor(kGreen+2);
    entry->SetTextColor(kGreen+2);
  }
  else if (RA2bmode.Contains("ge")) {
    entry=myleg->AddEntry("ge1bTight","Observed Limit","l");
    entry->SetLineStyle(1);
    entry->SetLineWidth(3);
    entry->SetLineColor(kRed);
    entry->SetTextColor(kBlack);

    entry=myleg->AddEntry("ge1bTight_exp","Expected Limit #pm 1#sigma","lf");
    entry->SetFillStyle (fillstyle);
    entry->SetFillColor (kCyan+2);
    entry->SetLineStyle(5);
    entry->SetLineWidth(3);
    entry->SetLineColor(kBlue);
    entry->SetTextColor(kBlack);


  }
  
   if (RA2bmode=="allPlusRA1") {
    entry=myleg->AddEntry("RA1_tb40","CMS #alpha_{T}","l");
    entry->SetLineColor(kBlack);
    entry->SetLineStyle(7);
    entry->SetLineWidth(3);
    entry->SetTextColor(kBlack);
   }  

  //constant squark and gluino mass contours
  for (int it=2;it<9;it++) {  
    if(it<7){
      if(lngl_40[it]!=0)lngl_40[it]->Draw("samec");   
      if(gl_40_text[it]!=0)gl_40_text[it]->Draw();
    }
      if(lnsq_40[it]!=0)lnsq_40[it]->Draw("samec");
    if(it<6){
      if(sq_40_text[it]!=0)sq_40_text[it]->Draw();
    }
  }
  //SSdilep->Draw("samec");
  //OSdilep->Draw("samec");
  //RA1->Draw("samec");
  //
  //sRA1->Draw("same"); 
  //RA5_old->Draw("c same");
  //RA6_old->Draw("c same");
  TString drawopt="samel"; //default choice
  if (RA2bmode.Contains("all"))  RA2b_1b_loose->Draw(drawopt);
  if (RA2bmode.Contains("all")) RA2b_2b_loose->Draw(drawopt);
  if (RA2bmode.Contains("all")) RA2b_1b_tight->Draw(drawopt);
  if (RA2bmode.Contains("all")) RA2b_2b_tight->Draw(drawopt);
  if (RA2bmode=="allPlusRA1") RA1_tb40->Draw(drawopt);

  if (RA2bmode=="ge1btight") {
    RA2b_1b_tight_shade->Draw("f");
    RA2b_1b_tight_exp_p->Draw(drawopt);
    RA2b_1b_tight_exp_m->Draw(drawopt);
    RA2b_1b_tight_exp->Draw(drawopt);
    RA2b_1b_tight->Draw(drawopt);
  }
  else if (RA2bmode=="ge1bloose") {
    RA2b_1b_loose_shade->Draw("f");
    RA2b_1b_loose_exp_p->Draw(drawopt);
    RA2b_1b_loose_exp_m->Draw(drawopt);
    RA2b_1b_loose_exp->Draw(drawopt);
    RA2b_1b_loose->Draw(drawopt);
  }
  else if (RA2bmode=="ge2bloose") {
    RA2b_2b_loose_shade->Draw("f");
    RA2b_2b_loose_exp_p->Draw(drawopt);
    RA2b_2b_loose_exp_m->Draw(drawopt);
    RA2b_2b_loose_exp->Draw(drawopt);
    RA2b_2b_loose->Draw(drawopt);
  }
  else if (RA2bmode=="ge2btight") {
    RA2b_2b_tight_shade->Draw("f");
    RA2b_2b_tight_exp_p->Draw(drawopt);
    RA2b_2b_tight_exp_m->Draw(drawopt);
    RA2b_2b_tight_exp->Draw(drawopt);
    RA2b_2b_tight->Draw(drawopt);
  }
  //
  //
  //TLatex* RA1label = new TLatex(670,430.,"#alpha_{T}");
  ////TLatex* RA1label = new TLatex(80,288.,"#alpha_{T}");
  //RA1label->SetTextFont(42);
  //RA1label->SetTextSize(0.05);
  //RA1label->SetTextColor(kRed+2);
  //RA1label->Draw("same");

  TLatex* RA2blabel_2b=0;
  TLatex* RA2blabel_1b=0;
  if (false) {
    RA2blabel_2b = new TLatex(1150,330.,"#geq 2 b-tags");
    RA2blabel_2b->SetTextFont(42);
    RA2blabel_2b->SetTextSize(0.05);
    RA2blabel_2b->SetTextColor(kGreen+2);
    RA2blabel_2b->Draw("same");
    
    RA2blabel_1b = new TLatex(1150,430.,"#geq 1 b-tags");
    RA2blabel_1b->SetTextFont(42);
    RA2blabel_1b->SetTextSize(0.05);
    RA2blabel_1b->SetTextColor(kRed+2);
    RA2blabel_1b->Draw("same");
  }
  //
  //TLatex* RA5label = new TLatex(400,370.,"SS Dilepton");
  //RA5label->SetTextFont(42);
  ////RA5label->SetTextAngle(20);
  //RA5label->SetTextSize(0.04);
  //RA5label->SetTextColor(kGreen+2);
  //RA5label->Draw("same");
  //
  //TLatex* RA6label = new TLatex(650,215.,"OS Dilepton");
  //RA6label->SetTextFont(42);
  ////RA6label->SetTextAngle(8);
  //RA6label->SetTextSize(0.04);
  //RA6label->SetTextColor(kCyan+2);
  //RA6label->Draw("same");
  
  
  //exclusion limits previous experiments
  if(tanBeta_ == 3){
    TEV_sn_d0_1->Draw("fsame");
    TEV_sn_d0_2->Draw("fsame");
  }
  //  LEP_ch->Draw("fsame");
  if (tanBeta_ != 40) LEP_sl->Draw("fsame");

  //remove CDF/D0 excluded regions
  //  TEV_sg_cdf->Draw("fsame");
  //  TEV_sg_d0->Draw("same");  
  //  TEV_sg_d0->Draw("fsame");


  //other labels
  Double_t xpos = 0;
  Double_t xposi = 0;
  Double_t ypos = 0;
  if(tanBeta_ == 40) xposi = 180+160;
  if(tanBeta_ == 40) xpos = 400;//240;
  if(tanBeta_ == 40) ypos = -10;
  
  //TLatex* lumilabel = new TLatex(750 +xposi + 100,767.-154,"#sqrt{s} = 7 TeV, #scale[0.65]{#int}Ldt = 0.98 fb^{-1}");
  TLatex* lumilabel = new TLatex(925+xpos-50,767.-154+105,"#sqrt{s} = 7 TeV, L_{int} = 1.1 fb^{-1}");
  TLatex* integral_symbol = new TLatex(1287 +xposi + 100-85,767.-145+95,"#int");

  lumilabel->SetTextSize(0.05);
  integral_symbol->SetTextSize(0.03);
  lumilabel->Draw("same");
  //  integral_symbol->Draw("same");

  TLatex* cmslabel = new TLatex(10.+xpos,767.-154+105,"CMS Preliminary");
  cmslabel->SetTextSize(0.05);
  cmslabel->Draw("same");

  TString text_tanBeta;
  text_tanBeta =  "tan#beta = "+tanb+",  A_{0} = -500 GeV,  #mu > 0";
  TLatex* cmssmpars = new TLatex(/*530.+xpos,690.+ypos-130*/150+xpos,660,text_tanBeta);

  cmssmpars->SetTextSize(0.04);
  cmssmpars->Draw("same");

  TLatex* lep_chargino = new TLatex(250,135,"LEP2 #tilde{#chi}_{1}^{#pm}");
  lep_chargino->SetTextSize(0.03);
  lep_chargino->SetTextFont(42);
  //    lep_chargino->Draw("same");

  TLatex* lep_slepton = new TLatex(26,190,"LEP2 #tilde{#font[12]{l}}^{#pm}");
  lep_slepton->SetTextSize(0.03);
  lep_slepton->SetTextAngle(-83);
  lep_slepton->SetTextFont(42);
  //  lep_slepton->Draw("same");



  //LM points
  TMarker* LM0 = new TMarker(200.,160.,20);
  TMarker* LM1 = new TMarker(60.,250.,20);
  TMarker* LM3 = new TMarker(330.,240.,20);
  TMarker* LM6 = new TMarker(80.,400.,20);
    
  LM0->SetMarkerSize(1.2);
  LM1->SetMarkerSize(1.2);
    
  TLatex* tLM0 = new TLatex(205.,160.," LM0");
  tLM0->SetTextSize(0.035);
    
  TLatex* tLM1 = new TLatex(80.,245.,"LM1");
  tLM1->SetTextSize(0.035);
  
  //TLatex* tLM3 = new TLatex(350.,235.,"LM3 (tan#beta=20)");
  TLatex* tLM3 = new TLatex(350.,235.,"LM3");
  tLM3->SetTextSize(0.035);
  
  TLatex* tLM6 = new TLatex(100.,395.,"LM6");
  tLM6->SetTextSize(0.035);
  
  //  if (tanBeta_ != 50){
  //  LM0->Draw("same");   
  //  tLM0->Draw("same");
  //  LM1->Draw("same");   
  //  tLM1->Draw("same");
  // }

  /*
  if (tanBeta_ == 10){ 
    LM1->Draw("same");
    tLM1->Draw("same");
    LM3->Draw("same");
    tLM3->Draw("same");
    LM6->Draw("same");
    tLM6->Draw("same");
  }
  */



  //stau=LSP contour
  stau->Draw("fsame");
  //  NoEWSB->Draw("fsame");
 
  //legends
  //  legexp->Draw();
  //  legst->Draw();
  //legNoEWSB->Draw();
    myleg->Draw();

  hist->Draw("sameaxis");
  cvsSys->RedrawAxis();
  cvsSys->Update();
  cvsSys->Write();
  
  if( plotLO_ ){
    cvsSys->SaveAs("ExclusionLimit_tanb"+tanb+"_LO.pdf");
    cvsSys->SaveAs("ExclusionLimit_tanb"+tanb+"_LO.png");
  }else{
    cvsSys->SaveAs("ExclusionLimit_tanb"+tanb+"_"+RA2bmode+".eps");
    cvsSys->SaveAs("ExclusionLimit_tanb"+tanb+"_"+RA2bmode+".pdf");
    cvsSys->SaveAs("ExclusionLimit_tanb"+tanb+"_"+RA2bmode+".png");
  }
  
  output->Write();
  //output->Close();
  //delete output; 
  
}