示例#1
0
// Draw label for Decay Channel in upper left corner of plot
void DrawPrelimLabel(int cmsprelim, double textSize) {

    TPaveText *cms = new TPaveText();
    cms->AddText("CMS");

    cms->SetX1NDC(      gStyle->GetPadLeftMargin() + gStyle->GetTickLength()        );
    cms->SetY1NDC(1.0 - gStyle->GetPadTopMargin()  - gStyle->GetTickLength() - 0.05 );
    cms->SetX2NDC(      gStyle->GetPadLeftMargin() + gStyle->GetTickLength() + 0.15 );
    cms->SetY2NDC(1.0 - gStyle->GetPadTopMargin()  - gStyle->GetTickLength()        );

    cms->SetFillStyle(0);
    cms->SetBorderSize(0);
    if (textSize!=0) cms->SetTextSize(textSize*1.1);
    cms->SetTextAlign(12);
    cms->SetTextFont(61);
    cms->Draw("same");

    if(cmsprelim > 0) {
      TPaveText *extra = new TPaveText();
      if(cmsprelim == 2) { extra->AddText("Private Work"); }
      else { extra->AddText("Preliminary"); }

      extra->SetX1NDC(      gStyle->GetPadLeftMargin() + gStyle->GetTickLength()        );
      extra->SetY1NDC(1.0 - gStyle->GetPadTopMargin()  - gStyle->GetTickLength() - 0.10 );
      extra->SetX2NDC(      gStyle->GetPadLeftMargin() + gStyle->GetTickLength() + 0.15 );
      extra->SetY2NDC(1.0 - gStyle->GetPadTopMargin()  - gStyle->GetTickLength() - 0.05 );

      extra->SetFillStyle(0);
      extra->SetBorderSize(0);
      if (textSize!=0) extra->SetTextSize(textSize);
      extra->SetTextAlign(12);
      extra->SetTextFont(52);
      extra->Draw("same");
    }
}
示例#2
0
void prnt(){

string run[13] = {"183544","183581","183780","183963","184066","184074","184130","183580","183602","184022","184072","184088","184169","periodH"};

for(i=0;i<14;i++)
{

 string MCfilename ="root/"+run[i]+".root"; 
 cout << MCfilename << endl;
 string plot = "lb_roi/"+run[i]+".eps" ;
 cout << plot <<endl;
 string event = "lb_event/"+run[i]+".eps" ;
 cout << event <<endl;

 string tex = "2011 periodH "+run[i];
 cout <<tex <<endl;


 TFile* f = new TFile(MCfilename.c_str());
        f->TFile::Open();

          TH1F *h1   = (TH1F*)f->Get("J10_lbn_vs_n_rois");
	  h1->Sumw2();
          TH1F *h2   = (TH1F*)f->Get("J10_lbn_vs_n_events");
          h2->Sumw2();
         
h1->Draw(); 
h1->SetMarkerStyle(1);
 TPaveText *pt = new TPaveText(.4,0.3290678,0.8406322,0.3695,"blNDC");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   text = pt->AddText(tex.c_str());   
   pt->Draw();
c1->SaveAs(plot.c_str());

h2->Draw();
h2->SetMarkerStyle(1);
 TPaveText *pt = new TPaveText(.4,0.3290678,0.8406322,0.3695,"blNDC");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   text = pt->AddText(tex.c_str());
   pt->Draw();
c1->SaveAs(event.c_str());



}
}
示例#3
0
文件: setStyle.C 项目: dcurry09/EMTF8
void formatForCmsPublic(TPad * c, TLegend *leg, TString title, int nsamp, float legx, float legy, float legw, float legh, TString legopt)
{
    if(title.Length()!=0)
    {
        TPaveText *pave = new TPaveText(0.5,0.96,0.94,0.99,"NDC");
        pave->SetBorderSize(0);
        pave->SetFillStyle(0);
        pave->SetTextAlign(32);
        pave->SetTextFont(42);

        TObjArray * tokens = title.Tokenize("\\\\");
        int nt = tokens->GetEntries();
        for(int it=0; it<nt; ++it)
        {
            TObjString * t = (TObjString *)tokens->At(it);
            pave->AddText(t->GetString());
        }

        pave->Draw("same");
    }

    float legx1=legx, legx2=legx+legw;
    float legy1 = legy, legy2 = legy-legh*(float)(nsamp);
    if(leg==0) leg = ((TPad *)c)->BuildLegend(legx1,legy1,legx2,legy2);
    leg->SetBorderSize(0);
    leg->SetFillColor(0);
    leg->SetFillStyle(0);
    leg->SetLineWidth(1);
    leg->SetTextFont(42);
    leg->SetEntryOption(legopt);
    leg->SetX1NDC(legx1);
    leg->SetY1NDC(legy1);//-nsamp*legh);
    leg->SetX2NDC(legx2);
    leg->SetY2NDC(legy2);
}
示例#4
0
void DrawStatBox(TObject** Histos, std::vector<char*> legend, bool Mean, double X, double Y, double W, double H)
{
   int    N             = legend.size();
   char   buffer[255];

   if(Mean)H*=3;
   for(int i=0;i<N;i++){
           TPaveText* stat = new TPaveText(X,Y-(i*H), X+W, Y-(i+1)*H, "NDC");
	   TH1* Histo = (TH1*)Histos[i];
           sprintf(buffer,"Entries : %i\n",(int)Histo->GetEntries());
           stat->AddText(buffer);

           if(Mean){
           sprintf(buffer,"Mean    : %6.2f\n",Histo->GetMean());
           stat->AddText(buffer);

           sprintf(buffer,"RMS     : %6.2f\n",Histo->GetRMS());
           stat->AddText(buffer);
           }

           stat->SetFillColor(0);
           stat->SetLineColor(Color[i]);
           stat->SetTextColor(Color[i]);
           stat->SetBorderSize(0);
           stat->SetMargin(0.05);
           stat->SetTextAlign(12);
           stat->Draw();
   }
}
示例#5
0
void makeScaleFactorHist(TCanvas* canvas, const std::string& name, const std::string& tag)
{
  TMultiGraph* multigraph = NULL;
  std::stringstream graphName;
  graphName << name << "ScaleFactorMultigraph";
  multigraph = (TMultiGraph*)canvas->GetPrimitive(graphName.str().c_str());
  if (multigraph == NULL) {
    std::cerr << "Error: no object of TCanvas " << canvas->GetName() << " with name ";
    std::cerr << graphName.str() << std::endl;
    return;
  }
  multigraph->GetYaxis()->SetRangeUser(0.3, 1.7);
  multigraph->GetYaxis()->SetLabelSize(0.03);
  canvas->Draw();
  canvas->SetCanvasSize(600,600);
  canvas->SetWindowSize(610,630);
  TPaveText* label = new TPaveText(0.25, 0.8, 0.55, 0.9, "NDC");
  label->SetTextFont(62);
  label->SetTextSize(0.03);
  label->SetBorderSize(0);
  label->SetFillColor(0);
  label->AddText("CMS 2011");
  label->AddText("");
  label->AddText("#int L dt = 204 pb^{-1}");
  label->SetTextAlign(11);
  label->Draw();
  std::stringstream file;
  file << "/data2/yohay/scaleFactor_" << tag << "_" << name << ".pdf";
  canvas->SaveAs(file.str().c_str());
}
示例#6
0
// Draw statistics info above plot
void DrawCMSLabels(double lumi, double energy, double textSize) {

  //const char *text = "%2.1f #times 10^{6} clusters (fiducial) (%1.1f GeV)";
  const char *text;
  if(lumi > 10000000) {
    lumi /= 10000000;
    text = "%2.1f #times 10^{7} tracks (%1.1f GeV)";
  }
  else {
    lumi /= 1000000;
    text = "%2.1f #times 10^{6} tracks (%1.1f GeV)";
  }
    
  TPaveText *label = new TPaveText();
  label->SetX1NDC(gStyle->GetPadLeftMargin());
  label->SetY1NDC(1.0-gStyle->GetPadTopMargin());
  label->SetX2NDC(1.0-gStyle->GetPadRightMargin());
  label->SetY2NDC(1.0);
  label->SetTextFont(42);
  label->AddText(Form(text, lumi, energy));
  label->SetFillStyle(0);
  label->SetBorderSize(0);
  if (textSize!=0) label->SetTextSize(textSize);
  label->SetTextAlign(32);
  label->Draw("same");
}
void DrawCell( TMVA::PDEFoamCell *cell, TMVA::PDEFoam *foam,
	       Double_t x, Double_t y,
	       Double_t xscale,  Double_t yscale )
{
   // recursively draw cell and it's daughters

   Float_t xsize = xscale*1.5;
   Float_t ysize = yscale/3;
   if (xsize > 0.15) xsize=0.1; //xscale/2;
   if (cell->GetDau0() != NULL) {
      TLine *a1 = new TLine(x-xscale/4, y-ysize, x-xscale, y-ysize*2);
      a1->SetLineWidth(2);
      a1->Draw();
      DrawCell(cell->GetDau0(), foam, x-xscale, y-yscale, xscale/2, yscale);
   }
   if (cell->GetDau1() != NULL){
      TLine *a1 = new TLine(x+xscale/4, y-ysize, x+xscale, y-ysize*2);
      a1->SetLineWidth(2);
      a1->Draw();
      DrawCell(cell->GetDau1(), foam, x+xscale, y-yscale, xscale/2, yscale);
   }

   TPaveText *t = new TPaveText(x-xsize, y-ysize, x+xsize, y+ysize, "NDC");

   t->SetBorderSize(1);
   t->SetFillStyle(1);

   // draw all cell elements
   t->AddText( Form("Intg=%.5f", cell->GetIntg()) );
   t->AddText( Form("Var=%.5f", cell->GetDriv()) );
   TVectorD *vec = (TVectorD*) cell->GetElement();
   if (vec != NULL){
      for (Int_t i = 0; i < vec->GetNrows(); ++i) {
	 t->AddText( Form("E[%i]=%.5f", i, vec(i)) );
      }
   }

   if (cell->GetStat() != 1) {
      // cell is inactive --> draw split point
      t->SetFillColor( TColor::GetColor("#BBBBBB") );
      t->SetTextColor( TColor::GetColor("#000000") );

      // cell position and size
      TMVA::PDEFoamVect cellPosi(foam->GetTotDim()), cellSize(foam->GetTotDim());
      cell->GetHcub(cellPosi, cellSize);
      Int_t    kBest = cell->GetBest(); // best division variable
      Double_t xBest = cell->GetXdiv(); // best division point
      t->AddText( Form("dim=%i", kBest) );
      t->AddText( Form("cut=%.5g", foam->VarTransformInvers(kBest,cellPosi[kBest] + xBest*cellSize[kBest])) );
   } else {
      t->SetFillColor( TColor::GetColor("#DD0033") );
      t->SetTextColor( TColor::GetColor("#FFFFFF") );
   }

   t->Draw();

   return;
}
示例#8
0
TPaveText *text(const char *txt, float x1, float y1, float x2, float y2) {
  TPaveText *text = new TPaveText(x1,y1,x2,y2,"brNDC");
  text->AddText(txt);
  text->SetBorderSize(0);
  text->SetFillStyle(0);
  text->SetTextAlign(12);
  text->SetTextFont(42);
  text->SetTextSize(0.05);
  return text;
}
示例#9
0
void OverlayAnalysis::PostDrawMultiGraph(GraphName graphName, TMultiGraph *pMultiGraph) const
{
    if(NULL == pMultiGraph)
        return;

    // base customize
    pMultiGraph->GetXaxis()->SetTitle("Distance between showers [cm]");
    pMultiGraph->GetXaxis()->SetLabelFont(42);
    pMultiGraph->GetXaxis()->SetTitleSize(0.05);
    pMultiGraph->GetXaxis()->SetTitleOffset(1.);
    pMultiGraph->GetXaxis()->SetTitleFont(42);
    pMultiGraph->GetXaxis()->SetRangeUser(std::max(static_cast<int>(m_startDistance) - 5, 0), m_endDistance + 5);

    pMultiGraph->GetYaxis()->SetTitle("");
    pMultiGraph->GetYaxis()->SetLabelFont(42);
    pMultiGraph->GetYaxis()->SetTitleSize(0.045);
    pMultiGraph->GetYaxis()->SetTitleOffset(1.3);
    pMultiGraph->GetYaxis()->SetTitleFont(42);
    pMultiGraph->GetYaxis()->SetLabelSize(0.035);

    TPaveText *pt = new TPaveText(0.3, 0.2, 0.93, 0.3, "tbNDC");
    pt->SetTextSize(0.05);
    pt->SetTextColor(kGray+2);
    pt->SetFillColor(0);
    pt->SetLineWidth(0);
    pt->SetBorderSize(0);
    pt->AddText("CALICE SDHCAL");
    pt->SetTextFont(62);
    pt->Draw();

    // plot per plot customize
    switch(graphName)
    {
    case N_PFOS:
        pMultiGraph->GetYaxis()->SetTitle("<N_{pfos}>");
        pMultiGraph->GetYaxis()->SetRangeUser(1, 3);
        break;
    case NEUTRAL_PURITY:
        pMultiGraph->GetYaxis()->SetTitle("#rho_{neutral}");
        pMultiGraph->GetYaxis()->SetRangeUser(0, 1);
        break;
    case NEUTRAL_EFFICIENCY:
        pMultiGraph->GetYaxis()->SetTitle("#varepsilon_{neutral}");
        pMultiGraph->GetYaxis()->SetRangeUser(0, 1);
        break;
    case NEUTRAL_RECOVER_PROBA:
        pMultiGraph->GetYaxis()->SetTitle("P_{n>0}");
        pMultiGraph->GetYaxis()->SetRangeUser(0, 1);
        break;
    case NEUTRAL_ENERGY_DIFFERENCE_EFFICIENT:
        pMultiGraph->GetYaxis()->SetTitle("<E_{n,rec} - E_{n,meas}>, n>0");
        pMultiGraph->GetYaxis()->SetRangeUser(-5, 5);
        break;
    }
}
示例#10
0
文件: plot.C 项目: Hosein47/usercode
TCanvas * plot (TH1F* histoDataIn, TString legendData, TH1F* histoSimulationIn, TString legendSimulation,
                TString & canvasName, Float_t maximum = 0.15, TString xAxisTitle = "#eta",
                TString yAxisTitle = "Number of Clusters", TString error = "", bool useLegend = true,
                TString text = "", Float_t textX = 0.7, Float_t textY = 0.4, Float_t rebin = 0 ) {

  TH1F * histoData = (TH1F*)histoDataIn->Clone();
  TH1F * histoSimulation = (TH1F*)histoSimulationIn->Clone();

  // histoData->Sumw2();
  histoData->Scale(1/(histoData->Integral()));
  histoSimulation->Scale(1/(histoSimulation->Integral()));

  // Create also the legend and add the histograms
  TLegend * legend = new TLegend( 0.55, 0.65, 0.76, 0.82 );
  legend->AddEntry( histoData, xAxisTitle );
  legend->AddEntry( histoSimulation, yAxisTitle, "F" );

  cout << "histoData = " << histoData << endl;
  cout << "histoSimulation = " << histoSimulation << endl;

  TCanvas * c = new TCanvas( canvasName, canvasName, 1000, 800 );
  c->Draw();

  histoSimulation->SetMaximum(maximum);

  histoSimulation->SetFillColor(kRed);
  // histoSimulation->SetLineWidth(0);
  histoSimulation->SetLineColor(kRed);
  histoSimulation->SetXTitle(xAxisTitle);
  histoSimulation->SetYTitle(yAxisTitle);
  histoSimulation->SetTitleOffset(1.6,"Y");
  histoSimulation->SetTitle();

  histoData->SetLineStyle(1);
  histoData->SetLineWidth(2.5);

  histoSimulation->Draw();
  histoData->Draw("same");

  legend->SetFillColor(kWhite);
  if (useLegend) legend->Draw("same");

  if ( text != "" ) {
    TPaveText * pt = new TPaveText(textX, textY, textX+0.2, textY+0.17, "NDC" ); // "NDC" option sets coords relative to pad dimensions
    pt->SetFillColor(0); // text is black on white
    pt->SetTextSize(0.08); 
    pt->SetBorderSize(0);
    pt->SetTextAlign(12);
    pt->AddText(text);
    pt->Draw("same");       //to draw your text object
  }

  return c;
};
void 
CMSPrelim(const char* dataset, const char* channel,const char* cat)
{
  double lowX=0.16;
  double lowY=0.835;

  int color=1; int font = 62;
  
  TPaveText* cmsprel  = new TPaveText(lowX, lowY+0.06, lowX+0.30, lowY+0.16, "NDC");
  cmsprel->SetBorderSize(   0 );
  cmsprel->SetFillStyle(    0 );
  cmsprel->SetTextAlign(   12 );
  cmsprel->SetTextColor( color );
  cmsprel->SetTextFont ( font );
  //cmsprel->SetTextSize ( 0.035 );
  //cmsprel->SetTextSize ( 0.027 );
  cmsprel->SetTextSize ( 0.030 );
  cmsprel->AddText(dataset);
  cmsprel->Draw();

  TPaveText* chan     = new TPaveText(lowX+0.05, lowY-0.002, lowX+0.45, lowY+0.028, "NDC");
  chan->SetBorderSize(   0 );
  chan->SetFillStyle(    0 );
  chan->SetTextAlign(   12 );
  chan->SetTextSize ( 0.035 );
  chan->SetTextColor( color );
  chan->SetTextFont ( font );
  chan->AddText(channel);
  chan->Draw();

  TPaveText* category     = new TPaveText(lowX+0.05, lowY-0.002-0.06, lowX+0.45, lowY+0.028-0.06, "NDC");
  category->SetBorderSize(   0 );
  category->SetFillStyle(    0 );
  category->SetTextAlign(   12 );
  category->SetTextSize ( 0.035 );
  category->SetTextColor( color );
  category->SetTextFont ( font );
  category->AddText(cat);
  category->Draw();
}
示例#12
0
TPaveText* addLHCbLabel(TString footer){
	TPaveText * label = new TPaveText(0.70,0.12,0.9,0.32,"BRNDC");
	//TPaveText * label = new TPaveText(0.12, 0.58, 0.12, 0.43,"BRNDC");
	//label->SetFillColor(0);
	label->SetFillStyle(0);
	label->SetBorderSize(0);
	label->SetTextAlign(11);
	label->SetTextSize(Float_t(0.04));
	TText * labeltext = 0;
	labeltext = label->AddText("LHC#font[12]{b} 2011 Data");
	labeltext = label->AddText("#sqrt{s} = 7TeV");
	labeltext = label->AddText(footer);
	return label;
}
示例#13
0
文件: online.C 项目: cipriangal/pan
void OnlineGUI::BadDraw(TString errMessage) {
  // Routine to display (in Pad) why a particular draw method has
  // failed.
  TPaveText *pt = new TPaveText(0.1,0.1,0.9,0.9,"brNDC");
  pt->SetBorderSize(3);
  pt->SetFillColor(10);
  pt->SetTextAlign(22);
  pt->SetTextFont(72);
  pt->SetTextColor(2);
  pt->AddText(errMessage.Data());
  pt->Draw();
//   cout << errMessage << endl;

}
示例#14
0
//	Originally Written by Conor Fitzpatrick
TPaveText* addLHCbLabel(TString footer, bool DATA){
	//
	TPaveText * label = new TPaveText(0.18, 0.73, 0.18, 0.88,"BRNDC");
	label->SetFillStyle(0);         //Transparent i.e. Opacity of 0 :D
	label->SetBorderSize(0);
	label->SetTextAlign(11);
	label->SetTextSize(Float_t(0.04));
	TText * labeltext = 0;
	TString labeltstring( "LHC#font[12]{b} 2011" );
	if( DATA ) labeltstring.Append( " Data" );
	if( !DATA ) labeltstring.Append( " Simulation" );
	labeltext = label->AddText( labeltstring );
	labeltext = label->AddText("#sqrt{s} = 7TeV");
	labeltext = label->AddText(footer);
	(void) labeltext;
	return label;
}
示例#15
0
// Draw label for Decay Channel in upper left corner of plot
void DrawDecayChLabel(TString decaychannel, double textSize) {

    TPaveText *decch = new TPaveText();

    decch->AddText(decaychannel);

    decch->SetX1NDC(      gStyle->GetPadLeftMargin() + gStyle->GetTickLength()        );
    decch->SetY1NDC(1.0 - gStyle->GetPadTopMargin()  - gStyle->GetTickLength() - 0.05 );
    decch->SetX2NDC(      gStyle->GetPadLeftMargin() + gStyle->GetTickLength() + 0.15 );
    decch->SetY2NDC(1.0 - gStyle->GetPadTopMargin()  - gStyle->GetTickLength()        );

    decch->SetFillStyle(0);
    decch->SetBorderSize(0);
    if (textSize!=0) decch->SetTextSize(textSize);
    decch->SetTextAlign(12);
    decch->Draw("same");
}
示例#16
0
void DrawFreeCMSLabels(char* text, double textSize) {

  //const char *text = "%2.1f #times 10^{6} clusters (fiducial) (%1.1f GeV)";
  //char *text = "%2.1f #times 10^{6} clusters (fiducial)";
    
  TPaveText *label = new TPaveText();
  label->SetX1NDC(gStyle->GetPadLeftMargin());
  label->SetY1NDC(1.0-gStyle->GetPadTopMargin());
  label->SetX2NDC(1.0-gStyle->GetPadRightMargin());
  label->SetY2NDC(1.0);
  label->SetTextFont(42);
  label->AddText(text);
  label->SetFillStyle(0);
  label->SetBorderSize(0);
  if (textSize!=0) label->SetTextSize(textSize);
  label->SetTextAlign(32);
  label->Draw("same");
}
示例#17
0
TPaveText* getHeader(double lumi, TString channelName)
{
  TPaveText* pt = new TPaveText(0.18,0.75,0.18,0.88,"brNDC");

  pt->SetBorderSize(1);
  pt->SetTextFont(42);
  pt->SetTextSize(0.04);
  pt->SetLineColor(0);
  pt->SetLineStyle(1);
  pt->SetLineWidth(1);
  pt->SetFillColor(0);
  pt->SetFillStyle(1001);
  pt->SetTextAlign(12);
  pt->AddText("CMS Preliminary");
  pt->AddText(Form("%.1f fb^{-1} at  #sqrt{s} = 7 TeV", lumi));
  if ( channelName != "" ) pt->AddText(channelName);

  return pt;
}
示例#18
0
///
/// Draw a horizontal line at given p-value, put a
/// label on top of it stating the corresponding CL.
///
void OneMinusClPlot::drawCLguideLine(float pvalue)
{
	m_mainCanvas->cd();
	m_mainCanvas->Update();
	float ymin = gPad->GetUymin();
	float ymax = gPad->GetUymax();
	float xmin = gPad->GetUxmin();
	float xmax = gPad->GetUxmax();

	float labelPos = xmin+(xmax-xmin)*0.10;
	if ( arg->isQuickhack(2) ) labelPos = xmin+(xmax-xmin)*0.55;
  if ( arg->isQuickhack(23) ) labelPos = xmin+(xmax-xmin)*0.8;
	float labelPosYmin = 0;
	float labelPosYmax = 0;

	if ( arg->plotlog ) {
		labelPosYmin = pvalue;
		labelPosYmax = labelPosYmin * 2.;
	}
	else {
		labelPosYmin = pvalue + 0.02;
		labelPosYmax = labelPosYmin + 0.05;
	}

	TPaveText *t = new TPaveText(labelPos, labelPosYmin, labelPos+(xmax-xmin)*0.5, labelPosYmax, "BR");
	t->SetBorderSize(0);
	t->SetFillStyle(0);
	t->SetTextAlign(12);
	t->SetTextFont(font);
	t->SetTextSize(labelsize);
	t->AddText(Form("%.1f%%",(1.-pvalue)*100.));
	t->Draw();

	TLine* l = new TLine(xmin, pvalue, xmax, pvalue);
	l->SetLineWidth(1);
	l->SetLineColor(kBlack);
	l->SetLineStyle(kDotted);
	l->Draw();
}
示例#19
0
void CMSPrelim()
{
  
  
  TPaveText* cmsprel  = new TPaveText(0.19, 0.895 , 0.19 + 0.30, 0.895 + 0.10, "NDC");
  cmsprel->SetBorderSize(   0 );
  cmsprel->SetFillStyle(    0 );
  cmsprel->SetTextAlign(   12 );
  cmsprel->SetTextColor( 1 );
  cmsprel->SetTextFont ( 62 );

  //cmsprel->SetTextSize ( 0.035 );
  //cmsprel->AddText("CMS Preliminary,  #sqrt{s}=7-8 TeV,  L=24.3 fb^{-1},  H#rightarrow#tau#tau");

  //cmsprel->SetTextSize ( 0.027 );
  //cmsprel->AddText("CMS Preliminary, L=4.9 fb^{-1}@#sqrt{s}=7 TeV, L=19.3 fb^{-1}@#sqrt{s}=8 TeV, H#rightarrow#tau#tau");
  //cmsprel->AddText("CMS Preliminary,  #sqrt{s}=7 TeV, L=4.9 fb^{-1}; #sqrt{s}=8 TeV, L=19.3 fb^{-1}; H#rightarrow#tau#tau");

  cmsprel->SetTextSize ( 0.030 );
  cmsprel->AddText("CMS Preliminary,  H#rightarrow#tau#tau,  4.9 fb^{-1} at 7 TeV, 19.4 fb^{-1} at 8 TeV");

  cmsprel->Draw();

}
示例#20
0
// Draw official labels (CMS Preliminary, luminosity and CM energy) above plot
void DrawCMSLabels(int cmsprelim=1, double energy=8, double textSize=0.04) {

    const char *text;
    if(cmsprelim ==2 ) {//Private work for PhDs students
        text = "Private Work, Simulation at #sqrt{s} = %2.f TeV";
    } else if (cmsprelim==1) {//CMS preliminary label
        text = "CMS Preliminary, Simulation at #sqrt{s} = %2.f TeV";
    } else {//CMS label
        text = "CMS, Simulation at #sqrt{s} = %2.f TeV";
    }
    
    TPaveText *label = new TPaveText();
    label->SetX1NDC(gStyle->GetPadLeftMargin());
    label->SetY1NDC(1.0-gStyle->GetPadTopMargin());
    label->SetX2NDC(1.0-gStyle->GetPadRightMargin());
    label->SetY2NDC(1.0);
    label->SetTextFont(42);
    label->AddText(Form(text, energy));
    label->SetFillStyle(0);
    label->SetBorderSize(0);
    if (textSize!=0) label->SetTextSize(textSize);
    label->SetTextAlign(32);
    label->Draw("same");
}
示例#21
0
void  peakOverlay(bool allpk=0, int ipeak=3) {

  double normalization = allpk?0.5:1.0;  // rapidity normalization -- note normalization values are set by hand at the moment 

  gROOT->LoadMacro("setTDRStyle_modified.C");
  setTDRStyle();

  if(allpk)
    assert(!ipeak);
  else
    assert(ipeak);
    
  const int ngr = allpk?3:2;
  
  TString path("mode");
  if(allpk) path+="0";
  else    path+="1";
  path+="/";
  

  TString title[ngr];
  if(allpk) {
    title[0] = "#Upsilon(1S)"; title[1] = "#Upsilon(2S)"; title[2] = "#Upsilon(3S)";
  } else {
    title[0] = "    |y|<1"; title[1]="1<|y|<2";
  }
  
  TString nfile[ngr];
  for(int i=0; i<ngr; i++)
    if(allpk)
      nfile[i] = TString::Format("%sxsection_%ds_y0.root",path.Data(),i+1);
    else 
      nfile[i] = TString::Format("%sxsection_%ds_y%d.root",path.Data(),ipeak,i);

  TFile* file[ngr];
  for(int i=0; i<ngr; i++)
    file[i] = TFile::Open(nfile[i],"read");
  
  TGraphAsymmErrors* gr[ngr], *grsta[ngr], *grsys[ngr];
  enum unc {all,sys,sta,cen};

  TFile* file[ngr];
  for(int i=0; i<ngr; i++) {
    file [i] = TFile::Open(nfile[i],"read");  
    gr   [i] = (TGraphAsymmErrors*)((TMultiGraph*)file[i]->Get("mg1"))->GetListOfGraphs()->At(all);//all
    grsys[i] = (TGraphAsymmErrors*)((TMultiGraph*)file[i]->Get("mg1"))->GetListOfGraphs()->At(sys);//all but lumi
    grsta[i] = (TGraphAsymmErrors*)((TMultiGraph*)file[i]->Get("mg1"))->GetListOfGraphs()->At(sta);//sta
  }
  
  for(int i=0; i<ngr; i++) {
    normalize(gr   [i],normalization);
    normalize(grsta[i],normalization);
    normalize(grsys[i],normalization);
  }

  TPaveText *tp = new TPaveText(0.5,0.8,0.8,0.9,"brNDC");
  tp->SetBorderSize(0);
  tp->AddText("CMS,  #sqrt{s} = 7 TeV");
  if(allpk)
    tp->AddText("L = 3 pb^{-1},  |y|<2");
  else {
    tp->AddText("L = 3 pb^{-1}");
  }

  TPaveText *tpp = new TPaveText(0.75,0.5,0.86,0.6,"brNDC");
  tpp->SetBorderSize(0);
  tpp->AddText(TString::Format("#Upsilon(%dS)",ipeak)); 

  
  TLegend *leg;
  if(allpk)
    leg = new TLegend(0.7,0.6,0.9,0.75);	
  else
    leg = new TLegend(0.7,0.65,0.9,0.75);
	
  int marker[]={21,24,22};
  for(int i=0; i<ngr; i++) {
    //these are needed, unless we re-run xsecresults with newstyle
    gr[i]->SetMarkerSize (1.4);
    if(i==2)
      gr[i]->SetMarkerSize (1.7);
    gr[i]->SetMarkerColor(13);
    //gr[i]->SetMarkerColor(2+2*i);
    //gr[i]->SetLineColor  (2+2*i);
    gr[i]->SetMarkerStyle(marker[i]);
    //gr[i]->SetMarkerStyle(27-3*i);
    leg->AddEntry(gr[i],title[i],"lpe");
  }

  if(!allpk) {
    //gr[0]->SetMarkerSize (1.4);
    //  gr[1]->SetMarkerSize (1.4);
  //gr[1]->SetFillColor(0.);
  }
  TCanvas a;
  TH1F *hh = gPad->DrawFrame(0.001,0,30,1);

  for(int i=0; i<ngr; i++) {
    grsta[i]->SetLineColor  (38);
    grsta[i]->SetMarkerColor(38);
    grsta[i]->SetFillColor  (38);
    grsta[i]->SetMarkerStyle(21);
    grsta[i]->SetMarkerSize(0.8);

    grsys[i]->SetLineColor  (kRed);
    grsys[i]->SetMarkerColor(kRed);
    grsys[i]->SetMarkerStyle(25);	
    grsys[i]->SetMarkerSize(0.8);	
    grsys[i]->SetFillStyle(0);    	
    grsys[i]->SetLineWidth(2);
  }

  for(int i=0; i<ngr; i++) {
    gr   [i]->Draw("e0");
    grsys[i]->Draw("[]");
    gr   [i]->Draw("pxy");
    //grsta[i]->Draw("e2"); //disabled, to simplify plot
  }

  double dummyx[1] = {0.}, dummyy[1] = {0.};
  dummy = new TGraph(1, dummyx, dummyy);

  TLegend *uleg = new TLegend(0.15,0.2,0.45,0.3);	
  //uleg->AddEntry(gr[0],"total uncertainty","p");
  //uleg->AddEntry(grsta[0],"stat. unc.","p");
  uleg->AddEntry(grsys[0],"total unc. except","p");
  //uleg->AddEntry(dummy,"global lumi unc. (11%)","e0");
  uleg->AddEntry(dummy,"luminosity (11%)","e0");
  uleg->Draw();

  leg->Draw();
  tp->Draw();
  if(!allpk)
    tpp->Draw();

  hh->GetYaxis()->SetTitleOffset(1.08); //needed
  hh->GetYaxis()->SetLabelSize(0.0475); //0.05
  //hh->GetXaxis()->SetLabelSize(0.045); //for consistency with y
  hh->GetYaxis()->SetTitleSize(0.055); //needed to fit...

  //TString ytitle = 
  TString ytitle;
  if(allpk)
    if(absrap)
      ytitle = TString::Format("d^{2}#sigma/dp_{T}d|y| #times #Beta(#mu#mu) (nb/(GeV/c))");
    else
      ytitle = TString::Format("d^{2}#sigma/dp_{T}dy #times #Beta(#mu#mu) (nb/(GeV/c))");
  else
    if(absrap)
      ytitle = TString::Format("d^{2}#sigma/dp_{T}d|y| #times #Beta(#mu#mu) (nb/(GeV/c))");
    else
      ytitle = TString::Format("d^{2}#sigma/dp_{T}dy #times #Beta(#mu#mu) (nb/(GeV/c))");

  hh->GetYaxis()->SetTitle(ytitle);
  hh->GetXaxis()->SetTitle("p_{T}^{#Upsilon} (GeV/c)");
  if(absrap)
    hh->SetMinimum(0.0005);
  else
    hh->SetMinimum(0.0002);
  hh->SetMaximum(1.0001);
  hh->GetXaxis()->SetRangeUser(0,30);
  
  gPad->SetLogy();
  
  TString pname;
  if(allpk)
    pname = TString::Format("xsec_overlay");
  else
    pname = TString::Format("xsec_%ds_2ybin",ipeak);

  a.SaveAs(path+pname + ".pdf");
  a.SaveAs(path+pname + ".gif");
  
  for(int i=0; i<ngr; i++)
    file[i]->Close();

  return;
}
void TracktoLCTYfull_2016B_June22all_sameYrange_fullIntegral_10k9k_lin()
{
//=========Macro generated from canvas: TracktoLCTYfull/TracktoLCTYfull
//=========  (Sat Aug  6 07:01:22 2016) by ROOT version6.06/01
   TCanvas *TracktoLCTYfull = new TCanvas("TracktoLCTYfull", "TracktoLCTYfull",0,0,500,500);
   gStyle->SetOptStat(0);
   TracktoLCTYfull->SetHighLightColor(2);
   TracktoLCTYfull->Range(-10000.5,-14.99438,-9995.5,134.9994);
   TracktoLCTYfull->SetFillColor(0);
   TracktoLCTYfull->SetBorderMode(0);
   TracktoLCTYfull->SetBorderSize(2);
   TracktoLCTYfull->SetFrameBorderMode(0);
   TracktoLCTYfull->SetFrameBorderMode(0);
   
   TH1D *TracktoLCTYfull_1__73 = new TH1D("TracktoLCTYfull_1__73","TracktoLCTYfull",100,-10000,-9996);
   TracktoLCTYfull_1__73->SetBinContent(26,100);
   TracktoLCTYfull_1__73->SetBinContent(101,26.00723);
   TracktoLCTYfull_1__73->SetMinimum(0.005);
   TracktoLCTYfull_1__73->SetMaximum(120);
   TracktoLCTYfull_1__73->SetEntries(675802);
   TracktoLCTYfull_1__73->SetStats(0);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#ff00ff");
   TracktoLCTYfull_1__73->SetLineColor(ci);

   ci = TColor::GetColor("#ff00ff");
   TracktoLCTYfull_1__73->SetMarkerColor(ci);
   TracktoLCTYfull_1__73->GetXaxis()->SetTitle("cm");
   TracktoLCTYfull_1__73->GetYaxis()->SetTitle("scaled number of entries");
   TracktoLCTYfull_1__73->Draw("H");
   
   TLegend *leg = new TLegend(0.5,0.7,0.9,0.9,NULL,"brNDC");
   leg->SetBorderSize(1);
   leg->SetTextFont(62);
   leg->SetTextSize(0.02);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("TracktoLCTYfull_1","ME11A: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#ff00ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_2","ME11B: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#ff9999");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_3","ME12+13: mean:-9999.0cm;RMS:0.0cm","l");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_4","ME2: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#ff0000");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_5","ME3: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#00ff00");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_6","ME4: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   leg->Draw();
   
   TH1D *TracktoLCTYfull_2__74 = new TH1D("TracktoLCTYfull_2__74","TracktoLCTYfull",100,-10000,-9996);
   TracktoLCTYfull_2__74->SetBinContent(26,100);
   TracktoLCTYfull_2__74->SetBinContent(101,35.88015);
   TracktoLCTYfull_2__74->SetEntries(1185341);
   TracktoLCTYfull_2__74->SetStats(0);

   ci = TColor::GetColor("#ff9999");
   TracktoLCTYfull_2__74->SetLineColor(ci);

   ci = TColor::GetColor("#ff9999");
   TracktoLCTYfull_2__74->SetMarkerColor(ci);
   TracktoLCTYfull_2__74->GetXaxis()->SetTitle("cm");
   TracktoLCTYfull_2__74->GetYaxis()->SetTitle("scaled number of entries");
   TracktoLCTYfull_2__74->Draw("H,same");
   
   leg = new TLegend(0.5,0.7,0.9,0.9,NULL,"brNDC");
   leg->SetBorderSize(1);
   leg->SetTextFont(62);
   leg->SetTextSize(0.02);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   entry=leg->AddEntry("TracktoLCTYfull_1","ME11A: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#ff00ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_2","ME11B: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#ff9999");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_3","ME12+13: mean:-9999.0cm;RMS:0.0cm","l");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_4","ME2: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#ff0000");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_5","ME3: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#00ff00");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_6","ME4: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   leg->Draw();
   
   TH1D *TracktoLCTYfull_3__75 = new TH1D("TracktoLCTYfull_3__75","TracktoLCTYfull",100,-10000,-9996);
   TracktoLCTYfull_3__75->SetBinContent(26,100);
   TracktoLCTYfull_3__75->SetBinContent(101,122.3848);
   TracktoLCTYfull_3__75->SetEntries(389596);
   TracktoLCTYfull_3__75->SetStats(0);
   TracktoLCTYfull_3__75->GetXaxis()->SetTitle("cm");
   TracktoLCTYfull_3__75->GetYaxis()->SetTitle("scaled number of entries");
   TracktoLCTYfull_3__75->Draw("H,same");
   
   leg = new TLegend(0.5,0.7,0.9,0.9,NULL,"brNDC");
   leg->SetBorderSize(1);
   leg->SetTextFont(62);
   leg->SetTextSize(0.02);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   entry=leg->AddEntry("TracktoLCTYfull_1","ME11A: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#ff00ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_2","ME11B: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#ff9999");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_3","ME12+13: mean:-9999.0cm;RMS:0.0cm","l");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_4","ME2: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#ff0000");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_5","ME3: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#00ff00");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_6","ME4: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   leg->Draw();
   
   TH1D *TracktoLCTYfull_4__76 = new TH1D("TracktoLCTYfull_4__76","TracktoLCTYfull",100,-10000,-9996);
   TracktoLCTYfull_4__76->SetBinContent(26,100);
   TracktoLCTYfull_4__76->SetBinContent(101,49.76866);
   TracktoLCTYfull_4__76->SetEntries(1890705);
   TracktoLCTYfull_4__76->SetStats(0);

   ci = TColor::GetColor("#ff0000");
   TracktoLCTYfull_4__76->SetLineColor(ci);

   ci = TColor::GetColor("#ff0000");
   TracktoLCTYfull_4__76->SetMarkerColor(ci);
   TracktoLCTYfull_4__76->GetXaxis()->SetTitle("cm");
   TracktoLCTYfull_4__76->GetYaxis()->SetTitle("scaled number of entries");
   TracktoLCTYfull_4__76->Draw("H,same");
   
   leg = new TLegend(0.5,0.7,0.9,0.9,NULL,"brNDC");
   leg->SetBorderSize(1);
   leg->SetTextFont(62);
   leg->SetTextSize(0.02);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   entry=leg->AddEntry("TracktoLCTYfull_1","ME11A: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#ff00ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_2","ME11B: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#ff9999");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_3","ME12+13: mean:-9999.0cm;RMS:0.0cm","l");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_4","ME2: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#ff0000");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_5","ME3: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#00ff00");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_6","ME4: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   leg->Draw();
   
   TH1D *TracktoLCTYfull_5__77 = new TH1D("TracktoLCTYfull_5__77","TracktoLCTYfull",100,-10000,-9996);
   TracktoLCTYfull_5__77->SetBinContent(26,100);
   TracktoLCTYfull_5__77->SetBinContent(101,63.70034);
   TracktoLCTYfull_5__77->SetEntries(1394704);
   TracktoLCTYfull_5__77->SetStats(0);

   ci = TColor::GetColor("#00ff00");
   TracktoLCTYfull_5__77->SetLineColor(ci);

   ci = TColor::GetColor("#00ff00");
   TracktoLCTYfull_5__77->SetMarkerColor(ci);
   TracktoLCTYfull_5__77->GetXaxis()->SetTitle("cm");
   TracktoLCTYfull_5__77->GetYaxis()->SetTitle("scaled number of entries");
   TracktoLCTYfull_5__77->Draw("H,same");
   
   leg = new TLegend(0.5,0.7,0.9,0.9,NULL,"brNDC");
   leg->SetBorderSize(1);
   leg->SetTextFont(62);
   leg->SetTextSize(0.02);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   entry=leg->AddEntry("TracktoLCTYfull_1","ME11A: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#ff00ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_2","ME11B: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#ff9999");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_3","ME12+13: mean:-9999.0cm;RMS:0.0cm","l");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_4","ME2: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#ff0000");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_5","ME3: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#00ff00");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_6","ME4: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   leg->Draw();
   
   TH1D *TracktoLCTYfull_6__78 = new TH1D("TracktoLCTYfull_6__78","TracktoLCTYfull",100,-10000,-9996);
   TracktoLCTYfull_6__78->SetBinContent(26,100);
   TracktoLCTYfull_6__78->SetBinContent(101,78.02474);
   TracktoLCTYfull_6__78->SetEntries(1102290);
   TracktoLCTYfull_6__78->SetStats(0);

   ci = TColor::GetColor("#0000ff");
   TracktoLCTYfull_6__78->SetLineColor(ci);

   ci = TColor::GetColor("#0000ff");
   TracktoLCTYfull_6__78->SetMarkerColor(ci);
   TracktoLCTYfull_6__78->GetXaxis()->SetTitle("cm");
   TracktoLCTYfull_6__78->GetYaxis()->SetTitle("scaled number of entries");
   TracktoLCTYfull_6__78->Draw("H,same");
   
   leg = new TLegend(0.5,0.7,0.9,0.9,NULL,"brNDC");
   leg->SetBorderSize(1);
   leg->SetTextFont(62);
   leg->SetTextSize(0.02);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   entry=leg->AddEntry("TracktoLCTYfull_1","ME11A: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#ff00ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_2","ME11B: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#ff9999");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_3","ME12+13: mean:-9999.0cm;RMS:0.0cm","l");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_4","ME2: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#ff0000");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_5","ME3: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#00ff00");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("TracktoLCTYfull_6","ME4: mean:-9999.0cm;RMS:0.0cm","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   leg->Draw();
   
   TPaveText *pt = new TPaveText(0.01,0.945,0.3707258,0.995,"blNDC");
   pt->SetName("title");
   pt->SetBorderSize(1);
   pt->SetFillColor(0);
   TText *AText = pt->AddText("TracktoLCTYfull");
   pt->Draw();
   TracktoLCTYfull->Modified();
   TracktoLCTYfull->cd();
   TracktoLCTYfull->SetSelected(TracktoLCTYfull);
}
示例#23
0
void 
HTT_MT_X(bool scaled=true, bool log=true, float min=0.1, float max=-1., const char* inputfile="root/$HISTFILE", const char* directory="muTau_$CATEGORY")
{
  // defining the common canvas, axes pad styles
  SetStyle(); gStyle->SetLineStyleString(11,"20 10");

  // determine category tag
  const char* category_extra = "";
  if(std::string(directory) == std::string("muTau_0jet_low"  )){ category_extra = "0 jet, low p_{T}";  }
  if(std::string(directory) == std::string("muTau_0jet_high" )){ category_extra = "0 jet, high p_{T}"; }
  if(std::string(directory) == std::string("muTau_boost_low" )){ category_extra = "1 jet, low p_{T}";  }
  if(std::string(directory) == std::string("muTau_boost_high")){ category_extra = "1 jet, high p_{T}"; }
  if(std::string(directory) == std::string("muTau_vbf"       )){ category_extra = "2 jet (VBF)";       }
  if(std::string(directory) == std::string("muTau_nobtag"    )){ category_extra = "No B-Tag";          }
  if(std::string(directory) == std::string("muTau_btag"      )){ category_extra = "B-Tag";             }

  const char* dataset;
  if(std::string(inputfile).find("7TeV")!=std::string::npos){dataset = "CMS Preliminary,  H#rightarrow#tau#tau, 4.9 fb^{-1} at 7 TeV";}
  if(std::string(inputfile).find("8TeV")!=std::string::npos){dataset = "CMS Preliminary,  H#rightarrow#tau#tau, 19.4 fb^{-1} at 8 TeV";}
#ifdef MSSM
  if(std::string(inputfile).find("8TeV")!=std::string::npos){dataset = "CMS Preliminary,  H#rightarrow#tau#tau, 12.1 fb^{-1} at 8 TeV";}
#endif
 
  // open example histogram file
  TFile* input = new TFile(inputfile);
  TH1F* Fakes  = refill((TH1F*)input->Get(TString::Format("%s/QCD"   , directory)), "QCD"); InitHist(Fakes, "", "", kMagenta-10, 1001);
  TH1F* EWK1   = refill((TH1F*)input->Get(TString::Format("%s/W"     , directory)), "W"  ); InitHist(EWK1 , "", "", kRed    + 2, 1001);
#ifdef EXTRA_SAMPLES
  TH1F* EWK2   = refill((TH1F*)input->Get(TString::Format("%s/ZJ"    , directory)), "ZJ" ); InitHist(EWK2 , "", "", kRed    + 2, 1001);
  TH1F* EWK3   = refill((TH1F*)input->Get(TString::Format("%s/ZL"    , directory)), "ZL" ); InitHist(EWK3 , "", "", kRed    + 2, 1001);
#else
  TH1F* EWK2   = refill((TH1F*)input->Get(TString::Format("%s/ZLL"   , directory)), "ZLL"); InitHist(EWK2 , "", "", kRed    + 2, 1001);
#endif
  TH1F* EWK    = refill((TH1F*)input->Get(TString::Format("%s/VV"    , directory)), "VV" ); InitHist(EWK  , "", "", kRed    + 2, 1001);
  TH1F* ttbar  = refill((TH1F*)input->Get(TString::Format("%s/TT"    , directory)), "TT" ); InitHist(ttbar, "", "", kBlue   - 8, 1001);
  TH1F* Ztt    = refill((TH1F*)input->Get(TString::Format("%s/ZTT"   , directory)), "ZTT"); InitHist(Ztt  , "", "", kOrange - 4, 1001);
#ifdef MSSM
  float ggHScale = 1., bbHScale = 1.; // scenario for MSSM, mhmax, mA=160, tanb=20, A + H for the time being
  if(std::string(inputfile).find("7TeV")!=std::string::npos){ ggHScale = ( 9157.9*0.119 + 10180.7*0.120)/1000.;
                                                             bbHScale = (23314.3*0.119 + 21999.3*0.120)/1000.; }
  if(std::string(inputfile).find("8TeV")!=std::string::npos){ ggHScale = (11815.3*0.119 + 13124.9*0.120)/1000.;
                                                             bbHScale = (31087.9*0.119 + 29317.8*0.120)/1000.; }
 //  float ggHScale = 1., bbHScale = 1.; // scenario for MSSM, mhmax, mA=160, tanb=10, A + H for the time being
//   if(std::string(inputfile).find("7TeV")!=std::string::npos){ ggHScale = (2111.4*0.11 + 4022.9*0.11)/1000.;
//                                                               bbHScale = (6211.6*0.11 + 5147.0*0.11)/1000.; }
//   if(std::string(inputfile).find("8TeV")!=std::string::npos){ ggHScale = (2729.9*0.11 + 5193.2*0.11)/1000.;
//                                                               bbHScale = (8282.7*0.11 + 6867.8*0.11)/1000.; }
  TH1F* ggH    = refill((TH1F*)input->Get(TString::Format("%s/ggH160", directory)), "ggH"); InitSignal(ggH); ggH ->Scale(ggHScale);
  TH1F* bbH    = refill((TH1F*)input->Get(TString::Format("%s/bbH160", directory)), "bbH"); InitSignal(bbH); bbH ->Scale(bbHScale);
#else
#ifndef DROP_SIGNAL
  TH1F* ggH    = refill((TH1F*)input->Get(TString::Format("%s/ggH125", directory)), "ggH"); InitSignal(ggH); ggH ->Scale(SIGNAL_SCALE);
  TH1F* qqH    = refill((TH1F*)input->Get(TString::Format("%s/qqH125", directory)), "qqH"); InitSignal(qqH); qqH ->Scale(SIGNAL_SCALE);
  TH1F* VH     = refill((TH1F*)input->Get(TString::Format("%s/VH125" , directory)), "VH" ); InitSignal(VH ); VH  ->Scale(SIGNAL_SCALE);
#endif
#endif
  TH1F* data   = refill((TH1F*)input->Get(TString::Format("%s/data_obs", directory)), "data", true);
  InitHist(data, "#bf{m_{#tau#tau} [GeV]}", "#bf{dN/dm_{#tau#tau} [1/GeV]}"); InitData(data);

  TH1F* ref=(TH1F*)Fakes->Clone("ref");
  ref->Add(EWK1 );
  ref->Add(EWK2 );
#ifdef EXTRA_SAMPLES
  ref->Add(EWK3 );
#endif
  ref->Add(EWK  );
  ref->Add(ttbar);
  ref->Add(Ztt  );

  double unscaled[7];
  unscaled[0] = Fakes->Integral();
  unscaled[1] = EWK  ->Integral();
  unscaled[1]+= EWK1 ->Integral();
  unscaled[1]+= EWK2 ->Integral();
#ifdef EXTRA_SAMPLES
  unscaled[1]+= EWK3 ->Integral();
#endif
  unscaled[2] = ttbar->Integral();
  unscaled[3] = Ztt  ->Integral();
#ifdef MSSM
  unscaled[4] = ggH  ->Integral();
  unscaled[5] = bbH  ->Integral();
  unscaled[6] = 0;
#else
#ifndef DROP_SIGNAL
  unscaled[4] = ggH  ->Integral();
  unscaled[5] = qqH  ->Integral();
  unscaled[6] = VH   ->Integral();
#endif
#endif

  if(scaled){
    rescale(Fakes, 7); 
    rescale(EWK1 , 3); 
    rescale(EWK2 , 4); 
#ifdef EXTRA_SAMPLES
    rescale(EWK3 , 5);
#endif 
    rescale(EWK  , 6); 
    rescale(ttbar, 2); 
    rescale(Ztt  , 1);
#ifdef MSSM
    rescale(ggH  , 8); 
    rescale(bbH  , 9);  
#else
#ifndef DROP_SIGNAL
    rescale(ggH  , 8); 
    rescale(qqH  , 9);  
    rescale(VH   ,10);  
#endif
#endif
  }

  TH1F* scales[7];
  scales[0] = new TH1F("scales-Fakes", "", 7, 0, 7);
  scales[0]->SetBinContent(1, unscaled[0]>0 ? (Fakes->Integral()/unscaled[0]-1.) : 0.);
  scales[1] = new TH1F("scales-EWK"  , "", 7, 0, 7);
  scales[1]->SetBinContent(2, unscaled[1]>0 ? ((EWK  ->Integral()
					       +EWK1 ->Integral()
					       +EWK2 ->Integral()
#ifdef EXTRA_SAMPLES
					       +EWK3 ->Integral()
#endif
						)/unscaled[1]-1.) : 0.);
  scales[2] = new TH1F("scales-ttbar", "", 7, 0, 7);
  scales[2]->SetBinContent(3, unscaled[2]>0 ? (ttbar->Integral()/unscaled[2]-1.) : 0.);
  scales[3] = new TH1F("scales-Ztt"  , "", 7, 0, 7);
  scales[3]->SetBinContent(4, unscaled[3]>0 ? (Ztt  ->Integral()/unscaled[3]-1.) : 0.);
#ifdef MSSM
  scales[4] = new TH1F("scales-ggH"  , "", 7, 0, 7);
  scales[4]->SetBinContent(5, unscaled[4]>0 ? (ggH  ->Integral()/unscaled[4]-1.) : 0.);
  scales[5] = new TH1F("scales-bbH"  , "", 7, 0, 7);
  scales[5]->SetBinContent(6, unscaled[5]>0 ? (bbH  ->Integral()/unscaled[5]-1.) : 0.);
  scales[6] = new TH1F("scales-NONE" , "", 7, 0, 7);
  scales[6]->SetBinContent(7, 0.);
#else
#ifndef DROP_SIGNAL
  scales[4] = new TH1F("scales-ggH"  , "", 7, 0, 7);
  scales[4]->SetBinContent(5, unscaled[4]>0 ? (ggH  ->Integral()/unscaled[4]-1.) : 0.);
  scales[5] = new TH1F("scales-qqH"  , "", 7, 0, 7);
  scales[5]->SetBinContent(6, unscaled[5]>0 ? (qqH  ->Integral()/unscaled[5]-1.) : 0.);
  scales[6] = new TH1F("scales-VH"   , "", 7, 0, 7);
  scales[6]->SetBinContent(7, unscaled[6]>0 ? (VH   ->Integral()/unscaled[6]-1.) : 0.);
#endif
#endif

  EWK1 ->Add(Fakes);
  EWK2 ->Add(EWK1 );
#ifdef EXTRA_SAMPLES
  EWK3 ->Add(EWK2 );
  EWK  ->Add(EWK3 );
#else
  EWK  ->Add(EWK2 );
#endif
  ttbar->Add(EWK  );
  Ztt  ->Add(ttbar);
  if(log){
#ifdef MSSM
    ggH  ->Add(bbH);
#else
#ifndef DROP_SIGNAL
    qqH  ->Add(VH );
    ggH  ->Add(qqH);
#endif
#endif
  }
  else{
#ifdef MSSM    
    bbH  ->Add(Ztt);
    ggH  ->Add(bbH);
#else
#ifndef DROP_SIGNAL
    VH   ->Add(Ztt);
    qqH  ->Add(VH );
    ggH  ->Add(qqH);
#endif
#endif
  }

  /*
    Mass plot before and after fit
  */
  TCanvas *canv = MakeCanvas("canv", "histograms", 600, 600);

  canv->cd();
  if(log){ canv->SetLogy(1); }
#if defined MSSM
  if(!log){ data->GetXaxis()->SetRange(0, data->FindBin(350)); } else{ data->GetXaxis()->SetRange(0, data->FindBin(1000)); };
#else
  data->GetXaxis()->SetRange(0, data->FindBin(350));
#endif
  data->SetNdivisions(505);
  data->SetMinimum(min);
  data->SetMaximum(max>0 ? max : std::max(maximum(data, log), maximum(Ztt, log)));
  data->Draw("e");

  TH1F* errorBand = (TH1F*)Ztt ->Clone();
  errorBand  ->SetMarkerSize(0);
  errorBand  ->SetFillColor(1);
  errorBand  ->SetFillStyle(3013);
  errorBand  ->SetLineWidth(1);
  for(int idx=0; idx<errorBand->GetNbinsX(); ++idx){
    if(errorBand->GetBinContent(idx)>0){
      std::cout << "Uncertainties on summed background samples: " << errorBand->GetBinError(idx)/errorBand->GetBinContent(idx) << std::endl;
      break;
    }
  }
  if(log){
    Ztt  ->Draw("histsame");
    ttbar->Draw("histsame");
    EWK  ->Draw("histsame");
    Fakes->Draw("histsame");
    $DRAW_ERROR
#ifndef DROP_SIGNAL
    ggH  ->Draw("histsame");
#endif
  }
  else{
#ifndef DROP_SIGNAL
    ggH  ->Draw("histsame");
#endif
    Ztt  ->Draw("histsame");
    ttbar->Draw("histsame");
    EWK  ->Draw("histsame");
    Fakes->Draw("histsame");
    $DRAW_ERROR
  }
  data->Draw("esame");
  canv->RedrawAxis();

  //CMSPrelim(dataset, "#tau_{#mu}#tau_{h}", 0.17, 0.835);
  CMSPrelim(dataset, "", 0.16, 0.835);  
  TPaveText* chan     = new TPaveText(0.20, 0.74+0.061, 0.32, 0.74+0.161, "NDC");
  chan->SetBorderSize(   0 );
  chan->SetFillStyle(    0 );
  chan->SetTextAlign(   12 );
  chan->SetTextSize ( 0.05 );
  chan->SetTextColor(    1 );
  chan->SetTextFont (   62 );
  chan->AddText("#mu#tau_{h}");
  chan->Draw();

  TPaveText* cat      = new TPaveText(0.20, 0.68+0.061, 0.32, 0.68+0.161, "NDC");
  cat->SetBorderSize(   0 );
  cat->SetFillStyle(    0 );
  cat->SetTextAlign(   12 );
  cat->SetTextSize ( 0.05 );
  cat->SetTextColor(    1 );
  cat->SetTextFont (   62 );
  cat->AddText(category_extra);
  cat->Draw();

#ifdef MSSM
  TPaveText* massA      = new TPaveText(0.75, 0.48+0.061, 0.85, 0.48+0.161, "NDC");
  massA->SetBorderSize(   0 );
  massA->SetFillStyle(    0 );
  massA->SetTextAlign(   12 );
  massA->SetTextSize ( 0.03 );
  massA->SetTextColor(    1 );
  massA->SetTextFont (   62 );
  massA->AddText("m_{A}=160GeV");
  massA->Draw();

  TPaveText* tanb      = new TPaveText(0.75, 0.44+0.061, 0.85, 0.44+0.161, "NDC");
  tanb->SetBorderSize(   0 );
  tanb->SetFillStyle(    0 );
  tanb->SetTextAlign(   12 );
  tanb->SetTextSize ( 0.03 );
  tanb->SetTextColor(    1 );
  tanb->SetTextFont (   62 );
  tanb->AddText("tan#beta=20");
  tanb->Draw();

  TPaveText* scen      = new TPaveText(0.75, 0.40+0.061, 0.85, 0.40+0.161, "NDC");
  scen->SetBorderSize(   0 );
  scen->SetFillStyle(    0 );
  scen->SetTextAlign(   12 );
  scen->SetTextSize ( 0.03 );
  scen->SetTextColor(    1 );
  scen->SetTextFont (   62 );
  scen->AddText("mhmax");
  scen->Draw();
#endif

#ifdef MSSM
  TLegend* leg = new TLegend(0.45, 0.65, 0.95, 0.90);
  SetLegendStyle(leg);
  leg->AddEntry(ggH  , "#phi#rightarrow#tau#tau" , "L" );
#else
  TLegend* leg = new TLegend(0.50, 0.65, 0.95, 0.90);
  SetLegendStyle(leg);
#ifndef DROP_SIGNAL
  if(SIGNAL_SCALE!=1){
    leg->AddEntry(ggH  , TString::Format("%.0f#timesH(125 GeV)#rightarrow#tau#tau", SIGNAL_SCALE) , "L" );
  }
  else{
    leg->AddEntry(ggH  , "H(125 GeV)#rightarrow#tau#tau" , "L" );
  }
#endif
#endif
  leg->AddEntry(data , "observed"                       , "LP");
  leg->AddEntry(Ztt  , "Z#rightarrow#tau#tau"           , "F" );
  leg->AddEntry(ttbar, "t#bar{t}"                       , "F" );
  leg->AddEntry(EWK  , "electroweak"                    , "F" );
  leg->AddEntry(Fakes, "QCD"                            , "F" );
  $ERROR_LEGEND
  leg->Draw();

//#ifdef MSSM
//  TPaveText* mssm  = new TPaveText(0.69, 0.85, 0.90, 0.90, "NDC");
//  mssm->SetBorderSize(   0 );
//  mssm->SetFillStyle(    0 );
//  mssm->SetTextAlign(   12 );
//  mssm->SetTextSize ( 0.03 );
//  mssm->SetTextColor(    1 );
//  mssm->SetTextFont (   62 );
//  mssm->AddText("(m_{A}=120, tan#beta=10)");
//  mssm->Draw();
//#else
//  TPaveText* mssm  = new TPaveText(0.83, 0.85, 0.95, 0.90, "NDC");
//  mssm->SetBorderSize(   0 );
//  mssm->SetFillStyle(    0 );
//  mssm->SetTextAlign(   12 );
//  mssm->SetTextSize ( 0.03 );
//  mssm->SetTextColor(    1 );
//  mssm->SetTextFont (   62 );
//  mssm->AddText("m_{H}=125");
//  mssm->Draw();
//#endif

  /*
    Ratio Data over MC
  */
  TCanvas *canv0 = MakeCanvas("canv0", "histograms", 600, 400);
  canv0->SetGridx();
  canv0->SetGridy();
  canv0->cd();

  TH1F* zero = (TH1F*)ref->Clone("zero"); zero->Clear();
  TH1F* rat1 = (TH1F*)data->Clone("rat"); 
  rat1->Divide(Ztt);
  for(int ibin=0; ibin<rat1->GetNbinsX(); ++ibin){
    if(rat1->GetBinContent(ibin+1)>0){
      // catch cases of 0 bins, which would lead to 0-alpha*0-1
      rat1->SetBinContent(ibin+1, rat1->GetBinContent(ibin+1)-1.);
    }
    zero->SetBinContent(ibin+1, 0.);
  }
  rat1->SetLineColor(kBlack);
  rat1->SetFillColor(kGray );
  rat1->SetMaximum(+0.5);
  rat1->SetMinimum(-0.5);
  rat1->GetYaxis()->CenterTitle();
  rat1->GetYaxis()->SetTitle("#bf{Data/MC-1}");
  rat1->GetXaxis()->SetTitle("#bf{m_{#tau#tau} [GeV]}");
  rat1->Draw();
  zero->SetLineColor(kBlack);
  zero->Draw("same");
  canv0->RedrawAxis();

  /*
    Ratio After fit over Prefit
  */
  TCanvas *canv1 = MakeCanvas("canv1", "histograms", 600, 400);
  canv1->SetGridx();
  canv1->SetGridy();
  canv1->cd();

  TH1F* rat2 = (TH1F*) Ztt->Clone("rat2");
  rat2->Divide(ref);
  for(int ibin=0; ibin<rat2->GetNbinsX(); ++ibin){
    if(rat2->GetBinContent(ibin+1)>0){
      // catch cases of 0 bins, which would lead to 0-alpha*0-1
      rat2 ->SetBinContent(ibin+1, rat2->GetBinContent(ibin+1)-1.);
    }
  }
  rat2->SetLineColor(kRed+ 3);
  rat2->SetFillColor(kRed-10);
  rat2->SetMaximum(+0.3);
  rat2->SetMinimum(-0.3);
  rat2->GetYaxis()->SetTitle("#bf{Fit/Prefit-1}");
  rat2->GetYaxis()->CenterTitle();
  rat2->GetXaxis()->SetTitle("#bf{m_{#tau#tau} [GeV]}");
  rat2->Draw();
  zero->SetLineColor(kBlack);
  zero->Draw("same");
  canv1->RedrawAxis();

  /*
    Relative shift per sample
  */
  TCanvas *canv2 = MakeCanvas("canv2", "histograms", 600, 400);
  canv2->SetGridx();
  canv2->SetGridy();
  canv2->cd();

  InitHist  (scales[0], "", "", kMagenta-10, 1001);
  InitHist  (scales[1], "", "", kRed    + 2, 1001);
  InitHist  (scales[2], "", "", kBlue   - 8, 1001);
  InitHist  (scales[3], "", "", kOrange - 4, 1001);
#ifndef DROP_SIGNAL
  InitSignal(scales[4]);
  InitSignal(scales[5]);
  InitSignal(scales[6]);
#endif
  scales[0]->Draw();
  scales[0]->GetXaxis()->SetBinLabel(1, "#bf{Fakes}");
  scales[0]->GetXaxis()->SetBinLabel(2, "#bf{EWK}"  );
  scales[0]->GetXaxis()->SetBinLabel(3, "#bf{ttbar}");
  scales[0]->GetXaxis()->SetBinLabel(4, "#bf{Ztt}"  );
#ifdef MSSM
  scales[0]->GetXaxis()->SetBinLabel(5, "#bf{ggH}"  );
  scales[0]->GetXaxis()->SetBinLabel(6, "#bf{bbH}"  );
  scales[0]->GetXaxis()->SetBinLabel(7, "NONE"      );
#else
  scales[0]->GetXaxis()->SetBinLabel(5, "#bf{ggH}"  );
  scales[0]->GetXaxis()->SetBinLabel(6, "#bf{qqH}"  );
  scales[0]->GetXaxis()->SetBinLabel(7, "#bf{VH}"   );
#endif
  scales[0]->SetMaximum(+1.0);
  scales[0]->SetMinimum(-1.0);
  scales[0]->GetYaxis()->CenterTitle();
  scales[0]->GetYaxis()->SetTitle("#bf{Fit/Prefit-1}");
  scales[1]->Draw("same");
  scales[2]->Draw("same");
  scales[3]->Draw("same");
#ifndef DROP_SIGNAL
  scales[4]->Draw("same");
  scales[5]->Draw("same");
  scales[6]->Draw("same");
#endif
  zero->Draw("same");
  canv2->RedrawAxis();

  /*
    prepare output
  */
  bool isSevenTeV = std::string(inputfile).find("7TeV")!=std::string::npos;
  canv ->Print(TString::Format("%s_%sscaled_%s_%s.png"       , directory, scaled ? "re" : "un", isSevenTeV ? "7TeV" : "8TeV", log ? "LOG" : "")); 
  canv ->Print(TString::Format("%s_%sscaled_%s_%s.pdf"       , directory, scaled ? "re" : "un", isSevenTeV ? "7TeV" : "8TeV", log ? "LOG" : "")); 
  canv ->Print(TString::Format("%s_%sscaled_%s_%s.eps"       , directory, scaled ? "re" : "un", isSevenTeV ? "7TeV" : "8TeV", log ? "LOG" : "")); 
  canv0->Print(TString::Format("%s_datamc_%sscaled_%s_%s.png", directory, scaled ? "re" : "un", isSevenTeV ? "7TeV" : "8TeV", log ? "LOG" : "")); 
  canv0->Print(TString::Format("%s_datamc_%sscaled_%s_%s.pdf", directory, scaled ? "re" : "un", isSevenTeV ? "7TeV" : "8TeV", log ? "LOG" : ""));
  canv0->Print(TString::Format("%s_datamc_%sscaled_%s_%s.eps", directory, scaled ? "re" : "un", isSevenTeV ? "7TeV" : "8TeV", log ? "LOG" : ""));
  canv1->Print(TString::Format("%s_prefit_%sscaled_%s_%s.png", directory, scaled ? "re" : "un", isSevenTeV ? "7TeV" : "8TeV", log ? "LOG" : "")); 
  canv1->Print(TString::Format("%s_prefit_%sscaled_%s_%s.pdf", directory, scaled ? "re" : "un", isSevenTeV ? "7TeV" : "8TeV", log ? "LOG" : ""));
  canv1->Print(TString::Format("%s_prefit_%sscaled_%s_%s.eps", directory, scaled ? "re" : "un", isSevenTeV ? "7TeV" : "8TeV", log ? "LOG" : ""));
  canv2->Print(TString::Format("%s_sample_%sscaled_%s_%s.png", directory, scaled ? "re" : "un", isSevenTeV ? "7TeV" : "8TeV", log ? "LOG" : "")); 
  canv2->Print(TString::Format("%s_sample_%sscaled_%s_%s.pdf", directory, scaled ? "re" : "un", isSevenTeV ? "7TeV" : "8TeV", log ? "LOG" : ""));
  canv2->Print(TString::Format("%s_sample_%sscaled_%s_%s.eps", directory, scaled ? "re" : "un", isSevenTeV ? "7TeV" : "8TeV", log ? "LOG" : ""));
  TFile* output = new TFile(TString::Format("%s_%sscaled_%s_%s.root", directory, scaled ? "re" : "un", isSevenTeV ? "7TeV" : "8TeV", log ? "LOG" : ""), "update");
  output->cd();
  data ->Write("data_obs");
  Fakes->Write("Fakes"   );
  EWK  ->Write("EWK"     );
  ttbar->Write("ttbar"   );
  Ztt  ->Write("Ztt"     );
#ifdef MSSM
  ggH  ->Write("ggH"     );
  bbH  ->Write("bbH"     );
#else
#ifndef DROP_SIGNAL
  ggH  ->Write("ggH"     );
  qqH  ->Write("qqH"     );
  VH   ->Write("VH"      );
#endif
#endif
  if(errorBand){
    errorBand->Write("errorBand");
  }
  output->Close();
}
示例#24
0
void plotRegrVsNoRegr(int channel, int massBin) {
  stringstream filenom, filenoregr;
  filenom << "m4lplots/nominal/fitM" << massBin << "_channel" << channel << ".root";
  filenoregr << "m4lplots/noregr/fitM" << massBin << "_channel" << channel << ".root";

  int col;
  if(channel==0) col=kOrange+7;
  if(channel==1) col=kAzure+2;
  if(channel==2) col=kGreen+3;

  TCanvas *c1 = new TCanvas("c1","c1",750,750);

  TFile *tfilenom = TFile::Open(filenom.str().c_str());
  RooPlot *plotnom = (RooPlot*)tfilenom->Get("m4lplot");
  plotnom->SetMarkerStyle(kOpenSquare);
  plotnom->Draw();
  TPaveText *pavenom = (TPaveText*)tfilenom->Get("TPave");
  pavenom->SetTextColor(col);
  pavenom->Draw("same");

  TFile *tfilenoregr = TFile::Open(filenoregr.str().c_str());
  RooPlot *plotnoregr = (RooPlot*)tfilenoregr->Get("m4lplot");
  plotnoregr->Draw("same");
  TPaveText *pavenoregr = (TPaveText*)tfilenoregr->Get("TPave");
  pavenoregr->Draw("same");

  // cosmetics
  TLegend *legend = new TLegend(0.20,0.45,0.45,0.60,NULL,"brNDC");
  legend->SetBorderSize(     0);
  legend->SetFillColor (     0);
  legend->SetTextAlign (    12);
  legend->SetTextFont  (    42);
  legend->SetTextSize  (0.03);

  TH1F *dummyPointsNom = new TH1F("dummyPNom","dummyPNom",1,0,1);
  TH1F *dummyPointsNoRegr = new TH1F("dummyPNoregr","dummyPNoregr",1,0,1);
  TH1F *dummyLine = new TH1F("dummyL","dummyL",1,0,1);
  dummyPointsNoRegr->SetMarkerStyle(kFullCircle);
  dummyPointsNoRegr->SetMarkerSize(1.1);
  dummyPointsNom->SetMarkerStyle(kFullSquare);
  dummyPointsNom->SetMarkerColor(col);
  dummyPointsNom->SetLineColor(col);
  dummyPointsNom->SetMarkerSize(1.1);
  dummyLine->SetLineColor(col);
  
  legend->AddEntry(dummyPointsNoRegr, "Simulation (E_{std}-p comb.)", "pel");
  legend->AddEntry(dummyPointsNom, "Simulation (E_{regr}-p comb.)", "pel");

  legend->Draw();

  TPaveText *text = new TPaveText(0.15,0.90,0.77,0.98,"brNDC");
  text->AddText("CMS Simulation");
  text->SetBorderSize(0);
  text->SetFillStyle(0);
  text->SetTextAlign(12);
  text->SetTextFont(42);
  text->SetTextSize(0.03);

  text->Draw();

  stringstream frameTitle;
  if(channel==0){frameTitle << "4#mu, m_{H} = ";}
  if(channel==1){frameTitle << "4e, m_{H} = ";}
  if(channel==2){frameTitle << "2e2#mu, m_{H} = ";}
  frameTitle << massBin << " GeV";

  TPaveText *titlet = new TPaveText(0.15,0.80,0.60,0.85,"brNDC");
  titlet->AddText(frameTitle.str().c_str());
  titlet->SetBorderSize(0);
  titlet->SetFillStyle(0);
  titlet->SetTextAlign(12);
  titlet->SetTextFont(132);
  titlet->SetTextSize(0.045);

  titlet->Draw();

  c1->SaveAs("comp.pdf");

}
示例#25
0
void fitSignalShapeW(int massBin,int id, int channels,int categ, int sample, 
		     /* float lumi, bool doSfLepton, */double rangeLow, double rangeHigh,
		     double bwSigma,
		     double fitValues[9], double fitErrors[9], double covQual[1]){
 // ------ root settings ---------
  gROOT->Reset();  
  gROOT->SetStyle("Plain");
  gStyle->SetPadGridX(kFALSE);
  gStyle->SetPadGridY(kFALSE);
  //gStyle->SetOptStat("kKsSiourRmMen");
  gStyle->SetOptStat("iourme");
  //gStyle->SetOptStat("rme");
  //gStyle->SetOptStat("");
  gStyle->SetOptFit(11);
  gStyle->SetPadLeftMargin(0.14);
  gStyle->SetPadRightMargin(0.06);
  // ------------------------------ 

  ROOT::Math::MinimizerOptions::SetDefaultTolerance( 1.E-7);

  stringstream FileName;
  //Insert the file here
  if(sample==1) FileName <<"root://lxcms03//data3/Higgs/150915/ZH125/ZZ4lAnalysis.root" ;
  else if(sample==2) FileName << "root://lxcms03//data3/Higgs/150915/WplusH125/ZZ4lAnalysis.root";
  else if(sample==3) FileName << "root://lxcms03//data3/Higgs/150915/WminusH125/ZZ4lAnalysis.root";
  else if(sample==4) FileName << "root://lxcms03//data3/Higgs/150915/ttH125/ZZ4lAnalysis.root";
  else {
    cout << "Wrong sample." << endl;
    return;
  }
    

  cout << "Using " << FileName.str() << endl;
  
 
  TFile* ggFile = TFile::Open(FileName.str().c_str()); 

  TTree* ggTree = (TTree*) ggFile->Get("ZZTree/candTree");

  float m4l;
  
  Short_t z1flav, z2flav; 
  float weight;

  Short_t nExtraLeptons;   
  float ZZPt;
  Short_t nJets;
  Short_t nBTaggedJets;
  std::vector<float> * jetpt = 0;
  std::vector<float> * jeteta = 0;
  std::vector<float> * jetphi = 0;
  std::vector<float> * jetmass = 0;
  float jet30pt[10];
  float jet30eta[10];
  float jet30phi[10];
  float jet30mass[10];
  float Fisher;
  
  int  nentries = ggTree->GetEntries();
 
  //--- ggTree part
  ggTree->SetBranchAddress("ZZMass",&m4l);
  ggTree->SetBranchAddress("Z1Flav",&z1flav);
  ggTree->SetBranchAddress("Z2Flav",&z2flav);
  ggTree->SetBranchAddress("genHEPMCweight",&weight);
  ggTree->SetBranchAddress("nExtraLep",&nExtraLeptons);
  ggTree->SetBranchAddress("nCleanedJets",&nJets);
  ggTree->SetBranchAddress("nCleanedJetsPt30BTagged",&nBTaggedJets);
  ggTree->SetBranchAddress("DiJetFisher",&Fisher);
  
  ggTree->SetBranchAddress("JetPt",&jetpt);
  ggTree->SetBranchAddress("JetEta",&jeteta);
  ggTree->SetBranchAddress("JetPhi",&jetphi);
  ggTree->SetBranchAddress("JetMass",&jetmass);
  ggTree->SetBranchAddress("ZZPt",&ZZPt);

  //--- rooFit part
  double xMin,xMax,xInit;
  xInit = (double) massBin;
  xMin = rangeLow;
  xMax = rangeHigh ;
  cout << "Fit range: [" << xMin << " , " << xMax << "]. Init value = " << xInit << endl;
  
  TH1F *hmass = new TH1F("hmass","hmass",200,xMin,xMax);
  //---------  
  RooRealVar x("mass","m_{4l}",xInit,xMin,xMax,"GeV");
  RooRealVar w("myW","myW",1.0,0.,1000.);
  RooArgSet ntupleVarSet(x,w);
  RooDataSet dataset("mass4l","mass4l",ntupleVarSet,WeightVar("myW"));

  for(int k=0; k<nentries; k++){
    ggTree->GetEvent(k);

    int njet30 = 0;
    for (unsigned int ijet = 0; ijet < jetpt->size(); ijet++) { 
      if ( (*jetpt)[ijet] > 30. ) {
	jet30pt[njet30] = (*jetpt)[ijet];      
	jet30eta[njet30] = (*jeteta)[ijet];
	jet30phi[njet30] = (*jetphi)[ijet];
	jet30mass[njet30] = (*jetmass)[ijet];
	njet30++;
      }
    }  
    int Cat = category(nExtraLeptons, ZZPt, m4l, njet30, nBTaggedJets, jet30pt, jet30eta, jet30phi,jet30mass, Fisher); 
    if (categ >= 0 && categ != Cat ) continue;

 
    if(channels==0 && z1flav*z2flav != 28561) continue;
    if(channels==1 && z1flav*z2flav != 14641) continue;
    if (weight <= 0 ) cout << "Warning! Negative weight events" << endl;
    if(channels==2 && z1flav*z2flav != 20449) continue;
    

    ntupleVarSet.setRealValue("mass",m4l);
    ntupleVarSet.setRealValue("myW",weight);
    if(x.getVal()>xMin && x.getVal()<xMax)
      dataset.add(ntupleVarSet, weight);
    hmass->Fill(m4l);

  }
  //---------

  cout << "dataset n entries: " << dataset.sumEntries() << endl;


  TCanvas *c1 = new TCanvas("c1","c1",725,725);


  c1->cd();

  TPad *pad1 = new TPad("pad1","This is pad1",0.05,0.35,0.95,0.97);
  pad1->Draw();
  TPad *pad2 = new TPad("pad2","This is pad2",0.05,0.02,0.95,0.35);
  pad2->Draw();

  //--- double CrystalBall
  RooRealVar mean("bias","mean of gaussian",0,-5.,5.) ;
  RooRealVar sigma("sigma","width of gaussian",1.5,0.,30.); 
  RooRealVar a1("a1","a1",1.46,0.5,5.);
  RooRealVar n1("n1","n1",1.92,0.,10.);   
  RooRealVar a2("a2","a2",1.46,1.,10.);
  RooRealVar n2("n2","n2",20,1.,50.);   
  RooDoubleCB DCBall("DCBall","Double Crystal ball",x,mean,sigma,a1,n1,a2,n2);
  if (channels== 1) mean.setVal(-1.);
  //--- Breit-Wigner
  float bwSigmaMax,bwSigmaMin;
  if(massBin<400) bwSigmaMin=bwSigmaMax=bwSigma;
  else { 
    bwSigmaMin=bwSigma-20.; 
    bwSigmaMax=bwSigma+20.; 
  }
  RooRealVar mean3("mean3","mean3",xInit) ;
  RooRealVar sigma3("sigma3","width3",bwSigma,bwSigmaMin,bwSigmaMax); 
  RooRealVar scale3("scale3","scale3 ",1.); 

  RooRelBWUFParam bw("bw","bw",x,mean3,scale3);
  //Chebyshev-Polynomial
  RooRealVar A1("A1","A1",-1,-3,3.);
  RooRealVar A2("A2","A2",0.5,-3.,3.);
  RooChebychev BkgPDF("BkgPDF","BkgPDF",x ,RooArgList(A1,A2));
  //Fraction
  RooRealVar frac("frac","Fraction for PDF",0.5,0.,1.);

  x.setBins(10000,"fft");
  RooFFTConvPdf model("model","model",x,bw,DCBall);
  

  RooAddPdf totPDF("totPDF","Total PDF ",RooArgList(model,BkgPDF),RooArgList(frac));
  
  RooArgSet* params = totPDF.getParameters(x);
  
  if(sample!=1 && categ!=0 && id!=125){
  if(channels==0 ){params->readFromFile("Ch0_Cat0_paraT.txt");}// Read the Parameter for the Resonance + Bkg(ChebyChev) 

  if(channels==1 ){params->readFromFile("Ch1_Cat0_paraT.txt");}// Read the Parameter for the Resonance + Bkg(ChebyChev)

  if(channels==2 ){params->readFromFile("Ch2_Cat0_paraT.txt");}//  Read the Parameter for the Resonance + Bkg(ChebyChev)
  }
  
  RooFitResult *fitres = (RooFitResult*)totPDF.fitTo(dataset,SumW2Error(1),Range(xMin,xMax),Strategy(2),NumCPU(8),Save(true));

  if (sample==1 && categ==0 && id==125){
 
  mean.setConstant(kTRUE);
  sigma.setConstant(kTRUE);
  a1.setConstant(kTRUE);
  n1.setConstant(kTRUE);
  a2.setConstant(kTRUE);
  n2.setConstant(kTRUE);
  mean3.setConstant(kTRUE);
  sigma3.setConstant(kTRUE);
  scale3.setConstant(kTRUE);
  A1.setConstant(kTRUE);
  A2.setConstant(kTRUE);
  frac.setConstant(kTRUE);

  if(channels==0 ){
  params->readFromFile("Ch0_Cat0_para.txt");  // Read the Parameter for the Resonance as ggH sample
  params->writeToFile("Ch0_Cat0_paraT.txt");} // Writing the Parameter for Full PDF including the Chebyshev-Polynomial

  if(channels==1 )
  {params->readFromFile("Ch1_Cat0_para.txt"); // Read the Parameter for the Resonance as in ggH sample
   params->writeToFile("Ch1_Cat0_paraT.txt");}// Writing the Parameter for Full PDF including the Chebyshev-Polynomial

  if(channels==2 ){
  params->readFromFile("Ch2_Cat0_para.txt"); // Read the Parameter for the Resonance as ggH sample
  params->writeToFile("Ch2_Cat0_paraT.txt");}// Writing the Parameter for Full PDF including the Chebyshev-Polynomial
  }
  
  stringstream frameTitle;
  if(channels==0){frameTitle << "4#mu, m_{H} = "; }
  if(channels==1){frameTitle << "4e, m_{H} = ";}
  if(channels==2){frameTitle << "2e2#mu, m_{H} = ";}
  frameTitle << massBin << " GeV";

  stringstream nameFileRoot;
  nameFileRoot << "fitM" << massBin << ".root";
  TFile *fileplot = TFile::Open(nameFileRoot.str().c_str(), "recreate");

  RooPlot* xframe = x.frame() ;
  xframe->SetTitle("");
  xframe->SetName("m4lplot");
  dataset.plotOn(xframe,DataError(RooAbsData::SumW2), MarkerStyle(kOpenCircle), MarkerSize(1.1) );
  int col;
  if(channels==0) col=kOrange+7;
  if(channels==1) col=kAzure+2;
  if(channels==2) col=kGreen+3;
  totPDF.plotOn(xframe,LineColor(col));


  RooHist* hpull = xframe->pullHist();

  RooPlot* frame3 = x.frame(Title("Pull Distribution")) ;
  frame3->addPlotable(hpull,"P");
  
  // cosmetics
  TLegend *legend = new TLegend(0.20,0.45,0.45,0.60,NULL,"brNDC");
  legend->SetBorderSize(0);
  legend->SetFillColor(0);
  legend->SetTextAlign(12);
  legend->SetTextFont (42);
  legend->SetTextSize (0.03);

  TH1F *dummyPoints = new TH1F("dummyP","dummyP",1,0,1);
  TH1F *dummyLine = new TH1F("dummyL","dummyL",1,0,1);
  dummyPoints->SetMarkerStyle(kOpenCircle);
  dummyPoints->SetMarkerSize(1.1);
  dummyLine->SetLineColor(col);
  
  legend->AddEntry(dummyPoints, "Simulation", "pe");
  legend->AddEntry(dummyLine, "Parametric Model", "l");
  
  TPaveText *text = new TPaveText(0.15,0.90,0.77,0.98,"brNDC");
  text->AddText("CMS Simulation");
  text->SetBorderSize(0);
  text->SetFillStyle(0);
  text->SetTextAlign(12);
  text->SetTextFont(42);
  text->SetTextSize(0.03);

  TPaveText *titlet = new TPaveText(0.15,0.80,0.60,0.85,"brNDC");
  titlet->AddText(frameTitle.str().c_str());
  titlet->SetBorderSize(0);
  titlet->SetFillStyle(0);
  titlet->SetTextAlign(12);
  titlet->SetTextFont(132);
  titlet->SetTextSize(0.045);

  TPaveText *sigmat = new TPaveText(0.15,0.65,0.77,0.78,"brNDC");
  stringstream sigmaval0, sigmaval1, sigmaval2;
  sigmaval0 << fixed;
  sigmaval0 << setprecision(1);
  sigmaval0 << "m_{dCB} = " << mean.getVal() + massBin << " GeV";
  sigmaval1 << fixed;
  sigmaval1 << setprecision(1);
  sigmaval1 << "#sigma_{dCB} = " << sigma.getVal() << " GeV";
  sigmaval2 << fixed;
  sigmaval2 << setprecision(1);
  sigmaval2 << "RMS_{eff} = " << effSigma(hmass) << " GeV";
  
  sigmat->AddText(sigmaval1.str().c_str());
  sigmat->AddText(sigmaval2.str().c_str());
  sigmat->SetBorderSize(0);
  sigmat->SetFillStyle(0);
  sigmat->SetTextAlign(12);
  sigmat->SetTextFont(132);
  sigmat->SetTextSize(0.04);
  
  xframe->GetYaxis()->SetTitleOffset(1.5);

  cout << "EFF RMS = " << effSigma(hmass) << "    RMS = " << hmass->GetRMS() << endl;

  pad1->cd();
  stringstream nameFile, nameFileC, nameFilePng;
  nameFile << "fitM" << massBin << "_channel" << channels<< "_category"<< categ << ".pdf";
  nameFileC << "fitM" << massBin << "_channel" << channels << "_category"<< categ << ".C";
  nameFilePng << "fitM" << massBin << "_channel" << channels << "_category"<< categ << ".png";

  xframe->Draw(); 
  gPad->Update(); legend->Draw(); text->Draw(); sigmat->Draw(); titlet->Draw();

  pad2->cd() ;
  frame3->Draw() ;
  frame3->SetMinimum(-3);
  frame3->SetMaximum(3);

  TLine *line1 = new TLine(105,0,140,0);
  line1->SetLineColor(kRed);
  line1->Draw();
  

  c1->Print(nameFile.str().c_str());
  c1->SaveAs(nameFileC.str().c_str());
  c1->SaveAs(nameFilePng.str().c_str());

  fileplot->cd();
  xframe->Write();
  sigmat->Write();
  hmass->Write();

  fileplot->Close();

  if(fitValues!=0){
    fitValues[0] = a1.getVal();
    fitValues[1] = a2.getVal();
    fitValues[2] = mean.getVal();
    fitValues[3] = mean3.getVal();
    fitValues[4] = n1.getVal();
    fitValues[5] = n2.getVal();
    fitValues[6] = sigma.getVal();
    fitValues[7] = A1.getVal();
    fitValues[8] = A2.getVal();

  }  

  if(fitErrors!=0){
    fitErrors[0] = a1.getError();
    fitErrors[1] = a2.getError();
    fitErrors[2] = mean.getError();
    fitErrors[3] = mean3.getError();
    fitErrors[4] = n1.getError();
    fitErrors[5] = n2.getError();
    fitErrors[6] = sigma.getError();
    fitErrors[7] = A1.getError();
    fitErrors[8] = A2.getError();

  }

  covQual[0] = fitres->covQual();
  
}
void InclusiveJets_2010_mcdataRatio(){

//general root settings
gROOT->SetStyle("Plain");
gStyle->SetOptStat(0); //get rid of statistics box

// to set the errors of the histograms to sqrt(sum of squares of weights)
TH1::SetDefaultSumw2() ;

//Ranges for plots
Float_t xmin=17.5 , ymin = 0.00001, xmax = 1684.0, ymax = 10000000000000000.;

//for the linecolor and linestyle
Int_t icol[8]={8,kViolet,7,4,12,46,6,7};
Int_t isty[8]={1,1,1,1,1,1,1,1};
Int_t imark[5] = {21,22,25,26,3};

//get the root files
TFile *f[3];
f[0] = new TFile("out_aida_40times900kevents_errorcut50/Z2MPIHADONbornkt5ktsupp250_errorcut.root");
f[1] = new TFile("out_aida_40times900kevents_errorcut50/Z2MPIHADOFFbornkt5ktsupp250_errorcut.root");
f[2] = new TFile("out_aida_40times900kevents_errorcut50/NOTUNEbornkt5ktsupp250_errorcut.root");

//get the Tgraph and convert into histo
TH1F _histotmp[6][3];
Int_t n = 3; //number of files
Int_t nh = 6; // number of histograms = number of y bins

for(const int ifile = 0; ifile < n; ifile++){

  _histotmp[0][ifile] = Gr2Hi((TGraph*) f[ifile]->Get("d01_x01_y01;1")); // |y| <0.5
  _histotmp[1][ifile] = Gr2Hi((TGraph*) f[ifile]->Get("d02_x01_y01;2")); // 0.5 < |y| < 1.0
  _histotmp[2][ifile] = Gr2Hi((TGraph*) f[ifile]->Get("d03_x01_y01;2")); // 1.0 < |y| < 1.5
  _histotmp[3][ifile] = Gr2Hi((TGraph*) f[ifile]->Get("d04_x01_y01;2")); // 1.5 < |y| < 2.0
  _histotmp[4][ifile] = Gr2Hi((TGraph*) f[ifile]->Get("d05_x01_y01;1")); // 2.0 < |y| < 2.5
  _histotmp[5][ifile] = Gr2Hi((TGraph*) f[ifile]->Get("d06_x01_y01;1")); // 2.5 < |y| < 3.0

  for(const int ihisto = 0; ihisto < nh; ihisto++){
    _histotmp[ihisto][ifile].SetName("");
  }
}

//change the histo so that I can plot it and do the ratio
 TH1F *_histo[6][3];

for(const int ifile = 0; ifile < n; ifile++){
  for(const int ihisto = 0; ihisto < nh; ihisto++){

    TH1F *_histo[ihisto][ifile]= (TH1F*)_histotmp[ihisto][ifile].Clone("");
/*
  _histo[ihisto][ifile]->Divide((TH1*)_histo[ihisto][1]);  //histo 0 / hsito 1
  TH1F *_ratio1[ihisto]= (TH1F*)_ratiotmp1[ihisto]->Clone("");
  _ratiotmp2[ihisto]->Divide((TH1*)_histo[ihisto][2]);  //histo 0 / hsito 2
  TH1F *_ratio2[ihisto]= (TH1F*)_ratiotmp2[ihisto]->Clone("");
*/
    _histo[ihisto][ifile]->SetLineWidth(2);
    _histo[ihisto][ifile]->SetLineColor(icol[ihisto]);
    _histo[ihisto][ifile]->SetMarkerStyle(2);
    _histo[ihisto][ifile]->SetMarkerColor(icol[ihisto]);

  }

//scale the histos that it fits in one histogram
_histo[0][ifile]->Scale(10000);
_histo[1][ifile]->Scale(1000);
_histo[2][ifile]->Scale(100);
_histo[3][ifile]->Scale(10);
_histo[4][ifile]->Scale(1);
}

//get the data 2010
//data =  new TFile("out_aida/CMS_2011_S9086218.root");

//TH1F _histodata1 = Gr2Hi((TGraph*)data->Get("d01_x01_y01;1")); // |y| <0.5
//TH1F _histodata2 = Gr2Hi((TGraph*)data->Get("d02_x01_y01;1")); // 0.5 < |y| < 1.0
//TH1F _histodata3 = Gr2Hi((TGraph*)data->Get("d03_x01_y01;1")); // 1.0 < |y| < 1.5
//TH1F _histodata4 = Gr2Hi((TGraph*)data->Get("d04_x01_y01;1")); // 1.5 < |y| < 2.0
//TH1F _histodata5 = Gr2Hi((TGraph*)data->Get("d05_x01_y01;1")); // 2.0 < |y| < 2.5
//TH1F _histodata6 = Gr2Hi((TGraph*)data->Get("d06_x01_y01;1")); // 2.5 < |y| < 3.0


   Double_t xAxis1[35] = {18, 21, 24, 28, 32, 37, 43, 49, 56, 64, 74, 84, 97, 114, 133, 153, 174, 196, 220, 245, 272, 300, 330, 362, 395, 430, 468, 507, 548, 592, 638, 686, 737, 846, 1684}; 

   TH1F *d01_x01_y01_histo = new TH1F("d01_x01_y01_histo","d01_x01_y01_histo",34, xAxis1);
   d01_x01_y01_histo->SetBinContent(1,1.97e+11);
   d01_x01_y01_histo->SetBinContent(2,1.02e+11);
   d01_x01_y01_histo->SetBinContent(3,5.14e+10);
   d01_x01_y01_histo->SetBinContent(4,2.66e+10);
   d01_x01_y01_histo->SetBinContent(5,1.38e+10);
   d01_x01_y01_histo->SetBinContent(6,6.53e+09);
   d01_x01_y01_histo->SetBinContent(7,3.35e+09);
   d01_x01_y01_histo->SetBinContent(8,1.8e+09);
   d01_x01_y01_histo->SetBinContent(9,9.2e+08);
   d01_x01_y01_histo->SetBinContent(10,4.66e+08);
   d01_x01_y01_histo->SetBinContent(11,2.37e+08);
   d01_x01_y01_histo->SetBinContent(12,1.18e+08);
   d01_x01_y01_histo->SetBinContent(13,5.43e+07);
   d01_x01_y01_histo->SetBinContent(14,2.39e+07);
   d01_x01_y01_histo->SetBinContent(15,1.08e+07);
   d01_x01_y01_histo->SetBinContent(16,5240000);
   d01_x01_y01_histo->SetBinContent(17,2610000);
   d01_x01_y01_histo->SetBinContent(18,1360000);
   d01_x01_y01_histo->SetBinContent(19,716000);
   d01_x01_y01_histo->SetBinContent(20,381000);
   d01_x01_y01_histo->SetBinContent(21,207000);
   d01_x01_y01_histo->SetBinContent(22,117000);
   d01_x01_y01_histo->SetBinContent(23,66800);
   d01_x01_y01_histo->SetBinContent(24,37900);
   d01_x01_y01_histo->SetBinContent(25,22000);
   d01_x01_y01_histo->SetBinContent(26,12900);
   d01_x01_y01_histo->SetBinContent(27,7540);
   d01_x01_y01_histo->SetBinContent(28,4410);
   d01_x01_y01_histo->SetBinContent(29,2770);
   d01_x01_y01_histo->SetBinContent(30,1450);
   d01_x01_y01_histo->SetBinContent(31,846);

   d01_x01_y01_histo->SetBinContent(32,499);
   d01_x01_y01_histo->SetBinContent(33,205);

   d01_x01_y01_histo->SetBinContent(34,20.2);

   d01_x01_y01_histo->SetBinError(1,2.547782e+10);
   d01_x01_y01_histo->SetBinError(2,1.24325e+10);
   d01_x01_y01_histo->SetBinError(3,6.016764e+09);
   d01_x01_y01_histo->SetBinError(4,3.005329e+09);
   d01_x01_y01_histo->SetBinError(5,1.530463e+09);
   d01_x01_y01_histo->SetBinError(6,7.056178e+08);
   d01_x01_y01_histo->SetBinError(7,3.617535e+08);
   d01_x01_y01_histo->SetBinError(8,1.96072e+08);
   d01_x01_y01_histo->SetBinError(9,9.919588e+07);
   d01_x01_y01_histo->SetBinError(10,5.102008e+07);
   d01_x01_y01_histo->SetBinError(11,2.639067e+07);
   d01_x01_y01_histo->SetBinError(12,1.335539e+07);
   d01_x01_y01_histo->SetBinError(13,6258885);
   d01_x01_y01_histo->SetBinError(14,2836105);
   d01_x01_y01_histo->SetBinError(15,1319900);
   d01_x01_y01_histo->SetBinError(16,663920.6);
   d01_x01_y01_histo->SetBinError(17,342646.4);
   d01_x01_y01_histo->SetBinError(18,184642.2);
   d01_x01_y01_histo->SetBinError(19,100845.5);
   d01_x01_y01_histo->SetBinError(20,55764.14);
   d01_x01_y01_histo->SetBinError(21,31565.29);
   d01_x01_y01_histo->SetBinError(22,18614.95);
   d01_x01_y01_histo->SetBinError(23,11075.51);
   d01_x01_y01_histo->SetBinError(24,6579.499);
   d01_x01_y01_histo->SetBinError(25,4015.708);
   d01_x01_y01_histo->SetBinError(26,2479.083);
   d01_x01_y01_histo->SetBinError(27,1527.99);
   d01_x01_y01_histo->SetBinError(28,943.6936);
   d01_x01_y01_histo->SetBinError(29,627.92);
   d01_x01_y01_histo->SetBinError(30,350.3168);
   d01_x01_y01_histo->SetBinError(31,219.1467);
   d01_x01_y01_histo->SetBinError(32,139.7467);
   d01_x01_y01_histo->SetBinError(33,62.02427);
   d01_x01_y01_histo->SetBinError(34,7.233998);
   d01_x01_y01_histo->SetEntries(34);
   d01_x01_y01_histo->SetStats(0);

   //d01_x01_y01_histo->Scale(10000);
   d01_x01_y01_histo->SetLineWidth(2);
   d01_x01_y01_histo->SetMarkerStyle(21);
   d01_x01_y01_histo->SetMarkerSize(0.7);
   d01_x01_y01_histo->SetFillColor(kGray);

   Double_t xAxis2[34] = {18, 21, 24, 28, 32, 37, 43, 49, 56, 64, 74, 84, 97, 114, 133, 153, 174, 196, 220, 245, 272, 300, 330, 362, 395, 430, 468, 507, 548, 592, 638, 686, 790, 1684}; 

   TH1F *d02_x01_y01_histo = new TH1F("d02_x01_y01_histo","d02_x01_y01_histo",33, xAxis2);
   d02_x01_y01_histo->SetBinContent(1,1.89e+10);
   d02_x01_y01_histo->SetBinContent(2,9.74e+09);
   d02_x01_y01_histo->SetBinContent(3,4.99e+09);
   d02_x01_y01_histo->SetBinContent(4,2.49e+09);
   d02_x01_y01_histo->SetBinContent(5,1.31e+09);
   d02_x01_y01_histo->SetBinContent(6,6.28e+08);
   d02_x01_y01_histo->SetBinContent(7,3.23e+08);
   d02_x01_y01_histo->SetBinContent(8,1.71e+08);
   d02_x01_y01_histo->SetBinContent(9,8.84e+07);
   d02_x01_y01_histo->SetBinContent(10,4.42e+07);
   d02_x01_y01_histo->SetBinContent(11,2.22e+07);
   d02_x01_y01_histo->SetBinContent(12,1.13e+07);
   d02_x01_y01_histo->SetBinContent(13,5130000);
   d02_x01_y01_histo->SetBinContent(14,2230000);
   d02_x01_y01_histo->SetBinContent(15,1010000);
   d02_x01_y01_histo->SetBinContent(16,482000);
   d02_x01_y01_histo->SetBinContent(17,238000);
   d02_x01_y01_histo->SetBinContent(18,122000);
   d02_x01_y01_histo->SetBinContent(19,64200);
   d02_x01_y01_histo->SetBinContent(20,34100);
   d02_x01_y01_histo->SetBinContent(21,18700);
   d02_x01_y01_histo->SetBinContent(22,10100);
   d02_x01_y01_histo->SetBinContent(23,5720);
   d02_x01_y01_histo->SetBinContent(24,3420);
   d02_x01_y01_histo->SetBinContent(25,1890);
   d02_x01_y01_histo->SetBinContent(26,1130);
   d02_x01_y01_histo->SetBinContent(27,590);
   d02_x01_y01_histo->SetBinContent(28,376);
   d02_x01_y01_histo->SetBinContent(29,196);
   d02_x01_y01_histo->SetBinContent(30,130);

   d02_x01_y01_histo->SetBinContent(31,62.4);
   d02_x01_y01_histo->SetBinContent(32,30.1);
   d02_x01_y01_histo->SetBinContent(33,2.14);

   d02_x01_y01_histo->SetBinError(1,2.47211e+09);
   d02_x01_y01_histo->SetBinError(2,1.196891e+09);
   d02_x01_y01_histo->SetBinError(3,5.890842e+08);
   d02_x01_y01_histo->SetBinError(4,2.837945e+08);
   d02_x01_y01_histo->SetBinError(5,1.465766e+08);
   d02_x01_y01_histo->SetBinError(6,6.848512e+07);
   d02_x01_y01_histo->SetBinError(7,3.536592e+07);
   d02_x01_y01_histo->SetBinError(8,1.879562e+07);
   d02_x01_y01_histo->SetBinError(9,9619569);
   d02_x01_y01_histo->SetBinError(10,4860292);
   d02_x01_y01_histo->SetBinError(11,2483524);
   d02_x01_y01_histo->SetBinError(12,1278948);
   d02_x01_y01_histo->SetBinError(13,596427.3);
   d02_x01_y01_histo->SetBinError(14,266851);
   d02_x01_y01_histo->SetBinError(15,124973);
   d02_x01_y01_histo->SetBinError(16,61551.8);
   d02_x01_y01_histo->SetBinError(17,31482.64);
   d02_x01_y01_histo->SetBinError(18,16749.58);
   d02_x01_y01_histo->SetBinError(19,9172.852);
   d02_x01_y01_histo->SetBinError(20,5077.065);
   d02_x01_y01_histo->SetBinError(21,2898.771);
   d02_x01_y01_histo->SetBinError(22,1633.017);
   d02_x01_y01_histo->SetBinError(23,965.8504);
   d02_x01_y01_histo->SetBinError(24,606.0352);
   d02_x01_y01_histo->SetBinError(25,351.8168);
   d02_x01_y01_histo->SetBinError(26,221.2594);
   d02_x01_y01_histo->SetBinError(27,122.0002);
   d02_x01_y01_histo->SetBinError(28,82.34314);
   d02_x01_y01_histo->SetBinError(29,45.69701);
   d02_x01_y01_histo->SetBinError(30,32.27314);
   d02_x01_y01_histo->SetBinError(31,16.82748);
   d02_x01_y01_histo->SetBinError(32,8.687436);
   d02_x01_y01_histo->SetBinError(33,0.745178);
   d02_x01_y01_histo->SetEntries(33);
   d02_x01_y01_histo->SetStats(0);

   d02_x01_y01_histo->SetLineStyle(0);
   d02_x01_y01_histo->SetLineWidth(2);
   d02_x01_y01_histo->SetMarkerStyle(22);
   d02_x01_y01_histo->SetMarkerSize(0.7);
   d02_x01_y01_histo->SetFillColor(kGray);


   Double_t xAxis3[33] = {18, 21, 24, 28, 32, 37, 43, 49, 56, 64, 74, 84, 97, 114, 133, 153, 174, 196, 220, 245, 272, 300, 330, 362, 395, 430, 468, 507, 548, 592, 638, 686, 1410}; 

   TH1F *d03_x01_y01_histo = new TH1F("d03_x01_y01_histo","d03_x01_y01_histo",32, xAxis3);
   d03_x01_y01_histo->SetBinContent(1,1.84e+09);
   d03_x01_y01_histo->SetBinContent(2,9.24e+08);
   d03_x01_y01_histo->SetBinContent(3,4.64e+08);
   d03_x01_y01_histo->SetBinContent(4,2.34e+08);
   d03_x01_y01_histo->SetBinContent(5,1.19e+08);
   d03_x01_y01_histo->SetBinContent(6,5.88e+07);
   d03_x01_y01_histo->SetBinContent(7,2.92e+07);
   d03_x01_y01_histo->SetBinContent(8,1.57e+07);
   d03_x01_y01_histo->SetBinContent(9,8090000);
   d03_x01_y01_histo->SetBinContent(10,4090000);
   d03_x01_y01_histo->SetBinContent(11,2050000);
   d03_x01_y01_histo->SetBinContent(12,994000);
   d03_x01_y01_histo->SetBinContent(13,452000);
   d03_x01_y01_histo->SetBinContent(14,192000);
   d03_x01_y01_histo->SetBinContent(15,86200);
   d03_x01_y01_histo->SetBinContent(16,40500);
   d03_x01_y01_histo->SetBinContent(17,20100);
   d03_x01_y01_histo->SetBinContent(18,10000);
   d03_x01_y01_histo->SetBinContent(19,5210);
   d03_x01_y01_histo->SetBinContent(20,2720);
   d03_x01_y01_histo->SetBinContent(21,1470);
   d03_x01_y01_histo->SetBinContent(22,803);
   d03_x01_y01_histo->SetBinContent(23,435);
   d03_x01_y01_histo->SetBinContent(24,252);
   d03_x01_y01_histo->SetBinContent(25,138);
   d03_x01_y01_histo->SetBinContent(26,75.7);
   d03_x01_y01_histo->SetBinContent(27,43.1);
   d03_x01_y01_histo->SetBinContent(28,23.5);
   d03_x01_y01_histo->SetBinContent(29,13.1);

   d03_x01_y01_histo->SetBinContent(30,6.96);
   d03_x01_y01_histo->SetBinContent(31,3.31);
   d03_x01_y01_histo->SetBinContent(32,0.263);

   d03_x01_y01_histo->SetBinError(1,3.267438e+08);
   d03_x01_y01_histo->SetBinError(2,1.460402e+08);
   d03_x01_y01_histo->SetBinError(3,6.756898e+07);
   d03_x01_y01_histo->SetBinError(4,3.169167e+07);
   d03_x01_y01_histo->SetBinError(5,1.534246e+07);
   d03_x01_y01_histo->SetBinError(6,7206299);
   d03_x01_y01_histo->SetBinError(7,3487964);
   d03_x01_y01_histo->SetBinError(8,1852766);
   d03_x01_y01_histo->SetBinError(9,937690);
   d03_x01_y01_histo->SetBinError(10,474695.6);
   d03_x01_y01_histo->SetBinError(11,239744.8);
   d03_x01_y01_histo->SetBinError(12,117028.5);
   d03_x01_y01_histo->SetBinError(13,54375.43);
   d03_x01_y01_histo->SetBinError(14,23751.81);
   d03_x01_y01_histo->SetBinError(15,11010.17);
   d03_x01_y01_histo->SetBinError(16,5355.962);
   d03_x01_y01_histo->SetBinError(17,2760.221);
   d03_x01_y01_histo->SetBinError(18,1428.408);
   d03_x01_y01_histo->SetBinError(19,775.8965);
   d03_x01_y01_histo->SetBinError(20,422.7916);
   d03_x01_y01_histo->SetBinError(21,238.9779);
   d03_x01_y01_histo->SetBinError(22,137.1344);
   d03_x01_y01_histo->SetBinError(23,78.10703);
   d03_x01_y01_histo->SetBinError(24,47.62767);
   d03_x01_y01_histo->SetBinError(25,27.54976);
   d03_x01_y01_histo->SetBinError(26,16.01829);
   d03_x01_y01_histo->SetBinError(27,9.722084);
   d03_x01_y01_histo->SetBinError(28,5.653863);
   d03_x01_y01_histo->SetBinError(29,3.37332);
   d03_x01_y01_histo->SetBinError(30,1.948179);
   d03_x01_y01_histo->SetBinError(31,1.026618);
   d03_x01_y01_histo->SetBinError(32,0.09205037);
   d03_x01_y01_histo->SetEntries(32);
   d03_x01_y01_histo->SetStats(0);

   d03_x01_y01_histo->SetLineStyle(0);
   d03_x01_y01_histo->SetLineWidth(2);
   d03_x01_y01_histo->SetMarkerStyle(25);
   d03_x01_y01_histo->SetMarkerSize(0.7);
   d03_x01_y01_histo->SetFillColor(kGray);

   Double_t xAxis4[30] = {18, 21, 24, 28, 32, 37, 43, 49, 56, 64, 74, 84, 97, 114, 133, 153, 174, 196, 220, 245, 272, 300, 330, 362, 395, 430, 468, 507, 548, 1032}; 

   TH1F *d04_x01_y01_histo = new TH1F("d04_x01_y01_histo","d04_x01_y01_histo",29, xAxis4);
   d04_x01_y01_histo->SetBinContent(1,1.44e+08);
   d04_x01_y01_histo->SetBinContent(2,7.35e+07);
   d04_x01_y01_histo->SetBinContent(3,3.8e+07);
   d04_x01_y01_histo->SetBinContent(4,1.89e+07);
   d04_x01_y01_histo->SetBinContent(5,9700000);
   d04_x01_y01_histo->SetBinContent(6,4670000);
   d04_x01_y01_histo->SetBinContent(7,2280000);
   d04_x01_y01_histo->SetBinContent(8,1220000);
   d04_x01_y01_histo->SetBinContent(9,629000);
   d04_x01_y01_histo->SetBinContent(10,305000);
   d04_x01_y01_histo->SetBinContent(11,151000);
   d04_x01_y01_histo->SetBinContent(12,73400);
   d04_x01_y01_histo->SetBinContent(13,32900);
   d04_x01_y01_histo->SetBinContent(14,13900);
   d04_x01_y01_histo->SetBinContent(15,6160);
   d04_x01_y01_histo->SetBinContent(16,2860);
   d04_x01_y01_histo->SetBinContent(17,1400);
   d04_x01_y01_histo->SetBinContent(18,711);
   d04_x01_y01_histo->SetBinContent(19,356);
   d04_x01_y01_histo->SetBinContent(20,186);
   d04_x01_y01_histo->SetBinContent(21,94.5);
   d04_x01_y01_histo->SetBinContent(22,50.9);
   d04_x01_y01_histo->SetBinContent(23,25.6);
   d04_x01_y01_histo->SetBinContent(24,13.3);
   d04_x01_y01_histo->SetBinContent(25,7);
   d04_x01_y01_histo->SetBinContent(26,3.45);
   d04_x01_y01_histo->SetBinContent(27,1.73);

   d04_x01_y01_histo->SetBinContent(28,0.796);
   d04_x01_y01_histo->SetBinContent(29,0.066);

   d04_x01_y01_histo->SetBinError(1,3.637846e+07);
   d04_x01_y01_histo->SetBinError(2,1.67099e+07);
   d04_x01_y01_histo->SetBinError(3,7851714);
   d04_x01_y01_histo->SetBinError(4,3568673);
   d04_x01_y01_histo->SetBinError(5,1703586);
   d04_x01_y01_histo->SetBinError(6,750723.4);
   d04_x01_y01_histo->SetBinError(7,343490.2);
   d04_x01_y01_histo->SetBinError(8,173448.2);
   d04_x01_y01_histo->SetBinError(9,84294.21);
   d04_x01_y01_histo->SetBinError(10,39082.27);
   d04_x01_y01_histo->SetBinError(11,18979.5);
   d04_x01_y01_histo->SetBinError(12,9119.636);
   d04_x01_y01_histo->SetBinError(13,4140.893);
   d04_x01_y01_histo->SetBinError(14,1810.098);
   d04_x01_y01_histo->SetBinError(15,830.3785);
   d04_x01_y01_histo->SetBinError(16,399.9657);
   d04_x01_y01_histo->SetBinError(17,204.9602);
   d04_x01_y01_histo->SetBinError(18,109.8075);
   d04_x01_y01_histo->SetBinError(19,59.1287);
   d04_x01_y01_histo->SetBinError(20,33.42105);
   d04_x01_y01_histo->SetBinError(21,18.47046);
   d04_x01_y01_histo->SetBinError(22,10.88183);
   d04_x01_y01_histo->SetBinError(23,6.000047);
   d04_x01_y01_histo->SetBinError(24,3.41489);
   d04_x01_y01_histo->SetBinError(25,1.994767);
   d04_x01_y01_histo->SetBinError(26,1.086542);
   d04_x01_y01_histo->SetBinError(27,0.610451);
   d04_x01_y01_histo->SetBinError(28,0.3130872);
   d04_x01_y01_histo->SetBinError(29,0.03211142);
   d04_x01_y01_histo->SetEntries(29);
   d04_x01_y01_histo->SetStats(0);

   d04_x01_y01_histo->SetLineStyle(0);
   d04_x01_y01_histo->SetLineWidth(2);
   d04_x01_y01_histo->SetMarkerStyle(26);
   d04_x01_y01_histo->SetMarkerSize(0.7);
   d04_x01_y01_histo->SetFillColor(kGray);

   Double_t xAxis5[27] = {18, 21, 24, 28, 32, 37, 43, 49, 56, 64, 74, 84, 97, 114, 133, 153, 174, 196, 220, 245, 272, 300, 330, 362, 395, 430, 737};

   TH1F *d05_x01_y01_histo = new TH1F("d05_x01_y01_histo","d05_x01_y01_histo",26, xAxis5);
   d05_x01_y01_histo->SetBinContent(1,1.05e+07);
   d05_x01_y01_histo->SetBinContent(2,5520000);
   d05_x01_y01_histo->SetBinContent(3,2720000);
   d05_x01_y01_histo->SetBinContent(4,1440000);
   d05_x01_y01_histo->SetBinContent(5,738000);
   d05_x01_y01_histo->SetBinContent(6,348000);
   d05_x01_y01_histo->SetBinContent(7,168000);
   d05_x01_y01_histo->SetBinContent(8,89800);
   d05_x01_y01_histo->SetBinContent(9,43800);
   d05_x01_y01_histo->SetBinContent(10,21800);
   d05_x01_y01_histo->SetBinContent(11,10300);
   d05_x01_y01_histo->SetBinContent(12,5030);
   d05_x01_y01_histo->SetBinContent(13,2180);
   d05_x01_y01_histo->SetBinContent(14,896);
   d05_x01_y01_histo->SetBinContent(15,384);
   d05_x01_y01_histo->SetBinContent(16,170);
   d05_x01_y01_histo->SetBinContent(17,78.5);
   d05_x01_y01_histo->SetBinContent(18,35.8);
   d05_x01_y01_histo->SetBinContent(19,16.5);
   d05_x01_y01_histo->SetBinContent(20,7.25);
   d05_x01_y01_histo->SetBinContent(21,3.27);
   d05_x01_y01_histo->SetBinContent(22,1.38);
   d05_x01_y01_histo->SetBinContent(23,0.579);
   d05_x01_y01_histo->SetBinContent(24,0.22);

   d05_x01_y01_histo->SetBinContent(25,0.0808);
   d05_x01_y01_histo->SetBinContent(26,0.00548);

   d05_x01_y01_histo->SetBinError(1,1978672);
   d05_x01_y01_histo->SetBinError(2,935188);
   d05_x01_y01_histo->SetBinError(3,421635.1);
   d05_x01_y01_histo->SetBinError(4,206618.7);
   d05_x01_y01_histo->SetBinError(5,100557.7);
   d05_x01_y01_histo->SetBinError(6,44514.08);
   d05_x01_y01_histo->SetBinError(7,20942.13);
   d05_x01_y01_histo->SetBinError(8,11048.87);
   d05_x01_y01_histo->SetBinError(9,5260.105);
   d05_x01_y01_histo->SetBinError(10,2634.555);
   d05_x01_y01_histo->SetBinError(11,1278.591);
   d05_x01_y01_histo->SetBinError(12,627.8137);
   d05_x01_y01_histo->SetBinError(13,282.1732);
   d05_x01_y01_histo->SetBinError(14,121.6466);
   d05_x01_y01_histo->SetBinError(15,55.24865);
   d05_x01_y01_histo->SetBinError(16,25.82574);
   d05_x01_y01_histo->SetBinError(17,12.76174);
   d05_x01_y01_histo->SetBinError(18,6.253124);
   d05_x01_y01_histo->SetBinError(19,3.142438);
   d05_x01_y01_histo->SetBinError(20,1.508923);
   d05_x01_y01_histo->SetBinError(21,0.7510828);
   d05_x01_y01_histo->SetBinError(22,0.3514478);
   d05_x01_y01_histo->SetBinError(23,0.1646418);
   d05_x01_y01_histo->SetBinError(24,0.071108);
   d05_x01_y01_histo->SetBinError(25,0.02988224);
   d05_x01_y01_histo->SetBinError(26,0.002567773);
   d05_x01_y01_histo->SetEntries(26);
   d05_x01_y01_histo->SetStats(0);

   d05_x01_y01_histo->SetLineStyle(0);
   d05_x01_y01_histo->SetLineWidth(2);
   d05_x01_y01_histo->SetMarkerStyle(3);
   d05_x01_y01_histo->SetMarkerSize(0.7);
   d05_x01_y01_histo->SetFillColor(kGray);

// MC / Data
TH1F *_ratio[6][3];

for(const int ifile = 0; ifile < n; ifile++){
  for(const int ihisto = 0; ihisto < nh; ihisto++){

    TH1F *_ratio[ihisto][ifile]= (TH1F*)_histo[ihisto][ifile]->Clone("");

    _ratio[ihisto][ifile]->SetLineWidth(1);
    _ratio[ihisto][ifile]->SetLineColor(icol[ihisto]);
    _ratio[ihisto][ifile]->SetMarkerStyle(imark[ihisto]);
    _ratio[ihisto][ifile]->SetMarkerSize(0.5);
    _ratio[ihisto][ifile]->SetMarkerColor(icol[ihisto]);
 }

  _ratio[0][ifile]->Divide((TH1*)d01_x01_y01_histo);  
  _ratio[1][ifile]->Divide((TH1*)d02_x01_y01_histo);  
  _ratio[2][ifile]->Divide((TH1*)d03_x01_y01_histo);  
  _ratio[3][ifile]->Divide((TH1*)d04_x01_y01_histo);  
  _ratio[4][ifile]->Divide((TH1*)d05_x01_y01_histo);  

//  TH1F *_ratio[ihisto]= (TH1F*)_ratiotmp1[ihisto]->Clone("");
 // _ratiotmp2[ihisto]->Divide((TH1*)_histo[ihisto][2]);  //histo 0 / hsito 2
//  TH1F *_ratio2[ihisto]= (TH1F*)_ratiotmp2[ihisto]->Clone("");

}



//create a canvas to draw TGraph and TH1F

TCanvas *c1 = new TCanvas("c1", "c1",369,0,680,750);

    //pads (inclusive jet cross section, MC / data )
   Pad_inclJet = new TPad("Pad_inclJet","xs",0.01,0.51,1.0,1.0);
   Pad_inclJet->Draw();
   Pad_MCdata1 = new TPad("Pad_MCdata1","ratio",0.01,0.40,1.0,0.50);
   Pad_MCdata1->Draw();
   Pad_MCdata2 = new TPad("Pad_MCdata2","ratio",0.01,0.30,1.0,0.40);
   Pad_MCdata2->Draw();
   Pad_MCdata3 = new TPad("Pad_MCdata3","ratio",0.01,0.20,1.0,0.30);
   Pad_MCdata3->Draw();
   Pad_MCdata4 = new TPad("Pad_MCdata4","ratio",0.01,0.10,1.0,0.20);
   Pad_MCdata4->Draw();
   Pad_MCdata5 = new TPad("Pad_MCdata5","ratio",0.01,0.0,1.0,0.10);
   Pad_MCdata5->Draw();

// first pad style
   Pad_inclJet->cd();
   gStyle->SetOptStat(0);
   gPad->SetFillColor(0);
   gPad->SetBorderMode(0);
   gPad->SetBorderSize(2);
   gPad->SetLogy();
   gPad->SetLeftMargin(0.14);
   gPad->SetRightMargin(0.03);
   gPad->SetTopMargin(0.03);
   gPad->SetFrameBorderMode(0);
   gPad->SetFrameBorderMode(0);

//empty histo for border and style

   TH1F *shape = new TH1F("","",1, xmin, xmax);
   shape->SetMinimum(ymin);
   shape->SetMaximum(ymax); 
   shape->GetXaxis()->SetTitle("Jet p_{T} (GeV/c)");
   shape->GetXaxis()->SetLabelSize(0.03);
   shape->GetXaxis()->SetTitleSize(0.03);
   shape->GetXaxis()->SetNdivisions(508);
   shape->GetXaxis()->SetTitleOffset(1.3);
   shape->GetYaxis()->SetTitle("#frac{d^{2}#sigma}{dp_{T}d|y|} (pb/GeV)");
   shape->GetYaxis()->SetLabelSize(0.03);
   shape->GetYaxis()->SetTitleSize(0.03);
   shape->GetYaxis()->SetTitleOffset(1.6);
   shape->Draw("e");

  //data
  d01_x01_y01_histo->Draw("E2same");
  d02_x01_y01_histo->Draw("E2same");
  d03_x01_y01_histo->Draw("E2same");
  d04_x01_y01_histo->Draw("E2same");
  d05_x01_y01_histo->Draw("E2same");

	_histo[0][0]->Draw("E1same");
	_histo[1][0]->Draw("E1same");
	_histo[2][0]->Draw("E1same");
	_histo[3][0]->Draw("E1same");
	_histo[4][0]->Draw("E1same");


  gPad->SetLogy();
  gPad->SetLogx();

   TLine *line = new TLine(xmin,1,xmax,1);
   line->SetLineStyle(2);
   line->Draw();

   TPaveText *pt = new TPaveText(0.17,0.79,0.37,0.95,"brNDC");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetTextAlign(12);
   pt->SetTextSize(0.03);
   text = pt->AddText("CMS 2010");
   text = pt->AddText("#sqrt{s} = 7 TeV");
   text = pt->AddText("anti-k_{T} R = 0.5");
   pt->Draw();

TLegend *leg = new TLegend(0.68,0.77,0.83,0.928);
   leg->SetBorderSize(1);
   leg->SetTextSize(0.025);
   leg->SetLineColor(0);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);

   leg->AddEntry((TH1F*)_histo[0][0],"POWHEG & Pythia6 Z2","pfl");
   leg->AddEntry((TH1F*)  d01_x01_y01_histo, "|y| <0.5 (x 10^{4})","pfl");
   leg->AddEntry((TH1F*)  d02_x01_y01_histo, "0.5 < |y| < 1.0 (x 10^{3})","pfl");
   leg->AddEntry((TH1F*)  d03_x01_y01_histo, "1.0 < |y| < 1.5 (x 10^{2})","pfl");
   leg->AddEntry((TH1F*)  d04_x01_y01_histo, "1.5 < |y| < 2.0 (x 10^{1})","pfl");
   leg->AddEntry((TH1F*)  d05_x01_y01_histo, "2.0 < |y| < 2.5 (x 10^{0})","pfl");

   leg->Draw();

