예제 #1
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; 
  
}
예제 #2
0
void CommandMSUGRA(TString plotName,Int_t tanBeta_, Bool_t plotLO_, Bool_t tb40_plotExpected) {
  
  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_);

  //some tan beta 40 stuff (load the squark and gluino mass lines)
  TGraph2D* squarkMasses=0;
  TGraph2D* gluinoMasses=0;
  if (tanBeta_==40) {
    const int nPoints = nSusyGridPoints();
    double m0[nPoints],m12[nPoints],squarkMass[nPoints],gluinoMass[nPoints];
    
    susyGrid(m0,m12,squarkMass,gluinoMass);
    
    squarkMasses = new TGraph2D("squarkMasses","",nPoints,m0,m12,squarkMass);
    gluinoMasses = new TGraph2D("gluinoMasses","",nPoints,m0,m12,gluinoMass);
    
    gluinoMasses->GetHistogram();
    squarkMasses->GetHistogram();
  }
  // end of tan beta 40 stuff

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

  //versions for tan beta 40
  TGraph* lnsq_40[15];
  TGraph* lngl_40[15];
  TLatex* sq_40_text[15];
  TLatex* gl_40_text[15];

  int loopmax = 6;
  if (tanBeta_==40) loopmax=15;
  for(int i = 0; i < loopmax; i++){
    if (tanBeta_==10) {
      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]);
    }
    else if (tanBeta_==40) {
      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();
  
  TDirectory* curDir = gDirectory;
//   TFile* f = new TFile("limits_binc_ht1000_met350-contours.root");
//   TFile* f = new TFile("limits_msugraNLO_multibtag_ht1000_met250_m12_0-550_HN_comb-contours.root");
  TFile* f = ContourFile;
  TGraph* ra4VieObs = (TGraph*)f->Get("gObs");
  TGraph* ra4VieExpM2 = (TGraph*)f->Get("gExpMinus2");
  TGraph* ra4VieExpM1 = (TGraph*)f->Get("gExpMinus1");
  TGraph* ra4VieExp = (TGraph*)f->Get("gExpMedian");
  TGraph* ra4VieExpP1 = (TGraph*)f->Get("gExpPlus1");
  TGraph* ra4VieExpP2 = (TGraph*)f->Get("gExpPlus2");
  TGraph* ra4VieExpArea(0);

  TGraph* ra4VieObsThM(0);
  TGraph* ra4VieExpThM(0);
  if ( ContourFileM ) {
    ra4VieObsThM = (TGraph*)ContourFileM->Get("gObs");
    ra4VieExpThM = (TGraph*)ContourFileM->Get("gExpMedian");
  }
  TGraph* ra4VieObsThP(0);
  TGraph* ra4VieExpThP(0);
  if ( ContourFileP ) {
    ra4VieObsThP = (TGraph*)ContourFileP->Get("gObs");
    ra4VieExpThP = (TGraph*)ContourFileP->Get("gExpMedian");
  }

  curDir->cd();


  double m0min = 0;
  double m0max=1600;
//   double m0max=1800;
  double xscale = m0max-m0min;
  if (tanBeta_ == 50) m0min=200;
  if (tanBeta_ == 40) {m0min=400;  m0max=2000;}
  xscale = (m0max-m0min)/xscale;
  TH2D* hist = new TH2D("h","h",100,m0min,m0max,100,120,700);
  hist->Draw();  
  hist->GetXaxis()->SetTitle("m_{0} (GeV/c^{2})");
  hist->GetYaxis()->SetTitle("m_{1/2} (GeV/c^{2})");
  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};

  TSpline3 *sRA4_LP =0;
  TSpline3 *sRA1 = 0;
  TSpline3 *sRA2 = 0;
  TSpline3 *sRA4_old =0;
  TSpline3 *sRAZ =0;

  if (tanBeta_==10) {
    ra4VieObs->SetLineWidth(3);
    ra4VieObs->SetLineColor(2);
    ra4VieExp->SetLineWidth(3);
//     ra4VieExp->SetLineStyle(2);
    ra4VieExp->SetLineColor(4);
//     ra4VieObs->RemovePoint(0);
//     ra4VieObs->RemovePoint(0);
//     double x,y;
//     ra4VieObs->GetPoint(36,x,y);
//     std::cout << x << " " << y << std::endl;
//     ra4VieObs->RemovePoint(37);
//     ra4VieObs->RemovePoint(37);
//     ra4VieObs->RemovePoint(37);
    if ( ra4VieExpM1 && ra4VieExpP1 ) {
      ra4VieExpArea = new TGraph();
      int np(0);
      double* xExp = ra4VieExpM1->GetX();
      double* yExp = ra4VieExpM1->GetY();
      for ( int i=0; i<ra4VieExpM1->GetN(); ++i ) 
	ra4VieExpArea->SetPoint(np++,xExp[i],yExp[i]);
      xExp = ra4VieExpP1->GetX();
      yExp = ra4VieExpP1->GetY();
      for ( int i=ra4VieExpP1->GetN()-1; i>=0; --i ) 
	ra4VieExpArea->SetPoint(np++,xExp[i],yExp[i]);
      ra4VieExpArea->SetLineColor(7);
      ra4VieExpArea->SetFillColor(7);
      ra4VieExpArea->Draw("F");
      ra4VieExpM1->SetLineWidth(1);
      ra4VieExpM1->SetLineStyle(3);
      ra4VieExpM1->SetLineColor(4);
      ra4VieExpP1->SetLineWidth(1);
      ra4VieExpP1->SetLineStyle(3);
      ra4VieExpP1->SetLineColor(4);
      ra4VieExpM1->Draw();
      ra4VieExpP1->Draw();
    }
    if ( ra4VieObsThM && ra4VieObsThP ) {
      ra4VieObsThM->SetLineWidth(2);
      ra4VieObsThM->SetLineColor(2);
      ra4VieObsThM->SetLineStyle(2);
      ra4VieObsThM->Draw();
      ra4VieObsThP->SetLineWidth(2);
      ra4VieObsThP->SetLineColor(2);
      ra4VieObsThP->SetLineStyle(2);
      ra4VieObsThP->Draw();
      
      ra4VieExpThM->SetLineWidth(2);
      ra4VieExpThM->SetLineColor(4);
      ra4VieExpThM->SetLineStyle(2);
      ra4VieExpThM->Draw();
      ra4VieExpThP->SetLineWidth(2);
      ra4VieExpThP->SetLineColor(4);
      ra4VieExpThP->SetLineStyle(2);
      ra4VieExpThP->Draw();
      
    }
    ra4VieExp->Draw();
    ra4VieObs->Draw();
//     if ( ra4VieExpM2 && ra4VieExpP2 ) {
//       ra4VieExpM2->SetLineWidth(2);
//       ra4VieExpM2->SetLineStyle(3);
//       ra4VieExpM2->SetLineColor(4);
//       ra4VieExpP2->SetLineWidth(2);
//       ra4VieExpP2->SetLineStyle(3);
//       ra4VieExpP2->SetLineColor(4);
//       ra4VieExpM2->Draw();
//       ra4VieExpP2->Draw();
//     }
  }
  else if (tanBeta_==40 ) {

  }
  
  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( plotLO_ ) {
    if ( ContourFileM && ContourFileP )
      myleg = new TLegend(0.3,0.55,0.6,0.7,NULL,"brNDC");
//       myleg = new TLegend(0.3,0.55,0.6,0.8,NULL,"brNDC");
    else
      myleg = new TLegend(0.3,0.65,0.6,0.7,NULL,"brNDC");
  }
  else if (tb40_plotExpected) myleg = new TLegend(0.25,0.76,0.44,0.91,NULL,"brNDC"); // copied from else block below
  else if (tanBeta_==40) myleg = new TLegend(leg_x1,leg_y1,leg_x2,leg_y2,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.03);
  myleg->SetBorderSize(0);

  TLegendEntry *entry=0;

  if (tanBeta_ == 10 ) {
//     myleg->SetHeader("RA4Tmpl, (NLO, exp. unc.)");
    myleg->SetHeader("95% CL exclusion limits");
    myleg->AddEntry(ra4VieObs,"observed","l");
    myleg->AddEntry(ra4VieExp,"median expected","l");
    if ( ra4VieExpM1 && ra4VieExpP1 ) {
//       myleg->AddEntry(ra4VieExpP1,"exp #pm 1#sigma","l");
      myleg->AddEntry(ra4VieExpArea,"expected #pm 1#sigma exp.","f");
    }
    if ( ra4VieObsThM && ra4VieObsThP ) {
      myleg->AddEntry(ra4VieObsThM,"observed / sig.cont.","l");
      myleg->AddEntry(ra4VieExpThM,"expected / sig.cont.","l");
//       myleg->AddEntry(ra4VieObsThM,"observed #pm 1#sigma theor.","l");
//       myleg->AddEntry(ra4VieExpThM,"expected #pm 1#sigma theor.","l");
    }
    //     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);
  }
  else if (tanBeta_==40) {

    //     entry=myleg->AddEntry("obs","Observed Limit","l");
    //     entry->SetLineColor(1);
    //     entry->SetLineStyle(1);
    //     entry->SetLineWidth(3);
    //     entry->SetTextColor(1);

    //     entry=myleg->AddEntry("exp","Expected Limit #pm 1#sigma","lf");
    //     entry->SetFillColor(kGray);
    //     entry->SetTextColor(1);
    //     entry->SetLineColor(1);
    //     entry->SetLineStyle(7);
    //     entry->SetLineWidth(3);
    //     entry->SetFillStyle(3002);


  }
  
  //constant squark and gluino mass contours
  if (tanBeta_==10) {
    for (int it=0;it<5;it++) {   
      lngl[it]->Draw("same");   
      lnsq[it]->Draw("same");
      sq_text[it]->Draw();
      gl_text[it]->Draw();
    }
  }
  else if (tanBeta_==40) {
    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();
      }
    }
  }

  if (tanBeta_==10) {
    //     SSdilep->Draw("samec");
    //     OSdilep->Draw("samec");
    //     Multilep->Draw("samec");
    //     RA1->Draw("samec");
    //     RA2->Draw("samec");
    //     MT2->Draw("samec");
    //     sRA4_LP->Draw("samec");
    // 	RAZ->Draw("samec");
    
    //     sRA1->Draw("same"); 
    //     sRA2->Draw("same"); 
    //     sRA4_old->Draw("samec");
    // 	sRAZ->Draw("samec");
    //     RA5_old->Draw("c same");
    //     RA6_old->Draw("c same");
  }
  else if (tanBeta_==40) {

    //     //expected curves and errors bands
    //     if ( tb40_plotExpected) {
    //       //not drawing the expected curves for better legibility
    // //       RA1_tb40_exp_p->Draw("samel");
    // //       RA1_tb40_exp_m->Draw("samel");
    // //       RA2b_1b_tight_exp_p->Draw("samel");
    // //       RA2b_1b_tight_exp_m->Draw("samel");
    // //keep the expected +/-1 sigma band
    //       RA1_tb40_exp_band->Draw("f") ;
    //       RA2b_1b_tight_exp_band->Draw("f") ;

    //       //important to draw lines after fill
    //       RA1_tb40_exp->Draw("samel");
    //       RA2b_1b_tight_exp->Draw("samel") ;

  }

  //     RA2b_1b_tight->Draw("samel");
  //     RA1_tb40->Draw("samel");

  // }
  
  TLegend* leg2=0;
  if (tanBeta_==10) {
    //     TLatex* RA1label = new TLatex(670,370.,"#alpha_{T}");
    //     RA1label->SetTextFont(42);
    //     RA1label->SetTextSize(0.05);
    //     RA1label->SetTextColor(kRed+2);
    //     RA1label->Draw("same");
    
    //     TLatex* RA2label = new TLatex(640,465.,"Jets+MHT");
    //     RA2label->SetTextFont(42);
    //     RA2label->SetTextSize(0.04);
    //     RA2label->SetTextColor(kBlue+2);
    //     RA2label->Draw("same");
	  
    //     TLatex* RAZlabel = new TLatex(740,415.,"Razor (0.8 fb^{-1})");
    //     RAZlabel->SetTextFont(42);
    //     RAZlabel->SetTextSize(0.04);
    //     RAZlabel->SetTextColor(kMagenta+1);
    //     RAZlabel->Draw("same");
    
    //     TLatex* RA5label = new TLatex(300,350.,"SS Dilepton");
    //     RA5label->SetTextFont(42);
    //     //RA5label->SetTextAngle(-10);
    //     RA5label->SetTextSize(0.04);
    //     RA5label->SetTextColor(kGreen+2);
    //     RA5label->Draw("same");
    
    //     //TLatex* RA6label = new TLatex(400,280.,"OS Dilepton");
    //     TLatex* RA6label = new TLatex(355,285.,"OS Dilepton");
    //     RA6label->SetTextFont(42);
    //     //RA6label->SetTextAngle(-15);
    //     RA6label->SetTextSize(0.04);
    //     RA6label->SetTextColor(kCyan+2);
    //     RA6label->Draw("same");

    //     TLatex* RA7label = new TLatex(338,215.,"Multi-Lepton");
    //     RA7label->SetTextFont(42);
    //     RA7label->SetTextSize(0.04);
    //     RA7label->SetTextColor(kYellow+2);
    //     RA7label->Draw("same");
    //     TLatex* RA7lumi = new TLatex(450,185.,"(2.1 fb^{-1})");
    //     RA7lumi->SetTextFont(42);
    //     RA7lumi->SetTextSize(0.04);
    //     RA7lumi->SetTextColor(kYellow+2);
    //     RA7lumi->Draw("same");

    
    //     TLatex* MT2label = new TLatex(400,440.,"MT2");
    //     MT2label->SetTextFont(42);
    //     MT2label->SetTextSize(0.04);
    //     MT2label->SetTextColor(kRed);
    //     MT2label->Draw("same");
    
    //     TLatex* RA4label = new TLatex(250,400.,"1 Lepton");
    //     RA4label->SetTextFont(42);
    //     RA4label->SetTextSize(0.04);
    //     RA4label->SetTextColor(kBlue);
    //     RA4label->Draw("same");
  }
  else if (tanBeta_==40  && !tb40_plotExpected) {
    //     int xposRA1 = 480;
    //     int yposRA1 = 510;

    //     int xposRA2b=450;
    //     int yposRA2b=275;

    //     TLatex* RA1label = new TLatex(xposRA1,yposRA1,"#alpha_{T}");
    //     RA1label->SetTextFont(42);
    //     RA1label->SetTextSize(0.05);
    //     RA1label->SetTextColor(kRed+2);
    //     RA1label->Draw("same");

    //     TLatex* RA2blabel = new TLatex(xposRA2b,yposRA2b,"Jets+MET+b");
    //     RA2blabel->SetTextFont(42);
    //     RA2blabel->SetTextSize(0.05);
    //     RA2blabel->SetTextColor(kBlue+1);
    //     RA2blabel->Draw("same");
    //   }
    //   else if (tanBeta_==40 && tb40_plotExpected) {

    //     leg2 = new TLegend(0.63,0.76,0.94,0.91,NULL,"brNDC");
    //     leg2->SetFillColor(0); 
    //     leg2->SetShadowColor(0);
    //     leg2->SetTextSize(0.04);
    //     leg2->SetBorderSize(0);
    
    //     entry=leg2->AddEntry("RA1_tb40","#alpha_{T}","l");
    //     entry->SetLineColor(kRed+2);
    //     entry->SetLineStyle(1);
    //     entry->SetLineWidth(3);
    //     entry->SetTextColor(kRed+2);

    //     entry=leg2->AddEntry("RA2b_1btight","Jets+MET+b","l");
    //     entry->SetLineColor(kBlue+1);
    //     entry->SetLineStyle(1);
    //     entry->SetLineWidth(3);
    //     entry->SetTextColor(kBlue+1);

  }

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

