Exemplo n.º 1
0
void CommandMSUGRA(TString plotName_,Int_t tanBeta_, Bool_t plotLO_){
  
  gStyle->SetOptTitle(0);
  gStyle->SetOptStat(0);
  gStyle->SetPalette(1); 
  gStyle->SetTextFont(42);
  
  //convert tanb value to string
  std::stringstream tmp;
  tmp << tanBeta_;
  TString tanb( tmp.str() );
  
  // Output file
  cout << " create " << plotName_ << 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_);

  //-----------------------------------
  // constant sqquark and gluino lines
  //-----------------------------------

  const unsigned int nlines = 4;

  TF1* lnsq[nlines];
  TF1* lngl[nlines];
  
  TLatex* sq_text[nlines];
  TLatex* gl_text[nlines];

  for(unsigned int i = 0; i < nlines; 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* legexp    = makeExpLegend( *TEV_sg_cdf,*TEV_sg_d0,*LEP_ch,*LEP_sl,*TEV_sn_d0_1,0.035,tanBeta_);
  //TLegend* legNoEWSB = makeNoEWSBLegend(0.05,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,500);
  //cvsSys->Range(-50.5298,26.16437,736.0927,500);
  cvsSys->SetFillColor(0);
  cvsSys->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
  TGraphErrors* First ;
  //TGraphErrors* FirstDummy ;
  TGraphErrors* Second;
  TGraphErrors* Third;
  TGraphErrors* Second_up;
  TGraphErrors* Second_low;
  TGraphErrors* expband;
  TGraphErrors* obs2010;

  if (tanBeta_		== 3) {
    //First		= getObserved_NLOunc();
    //FirstDummy	= getObserved_NLOunc();
  } else {
    //First		= getNLOobsTanbeta10();
    //First		= getNLOobsTanbeta10_smooth();
    //First		= getNLOobsTanbeta10_funky();
    First		= getNLOobsTanbeta10();
    //FirstDummy	= getObserved_NLOunc();
    //Second		= getNLOexpTanbeta10();
    Second		= getNLOexpTanbeta10();
    Second_up		= getNLOexpUpTanbeta10();
    Second_low		= getNLOexpDownTanbeta10();
    Third		= getNLOexpTanbeta10();
    expband		= getNLOexpTanbeta10_band();
    obs2010		= getNLOobsTanbeta10_2010();
    //Second_up		= getExpected_NLO_tanBeta3_up();
    //Second_low	= getExpected_NLO_tanBeta3_low();
  }
  //Third		= getExpected_NLOunc();//getLO_jetMultis();
  //Second		= getLO_signalCont();

  TGraph *grObserved3p5_shape = getObserved3p5_shape();
  TGraph *grExpected3p5_shape = getExpected3p5_shape();

//   First->SetMarkerColor(kWhite);
//   First->GetXaxis()->SetRangeUser(2.,500.);
//   First->GetYaxis()->SetRangeUser(80,500);
//   if(tanBeta_ == 50) First->GetXaxis()->SetRangeUser(200,500);
//   First->GetXaxis()->SetTitle("m_{0} (GeV)");
//   First->GetYaxis()->SetTitle("m_{1/2} (GeV)");
//   First->GetYaxis()->SetTitleOffset(0.8);

  double m0min = 0;
  if (tanBeta_ == 50) m0min=200;
  TH2D* hist = new TH2D("h","h",100,m0min,m0max,100,120,m12max);
  hist->Draw();  
  hist->GetXaxis()->SetTitle("m_{0} (GeV/c^{2})");
  hist->GetYaxis()->SetTitle("m_{1/2} (GeV/c^{2})");
  hist->GetYaxis()->SetTitleOffset(1.);
  hist->GetXaxis()->SetNdivisions(506);
  //  if (tanBeta_ == 50)  hist->GetXaxis()->SetNdivisions(504);
  hist->GetYaxis()->SetNdivisions(506);

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

  
  //TFile *f = TFile::Open("exclusion_Spring11_CLs.root");        
  //TFile *f = TFile::Open("exclusion_Fall10_tcmet_JPT.root"); 
  //TFile *f = TFile::Open("exclusion_Fall10_pfmet_pfjets.root"); 
  //TFile *f = new TFile("exclusion_Fall10_pfmet_pfjets_CLs.root");
  
  //TH2F* h = (TH2F*) f->Get("hexcl_NLO_obs");
  //TH2F* h = (TH2F*) f->Get("hexcl_NLO_exp");
  //TH2F* h = (TH2F*) f->Get("hexcl_NLO_expp1");
  //TH2F* h = (TH2F*) f->Get("hexcl_NLO_expm1");

  //h->SetMaximum(3);
  //h->Draw("samecolz");
  
  TSpline3 *sFirst = new TSpline3("sFirst",First);
  sFirst->SetLineColor(kRed);
  sFirst->SetLineWidth(3);
  First->SetLineColor(kRed);
  First->SetLineWidth(3);

  TSpline3 *sSecond = new TSpline3("sSecond",Second);
  sSecond->SetLineColor(kBlue);
  sSecond->SetLineStyle(2);
  sSecond->SetLineWidth(3);
  Second->SetLineColor(kBlue);
  Second->SetLineStyle(2);
  Second->SetLineWidth(3);

  TSpline3 *sSecond_up = new TSpline3("sSecond_up",Second_up);
  sSecond_up->SetLineColor(kCyan);
  sSecond_up->SetLineStyle(1);
  sSecond_up->SetLineWidth(3);
  Second_up->SetLineColor(kBlue);
  //Second_up->SetLineColor(1);
  Second_up->SetLineWidth(2);

  TSpline3 *sSecond_low = new TSpline3("sSecond_low",Second_low);
  sSecond_low->SetLineColor(kCyan);
  sSecond_low->SetLineStyle(1);
  sSecond_low->SetLineWidth(3);
  Second_low->SetLineColor(kBlue);
  //Second_low->SetLineColor(1);
  Second_low->SetLineWidth(2);

  Third->SetLineColor(kCyan);
  Third->SetLineWidth(30);

  
  // TSpline3 *sThird = new TSpline3("sThird",Third);
  // sThird->SetLineColor(kGreen+2);
  // sThird->SetLineStyle(4);
  // sThird->SetLineWidth(3);
  // Third->SetLineColor(kGreen+2);
  // Third->SetLineStyle(4);
  // Third->SetLineWidth(3);

  //  First->Draw("AP");
  
  /*
 for(vector<TH1F*>::iterator at = exclusionPlots.begin();at != exclusionPlots.end();++at){
      (*at)->SetContour(2);
      if(n == 0){
      	(*at)->DrawCopy();
	(*at)->SetTitle("tan#beta="+tanBeta_);
      }
      cout << " n " << n << endl;
     (*at)->DrawCopy("same");
      //  (*it)->Write();
      cout << " here " << endl;
      n++;
      }*/

  
  TLegend* myleg;

  if( plotLO_ ) myleg = new TLegend(0.3,0.75,0.54,0.9,NULL,"brNDC");
  else          myleg = new TLegend(0.25,0.75,0.54,0.9,NULL,"brNDC");



  myleg->SetFillColor(0); 
  myleg->SetShadowColor(0);
  myleg->SetTextSize(0.03);
  myleg->SetBorderSize(0);
  
  TH1F* hdummy = new TH1F();
  hdummy->SetLineColor(4);
  hdummy->SetFillColor(4);
  hdummy->SetFillStyle(3002);
  hdummy->SetLineWidth(2);
  hdummy->SetLineStyle(2);

  //  myleg->AddEntry(sSecond,"NLO Expected Limit","L");
  if (tanBeta_ == 3 && plotLO_) {
    myleg->AddEntry(sSecond,"LO Observed Limit","L");
    myleg->AddEntry(sFirst,"NLO Observed Limit","L"); 
  } else {
    //myleg->AddEntry(sFirst,"CMS OS Dilepton Limit","L"); 
    myleg->AddEntry(sFirst,"NLO observed limit","L"); 
    //myleg->AddEntry(hdummy,"NLO expected limit","LF"); 
    myleg->AddEntry(hdummy,"NLO expected limit","L"); 
    //myleg->AddEntry(sSecond,"NLO expected limit","L"); 
    //myleg->AddEntry(sSecond_up,"NLO expected limit (+/-1#sigma)","L"); 
    myleg->AddEntry(obs2010,"2010 NLO observed limit","L"); 
  }
  
  //sSecond_up->Draw("h same");
  //sSecond_low->Draw("h same");
      
 
  //constant squark and gluino mass contours
  for (unsigned int it=1;it<nlines;it++) {   
    lngl[it]->Draw("same");   
    lnsq[it]->Draw("same");
    sq_text[it]->Draw();
    gl_text[it]->Draw();
  }

  sSecond_up->SetFillStyle(4010);
  sSecond_up->SetFillColor(kCyan-10);

  sSecond_low->SetFillStyle(1001);
  sSecond_low->SetFillColor(10);

  //expected and observed (LO & NLO) contours
  //sFirst->Draw("same");    
  //sSecond->Draw("same");   
  //sThird->Draw("same");
  //Third->Draw("samec");

  //expband->Draw("samecf"); // summer11 expected band
  //First->Draw("samec");    // summer11 observed exclusion
  
  //First->SetMarkerColor(1);
  //First->Draw("samep");
  //Second->Draw("samec");   // summer11 expected limit
  obs2010->Draw("samec");
  //Second_up->Draw("samec");
  //Second_low->Draw("samec");

  grObserved3p5_shape->SetLineColor(2);
  grExpected3p5_shape->SetLineColor(4);
  grExpected3p5_shape->SetLineStyle(2);
  grObserved3p5_shape->Draw("same");
  grExpected3p5_shape->Draw("same");

  // if (tanBeta_ == 3) Third->Draw("samec");
  //if (tanBeta_ == 3 && plotLO_) Second->Draw("samec");

   
    
  //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(135.+xposi,510.,"L_{int} = 34 pb^{-1}, #sqrt{s} = 7 TeV");
  //TLatex* lumilabel = new TLatex(305.+xposi + 100,510.,"L_{int} = 976 pb^{-1}, #sqrt{s} = 7 TeV");
  TLatex* lumilabel = new TLatex(490,m12max+15,"#sqrt{s} = 7 TeV, #scale[0.6]{#int} L dt = 3.5 fb^{-1}");

  lumilabel->SetTextSize(0.05);
  lumilabel->Draw("same");

  TLatex* cmslabel = new TLatex(10.,m12max+15,"CMS Preliminary");
  cmslabel->SetTextSize(0.05);
  cmslabel->Draw("same");

  TString text_tanBeta;
  //text_tanBeta =  "tan#beta = "+tanb+", A_{0} = 0, sign(#mu) > 0";
  text_tanBeta =  "tan#beta = "+tanb+",  A_{0} = 0,  #mu > 0";
  //TLatex* cmssmpars = new TLatex(70.+xpos,340.+ypos,text_tanBeta);
 
  TLatex* cmssmpars = new TLatex(120,540,text_tanBeta);
  //TLatex* cmssmpars = new TLatex(200,370,text_tanBeta);
  cmssmpars->SetTextSize(0.045);

  cmssmpars->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");
  }

    /*
   Int_t n = 0;
    for(vector<TH1F*>::iterator at = exclusionPlots.begin();at != exclusionPlots.end();++at){
      (*at)->SetContour(2);
      if(n == 0){
      	(*at)->DrawCopy("same");
	(*at)->SetTitle("tan#beta=3");
      }
      cout << " n " << n << endl;
     (*at)->DrawCopy("same");
      //  (*it)->Write();
      cout << " here " << endl;
      n++;
      }
  
    */



  //stau=LSP contour
  stau->Draw("fsame");
  //NoEWSB->Draw("fsame");

  //legends
  legexp->Draw();
  legst->Draw();
  myleg->Draw();
  //legNoEWSB->Draw();

  //First->Draw("samec");
  // if (tanBeta_ == 3) Third->Draw("samec");
  //if (tanBeta_ == 3 && plotLO_) Second->Draw("samec");
  
  hist->Draw("sameaxis");
  cvsSys->RedrawAxis();
  cvsSys->Update();
  cvsSys->Write();
  
  if( plotLO_ ){
    cvsSys->SaveAs("RA6_ExclusionLimit_tanb"+tanb+"_LO.pdf");
    cvsSys->SaveAs("RA6_ExclusionLimit_tanb"+tanb+"_LO.png");
  }else{
    cvsSys->SaveAs("RA6_ExclusionLimit_tanb"+tanb+".eps");
    cvsSys->SaveAs("RA6_ExclusionLimit_tanb"+tanb+".pdf");
    cvsSys->SaveAs("RA6_ExclusionLimit_tanb"+tanb+".png");
  }
  
  output->Write();
  //output->Close();
  //delete output; 
  
}