//second pad MC / Data

   Pad_MCdata1->cd();

   gPad->SetFillColor(0);
   gPad->SetBorderMode(0);
   gPad->SetBorderSize(2);
   gPad->SetLeftMargin(0.14);
   gPad->SetRightMargin(0.03);
   gPad->SetTopMargin(0.0);
   gPad->SetFrameBorderMode(0);
   gPad->SetFrameBorderMode(0);

  gPad->SetLogx();

   //AK Empty histo for style and borders
   TH1F *shape_MCdata = new TH1F("","",1, xmin, xmax);
   shape_MCdata->SetMinimum(0.5);
   shape_MCdata->SetMaximum(2.0);
   shape_MCdata->GetXaxis()->SetTitle("Jet p_{T} (GeV/c)");
   shape_MCdata->GetXaxis()->SetLabelSize(0.0);
   shape_MCdata->GetXaxis()->SetTitleSize(0.0);
   shape_MCdata->GetXaxis()->SetTitleOffset(0.6);
   shape_MCdata->GetYaxis()->SetTitle("MC/Data");
   shape_MCdata->GetYaxis()->SetLabelSize(0.15);
   shape_MCdata->GetYaxis()->SetTitleSize(0.15);
   shape_MCdata->GetYaxis()->SetTitleOffset(0.2);
   shape_MCdata->GetYaxis()->SetNdivisions(108, kTRUE);   
   shape_MCdata->Draw("e");   