//   //remove CDF/D0 excluded regions
//   if (tanBeta_==10) {
//     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;

  if(tanBeta_ == 40) xposi = 180+160;
  if(tanBeta_ == 40) xpos = 400;//240;
  if(tanBeta_ == 40) ypos = 100;

 
  //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*xscale+xpos,767.-154+100,"#sqrt{s} = 7 TeV,   Ldt 4.98 fb^{ -1}");
  TLatex* integral_symbol = new TLatex((577+100)*xscale+xpos,767.-145+100,"#int");

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

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

  TString text_tanBeta;
  TString a0str="0";
  if (tanBeta_==40) a0str = "-500 GeV";
  text_tanBeta =  "tan#beta = "+tanb+",  A_{0} = "+a0str+",  #mu > 0";
  int anotherOffset = (tb40_plotExpected && tanBeta_==40) ? -100 : 0;
//   TLatex* cmssmpars = new TLatex(/*530.+xpos,690.+ypos-130*/120+xpos,555+ypos+anotherOffset,text_tanBeta);
//   TLatex* cmssmpars = new TLatex(0.61,0.60,text_tanBeta);
  TLatex* cmssmpars = new TLatex(0.61,0.70,text_tanBeta);
  cmssmpars->SetNDC(1);

  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
  if (tanBeta_==10) {
    stau->Draw("fsame");
//     NoEWSB->Draw("fsame");
    
    //legends
    legexp->Draw();
    legst->Draw();
    //legNoEWSB->Draw();
  }
  if (tanBeta_!=40 || tb40_plotExpected)  myleg->Draw();
  if (tanBeta_==40 && tb40_plotExpected) leg2->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+".eps");
    cvsSys->SaveAs("ExclusionLimit_tanb"+tanb+".ps");
    cvsSys->SaveAs("ExclusionLimit_tanb"+tanb+".pdf");
    cvsSys->SaveAs("ExclusionLimit_tanb"+tanb+".png");
  }
  
  output->Write();

  //output->Close();
  //delete output; 

}