// horizontal line at y = 1
   TLine *line = new TLine(xmin,1,xmax,1);
   line->SetLineStyle(2);
   line->Draw();

   TPaveText *pt = new TPaveText(0.89,0.7,0.94,0.8,"brNDC");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetTextAlign(12);
   pt->SetTextSize(0.2);
   text = pt->AddText("|y| <0.5");
   pt->Draw();

	_ratio[0][0]->Draw("EhistSame");

   Pad_MCdata2->cd();

   gPad->SetFillColor(0);
   gPad->SetBorderMode(0);
   gPad->SetBorderSize(2);
   gPad->SetLeftMargin(0.14);
   gPad->SetRightMargin(0.03);
   gPad->SetTopMargin(0.0);
   gPad->SetFrameBorderMode(0);
   gPad->SetFrameBorderMode(0);

  gPad->SetLogx();

   shape_MCdata->Draw("e");   



// horizontal line at y = 1
   TLine *line = new TLine(xmin,1,xmax,1);
   line->SetLineStyle(2);
   line->Draw();

   TPaveText *pt = new TPaveText(0.84,0.7,0.89,0.8,"brNDC");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetTextAlign(12);
   pt->SetTextSize(0.2);
   text = pt->AddText("0.5 < |y| < 1.0");
   pt->Draw();

	_ratio[1][0]->Draw("EhistSame");

   Pad_MCdata3->cd();

   gPad->SetFillColor(0);
   gPad->SetBorderMode(0);
   gPad->SetBorderSize(2);
   gPad->SetLeftMargin(0.14);
   gPad->SetRightMargin(0.03);
   gPad->SetTopMargin(0.0);
   gPad->SetFrameBorderMode(0);
   gPad->SetFrameBorderMode(0);

  gPad->SetLogx();

   shape_MCdata->Draw("e");   
// horizontal line at y = 1
   TLine *line = new TLine(xmin,1,xmax,1);
   line->SetLineStyle(2);
   line->Draw();

   TPaveText *pt = new TPaveText(0.84,0.7,0.89,0.8,"brNDC");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetTextAlign(12);
   pt->SetTextSize(0.2);
   text = pt->AddText("1.0 < |y| < 1.5");
   pt->Draw();
	_ratio[2][0]->Draw("EhistSame");

   Pad_MCdata4->cd();

   gPad->SetFillColor(0);
   gPad->SetBorderMode(0);
   gPad->SetBorderSize(2);
   gPad->SetLeftMargin(0.14);
   gPad->SetRightMargin(0.03);
   gPad->SetTopMargin(0.0);
   gPad->SetFrameBorderMode(0);
   gPad->SetFrameBorderMode(0);

  gPad->SetLogx();

   shape_MCdata->Draw("e");   
// horizontal line at y = 1
   TLine *line = new TLine(xmin,1,xmax,1);
   line->SetLineStyle(2);
   line->Draw();

   TPaveText *pt = new TPaveText(0.84,0.7,0.89,0.8,"brNDC");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetTextAlign(12);
   pt->SetTextSize(0.2);
   text = pt->AddText("1.5 < |y| < 2.0");
   pt->Draw();
	_ratio[3][0]->Draw("EhistSame");

   Pad_MCdata5->cd();

   gPad->SetFillColor(0);
   gPad->SetBorderMode(0);
   gPad->SetBorderSize(2);
   gPad->SetLeftMargin(0.14);
   gPad->SetRightMargin(0.03);
   gPad->SetTopMargin(0.0);
   gPad->SetFrameBorderMode(0);
   gPad->SetFrameBorderMode(0);

  gPad->SetLogx();

   shape_MCdata->Draw("e");   
// horizontal line at y = 1
   TLine *line = new TLine(xmin,1,xmax,1);
   line->SetLineStyle(2);
   line->Draw();

   TPaveText *pt = new TPaveText(0.84,0.7,0.89,0.8,"brNDC");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetTextAlign(12);
   pt->SetTextSize(0.2);
   text = pt->AddText("2.0 < |y| < 2.5");
   pt->Draw();
	_ratio[4][0]->Draw("EhistSame");

//write in png file
mysubpad1 =(TPad*)c1->GetPad(0);
mysubpad1->Print("pics/InclusiveJets_10_mcdataRatio.png");

} 
示例#27
0
void proj_npe_1()
{
//=========Macro generated from canvas: c/
//=========  (Wed Jul 15 16:16:05 2015) by ROOT version6.04/00
   TCanvas *c = new TCanvas("c", "",0,45,600,500);
   c->SetHighLightColor(2);
   c->Range(-2655.754,-5.755,4350.289,51.795);
   c->SetFillColor(0);
   c->SetBorderMode(0);
   c->SetBorderSize(2);
   c->SetFrameBorderMode(0);
   c->SetFrameBorderMode(0);
   
   Double_t _fx2[39] = {
   -1488.08,
   -1403.181,
   -1178.164,
   -1033.78,
   -849.3154,
   -838.8983,
   -788.1957,
   -701.2156,
   -654.0264,
   -163.6875,
   1.142557,
   54.07047,
   256.5688,
   531.8203,
   632.5535,
   750.8472,
   835.9491,
   859.9519,
   970.3359,
   1013.975,
   1084.685,
   1488.872,
   1635.959,
   1867.579,
   1967.102,
   2022.346,
   2109.155,
   2234.388,
   2395.154,
   2415.658,
   2534.104,
   2547.086,
   2643.154,
   2683.775,
   2846.919,
   3002.304,
   3074.222,
   3131.044,
   3182.615};
   Double_t _fy2[39] = {
   2.55,
   2.3,
   2.55,
   2.7,
   2.4,
   2.65,
   2.75,
   2.5,
   2.4,
   2.45,
   42.05,
   2.55,
   2.6,
   2.6,
   2.85,
   2.7,
   2.55,
   2.6,
   2.6,
   2.6,
   2.55,
   2.25,
   2.65,
   2.6,
   2.55,
   2.25,
   2.55,
   2.45,
   2.65,
   2.65,
   2.65,
   2.6,
   2.6,
   2.35,
   2.55,
   2.15,
   2.45,
   2.75,
   2.3};
   TGraph *graph = new TGraph(39,_fx2,_fy2);
   graph->SetName("");
   graph->SetTitle("Event 1");
   graph->SetFillColor(1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#0000ff");
   graph->SetMarkerColor(ci);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_Graph2 = new TH1F("Graph_Graph2","Event 1",100,-1955.149,3649.684);
   Graph_Graph2->SetMinimum(0);
   Graph_Graph2->SetMaximum(46.04);
   Graph_Graph2->SetDirectory(0);
   Graph_Graph2->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph2->SetLineColor(ci);
   Graph_Graph2->GetXaxis()->SetTitle("time wrt trigger [cm]");
   Graph_Graph2->GetXaxis()->SetLabelFont(42);
   Graph_Graph2->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph2->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph2->GetXaxis()->SetTitleFont(42);
   Graph_Graph2->GetYaxis()->SetTitle("#PE");
   Graph_Graph2->GetYaxis()->SetLabelFont(42);
   Graph_Graph2->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph2->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph2->GetYaxis()->SetTitleFont(42);
   Graph_Graph2->GetZaxis()->SetLabelFont(42);
   Graph_Graph2->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph2->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph2->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph2);
   
   graph->Draw("ap");
   
   TPaveText *pt = new TPaveText(0.4189298,0.94,0.5810702,0.995,"blNDC");
   pt->SetName("title");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetFillStyle(0);
   pt->SetTextFont(42);
   TText *AText = pt->AddText("Event 1");
   pt->Draw();
   c->Modified();
   c->cd();
   c->SetSelected(c);
}
void phimetphijet2()
{
//=========Macro generated from canvas: phimetphijet2/phimetphijet2
//=========  (Mon Nov 23 11:05:11 2015) by ROOT version6.02/05
   TCanvas *phimetphijet2 = new TCanvas("phimetphijet2", "phimetphijet2",300,322,700,700);
   phimetphijet2->Range(-3.926991,-6.296078,3.926991,4.627329);
   phimetphijet2->SetFillColor(0);
   phimetphijet2->SetBorderMode(0);
   phimetphijet2->SetBorderSize(2);
   phimetphijet2->SetLogy();
   phimetphijet2->SetFrameBorderMode(0);
   phimetphijet2->SetFrameBorderMode(0);
   
   THStack *phimetphijet2 = new THStack();
   phimetphijet2->SetName("phimetphijet2");
   phimetphijet2->SetTitle("phimetphijet2");
   
   TH1F *phimetphijet2_stack_20 = new TH1F("phimetphijet2_stack_20","phimetphijet2",20,-3.141593,3.141593);
   phimetphijet2_stack_20->SetMinimum(6.255515e-06);
   phimetphijet2_stack_20->SetMaximum(3427.587);
   phimetphijet2_stack_20->SetDirectory(0);
   phimetphijet2_stack_20->SetStats(0);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#000099");
   phimetphijet2_stack_20->SetLineColor(ci);
   phimetphijet2_stack_20->GetXaxis()->SetTitle("phimetphijet2");
   phimetphijet2_stack_20->GetXaxis()->SetLabelFont(42);
   phimetphijet2_stack_20->GetXaxis()->SetLabelSize(0.035);
   phimetphijet2_stack_20->GetXaxis()->SetTitleSize(0.035);
   phimetphijet2_stack_20->GetXaxis()->SetTitleFont(42);
   phimetphijet2_stack_20->GetYaxis()->SetTitle("Events/pb");
   phimetphijet2_stack_20->GetYaxis()->SetLabelFont(42);
   phimetphijet2_stack_20->GetYaxis()->SetLabelSize(0.035);
   phimetphijet2_stack_20->GetYaxis()->SetTitleSize(0.035);
   phimetphijet2_stack_20->GetYaxis()->SetTitleFont(42);
   phimetphijet2_stack_20->GetZaxis()->SetLabelFont(42);
   phimetphijet2_stack_20->GetZaxis()->SetLabelSize(0.035);
   phimetphijet2_stack_20->GetZaxis()->SetTitleSize(0.035);
   phimetphijet2_stack_20->GetZaxis()->SetTitleFont(42);
   phimetphijet2->SetHistogram(phimetphijet2_stack_20);
   
   
   TH1D *phimetphijet296 = new TH1D("phimetphijet296"," #Delta_{#phi}[MET,jet_{2}]",20,-3.141593,3.141593);
   phimetphijet296->SetBinContent(1,599.5565);
   phimetphijet296->SetBinContent(2,601.8699);
   phimetphijet296->SetBinContent(3,574.6103);
   phimetphijet296->SetBinContent(4,505.7655);
   phimetphijet296->SetBinContent(5,574.5997);
   phimetphijet296->SetBinContent(6,596.3209);
   phimetphijet296->SetBinContent(7,665.2723);
   phimetphijet296->SetBinContent(8,850.025);
   phimetphijet296->SetBinContent(9,1039.648);
   phimetphijet296->SetBinContent(10,1354.568);
   phimetphijet296->SetBinContent(11,1313.67);
   phimetphijet296->SetBinContent(12,1079.464);
   phimetphijet296->SetBinContent(13,839.0052);
   phimetphijet296->SetBinContent(14,679.6341);
   phimetphijet296->SetBinContent(15,578.1462);
   phimetphijet296->SetBinContent(16,532.6048);
   phimetphijet296->SetBinContent(17,559.8399);
   phimetphijet296->SetBinContent(18,538.712);
   phimetphijet296->SetBinContent(19,558.2774);
   phimetphijet296->SetBinContent(20,576.3311);
   phimetphijet296->SetBinError(1,14.01782);
   phimetphijet296->SetBinError(2,14.06125);
   phimetphijet296->SetBinError(3,13.75496);
   phimetphijet296->SetBinError(4,12.88979);
   phimetphijet296->SetBinError(5,13.75495);
   phimetphijet296->SetBinError(6,14.00518);
   phimetphijet296->SetBinError(7,14.76104);
   phimetphijet296->SetBinError(8,16.69368);
   phimetphijet296->SetBinError(9,18.3991);
   phimetphijet296->SetBinError(10,20.96339);
   phimetphijet296->SetBinError(11,20.62724);
   phimetphijet296->SetBinError(12,18.76332);
   phimetphijet296->SetBinError(13,16.57613);
   phimetphijet296->SetBinError(14,14.92679);
   phimetphijet296->SetBinError(15,13.77979);
   phimetphijet296->SetBinError(16,13.24077);
   phimetphijet296->SetBinError(17,13.5788);
   phimetphijet296->SetBinError(18,13.30024);
   phimetphijet296->SetBinError(19,13.5421);
   phimetphijet296->SetBinError(20,13.74356);
   phimetphijet296->SetEntries(88534);

   ci = TColor::GetColor("#00cc00");
   phimetphijet296->SetFillColor(ci);

   ci = TColor::GetColor("#00cc00");
   phimetphijet296->SetLineColor(ci);

   ci = TColor::GetColor("#00cc00");
   phimetphijet296->SetMarkerColor(ci);
   phimetphijet296->SetMarkerStyle(22);
   phimetphijet296->GetXaxis()->SetTitle("phimetphijet2");
   phimetphijet296->GetXaxis()->SetLabelFont(42);
   phimetphijet296->GetXaxis()->SetLabelSize(0.035);
   phimetphijet296->GetXaxis()->SetTitleSize(0.035);
   phimetphijet296->GetXaxis()->SetTitleFont(42);
   phimetphijet296->GetYaxis()->SetTitle("Events/pb");
   phimetphijet296->GetYaxis()->SetLabelFont(42);
   phimetphijet296->GetYaxis()->SetLabelSize(0.035);
   phimetphijet296->GetYaxis()->SetTitleSize(0.035);
   phimetphijet296->GetYaxis()->SetTitleFont(42);
   phimetphijet296->GetZaxis()->SetLabelFont(42);
   phimetphijet296->GetZaxis()->SetLabelSize(0.035);
   phimetphijet296->GetZaxis()->SetTitleSize(0.035);
   phimetphijet296->GetZaxis()->SetTitleFont(42);
   phimetphijet2->Add(phimetphijet2,"");
   
   TH1D *phimetphijet297 = new TH1D("phimetphijet297"," #Delta_{#phi}[MET,jet_{2}]",20,-3.141593,3.141593);
   phimetphijet297->SetBinContent(1,3.833102);
   phimetphijet297->SetBinContent(2,4.030573);
   phimetphijet297->SetBinContent(3,4.099132);
   phimetphijet297->SetBinContent(4,4.272269);
   phimetphijet297->SetBinContent(5,4.209427);
   phimetphijet297->SetBinContent(6,4.370433);
   phimetphijet297->SetBinContent(7,4.06457);
   phimetphijet297->SetBinContent(8,3.764594);
   phimetphijet297->SetBinContent(9,3.518276);
   phimetphijet297->SetBinContent(10,3.486163);
   phimetphijet297->SetBinContent(11,3.551275);
   phimetphijet297->SetBinContent(12,3.544476);
   phimetphijet297->SetBinContent(13,3.844214);
   phimetphijet297->SetBinContent(14,3.933075);
   phimetphijet297->SetBinContent(15,4.224541);
   phimetphijet297->SetBinContent(16,4.33643);
   phimetphijet297->SetBinContent(17,4.349964);
   phimetphijet297->SetBinContent(18,4.199265);
   phimetphijet297->SetBinContent(19,4.023059);
   phimetphijet297->SetBinContent(20,3.888278);
   phimetphijet297->SetBinError(1,0.05590373);
   phimetphijet297->SetBinError(2,0.05732162);
   phimetphijet297->SetBinError(3,0.0572273);
   phimetphijet297->SetBinError(4,0.05746171);
   phimetphijet297->SetBinError(5,0.05623738);
   phimetphijet297->SetBinError(6,0.0572591);
   phimetphijet297->SetBinError(7,0.05438423);
   phimetphijet297->SetBinError(8,0.05158963);
   phimetphijet297->SetBinError(9,0.04876562);
   phimetphijet297->SetBinError(10,0.04882319);
   phimetphijet297->SetBinError(11,0.04943321);
   phimetphijet297->SetBinError(12,0.04933328);
   phimetphijet297->SetBinError(13,0.0524752);
   phimetphijet297->SetBinError(14,0.05317107);
   phimetphijet297->SetBinError(15,0.05552655);
   phimetphijet297->SetBinError(16,0.0574827);
   phimetphijet297->SetBinError(17,0.05824327);
   phimetphijet297->SetBinError(18,0.05807843);
   phimetphijet297->SetBinError(19,0.05712001);
   phimetphijet297->SetBinError(20,0.05627091);
   phimetphijet297->SetEntries(324582);

   ci = TColor::GetColor("#00ffff");
   phimetphijet297->SetFillColor(ci);

   ci = TColor::GetColor("#00ffff");
   phimetphijet297->SetLineColor(ci);

   ci = TColor::GetColor("#00ffff");
   phimetphijet297->SetMarkerColor(ci);
   phimetphijet297->SetMarkerStyle(20);
   phimetphijet297->GetXaxis()->SetTitle("phimetphijet2");
   phimetphijet297->GetXaxis()->SetLabelFont(42);
   phimetphijet297->GetXaxis()->SetLabelSize(0.035);
   phimetphijet297->GetXaxis()->SetTitleSize(0.035);
   phimetphijet297->GetXaxis()->SetTitleFont(42);
   phimetphijet297->GetYaxis()->SetTitle("Events/pb");
   phimetphijet297->GetYaxis()->SetLabelFont(42);
   phimetphijet297->GetYaxis()->SetLabelSize(0.035);
   phimetphijet297->GetYaxis()->SetTitleSize(0.035);
   phimetphijet297->GetYaxis()->SetTitleFont(42);
   phimetphijet297->GetZaxis()->SetLabelFont(42);
   phimetphijet297->GetZaxis()->SetLabelSize(0.035);
   phimetphijet297->GetZaxis()->SetTitleSize(0.035);
   phimetphijet297->GetZaxis()->SetTitleFont(42);
   phimetphijet2->Add(phimetphijet2,"");
   
   TH1D *phimetphijet298 = new TH1D("phimetphijet298"," #Delta_{#phi}[MET,jet_{2}]",20,-3.141593,3.141593);
   phimetphijet298->SetBinContent(1,0.562526);
   phimetphijet298->SetBinContent(2,0.5785768);
   phimetphijet298->SetBinContent(3,0.5795457);
   phimetphijet298->SetBinContent(4,0.5955618);
   phimetphijet298->SetBinContent(5,0.5771722);
   phimetphijet298->SetBinContent(6,0.5592627);
   phimetphijet298->SetBinContent(7,0.508213);
   phimetphijet298->SetBinContent(8,0.4729086);
   phimetphijet298->SetBinContent(9,0.4529622);
   phimetphijet298->SetBinContent(10,0.452754);
   phimetphijet298->SetBinContent(11,0.4560625);
   phimetphijet298->SetBinContent(12,0.4478396);
   phimetphijet298->SetBinContent(13,0.481398);
   phimetphijet298->SetBinContent(14,0.5057427);
   phimetphijet298->SetBinContent(15,0.5478765);
   phimetphijet298->SetBinContent(16,0.5759238);
   phimetphijet298->SetBinContent(17,0.588108);
   phimetphijet298->SetBinContent(18,0.6099644);
   phimetphijet298->SetBinContent(19,0.6091882);
   phimetphijet298->SetBinContent(20,0.5592744);
   phimetphijet298->SetBinError(1,0.006701172);
   phimetphijet298->SetBinError(2,0.006782582);
   phimetphijet298->SetBinError(3,0.006778253);
   phimetphijet298->SetBinError(4,0.006758593);
   phimetphijet298->SetBinError(5,0.006577098);
   phimetphijet298->SetBinError(6,0.006435378);
   phimetphijet298->SetBinError(7,0.005984446);
   phimetphijet298->SetBinError(8,0.005703029);
   phimetphijet298->SetBinError(9,0.00552641);
   phimetphijet298->SetBinError(10,0.005538473);
   phimetphijet298->SetBinError(11,0.00554042);
   phimetphijet298->SetBinError(12,0.00553433);
   phimetphijet298->SetBinError(13,0.00578102);
   phimetphijet298->SetBinError(14,0.005996152);
   phimetphijet298->SetBinError(15,0.006336019);
   phimetphijet298->SetBinError(16,0.006562733);
   phimetphijet298->SetBinError(17,0.00671901);
   phimetphijet298->SetBinError(18,0.006958606);
   phimetphijet298->SetBinError(19,0.006977009);
   phimetphijet298->SetBinError(20,0.006670566);
   phimetphijet298->SetEntries(300679);

   ci = TColor::GetColor("#ffcc00");
   phimetphijet298->SetFillColor(ci);

   ci = TColor::GetColor("#ffcc00");
   phimetphijet298->SetLineColor(ci);

   ci = TColor::GetColor("#ffcc00");
   phimetphijet298->SetMarkerColor(ci);
   phimetphijet298->SetMarkerStyle(21);
   phimetphijet298->GetXaxis()->SetTitle("phimetphijet2");
   phimetphijet298->GetXaxis()->SetLabelFont(42);
   phimetphijet298->GetXaxis()->SetLabelSize(0.035);
   phimetphijet298->GetXaxis()->SetTitleSize(0.035);
   phimetphijet298->GetXaxis()->SetTitleFont(42);
   phimetphijet298->GetYaxis()->SetTitle("Events/pb");
   phimetphijet298->GetYaxis()->SetLabelFont(42);
   phimetphijet298->GetYaxis()->SetLabelSize(0.035);
   phimetphijet298->GetYaxis()->SetTitleSize(0.035);
   phimetphijet298->GetYaxis()->SetTitleFont(42);
   phimetphijet298->GetZaxis()->SetLabelFont(42);
   phimetphijet298->GetZaxis()->SetLabelSize(0.035);
   phimetphijet298->GetZaxis()->SetTitleSize(0.035);
   phimetphijet298->GetZaxis()->SetTitleFont(42);
   phimetphijet2->Add(phimetphijet2,"");
   
   TH1D *phimetphijet299 = new TH1D("phimetphijet299"," #Delta_{#phi}[MET,jet_{2}]",20,-3.141593,3.141593);
   phimetphijet299->SetBinContent(1,0.01442198);
   phimetphijet299->SetBinContent(2,0.01314174);
   phimetphijet299->SetBinContent(3,0.01025734);
   phimetphijet299->SetBinContent(4,0.008221299);
   phimetphijet299->SetBinContent(5,0.006293227);
   phimetphijet299->SetBinContent(6,0.006031009);
   phimetphijet299->SetBinContent(7,0.004565674);
   phimetphijet299->SetBinContent(8,0.003886993);
   phimetphijet299->SetBinContent(9,0.004241758);
   phimetphijet299->SetBinContent(10,0.004334306);
   phimetphijet299->SetBinContent(11,0.003686474);
   phimetphijet299->SetBinContent(12,0.00418006);
   phimetphijet299->SetBinContent(13,0.00434973);
   phimetphijet299->SetBinContent(14,0.004951289);
   phimetphijet299->SetBinContent(15,0.005429451);
   phimetphijet299->SetBinContent(16,0.006277802);
   phimetphijet299->SetBinContent(17,0.009578662);
   phimetphijet299->SetBinContent(18,0.01055041);
   phimetphijet299->SetBinContent(19,0.01200032);
   phimetphijet299->SetBinContent(20,0.01436028);
   phimetphijet299->SetBinError(1,0.0004716491);
   phimetphijet299->SetBinError(2,0.0004502285);
   phimetphijet299->SetBinError(3,0.0003977627);
   phimetphijet299->SetBinError(4,0.000356104);
   phimetphijet299->SetBinError(5,0.0003115612);
   phimetphijet299->SetBinError(6,0.0003050012);
   phimetphijet299->SetBinError(7,0.0002653744);
   phimetphijet299->SetBinError(8,0.0002448576);
   phimetphijet299->SetBinError(9,0.0002557877);
   phimetphijet299->SetBinError(10,0.000258563);
   phimetphijet299->SetBinError(11,0.0002384582);
   phimetphijet299->SetBinError(12,0.0002539206);
   phimetphijet299->SetBinError(13,0.0002590227);
   phimetphijet299->SetBinError(14,0.000276354);
   phimetphijet299->SetBinError(15,0.0002893907);
   phimetphijet299->SetBinError(16,0.0003111791);
   phimetphijet299->SetBinError(17,0.0003843785);
   phimetphijet299->SetBinError(18,0.000403405);
   phimetphijet299->SetBinError(19,0.0004302323);
   phimetphijet299->SetBinError(20,0.0004706392);
   phimetphijet299->SetEntries(9774);

   ci = TColor::GetColor("#ff0000");
   phimetphijet299->SetFillColor(ci);

   ci = TColor::GetColor("#ff0000");
   phimetphijet299->SetLineColor(ci);

   ci = TColor::GetColor("#ff0000");
   phimetphijet299->SetMarkerColor(ci);
   phimetphijet299->SetMarkerStyle(20);
   phimetphijet299->GetXaxis()->SetTitle("phimetphijet2");
   phimetphijet299->GetXaxis()->SetLabelFont(42);
   phimetphijet299->GetXaxis()->SetLabelSize(0.035);
   phimetphijet299->GetXaxis()->SetTitleSize(0.035);
   phimetphijet299->GetXaxis()->SetTitleFont(42);
   phimetphijet299->GetYaxis()->SetTitle("Events/pb");
   phimetphijet299->GetYaxis()->SetLabelFont(42);
   phimetphijet299->GetYaxis()->SetLabelSize(0.035);
   phimetphijet299->GetYaxis()->SetTitleSize(0.035);
   phimetphijet299->GetYaxis()->SetTitleFont(42);
   phimetphijet299->GetZaxis()->SetLabelFont(42);
   phimetphijet299->GetZaxis()->SetLabelSize(0.035);
   phimetphijet299->GetZaxis()->SetTitleSize(0.035);
   phimetphijet299->GetZaxis()->SetTitleFont(42);
   phimetphijet2->Add(phimetphijet2,"");
   
   TH1D *phimetphijet2100 = new TH1D("phimetphijet2100"," #Delta_{#phi}[MET,jet_{2}]",20,-3.141593,3.141593);
   phimetphijet2100->SetBinContent(1,0.0001677165);
   phimetphijet2100->SetBinContent(2,0.0002012598);
   phimetphijet2100->SetBinContent(3,0.0002180314);
   phimetphijet2100->SetBinContent(4,0.0002348031);
   phimetphijet2100->SetBinContent(5,0.0001509448);
   phimetphijet2100->SetBinContent(6,0.0001174015);
   phimetphijet2100->SetBinContent(7,0.0001341732);
   phimetphijet2100->SetBinContent(8,8.385824e-05);
   phimetphijet2100->SetBinContent(9,0.0001006299);
   phimetphijet2100->SetBinContent(10,0.0001509448);
   phimetphijet2100->SetBinContent(11,6.708659e-05);
   phimetphijet2100->SetBinContent(12,3.35433e-05);
   phimetphijet2100->SetBinContent(13,0.0002180314);
   phimetphijet2100->SetBinContent(14,0.0002180314);
   phimetphijet2100->SetBinContent(15,0.0002012598);
   phimetphijet2100->SetBinContent(16,0.0001174015);
   phimetphijet2100->SetBinContent(17,0.0003186613);
   phimetphijet2100->SetBinContent(18,0.0003689762);
   phimetphijet2100->SetBinContent(19,8.385824e-05);
   phimetphijet2100->SetBinContent(20,8.385824e-05);
   phimetphijet2100->SetBinError(1,5.303661e-05);
   phimetphijet2100->SetBinError(2,5.809869e-05);
   phimetphijet2100->SetBinError(3,6.047104e-05);
   phimetphijet2100->SetBinError(4,6.275376e-05);
   phimetphijet2100->SetBinError(5,5.031494e-05);
   phimetphijet2100->SetBinError(6,4.437361e-05);
   phimetphijet2100->SetBinError(7,4.743738e-05);
   phimetphijet2100->SetBinError(8,3.750254e-05);
   phimetphijet2100->SetBinError(9,4.108198e-05);
   phimetphijet2100->SetBinError(10,5.031494e-05);
   phimetphijet2100->SetBinError(11,3.35433e-05);
   phimetphijet2100->SetBinError(12,2.371869e-05);
   phimetphijet2100->SetBinError(13,6.047104e-05);
   phimetphijet2100->SetBinError(14,6.047104e-05);
   phimetphijet2100->SetBinError(15,5.809869e-05);
   phimetphijet2100->SetBinError(16,4.437361e-05);
   phimetphijet2100->SetBinError(17,7.310592e-05);
   phimetphijet2100->SetBinError(18,7.8666e-05);
   phimetphijet2100->SetBinError(19,3.750254e-05);
   phimetphijet2100->SetBinError(20,3.750254e-05);
   phimetphijet2100->SetEntries(195);

   ci = TColor::GetColor("#0000ff");
   phimetphijet2100->SetFillColor(ci);

   ci = TColor::GetColor("#0000ff");
   phimetphijet2100->SetLineColor(ci);

   ci = TColor::GetColor("#0000ff");
   phimetphijet2100->SetMarkerColor(ci);
   phimetphijet2100->SetMarkerStyle(21);
   phimetphijet2100->GetXaxis()->SetTitle("phimetphijet2");
   phimetphijet2100->GetXaxis()->SetLabelFont(42);
   phimetphijet2100->GetXaxis()->SetLabelSize(0.035);
   phimetphijet2100->GetXaxis()->SetTitleSize(0.035);
   phimetphijet2100->GetXaxis()->SetTitleFont(42);
   phimetphijet2100->GetYaxis()->SetTitle("Events/pb");
   phimetphijet2100->GetYaxis()->SetLabelFont(42);
   phimetphijet2100->GetYaxis()->SetLabelSize(0.035);
   phimetphijet2100->GetYaxis()->SetTitleSize(0.035);
   phimetphijet2100->GetYaxis()->SetTitleFont(42);
   phimetphijet2100->GetZaxis()->SetLabelFont(42);
   phimetphijet2100->GetZaxis()->SetLabelSize(0.035);
   phimetphijet2100->GetZaxis()->SetTitleSize(0.035);
   phimetphijet2100->GetZaxis()->SetTitleFont(42);
   phimetphijet2->Add(phimetphijet2,"");
   phimetphijet2->Draw("nostack");
   
   TPaveText *pt = new TPaveText(0.3269253,0.9342857,0.6730747,0.995,"blNDC");
   pt->SetName("title");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetFillStyle(0);
   pt->SetTextFont(42);
   TText *AText = pt->AddText("phimetphijet2");
   pt->Draw();
   
   TLegend *leg = new TLegend(0.54023,0.639881,0.938218,0.924107,NULL,"brNDC");
   leg->SetBorderSize(1);
   leg->SetTextSize(0.034965);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("phimetphijet2","phimetphijet2_QCD","lp");

   ci = TColor::GetColor("#00cc00");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);

   ci = TColor::GetColor("#00cc00");
   entry->SetMarkerColor(ci);
   entry->SetMarkerStyle(22);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("phimetphijet2","phimetphijet2_WJetsToLNu","lp");

   ci = TColor::GetColor("#00ffff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);

   ci = TColor::GetColor("#00ffff");
   entry->SetMarkerColor(ci);
   entry->SetMarkerStyle(20);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("phimetphijet2","phimetphijet2_ZJetsToNuNu","lp");

   ci = TColor::GetColor("#ffcc00");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);

   ci = TColor::GetColor("#ffcc00");
   entry->SetMarkerColor(ci);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("phimetphijet2","phimetphijet2_signal","lp");

   ci = TColor::GetColor("#ff0000");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);

   ci = TColor::GetColor("#ff0000");
   entry->SetMarkerColor(ci);
   entry->SetMarkerStyle(20);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("phimetphijet2","phimetphijet2_ttbar","lp");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);

   ci = TColor::GetColor("#0000ff");
   entry->SetMarkerColor(ci);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   phimetphijet2->Modified();
   phimetphijet2->cd();
   phimetphijet2->SetSelected(phimetphijet2);
}
void effAndSmallSF_DATA_MC_Cracks_pT2()
{
//=========Macro generated from canvas: Canvas/Canvas
//=========  (Mon Feb  8 17:29:37 2016) by ROOT version6.02/05
   TCanvas *Canvas = new TCanvas("Canvas", "Canvas",0,0,725,725);
   gStyle->SetOptFit(1);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   Canvas->SetHighLightColor(2);
   Canvas->Range(0,0,1,1);
   Canvas->SetFillColor(0);
   Canvas->SetBorderMode(0);
   Canvas->SetBorderSize(2);
   Canvas->SetTickx(1);
   Canvas->SetTicky(1);
   Canvas->SetLeftMargin(0.15);
   Canvas->SetRightMargin(0.05);
   Canvas->SetTopMargin(0.07);
   Canvas->SetBottomMargin(0.17);
   Canvas->SetFrameFillStyle(0);
   Canvas->SetFrameBorderMode(0);
  
// ------------>Primitives in pad: pad1
   TPad *pad1 = new TPad("pad1", "pad1",0.01,0.3,0.99,0.99);
   pad1->Draw();
   pad1->cd();
   pad1->Range(-15.32432,-0.03620689,94.13513,1.17069);
   pad1->SetFillColor(0);
   pad1->SetBorderMode(0);
   pad1->SetBorderSize(2);
   pad1->SetGridx();
   pad1->SetGridy();
   pad1->SetTickx(1);
   pad1->SetTicky(1);
   pad1->SetLeftMargin(0.14);
   pad1->SetRightMargin(0.12);
   pad1->SetBottomMargin(0.03);
   pad1->SetFrameFillStyle(0);
   pad1->SetFrameBorderMode(0);
   pad1->SetFrameFillStyle(0);
   pad1->SetFrameBorderMode(0);
   
   Double_t Graph0_fx3001[3] = {
   13.5,
   25,
   55};
   Double_t Graph0_fy3001[3] = {
   0.9387,
   0.9652,
   0.9863};
   Double_t Graph0_felx3001[3] = {
   6.5,
   5,
   25};
   Double_t Graph0_fely3001[3] = {
   0.0034,
   0.0013,
   0.0003};
   Double_t Graph0_fehx3001[3] = {
   6.5,
   5,
   25};
   Double_t Graph0_fehy3001[3] = {
   0.0034,
   0.0013,
   0.0003};
   TGraphAsymmErrors *grae = new TGraphAsymmErrors(3,Graph0_fx3001,Graph0_fy3001,Graph0_felx3001,Graph0_fehx3001,Graph0_fely3001,Graph0_fehy3001);
   grae->SetName("Graph0");
   grae->SetTitle("TGraphAsymmErrors for MC efficiencies");

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#99ccff");
   grae->SetFillColor(ci);

   ci = TColor::GetColor("#3399ff");
   grae->SetLineColor(ci);

   ci = TColor::GetColor("#3399ff");
   grae->SetMarkerColor(ci);
   grae->SetMarkerStyle(22);
   grae->SetMarkerSize(0.7);
   
   TH1F *Graph_TH1F3001 = new TH1F("Graph_TH1F3001","TH1F histogram",100,0,81);
   Graph_TH1F3001->SetMinimum(0);
   Graph_TH1F3001->SetMaximum(1.05);
   Graph_TH1F3001->SetFillStyle(0);
   Graph_TH1F3001->SetLineStyle(0);
   Graph_TH1F3001->SetMarkerStyle(20);
   Graph_TH1F3001->GetXaxis()->SetLabelFont(42);
   Graph_TH1F3001->GetXaxis()->SetLabelOffset(0.007);
   Graph_TH1F3001->GetXaxis()->SetLabelSize(0);
   Graph_TH1F3001->GetXaxis()->SetTitleSize(0.06);
   Graph_TH1F3001->GetXaxis()->SetTitleFont(42);
   Graph_TH1F3001->GetYaxis()->SetTitle("ID efficiency");
   Graph_TH1F3001->GetYaxis()->SetLabelFont(42);
   Graph_TH1F3001->GetYaxis()->SetLabelOffset(0.007);
   Graph_TH1F3001->GetYaxis()->SetLabelSize(0.05);
   Graph_TH1F3001->GetYaxis()->SetTitleSize(0.06);
   Graph_TH1F3001->GetYaxis()->SetTitleOffset(0.85);
   Graph_TH1F3001->GetYaxis()->SetTitleFont(42);
   Graph_TH1F3001->GetZaxis()->SetLabelFont(42);
   Graph_TH1F3001->GetZaxis()->SetLabelOffset(0.007);
   Graph_TH1F3001->GetZaxis()->SetLabelSize(0.05);
   Graph_TH1F3001->GetZaxis()->SetTitleSize(0.06);
   Graph_TH1F3001->GetZaxis()->SetTitleFont(42);
   grae->SetHistogram(Graph_TH1F3001);
   
   grae->Draw("a2");
   
   Double_t Graph0_fx3002[3] = {
   13.5,
   25,
   55};
   Double_t Graph0_fy3002[3] = {
   0.9387,
   0.9652,
   0.9863};
   Double_t Graph0_felx3002[3] = {
   6.5,
   5,
   25};
   Double_t Graph0_fely3002[3] = {
   0.0034,
   0.0013,
   0.0003};
   Double_t Graph0_fehx3002[3] = {
   6.5,
   5,
   25};
   Double_t Graph0_fehy3002[3] = {
   0.0034,
   0.0013,
   0.0003};
   grae = new TGraphAsymmErrors(3,Graph0_fx3002,Graph0_fy3002,Graph0_felx3002,Graph0_fehx3002,Graph0_fely3002,Graph0_fehy3002);
   grae->SetName("Graph0");
   grae->SetTitle("TGraphAsymmErrors for MC efficiencies");

   ci = TColor::GetColor("#99ccff");
   grae->SetFillColor(ci);

   ci = TColor::GetColor("#3399ff");
   grae->SetLineColor(ci);

   ci = TColor::GetColor("#3399ff");
   grae->SetMarkerColor(ci);
   grae->SetMarkerStyle(22);
   grae->SetMarkerSize(0.7);
   
   TH1F *Graph_Graph_TH1F30013002 = new TH1F("Graph_Graph_TH1F30013002","TH1F histogram",100,0,81);
   Graph_Graph_TH1F30013002->SetMinimum(0);
   Graph_Graph_TH1F30013002->SetMaximum(1.05);
   Graph_Graph_TH1F30013002->SetFillStyle(0);
   Graph_Graph_TH1F30013002->SetLineStyle(0);
   Graph_Graph_TH1F30013002->SetMarkerStyle(20);
   Graph_Graph_TH1F30013002->GetXaxis()->SetLabelFont(42);
   Graph_Graph_TH1F30013002->GetXaxis()->SetLabelOffset(0.007);
   Graph_Graph_TH1F30013002->GetXaxis()->SetLabelSize(0);
   Graph_Graph_TH1F30013002->GetXaxis()->SetTitleSize(0.06);
   Graph_Graph_TH1F30013002->GetXaxis()->SetTitleFont(42);
   Graph_Graph_TH1F30013002->GetYaxis()->SetTitle("ID efficiency");
   Graph_Graph_TH1F30013002->GetYaxis()->SetLabelFont(42);
   Graph_Graph_TH1F30013002->GetYaxis()->SetLabelOffset(0.007);
   Graph_Graph_TH1F30013002->GetYaxis()->SetLabelSize(0.05);
   Graph_Graph_TH1F30013002->GetYaxis()->SetTitleSize(0.06);
   Graph_Graph_TH1F30013002->GetYaxis()->SetTitleOffset(0.85);
   Graph_Graph_TH1F30013002->GetYaxis()->SetTitleFont(42);
   Graph_Graph_TH1F30013002->GetZaxis()->SetLabelFont(42);
   Graph_Graph_TH1F30013002->GetZaxis()->SetLabelOffset(0.007);
   Graph_Graph_TH1F30013002->GetZaxis()->SetLabelSize(0.05);
   Graph_Graph_TH1F30013002->GetZaxis()->SetTitleSize(0.06);
   Graph_Graph_TH1F30013002->GetZaxis()->SetTitleFont(42);
   grae->SetHistogram(Graph_Graph_TH1F30013002);
   
   grae->Draw("p");
   
   Double_t Graph1_fx3003[3] = {
   13.5,
   25,
   55};
   Double_t Graph1_fy3003[3] = {
   0.973,
   0.9563,
   0.9835};
   Double_t Graph1_felx3003[3] = {
   6.5,
   5,
   25};
   Double_t Graph1_fely3003[3] = {
   0.004,
   0.0015,
   0.0009};
   Double_t Graph1_fehx3003[3] = {
   6.5,
   5,
   25};
   Double_t Graph1_fehy3003[3] = {
   0.004,
   0.0015,
   0.0009};
   grae = new TGraphAsymmErrors(3,Graph1_fx3003,Graph1_fy3003,Graph1_felx3003,Graph1_fehx3003,Graph1_fely3003,Graph1_fehy3003);
   grae->SetName("Graph1");
   grae->SetTitle("TGraphAsymmErrors for Data efficiencies");
   grae->SetFillColor(1);
   grae->SetMarkerStyle(9);
   grae->SetMarkerSize(0.7);
   
   TH1F *Graph_Graph3003 = new TH1F("Graph_Graph3003","TGraphAsymmErrors for Data efficiencies",100,0,87.3);
   Graph_Graph3003->SetMinimum(0.95184);
   Graph_Graph3003->SetMaximum(0.98736);
   Graph_Graph3003->SetDirectory(0);
   Graph_Graph3003->SetStats(0);
   Graph_Graph3003->SetFillStyle(0);
   Graph_Graph3003->SetLineStyle(0);
   Graph_Graph3003->SetMarkerStyle(20);
   Graph_Graph3003->GetXaxis()->SetLabelFont(42);
   Graph_Graph3003->GetXaxis()->SetLabelOffset(0.007);
   Graph_Graph3003->GetXaxis()->SetLabelSize(0.05);
   Graph_Graph3003->GetXaxis()->SetTitleSize(0.06);
   Graph_Graph3003->GetXaxis()->SetTitleFont(42);
   Graph_Graph3003->GetYaxis()->SetLabelFont(42);
   Graph_Graph3003->GetYaxis()->SetLabelOffset(0.007);
   Graph_Graph3003->GetYaxis()->SetLabelSize(0.05);
   Graph_Graph3003->GetYaxis()->SetTitleSize(0.06);
   Graph_Graph3003->GetYaxis()->SetTitleOffset(0.85);
   Graph_Graph3003->GetYaxis()->SetTitleFont(42);
   Graph_Graph3003->GetZaxis()->SetLabelFont(42);
   Graph_Graph3003->GetZaxis()->SetLabelOffset(0.007);
   Graph_Graph3003->GetZaxis()->SetLabelSize(0.05);
   Graph_Graph3003->GetZaxis()->SetTitleSize(0.06);
   Graph_Graph3003->GetZaxis()->SetTitleFont(42);
   grae->SetHistogram(Graph_Graph3003);
   
   grae->Draw("p");
   
   TLegend *leg = new TLegend(0.63,0.2,0.87,0.33,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextFont(62);
   leg->SetTextSize(0.03);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("Graph1","Data","p");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(9);
   entry->SetMarkerSize(0.7);
   entry->SetTextFont(62);
   entry=leg->AddEntry("Graph0","Simulation","fp");

   ci = TColor::GetColor("#99ccff");
   entry->SetFillColor(ci);
   entry->SetFillStyle(1001);

   ci = TColor::GetColor("#3399ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);

   ci = TColor::GetColor("#3399ff");
   entry->SetMarkerColor(ci);
   entry->SetMarkerStyle(22);
   entry->SetMarkerSize(0.7);
   entry->SetTextFont(62);
   leg->Draw();
   
   TPaveText *pt = new TPaveText(0.14,0.94,0.89,0.99,"brNDC");
   pt->SetBorderSize(0);
   pt->SetFillStyle(0);
   pt->SetTextAlign(12);
   pt->SetTextSize(0.03);
   TText *AText = pt->AddText(0.01,0.3,"CMS Preliminary");
   AText = pt->AddText(0.7,0.3,"#sqrt{s} = 13 TeV, L = 2.26 fb^{-1}");
   pt->Draw();
      tex = new TLatex(0.67,0.4,"Z #rightarrow e^{+} e^{-}");
tex->SetNDC();
   tex->SetTextSize(0.03);
   tex->SetLineWidth(2);
   tex->Draw();
      tex = new TLatex(0.63,0.35," Crack probes");
tex->SetNDC();
   tex->SetTextSize(0.03);
   tex->SetLineWidth(2);
   tex->Draw();
   pad1->Modified();
   Canvas->cd();
  
// ------------>Primitives in pad: pad2
   TPad *pad2 = new TPad("pad2", "pad2",0.01,0.01,0.99,0.3);
   pad2->Draw();
   pad2->cd();
   pad2->Range(-15.32432,0.4915493,94.13513,1.125352);
   pad2->SetFillColor(0);
   pad2->SetBorderMode(0);
   pad2->SetBorderSize(2);
   pad2->SetGridx();
   pad2->SetGridy();
   pad2->SetTickx(1);
   pad2->SetTicky(1);
   pad2->SetLeftMargin(0.14);
   pad2->SetRightMargin(0.12);
   pad2->SetTopMargin(0.04);
   pad2->SetBottomMargin(0.25);
   pad2->SetFrameFillStyle(0);
   pad2->SetFrameBorderMode(0);
   pad2->SetFrameFillStyle(0);
   pad2->SetFrameBorderMode(0);
   
   Double_t Graph0_fx3004[3] = {
   13.5,
   25,
   55};
   Double_t Graph0_fy3004[3] = {
   1.0365,
   0.9908,
   0.9971};
   Double_t Graph0_felx3004[3] = {
   6.5,
   5,
   25};
   Double_t Graph0_fely3004[3] = {
   0.009,
   0.0082,
   0.0016};
   Double_t Graph0_fehx3004[3] = {
   6.5,
   5,
   25};
   Double_t Graph0_fehy3004[3] = {
   0.009,
   0.0082,
   0.0016};
   grae = new TGraphAsymmErrors(3,Graph0_fx3004,Graph0_fy3004,Graph0_felx3004,Graph0_fehx3004,Graph0_fely3004,Graph0_fehy3004);
   grae->SetName("Graph0");
   grae->SetTitle("TGraphAsymmErrors for scale factors");

   ci = TColor::GetColor("#99ccff");
   grae->SetFillColor(ci);

   ci = TColor::GetColor("#3399ff");
   grae->SetLineColor(ci);

   ci = TColor::GetColor("#3399ff");
   grae->SetMarkerColor(ci);
   grae->SetMarkerSize(0.7);
   
   TH1F *Graph_Small TH1F3004 = new TH1F("Graph_Small TH1F3004","Small TH1F histogram",100,0,81);
   Graph_Small TH1F3004->SetMinimum(0.65);
   Graph_Small TH1F3004->SetMaximum(1.1);
   Graph_Small TH1F3004->SetFillStyle(0);
   Graph_Small TH1F3004->SetLineStyle(0);
   Graph_Small TH1F3004->SetMarkerStyle(20);
   Graph_Small TH1F3004->GetXaxis()->SetTitle("p_{T} [GeV]");
   Graph_Small TH1F3004->GetXaxis()->SetLabelFont(42);
   Graph_Small TH1F3004->GetXaxis()->SetLabelOffset(0.007);
   Graph_Small TH1F3004->GetXaxis()->SetLabelSize(0.08);
   Graph_Small TH1F3004->GetXaxis()->SetTitleSize(0.08);
   Graph_Small TH1F3004->GetXaxis()->SetTitleFont(42);
   Graph_Small TH1F3004->GetYaxis()->SetLabelFont(42);
   Graph_Small TH1F3004->GetYaxis()->SetLabelOffset(0.007);
   Graph_Small TH1F3004->GetYaxis()->SetLabelSize(0.08);
   Graph_Small TH1F3004->GetYaxis()->SetTitleSize(0.08);
   Graph_Small TH1F3004->GetYaxis()->SetTitleOffset(0.75);
   Graph_Small TH1F3004->GetYaxis()->SetTitleFont(42);
   Graph_Small TH1F3004->GetZaxis()->SetLabelFont(42);
   Graph_Small TH1F3004->GetZaxis()->SetLabelOffset(0.007);
   Graph_Small TH1F3004->GetZaxis()->SetLabelSize(0.05);
   Graph_Small TH1F3004->GetZaxis()->SetTitleSize(0.06);
   Graph_Small TH1F3004->GetZaxis()->SetTitleFont(42);
   grae->SetHistogram(Graph_Small TH1F3004);
   
   grae->Draw("a2");
   
   Double_t Graph0_fx3005[3] = {
   13.5,
   25,
   55};
   Double_t Graph0_fy3005[3] = {
   1.0365,
   0.9908,
   0.9971};
   Double_t Graph0_felx3005[3] = {
   6.5,
   5,
   25};
   Double_t Graph0_fely3005[3] = {
   0.009,
   0.0082,
   0.0016};
   Double_t Graph0_fehx3005[3] = {
   6.5,
   5,
   25};
   Double_t Graph0_fehy3005[3] = {
   0.009,
   0.0082,
   0.0016};
   grae = new TGraphAsymmErrors(3,Graph0_fx3005,Graph0_fy3005,Graph0_felx3005,Graph0_fehx3005,Graph0_fely3005,Graph0_fehy3005);
   grae->SetName("Graph0");
   grae->SetTitle("TGraphAsymmErrors for scale factors");

   ci = TColor::GetColor("#99ccff");
   grae->SetFillColor(ci);

   ci = TColor::GetColor("#3399ff");
   grae->SetLineColor(ci);

   ci = TColor::GetColor("#3399ff");
   grae->SetMarkerColor(ci);
   grae->SetMarkerSize(0.7);
   
   TH1F *Graph_Graph_Small TH1F30043005 = new TH1F("Graph_Graph_Small TH1F30043005","Small TH1F histogram",100,0,81);
   Graph_Graph_Small TH1F30043005->SetMinimum(0.65);
   Graph_Graph_Small TH1F30043005->SetMaximum(1.1);
   Graph_Graph_Small TH1F30043005->SetFillStyle(0);
   Graph_Graph_Small TH1F30043005->SetLineStyle(0);
   Graph_Graph_Small TH1F30043005->SetMarkerStyle(20);
   Graph_Graph_Small TH1F30043005->GetXaxis()->SetTitle("p_{T} [GeV]");
   Graph_Graph_Small TH1F30043005->GetXaxis()->SetLabelFont(42);
   Graph_Graph_Small TH1F30043005->GetXaxis()->SetLabelOffset(0.007);
   Graph_Graph_Small TH1F30043005->GetXaxis()->SetLabelSize(0.08);
   Graph_Graph_Small TH1F30043005->GetXaxis()->SetTitleSize(0.08);
   Graph_Graph_Small TH1F30043005->GetXaxis()->SetTitleFont(42);
   Graph_Graph_Small TH1F30043005->GetYaxis()->SetLabelFont(42);
   Graph_Graph_Small TH1F30043005->GetYaxis()->SetLabelOffset(0.007);
   Graph_Graph_Small TH1F30043005->GetYaxis()->SetLabelSize(0.08);
   Graph_Graph_Small TH1F30043005->GetYaxis()->SetTitleSize(0.08);
   Graph_Graph_Small TH1F30043005->GetYaxis()->SetTitleOffset(0.75);
   Graph_Graph_Small TH1F30043005->GetYaxis()->SetTitleFont(42);
   Graph_Graph_Small TH1F30043005->GetZaxis()->SetLabelFont(42);
   Graph_Graph_Small TH1F30043005->GetZaxis()->SetLabelOffset(0.007);
   Graph_Graph_Small TH1F30043005->GetZaxis()->SetLabelSize(0.05);
   Graph_Graph_Small TH1F30043005->GetZaxis()->SetTitleSize(0.06);
   Graph_Graph_Small TH1F30043005->GetZaxis()->SetTitleFont(42);
   grae->SetHistogram(Graph_Graph_Small TH1F30043005);
   
   grae->Draw("p");
   pad2->Modified();
   Canvas->cd();
   Canvas->Modified();
   Canvas->cd();
   Canvas->SetSelected(Canvas);
}
void paraPull_alpha_MUON_ISO_SYS_2TeV_2Lep_plots_All()
{
//=========Macro generated from canvas: c1/alpha_MUON_ISO_SYS
//=========  (Sun Nov 22 20:21:56 2015) by ROOT version6.02/12
   TCanvas *c1 = new TCanvas("c1", "alpha_MUON_ISO_SYS",0,22,1000,600);
   gStyle->SetOptStat(0);
   c1->Range(-4.125,-0.9777052,37.125,1.049159);
   c1->SetFillColor(0);
   c1->SetBorderMode(0);
   c1->SetBorderSize(2);
   c1->SetGridx();
   c1->SetGridy();
   c1->SetFrameBorderMode(0);
   c1->SetFrameBorderMode(0);
   
   TH1F *NuisanceParameterFreed33 = new TH1F("NuisanceParameterFreed33","alpha_MUON_ISO_SYS",33,0,33);
   NuisanceParameterFreed33->SetMinimum(-0.7750188);
   NuisanceParameterFreed33->SetMaximum(0.8464727);
   NuisanceParameterFreed33->SetStats(0);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#000099");
   NuisanceParameterFreed33->SetLineColor(ci);
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(1,"XS_ttbar");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(2,"EG_SCALE_ALL");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(3,"FT_EFF_Eigen_C_0");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(4,"Luminosity");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(5,"XS_st");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(6,"FT_EFF_Eigen_B_1");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(7,"XS_Zc");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(8,"MUONS_ID");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(9,"FT_EFF_Eigen_C_1");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(10,"FT_EFF_Eigen_C_3");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(11,"MUON_EFF_TrigSystUncertainty");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(12,"XS_Zl");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(13,"EL_EFF_ID_TotalCorrUncertainty");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(14,"FT_EFF_Eigen_B_0");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(15,"FT_EFF_Eigen_B_2");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(16,"EL_EFF_Iso_TotalCorrUncertainty");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(17,"EL_EFF_Reco_TotalCorrUncertainty");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(18,"MUONS_SCALE");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(19,"MUON_ISO_STAT");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(20,"FT_EFF_extrapolation");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(21,"MUON_EFF_STAT");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(22,"MUON_EFF_SYS");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(23,"MUON_EFF_TrigStatUncertainty");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(24,"FT_EFF_Eigen_Light_2");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(25,"FT_EFF_Eigen_Light_1");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(26,"EG_RESOLUTION_ALL");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(27,"XS_diboson");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(28,"FT_EFF_Eigen_Light_4");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(29,"FT_EFF_Eigen_Light_3");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(30,"MUONS_MS");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(31,"XS_Zb");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(32,"FT_EFF_Eigen_C_2");
   NuisanceParameterFreed33->GetXaxis()->SetBinLabel(33,"FT_EFF_Eigen_Light_0");
   NuisanceParameterFreed33->GetXaxis()->SetLabelFont(42);
   NuisanceParameterFreed33->GetXaxis()->SetLabelSize(0.035);
   NuisanceParameterFreed33->GetXaxis()->SetTitleSize(0.035);
   NuisanceParameterFreed33->GetXaxis()->SetTitleFont(42);
   NuisanceParameterFreed33->GetYaxis()->SetTitle("#theta_{fit} - #theta_{initial}/#Delta#theta");
   NuisanceParameterFreed33->GetYaxis()->SetLabelFont(42);
   NuisanceParameterFreed33->GetYaxis()->SetLabelSize(0.035);
   NuisanceParameterFreed33->GetYaxis()->SetTitleSize(0.035);
   NuisanceParameterFreed33->GetYaxis()->SetTitleFont(42);
   NuisanceParameterFreed33->GetZaxis()->SetLabelFont(42);
   NuisanceParameterFreed33->GetZaxis()->SetLabelSize(0.035);
   NuisanceParameterFreed33->GetZaxis()->SetTitleSize(0.035);
   NuisanceParameterFreed33->GetZaxis()->SetTitleFont(42);
   NuisanceParameterFreed33->Draw("hist");
   
   Double_t _fx1033[35] = {
   1.22802e-312,
   0.5,
   1.5,
   2.5,
   3.5,
   4.5,
   5.5,
   6.5,
   7.5,
   8.5,
   9.5,
   10.5,
   11.5,
   12.5,
   13.5,
   14.5,
   15.5,
   16.5,
   17.5,
   18.5,
   19.5,
   20.5,
   21.5,
   22.5,
   23.5,
   24.5,
   25.5,
   26.5,
   27.5,
   28.5,
   29.5,
   30.5,
   31.5,
   32.5,
   0};
   Double_t _fy1033[35] = {
   1.22802e-312,
   -0.7750188,
   -0.3925669,
   -0.2928498,
   -0.2070924,
   -0.1830524,
   -0.1280032,
   -0.1262679,
   -0.1096289,
   -0.06558224,
   -0.05681625,
   -0.05340132,
   -0.04752113,
   -0.03756,
   -0.03159065,
   -0.03113199,
   -0.02395544,
   -0.01709673,
   -0.001375576,
   0.0001640258,
   0.01017132,
   0.01056379,
   0.01803238,
   0.01953954,
   0.02015159,
   0.02033505,
   0.0231812,
   0.04061694,
   0.04275862,
   0.04588616,
   0.04795404,
   0.05347781,
   0.05730227,
   0.8464727,
   0};
   Double_t _fex1033[35] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t _fey1033[35] = {
   0,
   0,
   0.6105177,
   1.072963,
   1.274131,
   0.9350411,
   0.9915346,
   0.9862834,
   0.9243374,
   0.769056,
   0.9864216,
   0.9937953,
   0.9917567,
   0.9969205,
   0.9819024,
   0.9371645,
   0.9926625,
   0.9931845,
   0.9925671,
   1.004991,
   0.9933467,
   0.9551202,
   0.9932281,
   0.9929675,
   0.9926546,
   0.9909755,
   0.9913131,
   1.098392,
   0.9868992,
   0.9931708,
   0.9930622,
   0.7376817,
   0.7516033,
   0.9909095,
   0.7841002};
   TGraphErrors *gre = new TGraphErrors(35,_fx1033,_fy1033,_fex1033,_fey1033);
   gre->SetName("");
   gre->SetTitle("");
   gre->SetFillColor(1);
   gre->SetMarkerStyle(20);
   gre->SetMarkerSize(1.2);
   
   TH1F *Graph_Graph1033 = new TH1F("Graph_Graph1033","",100,0,35.75);
   Graph_Graph1033->SetMinimum(-1.813084);
   Graph_Graph1033->SetMaximum(2.169243);
   Graph_Graph1033->SetDirectory(0);
   Graph_Graph1033->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph1033->SetLineColor(ci);
   Graph_Graph1033->GetXaxis()->SetLabelFont(42);
   Graph_Graph1033->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph1033->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph1033->GetXaxis()->SetTitleFont(42);
   Graph_Graph1033->GetYaxis()->SetLabelFont(42);
   Graph_Graph1033->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph1033->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph1033->GetYaxis()->SetTitleFont(42);
   Graph_Graph1033->GetZaxis()->SetLabelFont(42);
   Graph_Graph1033->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph1033->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph1033->GetZaxis()->SetTitleFont(42);
   gre->SetHistogram(Graph_Graph1033);
   
   gre->Draw("p");
   
   TLegend *leg = new TLegend(0.1,0.4,0.4,0.95,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextFont(72);
   leg->SetTextSize(0.015);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(0);
   leg->Draw();
   
   TPaveText *pt = new TPaveText(0.3293574,0.9341608,0.6706426,0.995,"blNDC");
   pt->SetName("title");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetFillStyle(0);
   pt->SetTextFont(42);
   TText *AText = pt->AddText("alpha_MUON_ISO_SYS");
   pt->Draw();
   c1->Modified();
   c1->cd();
   c1->SetSelected(c1);
}