void melaDistributions_2D(int index=0,int altModelColor=4){

  gROOT->ProcessLine(".L  ~/tdrstyle.C");
  setTDRStyle();

  TChain* SMHiggs = new TChain("angles");
  TChain* altModel = new TChain("angles");

  TChain* qqZZ = new TChain("angles");

  SMHiggs->Add("/scratch0/hep/whitbeck/OLDHOME/4lHelicity/generatorJHU_V02-01-00/SMHiggs_store/SMHiggs_125GeV_wResolution_withDiscriminants.root");
  
  string fileName[7]={
    "/scratch0/hep/whitbeck/OLDHOME/4lHelicity/generatorJHU_V02-01-00/psScalar_store/psScalar_125GeV_wResolution_withDiscriminants.root",
    "/scratch0/hep/whitbeck/OLDHOME/4lHelicity/generatorJHU_V02-01-00/minGrav_store/minGrav_125GeV_wResolution_withDiscriminants.root",
    "/scratch0/hep/whitbeck/OLDHOME/4lHelicity/generatorJHU_V02-01-00/vector_store/vector_125GeV_wResolution_withDiscriminants.root",
    "/scratch0/hep/whitbeck/OLDHOME/4lHelicity/generatorJHU_V02-01-00/psVector_store/psVector_125GeV_wResolution_withDiscriminants.root",
    "/scratch0/hep/whitbeck/OLDHOME/4lHelicity/generatorJHU_V02-01-00/2hPlus_store/2hPlus_125GeV_wResolution_withDiscriminants.root",
    "/scratch0/hep/whitbeck/OLDHOME/4lHelicity/generatorJHU_V02-01-00/2hMinus_store/2hMinus_125GeV_wResolution_withDiscriminants.root",
    "/scratch0/hep/whitbeck/OLDHOME/4lHelicity/generatorJHU_V02-01-00/0hPlus_store/0hPlus_125GeV_wResolution_withDiscriminants.root"
  };

  string discrimName[7]={"pseudomelaLD","gravimelaLD","vectormelaLD","psVectormelaLD","2hPlusmelaLD","2hMinusmelaLD","0hPlusmelaLD"};

  string axisTitle[7]={"D_{0^{-}}","D_{2_{m}^{+}}","D_{1^{+}}","D_{1^{-}}","D_{2_{h}^{+}}","D_{2_{h}^{-}}","D_{0_{h}^{+}}"};

  altModel->Add( fileName[index].c_str() );

  qqZZ->Add("/scratch0/hep/whitbeck/4lHelicity/datafiles/7TeV/training/pwgevents_*_wResolution_withDiscriminants.root");

  char drawString[100];

  gStyle->SetPadRightMargin(0.12);

  TCanvas* qqZZcan = new TCanvas("qqZZcan","qqZZcan",600,600);
  TCanvas* SMHcan = new TCanvas("SMHcan","SMHcan",600,600);
  TCanvas* altModelcan = new TCanvas("altModelcan","altModelcan",600,600);

  char* binning;
  char* cutString;
  binning ="(30,110,140,20,0,1)";
  cutString="zzmass>110&&zzmass<140";
  
  sprintf(drawString,"%s:zzmass>>qqZZhisto%s",discrimName[index].c_str(),binning);
  qqZZ->Draw(drawString,cutString);

  sprintf(drawString,"%s:zzmass>>SMHhisto%s",discrimName[index].c_str(),binning);
  SMHiggs->Draw(drawString,cutString);

  sprintf(drawString,"%s:zzmass>>altModelhisto%s",discrimName[index].c_str(),binning);
  altModel->Draw(drawString,cutString);

  TH1F* qqZZhisto = (TH1F*) gDirectory->Get("qqZZhisto");
  qqZZhisto->Scale(1./qqZZhisto->GetMaximum());
  qqZZhisto->GetYaxis()->SetTitle( axisTitle[index].c_str() );
  qqZZhisto->GetXaxis()->SetTitle( "m_{4l}" );
  qqZZhisto->GetYaxis()->CenterTitle();
  qqZZhisto->GetXaxis()->SetNdivisions(-505);
  qqZZhisto->GetYaxis()->SetNdivisions(-505);
  qqZZhisto->GetZaxis()->SetNdivisions(-505);
  qqZZhisto->GetXaxis()->CenterTitle();
  
  TGaxis::SetMaxDigits(3);

  TH1F* SMHhisto = (TH1F*) gDirectory->Get("SMHhisto");
  SMHhisto->Scale(1./SMHhisto->GetMaximum());
  SMHhisto->GetYaxis()->SetTitle( axisTitle[index].c_str() );
  SMHhisto->GetXaxis()->SetTitle( "m_{4l}" );
  SMHhisto->GetYaxis()->CenterTitle();
  SMHhisto->GetXaxis()->SetNdivisions(-505);
  SMHhisto->GetYaxis()->SetNdivisions(-505);
  SMHhisto->GetZaxis()->SetNdivisions(-505);
  SMHhisto->GetXaxis()->CenterTitle();


  TH1F* altModelhisto = (TH1F*) gDirectory->Get("altModelhisto");
  altModelhisto->Scale(1./altModelhisto->GetMaximum());
  altModelhisto->GetYaxis()->SetTitle( axisTitle[index].c_str() );
  altModelhisto->GetXaxis()->SetTitle( "m_{4l}" );
  altModelhisto->GetYaxis()->CenterTitle();
  altModelhisto->GetXaxis()->SetNdivisions(-505);
  altModelhisto->GetYaxis()->SetNdivisions(-505);
  altModelhisto->GetZaxis()->SetNdivisions(-505);
  altModelhisto->GetXaxis()->CenterTitle();

  qqZZcan->cd();
  qqZZhisto->Draw("COLZ");

  SMHcan->cd();
  SMHhisto->Draw("COLZ");

  altModelcan->cd();
  altModelhisto->Draw("COLZ");

  char saveName[100];

  sprintf(saveName,"epsfiles/kinematics_2D_%s_qqZZ.eps",discrimName[index].c_str() );
  qqZZcan->SaveAs(saveName);
  sprintf(saveName,"pngfiles/kinematics_2D_%s_qqZZ.png",discrimName[index].c_str() );
  qqZZcan->SaveAs(saveName);

  sprintf(saveName,"epsfiles/kinematics_2D_%s_SMH.eps",discrimName[index].c_str() );
  SMHcan->SaveAs(saveName);
  sprintf(saveName,"pngfiles/kinematics_2D_%s_SMH.png",discrimName[index].c_str() );
  SMHcan->SaveAs(saveName);

  sprintf(saveName,"epsfiles/kinematics_2D_%s_altModel.eps",discrimName[index].c_str() );
  altModelcan->SaveAs(saveName);
  sprintf(saveName,"pngfiles/kinematics_2D_%s_altModel.png",discrimName[index].c_str() );
  altModelcan->SaveAs(saveName);

}
Exemple #2
0
void gyieldsp()
{
//=========Macro generated from canvas: c1/c1
//=========  (Fri Jul 31 19:31:43 2015) by ROOT version6.05/01
   TCanvas *c1 = new TCanvas("c1", "c1",0,23,600,600);
   gStyle->SetOptFit(1);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   c1->Range(0,0,1,1);
   c1->SetFillColor(0);
   c1->SetBorderMode(0);
   c1->SetBorderSize(2);
   c1->SetTickx(1);
   c1->SetTicky(1);
   c1->SetLeftMargin(0.16);
   c1->SetRightMargin(0.04);
   c1->SetTopMargin(0.08);
   c1->SetBottomMargin(0.12);
   c1->SetFrameFillStyle(0);
   c1->SetFrameBorderMode(0);
  
// ------------>Primitives in pad: pad1
   TPad *pad1 = new TPad("pad1", "pad1",0,0.26,1,1);
   pad1->Draw();
   pad1->cd();
   pad1->Range(-3.5,-6.621622,2.75,158.9189);
   pad1->SetFillColor(0);
   pad1->SetBorderMode(0);
   pad1->SetBorderSize(2);
   pad1->SetTickx(1);
   pad1->SetTicky(1);
   pad1->SetLeftMargin(0.16);
   pad1->SetRightMargin(0.04);
   pad1->SetTopMargin(0.1142857);
   pad1->SetBottomMargin(0.04);
   pad1->SetFrameFillStyle(0);
   pad1->SetFrameBorderMode(0);
   pad1->SetFrameFillStyle(0);
   pad1->SetFrameBorderMode(0);
   
   Double_t Graph0_fx3021[10] = {
   2.2,
   1.75,
   1.25,
   0.75,
   0.25,
   -0.25,
   -0.75,
   -1.25,
   -1.75,
   -2.2};
   Double_t Graph0_fy3021[10] = {
   103.56,
   105.744,
   103.4081,
   100.0093,
   97.03688,
   94.36609,
   90.5471,
   82.43278,
   65.82142,
   43.43165};
   Double_t Graph0_felx3021[10] = {
   0.2,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.2};
   Double_t Graph0_fely3021[10] = {
   7.299733,
   7.206486,
   6.824632,
   6.594841,
   6.406375,
   6.079494,
   5.746822,
   5.225105,
   4.165823,
   2.787035};
   Double_t Graph0_fehx3021[10] = {
   0.2,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.2};
   Double_t Graph0_fehy3021[10] = {
   5.988963,
   6.218694,
   6.307709,
   6.368316,
   5.847823,
   5.655323,
   5.083818,
   4.561256,
   3.722445,
   2.542957};
   TGraphAsymmErrors *grae = new TGraphAsymmErrors(10,Graph0_fx3021,Graph0_fy3021,Graph0_felx3021,Graph0_fehx3021,Graph0_fely3021,Graph0_fehy3021);
   grae->SetName("Graph0");
   grae->SetTitle("Graph");

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

   ci = TColor::GetColor("#ff0000");
   grae->SetLineColor(ci);
   grae->SetLineWidth(4);
   grae->SetMarkerStyle(20);
   grae->SetMarkerSize(0);
   
   TH1F *Graph_Graph3021 = new TH1F("Graph_Graph3021","Graph",100,-2.5,2.5);
   Graph_Graph3021->SetMinimum(0);
   Graph_Graph3021->SetMaximum(140);
   Graph_Graph3021->SetDirectory(0);
   Graph_Graph3021->SetStats(0);
   Graph_Graph3021->SetLineStyle(0);
   Graph_Graph3021->SetMarkerStyle(20);
   Graph_Graph3021->GetXaxis()->SetNdivisions(505);
   Graph_Graph3021->GetXaxis()->SetLabelFont(42);
   Graph_Graph3021->GetXaxis()->SetLabelOffset(0.007);
   Graph_Graph3021->GetXaxis()->SetLabelSize(0);
   Graph_Graph3021->GetXaxis()->SetTitleSize(0.07142857);
   Graph_Graph3021->GetXaxis()->SetTitleOffset(1.1);
   Graph_Graph3021->GetXaxis()->SetTitleFont(42);
   Graph_Graph3021->GetYaxis()->SetTitle("d#sigma (W^{+}#rightarrow#font[12]{l}^{+}#nu) / d#eta_{lab} [nb]");
   Graph_Graph3021->GetYaxis()->SetLabelFont(42);
   Graph_Graph3021->GetYaxis()->SetLabelOffset(0.007);
   Graph_Graph3021->GetYaxis()->SetLabelSize(0.07142857);
   Graph_Graph3021->GetYaxis()->SetTitleSize(0.07142857);
   Graph_Graph3021->GetYaxis()->SetTitleOffset(1.05);
   Graph_Graph3021->GetYaxis()->SetTitleFont(42);
   Graph_Graph3021->GetZaxis()->SetLabelFont(42);
   Graph_Graph3021->GetZaxis()->SetLabelOffset(0.007);
   Graph_Graph3021->GetZaxis()->SetLabelSize(0.05);
   Graph_Graph3021->GetZaxis()->SetTitleSize(0.06);
   Graph_Graph3021->GetZaxis()->SetTitleFont(42);
   grae->SetHistogram(Graph_Graph3021);
   
   grae->Draw("a2");
   
   Double_t Graph1_fx3022[10] = {
   2.2,
   1.75,
   1.25,
   0.75,
   0.25,
   -0.25,
   -0.75,
   -1.25,
   -1.75,
   -2.2};
   Double_t Graph1_fy3022[10] = {
   103.56,
   105.744,
   103.4081,
   100.0093,
   97.03688,
   94.36609,
   90.5471,
   82.43278,
   65.82142,
   43.43165};
   Double_t Graph1_felx3022[10] = {
   0.2,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.2};
   Double_t Graph1_fely3022[10] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Graph1_fehx3022[10] = {
   0.2,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.2};
   Double_t Graph1_fehy3022[10] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   grae = new TGraphAsymmErrors(10,Graph1_fx3022,Graph1_fy3022,Graph1_felx3022,Graph1_fehx3022,Graph1_fely3022,Graph1_fehy3022);
   grae->SetName("Graph1");
   grae->SetTitle("Graph");

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

   ci = TColor::GetColor("#ff0000");
   grae->SetLineColor(ci);
   grae->SetLineWidth(4);
   grae->SetMarkerStyle(20);
   grae->SetMarkerSize(0);
   grae->Draw("z");
   
   Double_t Graph2_fx3023[10] = {
   2.2,
   1.75,
   1.25,
   0.75,
   0.25,
   -0.25,
   -0.75,
   -1.25,
   -1.75,
   -2.2};
   Double_t Graph2_fy3023[10] = {
   91.59545,
   95.26883,
   95.65156,
   95.47892,
   95.94693,
   96.02597,
   93.3635,
   84.56484,
   65.95871,
   42.11706};
   Double_t Graph2_felx3023[10] = {
   0.2,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.2};
   Double_t Graph2_fely3023[10] = {
   8.336985,
   8.261181,
   7.634488,
   6.438496,
   6.661149,
   6.164321,
   6.1019,
   4.954787,
   4.773841,
   2.599375};
   Double_t Graph2_fehx3023[10] = {
   0.2,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.2};
   Double_t Graph2_fehy3023[10] = {
   8.262572,
   7.14746,
   6.62492,
   6.725295,
   5.946212,
   5.838684,
   5.077774,
   5.257491,
   3.443198,
   2.602454};
   grae = new TGraphAsymmErrors(10,Graph2_fx3023,Graph2_fy3023,Graph2_felx3023,Graph2_fehx3023,Graph2_fely3023,Graph2_fehy3023);
   grae->SetName("Graph2");
   grae->SetTitle("Graph");

   ci = TColor::GetColor("#009900");
   grae->SetFillColor(ci);
   grae->SetFillStyle(3375);

   ci = TColor::GetColor("#009900");
   grae->SetLineColor(ci);
   grae->SetLineStyle(7);
   grae->SetLineWidth(4);
   grae->SetMarkerStyle(20);
   
   TH1F *Graph_Graph3023 = new TH1F("Graph_Graph3023","Graph",100,-2.88,2.88);
   Graph_Graph3023->SetMinimum(33.22782);
   Graph_Graph3023->SetMaximum(108.7062);
   Graph_Graph3023->SetDirectory(0);
   Graph_Graph3023->SetStats(0);
   Graph_Graph3023->SetLineStyle(0);
   Graph_Graph3023->SetMarkerStyle(20);
   Graph_Graph3023->GetXaxis()->SetLabelFont(42);
   Graph_Graph3023->GetXaxis()->SetLabelOffset(0.007);
   Graph_Graph3023->GetXaxis()->SetLabelSize(0.05);
   Graph_Graph3023->GetXaxis()->SetTitleSize(0.06);
   Graph_Graph3023->GetXaxis()->SetTitleOffset(1.1);
   Graph_Graph3023->GetXaxis()->SetTitleFont(42);
   Graph_Graph3023->GetYaxis()->SetLabelFont(42);
   Graph_Graph3023->GetYaxis()->SetLabelOffset(0.007);
   Graph_Graph3023->GetYaxis()->SetLabelSize(0.05);
   Graph_Graph3023->GetYaxis()->SetTitleSize(0.06);
   Graph_Graph3023->GetYaxis()->SetTitleOffset(1.5);
   Graph_Graph3023->GetYaxis()->SetTitleFont(42);
   Graph_Graph3023->GetZaxis()->SetLabelFont(42);
   Graph_Graph3023->GetZaxis()->SetLabelOffset(0.007);
   Graph_Graph3023->GetZaxis()->SetLabelSize(0.05);
   Graph_Graph3023->GetZaxis()->SetTitleSize(0.06);
   Graph_Graph3023->GetZaxis()->SetTitleFont(42);
   grae->SetHistogram(Graph_Graph3023);
   
   grae->Draw("2");
   
   Double_t Graph3_fx3024[10] = {
   2.2,
   1.75,
   1.25,
   0.75,
   0.25,
   -0.25,
   -0.75,
   -1.25,
   -1.75,
   -2.2};
   Double_t Graph3_fy3024[10] = {
   91.59545,
   95.26883,
   95.65156,
   95.47892,
   95.94693,
   96.02597,
   93.3635,
   84.56484,
   65.95871,
   42.11706};
   Double_t Graph3_felx3024[10] = {
   0.2,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.2};
   Double_t Graph3_fely3024[10] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Graph3_fehx3024[10] = {
   0.2,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.2};
   Double_t Graph3_fehy3024[10] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   grae = new TGraphAsymmErrors(10,Graph3_fx3024,Graph3_fy3024,Graph3_felx3024,Graph3_fehx3024,Graph3_fely3024,Graph3_fehy3024);
   grae->SetName("Graph3");
   grae->SetTitle("Graph");

   ci = TColor::GetColor("#009900");
   grae->SetFillColor(ci);
   grae->SetFillStyle(3375);

   ci = TColor::GetColor("#009900");
   grae->SetLineColor(ci);
   grae->SetLineStyle(7);
   grae->SetLineWidth(4);
   grae->SetMarkerStyle(20);
   grae->Draw("z");
   
   Double_t Graph4_fx1011[10] = {
   2.2,
   1.75,
   1.25,
   0.75,
   0.25,
   -0.25,
   -0.75,
   -1.25,
   -1.75,
   -2.2};
   Double_t Graph4_fy1011[10] = {
   108.0732,
   102.2597,
   100.2246,
   101.796,
   105.3416,
   99.73788,
   98.62062,
   85.94448,
   62.90271,
   44.47931};
   Double_t Graph4_fex1011[10] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Graph4_fey1011[10] = {
   6.667786,
   4.792637,
   3.765295,
   3.224798,
   3.479167,
   3.377478,
   3.07273,
   3.40604,
   2.800731,
   2.87761};
   TGraphErrors *gre = new TGraphErrors(10,Graph4_fx1011,Graph4_fy1011,Graph4_fex1011,Graph4_fey1011);
   gre->SetName("Graph4");
   gre->SetTitle("Graph");
   gre->SetFillColor(1);
   gre->SetFillStyle(0);
   gre->SetLineWidth(2);
   gre->SetMarkerStyle(20);
   gre->Draw("||");
   
   Double_t gyieldsp_exp_statonly_1_fx1012[10] = {
   2.2,
   1.75,
   1.25,
   0.75,
   0.25,
   -0.25,
   -0.75,
   -1.25,
   -1.75,
   -2.2};
   Double_t gyieldsp_exp_statonly_1_fy1012[10] = {
   108.0732,
   102.2597,
   100.2246,
   101.796,
   105.3416,
   99.73788,
   98.62062,
   85.94448,
   62.90271,
   44.47931};
   Double_t gyieldsp_exp_statonly_1_fex1012[10] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t gyieldsp_exp_statonly_1_fey1012[10] = {
   2.814265,
   2.293805,
   2.181326,
   2.056934,
   2.054972,
   2.059018,
   2.050204,
   2.01317,
   1.754638,
   1.667829};
   gre = new TGraphErrors(10,gyieldsp_exp_statonly_1_fx1012,gyieldsp_exp_statonly_1_fy1012,gyieldsp_exp_statonly_1_fex1012,gyieldsp_exp_statonly_1_fey1012);
   gre->SetName("gyieldsp_exp_statonly_1");
   gre->SetTitle("Graph");
   gre->SetFillColor(1);
   gre->SetLineWidth(2);
   gre->SetMarkerStyle(20);
   gre->SetMarkerSize(1.2);
   
   TH1F *Graph_gyieldsp_exp_statonly_11012 = new TH1F("Graph_gyieldsp_exp_statonly_11012","Graph",100,-2.64,2.64);
   Graph_gyieldsp_exp_statonly_11012->SetMinimum(36.00388);
   Graph_gyieldsp_exp_statonly_11012->SetMaximum(117.6951);
   Graph_gyieldsp_exp_statonly_11012->SetDirectory(0);
   Graph_gyieldsp_exp_statonly_11012->SetStats(0);
   Graph_gyieldsp_exp_statonly_11012->SetLineStyle(0);
   Graph_gyieldsp_exp_statonly_11012->SetMarkerStyle(20);
   Graph_gyieldsp_exp_statonly_11012->GetXaxis()->SetLabelFont(42);
   Graph_gyieldsp_exp_statonly_11012->GetXaxis()->SetLabelOffset(0.007);
   Graph_gyieldsp_exp_statonly_11012->GetXaxis()->SetLabelSize(0.05);
   Graph_gyieldsp_exp_statonly_11012->GetXaxis()->SetTitleSize(0.06);
   Graph_gyieldsp_exp_statonly_11012->GetXaxis()->SetTitleOffset(1.1);
   Graph_gyieldsp_exp_statonly_11012->GetXaxis()->SetTitleFont(42);
   Graph_gyieldsp_exp_statonly_11012->GetYaxis()->SetLabelFont(42);
   Graph_gyieldsp_exp_statonly_11012->GetYaxis()->SetLabelOffset(0.007);
   Graph_gyieldsp_exp_statonly_11012->GetYaxis()->SetLabelSize(0.05);
   Graph_gyieldsp_exp_statonly_11012->GetYaxis()->SetTitleSize(0.06);
   Graph_gyieldsp_exp_statonly_11012->GetYaxis()->SetTitleOffset(1.5);
   Graph_gyieldsp_exp_statonly_11012->GetYaxis()->SetTitleFont(42);
   Graph_gyieldsp_exp_statonly_11012->GetZaxis()->SetLabelFont(42);
   Graph_gyieldsp_exp_statonly_11012->GetZaxis()->SetLabelOffset(0.007);
   Graph_gyieldsp_exp_statonly_11012->GetZaxis()->SetLabelSize(0.05);
   Graph_gyieldsp_exp_statonly_11012->GetZaxis()->SetTitleSize(0.06);
   Graph_gyieldsp_exp_statonly_11012->GetZaxis()->SetTitleFont(42);
   gre->SetHistogram(Graph_gyieldsp_exp_statonly_11012);
   
   gre->Draw("pz");
   
   TLegend *leg = new TLegend(0.6,0.1,0.9,0.3142857,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextSize(0.05714286);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("Graph4","Data","p");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(20);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph0","CT10","lf");

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

   ci = TColor::GetColor("#ff0000");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(4);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph2","CT10+EPS09","lf");

   ci = TColor::GetColor("#009900");
   entry->SetFillColor(ci);
   entry->SetFillStyle(3375);

   ci = TColor::GetColor("#009900");
   entry->SetLineColor(ci);
   entry->SetLineStyle(7);
   entry->SetLineWidth(4);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   
   TPaveText *pt = new TPaveText(-2.35,125,-0.35,140,"br");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetFillStyle(0);
   pt->SetTextAlign(13);
   pt->SetTextFont(42);
   pt->SetTextSize(0.05714286);
   TText *AText = pt->AddText("Luminosity uncertainty: 3.5%");
   pt->Draw();
   
   pt = new TPaveText(0.27,0.2,0.5,0.3428571,"brNDC");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetFillStyle(0);
   pt->SetTextAlign(13);
   pt->SetTextFont(42);
   pt->SetTextSize(0.05714286);
   AText = pt->AddText("W^{+} #rightarrow #font[12]{l}^{+} + #nu");
   AText = pt->AddText("p_{T}^{#font[12]{l}} > 25 GeV/c");
   pt->Draw();
      tex = new TLatex(0.96,0.9177143," #sqrt{s_{NN}} = 5.02 TeV");
tex->SetNDC();
   tex->SetTextAlign(31);
   tex->SetTextFont(42);
   tex->SetTextSize(0.05714286);
   tex->SetLineWidth(2);
   tex->Draw();
      tex = new TLatex(0.16,0.9177143,"pPb 34.6 nb^{-1}");
tex->SetNDC();
   tex->SetTextFont(42);
   tex->SetTextSize(0.05714286);
   tex->SetLineWidth(2);
   tex->Draw();
      tex = new TLatex(0.924,0.8476571,"CMS");
tex->SetNDC();
   tex->SetTextAlign(33);
   tex->SetTextFont(61);
   tex->SetTextSize(0.06857143);
   tex->SetLineWidth(2);
   tex->Draw();
   
   TH1F *Graph_copy = new TH1F("Graph_copy","Graph",100,-2.5,2.5);
   Graph_copy->SetMinimum(0);
   Graph_copy->SetMaximum(140);
   Graph_copy->SetDirectory(0);
   Graph_copy->SetStats(0);
   Graph_copy->SetLineStyle(0);
   Graph_copy->SetMarkerStyle(20);
   Graph_copy->GetXaxis()->SetNdivisions(505);
   Graph_copy->GetXaxis()->SetLabelFont(42);
   Graph_copy->GetXaxis()->SetLabelOffset(0.007);
   Graph_copy->GetXaxis()->SetLabelSize(0);
   Graph_copy->GetXaxis()->SetTitleSize(0.07142857);
   Graph_copy->GetXaxis()->SetTitleOffset(1.1);
   Graph_copy->GetXaxis()->SetTitleFont(42);
   Graph_copy->GetYaxis()->SetTitle("d#sigma (W^{+}#rightarrow#font[12]{l}^{+}#nu) / d#eta_{lab} [nb]");
   Graph_copy->GetYaxis()->SetLabelFont(42);
   Graph_copy->GetYaxis()->SetLabelOffset(0.007);
   Graph_copy->GetYaxis()->SetLabelSize(0.07142857);
   Graph_copy->GetYaxis()->SetTitleSize(0.07142857);
   Graph_copy->GetYaxis()->SetTitleOffset(1.05);
   Graph_copy->GetYaxis()->SetTitleFont(42);
   Graph_copy->GetZaxis()->SetLabelFont(42);
   Graph_copy->GetZaxis()->SetLabelOffset(0.007);
   Graph_copy->GetZaxis()->SetLabelSize(0.05);
   Graph_copy->GetZaxis()->SetTitleSize(0.06);
   Graph_copy->GetZaxis()->SetTitleFont(42);
   Graph_copy->Draw("sameaxis");
   pad1->Modified();
   c1->cd();
  
// ------------>Primitives in pad: pad2
   TPad *pad2 = new TPad("pad2", "pad2",0,0,1,0.288);
   pad2->Draw();
   pad2->cd();
   pad2->Range(-3.5,0.35,2.75,1.35);
   pad2->SetFillColor(0);
   pad2->SetFillStyle(4000);
   pad2->SetBorderMode(0);
   pad2->SetBorderSize(2);
   pad2->SetTickx(1);
   pad2->SetTicky(1);
   pad2->SetLeftMargin(0.16);
   pad2->SetRightMargin(0.04);
   pad2->SetTopMargin(0);
   pad2->SetBottomMargin(0.4);
   pad2->SetFrameFillStyle(4000);
   pad2->SetFrameBorderMode(0);
   pad2->SetFrameFillStyle(4000);
   pad2->SetFrameBorderMode(0);
   
   TH1F *Graph = new TH1F("Graph","Graph",100,-2.5,2.5);
   Graph->SetMinimum(0.75);
   Graph->SetMaximum(1.35);
   Graph->SetDirectory(0);
   Graph->SetStats(0);
   Graph->SetLineStyle(0);
   Graph->SetMarkerStyle(20);
   Graph->GetXaxis()->SetTitle("#eta_{lab}");
   Graph->GetXaxis()->SetNdivisions(505);
   Graph->GetXaxis()->SetLabelFont(42);
   Graph->GetXaxis()->SetLabelOffset(0.007);
   Graph->GetXaxis()->SetLabelSize(0.1666667);
   Graph->GetXaxis()->SetTitleSize(0.1666667);
   Graph->GetXaxis()->SetTitleOffset(1.1);
   Graph->GetXaxis()->SetTitleFont(42);
   Graph->GetYaxis()->SetTitle("Ratio ");
   Graph->GetYaxis()->SetNdivisions(503);
   Graph->GetYaxis()->SetLabelFont(42);
   Graph->GetYaxis()->SetLabelOffset(0.007);
   Graph->GetYaxis()->SetLabelSize(0.1666667);
   Graph->GetYaxis()->SetTitleSize(0.1666667);
   Graph->GetYaxis()->SetTitleOffset(0.45);
   Graph->GetYaxis()->SetTitleFont(42);
   Graph->GetZaxis()->SetLabelFont(42);
   Graph->GetZaxis()->SetLabelOffset(0.007);
   Graph->GetZaxis()->SetLabelSize(0.05);
   Graph->GetZaxis()->SetTitleSize(0.06);
   Graph->GetZaxis()->SetTitleFont(42);
   Graph->Draw("");
   
   Double_t Graph0_fx1013[10] = {
   2.2,
   1.75,
   1.25,
   0.75,
   0.25,
   -0.25,
   -0.75,
   -1.25,
   -1.75,
   -2.2};
   Double_t Graph0_fy1013[10] = {
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1};
   Double_t Graph0_fex1013[10] = {
   0.2,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.2};
   Double_t Graph0_fey1013[10] = {
   0.0644708,
   0.06365122,
   0.06354681,
   0.06481966,
   0.06320752,
   0.0622177,
   0.05991862,
   0.05949606,
   0.06001632,
   0.06142499};
   gre = new TGraphErrors(10,Graph0_fx1013,Graph0_fy1013,Graph0_fex1013,Graph0_fey1013);
   gre->SetName("Graph0");
   gre->SetTitle("Graph");

   ci = TColor::GetColor("#ffff00");
   gre->SetFillColor(ci);

   ci = TColor::GetColor("#ff0000");
   gre->SetLineColor(ci);
   gre->SetLineWidth(4);
   gre->SetMarkerStyle(20);
   gre->SetMarkerSize(0);
   
   TH1F *Graph_Graph1013 = new TH1F("Graph_Graph1013","Graph",100,-2.88,2.88);
   Graph_Graph1013->SetMinimum(0.9222164);
   Graph_Graph1013->SetMaximum(1.077784);
   Graph_Graph1013->SetDirectory(0);
   Graph_Graph1013->SetStats(0);
   Graph_Graph1013->SetLineStyle(0);
   Graph_Graph1013->SetMarkerStyle(20);
   Graph_Graph1013->GetXaxis()->SetLabelFont(42);
   Graph_Graph1013->GetXaxis()->SetLabelOffset(0.007);
   Graph_Graph1013->GetXaxis()->SetLabelSize(0.05);
   Graph_Graph1013->GetXaxis()->SetTitleSize(0.06);
   Graph_Graph1013->GetXaxis()->SetTitleOffset(1.1);
   Graph_Graph1013->GetXaxis()->SetTitleFont(42);
   Graph_Graph1013->GetYaxis()->SetLabelFont(42);
   Graph_Graph1013->GetYaxis()->SetLabelOffset(0.007);
   Graph_Graph1013->GetYaxis()->SetLabelSize(0.05);
   Graph_Graph1013->GetYaxis()->SetTitleSize(0.06);
   Graph_Graph1013->GetYaxis()->SetTitleOffset(1.5);
   Graph_Graph1013->GetYaxis()->SetTitleFont(42);
   Graph_Graph1013->GetZaxis()->SetLabelFont(42);
   Graph_Graph1013->GetZaxis()->SetLabelOffset(0.007);
   Graph_Graph1013->GetZaxis()->SetLabelSize(0.05);
   Graph_Graph1013->GetZaxis()->SetTitleSize(0.06);
   Graph_Graph1013->GetZaxis()->SetTitleFont(42);
   gre->SetHistogram(Graph_Graph1013);
   
   gre->Draw("2");
   
   Double_t Graph1_fx1014[10] = {
   2.2,
   1.75,
   1.25,
   0.75,
   0.25,
   -0.25,
   -0.75,
   -1.25,
   -1.75,
   -2.2};
   Double_t Graph1_fy1014[10] = {
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1};
   Double_t Graph1_fex1014[10] = {
   0.2,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.2};
   Double_t Graph1_fey1014[10] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   gre = new TGraphErrors(10,Graph1_fx1014,Graph1_fy1014,Graph1_fex1014,Graph1_fey1014);
   gre->SetName("Graph1");
   gre->SetTitle("Graph");

   ci = TColor::GetColor("#ffff00");
   gre->SetFillColor(ci);

   ci = TColor::GetColor("#ff0000");
   gre->SetLineColor(ci);
   gre->SetLineWidth(4);
   gre->SetMarkerStyle(20);
   gre->SetMarkerSize(0);
   gre->Draw("z");
   
   Double_t Graph2_fx1015[10] = {
   2.2,
   1.75,
   1.25,
   0.75,
   0.25,
   -0.25,
   -0.75,
   -1.25,
   -1.75,
   -2.2};
   Double_t Graph2_fy1015[10] = {
   0.8844678,
   0.9009383,
   0.9249909,
   0.9547005,
   0.9887677,
   1.01759,
   1.031104,
   1.025864,
   1.002086,
   0.9697318};
   Double_t Graph2_fex1015[10] = {
   0.2,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.2};
   Double_t Graph2_fey1015[10] = {
   0.05296218,
   0.042007,
   0.03326947,
   0.02116912,
   0.0170915,
   0.01890429,
   0.01672622,
   0.01681633,
   0.01541551,
   0.01597539};
   gre = new TGraphErrors(10,Graph2_fx1015,Graph2_fy1015,Graph2_fex1015,Graph2_fey1015);
   gre->SetName("Graph2");
   gre->SetTitle("Graph");

   ci = TColor::GetColor("#009900");
   gre->SetFillColor(ci);
   gre->SetFillStyle(3375);

   ci = TColor::GetColor("#009900");
   gre->SetLineColor(ci);
   gre->SetLineStyle(7);
   gre->SetLineWidth(4);
   gre->SetMarkerStyle(20);
   
   TH1F *Graph_Graph1015 = new TH1F("Graph_Graph1015","Graph",100,-2.88,2.88);
   Graph_Graph1015->SetMinimum(0.8098732);
   Graph_Graph1015->SetMaximum(1.069463);
   Graph_Graph1015->SetDirectory(0);
   Graph_Graph1015->SetStats(0);
   Graph_Graph1015->SetLineStyle(0);
   Graph_Graph1015->SetMarkerStyle(20);
   Graph_Graph1015->GetXaxis()->SetLabelFont(42);
   Graph_Graph1015->GetXaxis()->SetLabelOffset(0.007);
   Graph_Graph1015->GetXaxis()->SetLabelSize(0.05);
   Graph_Graph1015->GetXaxis()->SetTitleSize(0.06);
   Graph_Graph1015->GetXaxis()->SetTitleOffset(1.1);
   Graph_Graph1015->GetXaxis()->SetTitleFont(42);
   Graph_Graph1015->GetYaxis()->SetLabelFont(42);
   Graph_Graph1015->GetYaxis()->SetLabelOffset(0.007);
   Graph_Graph1015->GetYaxis()->SetLabelSize(0.05);
   Graph_Graph1015->GetYaxis()->SetTitleSize(0.06);
   Graph_Graph1015->GetYaxis()->SetTitleOffset(1.5);
   Graph_Graph1015->GetYaxis()->SetTitleFont(42);
   Graph_Graph1015->GetZaxis()->SetLabelFont(42);
   Graph_Graph1015->GetZaxis()->SetLabelOffset(0.007);
   Graph_Graph1015->GetZaxis()->SetLabelSize(0.05);
   Graph_Graph1015->GetZaxis()->SetTitleSize(0.06);
   Graph_Graph1015->GetZaxis()->SetTitleFont(42);
   gre->SetHistogram(Graph_Graph1015);
   
   gre->Draw("2");
   
   Double_t Graph3_fx1016[10] = {
   2.2,
   1.75,
   1.25,
   0.75,
   0.25,
   -0.25,
   -0.75,
   -1.25,
   -1.75,
   -2.2};
   Double_t Graph3_fy1016[10] = {
   0.8844678,
   0.9009383,
   0.9249909,
   0.9547005,
   0.9887677,
   1.01759,
   1.031104,
   1.025864,
   1.002086,
   0.9697318};
   Double_t Graph3_fex1016[10] = {
   0.2,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.25,
   0.2};
   Double_t Graph3_fey1016[10] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   gre = new TGraphErrors(10,Graph3_fx1016,Graph3_fy1016,Graph3_fex1016,Graph3_fey1016);
   gre->SetName("Graph3");
   gre->SetTitle("Graph");

   ci = TColor::GetColor("#009900");
   gre->SetFillColor(ci);
   gre->SetFillStyle(3375);

   ci = TColor::GetColor("#009900");
   gre->SetLineColor(ci);
   gre->SetLineStyle(7);
   gre->SetLineWidth(4);
   gre->SetMarkerStyle(20);
   gre->Draw("z");
   
   Double_t Graph4_fx1017[10] = {
   2.2,
   1.75,
   1.25,
   0.75,
   0.25,
   -0.25,
   -0.75,
   -1.25,
   -1.75,
   -2.2};
   Double_t Graph4_fy1017[10] = {
   1.043581,
   0.9670498,
   0.9692137,
   1.017865,
   1.085583,
   1.056925,
   1.089164,
   1.042601,
   0.9556571,
   1.024122};
   Double_t Graph4_fex1017[10] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Graph4_fey1017[10] = {
   0.06438575,
   0.04532301,
   0.03641199,
   0.03224499,
   0.03585407,
   0.03579123,
   0.03393516,
   0.041319,
   0.04255045,
   0.06625605};
   gre = new TGraphErrors(10,Graph4_fx1017,Graph4_fy1017,Graph4_fex1017,Graph4_fey1017);
   gre->SetName("Graph4");
   gre->SetTitle("Graph");
   gre->SetFillColor(1);
   gre->SetFillStyle(0);
   gre->SetLineWidth(2);
   gre->SetMarkerStyle(20);
   gre->Draw("||");
   
   Double_t Graph5_fx1018[10] = {
   2.2,
   1.75,
   1.25,
   0.75,
   0.25,
   -0.25,
   -0.75,
   -1.25,
   -1.75,
   -2.2};
   Double_t Graph5_fy1018[10] = {
   1.043581,
   0.9670498,
   0.9692137,
   1.017865,
   1.085583,
   1.056925,
   1.089164,
   1.042601,
   0.9556571,
   1.024122};
   Double_t Graph5_fex1018[10] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Graph5_fey1018[10] = {
   0.02717523,
   0.02169205,
   0.02109434,
   0.02056743,
   0.02117723,
   0.02181947,
   0.02264241,
   0.02442196,
   0.02665755,
   0.03840124};
   gre = new TGraphErrors(10,Graph5_fx1018,Graph5_fy1018,Graph5_fex1018,Graph5_fey1018);
   gre->SetName("Graph5");
   gre->SetTitle("Graph");
   gre->SetFillColor(1);
   gre->SetLineWidth(2);
   gre->SetMarkerStyle(20);
   
   TH1F *Graph_Graph1018 = new TH1F("Graph_Graph1018","Graph",100,-2.64,2.64);
   Graph_Graph1018->SetMinimum(0.9107189);
   Graph_Graph1018->SetMaximum(1.130087);
   Graph_Graph1018->SetDirectory(0);
   Graph_Graph1018->SetStats(0);
   Graph_Graph1018->SetLineStyle(0);
   Graph_Graph1018->SetMarkerStyle(20);
   Graph_Graph1018->GetXaxis()->SetLabelFont(42);
   Graph_Graph1018->GetXaxis()->SetLabelOffset(0.007);
   Graph_Graph1018->GetXaxis()->SetLabelSize(0.05);
   Graph_Graph1018->GetXaxis()->SetTitleSize(0.06);
   Graph_Graph1018->GetXaxis()->SetTitleOffset(1.1);
   Graph_Graph1018->GetXaxis()->SetTitleFont(42);
   Graph_Graph1018->GetYaxis()->SetLabelFont(42);
   Graph_Graph1018->GetYaxis()->SetLabelOffset(0.007);
   Graph_Graph1018->GetYaxis()->SetLabelSize(0.05);
   Graph_Graph1018->GetYaxis()->SetTitleSize(0.06);
   Graph_Graph1018->GetYaxis()->SetTitleOffset(1.5);
   Graph_Graph1018->GetYaxis()->SetTitleFont(42);
   Graph_Graph1018->GetZaxis()->SetLabelFont(42);
   Graph_Graph1018->GetZaxis()->SetLabelOffset(0.007);
   Graph_Graph1018->GetZaxis()->SetLabelSize(0.05);
   Graph_Graph1018->GetZaxis()->SetTitleSize(0.06);
   Graph_Graph1018->GetZaxis()->SetTitleFont(42);
   gre->SetHistogram(Graph_Graph1018);
   
   gre->Draw("pz");
   
   TH1F *Graph_copy = new TH1F("Graph_copy","Graph",100,-2.5,2.5);
   Graph_copy->SetMinimum(0.75);
   Graph_copy->SetMaximum(1.35);
   Graph_copy->SetDirectory(0);
   Graph_copy->SetStats(0);
   Graph_copy->SetLineStyle(0);
   Graph_copy->SetMarkerStyle(20);
   Graph_copy->GetXaxis()->SetTitle("#eta_{lab}");
   Graph_copy->GetXaxis()->SetNdivisions(505);
   Graph_copy->GetXaxis()->SetLabelFont(42);
   Graph_copy->GetXaxis()->SetLabelOffset(0.007);
   Graph_copy->GetXaxis()->SetLabelSize(0.1666667);
   Graph_copy->GetXaxis()->SetTitleSize(0.1666667);
   Graph_copy->GetXaxis()->SetTitleOffset(1.1);
   Graph_copy->GetXaxis()->SetTitleFont(42);
   Graph_copy->GetYaxis()->SetTitle("Ratio ");
   Graph_copy->GetYaxis()->SetNdivisions(503);
   Graph_copy->GetYaxis()->SetLabelFont(42);
   Graph_copy->GetYaxis()->SetLabelOffset(0.007);
   Graph_copy->GetYaxis()->SetLabelSize(0.1666667);
   Graph_copy->GetYaxis()->SetTitleSize(0.1666667);
   Graph_copy->GetYaxis()->SetTitleOffset(0.45);
   Graph_copy->GetYaxis()->SetTitleFont(42);
   Graph_copy->GetZaxis()->SetLabelFont(42);
   Graph_copy->GetZaxis()->SetLabelOffset(0.007);
   Graph_copy->GetZaxis()->SetLabelSize(0.05);
   Graph_copy->GetZaxis()->SetTitleSize(0.06);
   Graph_copy->GetZaxis()->SetTitleFont(42);
   Graph_copy->Draw("sameaxis");
   pad2->Modified();
   c1->cd();
   c1->Modified();
   c1->cd();
   c1->SetSelected(c1);
}
Exemple #3
0
void Merged()
{
   TH1F *hTracklet = new TH1F("hTracklet","",12,-3,3);

   hTracklet->SetBinContent(2,6.251);
   hTracklet->SetBinContent(11,6.251);
   hTracklet->SetBinContent(3,6.314);
   hTracklet->SetBinContent(10,6.314);
   hTracklet->SetBinContent(4,6.222);
   hTracklet->SetBinContent(9,6.222);
   hTracklet->SetBinContent(5,5.976);
   hTracklet->SetBinContent(8,5.976);
   hTracklet->SetBinContent(6,5.75);
   hTracklet->SetBinContent(7,5.75);
   hTracklet->SetAxisRange(0,8,"Y");
   hTracklet->SetXTitle("#eta");
   hTracklet->SetYTitle("dN/d#eta");

   TH1F *hCluster = new TH1F("hCluster","",12,-3,3);

   hCluster->SetBinContent(3,6.53);
   hCluster->SetBinContent(4,6.25);
   hCluster->SetBinContent(5,6.09);
   hCluster->SetBinContent(6,5.73);
   hCluster->SetBinContent(7,5.73);
   hCluster->SetBinContent(8,6.11);
   hCluster->SetBinContent(9,6.29);
   hCluster->SetBinContent(10,6.55);
   hCluster->SetMarkerStyle(4);

   TH1F *h = new TH1F("h","",40,-10,10);
   h->SetBinContent(0,0.07195663);
   h->SetBinContent(1,0.1089206);
   h->SetBinContent(2,0.2419911);
   h->SetBinContent(3,0.4864465);
   h->SetBinContent(4,0.8314441);
   h->SetBinContent(5,1.224248);
   h->SetBinContent(6,1.54066);
   h->SetBinContent(7,1.773287);
   h->SetBinContent(8,2.302119);
   h->SetBinContent(9,2.786102);
   h->SetBinContent(10,3.409561);
   h->SetBinContent(11,3.827994);
   h->SetBinContent(12,4.253327);
   h->SetBinContent(13,4.371119);
   h->SetBinContent(14,4.529325);
   h->SetBinContent(15,4.641202);
   h->SetBinContent(16,4.679152);
   h->SetBinContent(17,4.618039);
   h->SetBinContent(18,4.389847);
   h->SetBinContent(19,4.233613);
   h->SetBinContent(20,4.05175);
   h->SetBinContent(21,4.100049);
   h->SetBinContent(22,4.364712);
   h->SetBinContent(23,4.435683);
   h->SetBinContent(24,4.593889);
   h->SetBinContent(25,4.614588);
   h->SetBinContent(26,4.524396);
   h->SetBinContent(27,4.514539);
   h->SetBinContent(28,4.350912);
   h->SetBinContent(29,4.185806);
   h->SetBinContent(30,3.950222);
   h->SetBinContent(31,3.432725);
   h->SetBinContent(32,2.915722);
   h->SetBinContent(33,2.364712);
   h->SetBinContent(34,1.825037);
   h->SetBinContent(35,1.494332);
   h->SetBinContent(36,1.25382);
   h->SetBinContent(37,0.8669295);
   h->SetBinContent(38,0.501725);
   h->SetBinContent(39,0.2138985);
   h->SetBinContent(40,0.1059635);
   h->SetBinContent(41,0.07343519);
   h->SetBinError(0,0.005955173);
   h->SetBinError(1,0.007326796);
   h->SetBinError(2,0.01092091);
   h->SetBinError(3,0.01548376);
   h->SetBinError(4,0.02024303);
   h->SetBinError(5,0.0245637);
   h->SetBinError(6,0.02755576);
   h->SetBinError(7,0.029563);
   h->SetBinError(8,0.03368394);
   h->SetBinError(9,0.03705591);
   h->SetBinError(10,0.04099286);
   h->SetBinError(11,0.04343548);
   h->SetBinError(12,0.04578501);
   h->SetBinError(13,0.04641467);
   h->SetBinError(14,0.04724716);
   h->SetBinError(15,0.04782712);
   h->SetBinError(16,0.04802226);
   h->SetBinError(17,0.04770762);
   h->SetBinError(18,0.046514);
   h->SetBinError(19,0.04567878);
   h->SetBinError(20,0.04468691);
   h->SetBinError(21,0.04495247);
   h->SetBinError(22,0.04638064);
   h->SetBinError(23,0.0467562);
   h->SetBinError(24,0.04758271);
   h->SetBinError(25,0.0476898);
   h->SetBinError(26,0.04722145);
   h->SetBinError(27,0.04716998);
   h->SetBinError(28,0.04630726);
   h->SetBinError(29,0.04542014);
   h->SetBinError(30,0.04412348);
   h->SetBinError(31,0.04113188);
   h->SetBinError(32,0.0379081);
   h->SetBinError(33,0.03413879);
   h->SetBinError(34,0.02999127);
   h->SetBinError(35,0.02713829);
   h->SetBinError(36,0.02485859);
   h->SetBinError(37,0.02067049);
   h->SetBinError(38,0.01572504);
   h->SetBinError(39,0.01026746);
   h->SetBinError(40,0.007226653);
   h->SetBinError(41,0.006016045);
   h->SetEntries(237505);
   h->SetFillColor(1);
   h->SetFillStyle(0);
   h->SetLineStyle(0);
   h->SetMarkerStyle(21);
   h->SetMarkerColor(4);
   h->SetMarkerSize(1.25);
   h->GetXaxis()->SetTitle("#eta");
   h->GetXaxis()->SetLabelFont(42);
   h->GetXaxis()->SetLabelOffset(0.01);
   h->GetXaxis()->SetLabelSize(0.045);
   h->GetXaxis()->SetTitleSize(0.055);
   h->GetXaxis()->SetTitleFont(42);
   h->GetYaxis()->SetTitle("dN/d#eta");
   h->GetYaxis()->SetLabelFont(42);
   h->GetYaxis()->SetLabelOffset(0.01);
   h->GetYaxis()->SetLabelSize(0.045);
   h->GetYaxis()->SetTitleSize(0.055);
   h->GetYaxis()->SetTitleOffset(1.3);
   h->GetYaxis()->SetTitleFont(42);
   h->GetZaxis()->SetLabelFont(42);
   h->GetZaxis()->SetLabelSize(0.045);
   h->GetZaxis()->SetTitleFont(42);


   TH1F *hATLAS = new TH1F("hATLAS","",40,-10,10);
   hATLAS->SetBinContent(0,0.08524267);
   hATLAS->SetBinContent(1,0.1512688);
   hATLAS->SetBinContent(2,0.3321015);
   hATLAS->SetBinContent(3,0.6415373);
   hATLAS->SetBinContent(4,0.9425967);
   hATLAS->SetBinContent(5,1.193397);
   hATLAS->SetBinContent(6,1.452082);
   hATLAS->SetBinContent(7,1.836413);
   hATLAS->SetBinContent(8,2.275437);
   hATLAS->SetBinContent(9,2.840108);
   hATLAS->SetBinContent(10,3.400838);
   hATLAS->SetBinContent(11,4.043853);
   hATLAS->SetBinContent(12,4.521803);
   hATLAS->SetBinContent(13,5.043114);
   hATLAS->SetBinContent(14,5.39591);
   hATLAS->SetBinContent(15,5.757083);
   hATLAS->SetBinContent(16,6.010347);
   hATLAS->SetBinContent(17,6.007884);
   hATLAS->SetBinContent(18,5.883715);
   hATLAS->SetBinContent(19,5.838877);
   hATLAS->SetBinContent(20,5.451097);
   hATLAS->SetBinContent(21,5.490022);
   hATLAS->SetBinContent(22,5.663464);
   hATLAS->SetBinContent(23,5.971914);
   hATLAS->SetBinContent(24,6.058635);
   hATLAS->SetBinContent(25,5.969944);
   hATLAS->SetBinContent(26,5.797487);
   hATLAS->SetBinContent(27,5.353043);
   hATLAS->SetBinContent(28,4.894802);
   hATLAS->SetBinContent(29,4.5085);
   hATLAS->SetBinContent(30,4.00542);
   hATLAS->SetBinContent(31,3.448633);
   hATLAS->SetBinContent(32,2.883469);
   hATLAS->SetBinContent(33,2.337029);
   hATLAS->SetBinContent(34,1.805863);
   hATLAS->SetBinContent(35,1.42104);
   hATLAS->SetBinContent(36,1.205223);
   hATLAS->SetBinContent(37,0.9795516);
   hATLAS->SetBinContent(38,0.6228135);
   hATLAS->SetBinContent(39,0.3261887);
   hATLAS->SetBinContent(40,0.1547179);
   hATLAS->SetBinContent(41,0.09608278);
   hATLAS->SetBinError(0,0.00648088);
   hATLAS->SetBinError(1,0.008633366);
   hATLAS->SetBinError(2,0.01279207);
   hATLAS->SetBinError(3,0.01777937);
   hATLAS->SetBinError(4,0.02155105);
   hATLAS->SetBinError(5,0.02424923);
   hATLAS->SetBinError(6,0.0267486);
   hATLAS->SetBinError(7,0.03008089);
   hATLAS->SetBinError(8,0.03348404);
   hATLAS->SetBinError(9,0.03740873);
   hATLAS->SetBinError(10,0.04093534);
   hATLAS->SetBinError(11,0.04463784);
   hATLAS->SetBinError(12,0.0472021);
   hATLAS->SetBinError(13,0.04984882);
   hATLAS->SetBinError(14,0.05156296);
   hATLAS->SetBinError(15,0.05326068);
   hATLAS->SetBinError(16,0.05441959);
   hATLAS->SetBinError(17,0.05440843);
   hATLAS->SetBinError(18,0.05384325);
   hATLAS->SetBinError(19,0.0536377);
   hATLAS->SetBinError(20,0.05182597);
   hATLAS->SetBinError(21,0.05201068);
   hATLAS->SetBinError(22,0.05282586);
   hATLAS->SetBinError(23,0.05424532);
   hATLAS->SetBinError(24,0.05463776);
   hATLAS->SetBinError(25,0.05423637);
   hATLAS->SetBinError(26,0.05344725);
   hATLAS->SetBinError(27,0.05135773);
   hATLAS->SetBinError(28,0.04911035);
   hATLAS->SetBinError(29,0.04713261);
   hATLAS->SetBinError(30,0.04442521);
   hATLAS->SetBinError(31,0.04122199);
   hATLAS->SetBinError(32,0.03769321);
   hATLAS->SetBinError(33,0.03393419);
   hATLAS->SetBinError(34,0.02982963);
   hATLAS->SetBinError(35,0.02646114);
   hATLAS->SetBinError(36,0.02436908);
   hATLAS->SetBinError(37,0.02196945);
   hATLAS->SetBinError(38,0.017518);
   hATLAS->SetBinError(39,0.01267768);
   hATLAS->SetBinError(40,0.008731237);
   hATLAS->SetBinError(41,0.006880631);
   hATLAS->SetEntries(280271);
   hATLAS->SetFillColor(1);
   hATLAS->SetFillStyle(0);
   hATLAS->SetLineStyle(0);
   hATLAS->SetMarkerStyle(22);
   hATLAS->SetMarkerColor(4);
   hATLAS->SetMarkerSize(1.25);
   hATLAS->GetXaxis()->SetTitle("#eta");
   hATLAS->GetXaxis()->SetLabelFont(42);
   hATLAS->GetXaxis()->SetLabelOffset(0.01);
   hATLAS->GetXaxis()->SetLabelSize(0.045);
   hATLAS->GetXaxis()->SetTitleSize(0.055);
   hATLAS->GetXaxis()->SetTitleFont(42);
   hATLAS->GetYaxis()->SetTitle("dN/d#eta");
   hATLAS->GetYaxis()->SetLabelFont(42);
   hATLAS->GetYaxis()->SetLabelOffset(0.01);
   hATLAS->GetYaxis()->SetLabelSize(0.045);
   hATLAS->GetYaxis()->SetTitleSize(0.055);
   hATLAS->GetYaxis()->SetTitleOffset(1.3);
   hATLAS->GetYaxis()->SetTitleFont(42);
   hATLAS->GetZaxis()->SetLabelFont(42);
   hATLAS->GetZaxis()->SetLabelSize(0.045);
   hATLAS->GetZaxis()->SetTitleFont(42);
   
   TCanvas *MyCanvas = new TCanvas("MyCanvas", "Final result",1,360,550,600);

   hTracklet->Draw("p");
   hCluster->Draw("p same");
   hATLAS->Draw("same");
   h->Draw("same");
   Float_t ywidth = 0.25;
   //TLegend *leg2 = new TLegend(0.38,0.27,0.81,0.27+ywidth2,"","brNDC");
   TLegend *leg2 = new TLegend(0.39,0.21,0.82,0.21+ywidth,NULL,"brNDC");

   leg2->SetMargin(0.5);
   leg2->SetBorderSize(0);
   leg2->SetTextFont(62);
   leg2->SetLineColor(1);
   leg2->SetLineStyle(1);
   leg2->SetLineWidth(1);
   leg2->SetFillColor(0);
   //leg->SetFillStyle(1001);
   leg2->SetFillStyle(0);
   leg2->SetTextSize(0.033);
   leg2->SetHeader("     7.0 TeV");
   leg2->AddEntry(hTracklet,"CMS Preliminary Tracklet","p");
   leg2->AddEntry(hCluster,"CMS Preliminary Cluster","p");
   leg2->AddEntry(hATLAS,"ATLAS Tune","p");
   leg2->AddEntry(h,"D6T Tune","p");


   leg2->Draw();
}
void compare_ATLAS_pp_fitBoth_TH1F(Int_t nfit=6, Int_t FitStart=50, Int_t FitEnd=450){
     TH1::SetDefaultSumw2();
   gStyle->SetOptFit(1);     
   gStyle->SetOptStat(0);
   
//=========Macro generated from canvas: cATLAS_pp/
//=========  (Wed Jul 22 23:01:26 2015) by ROOT version5.32/00

   TF1 *fitppATLAS = new TF1("fitppATLAS","[0]*pow(x+[2],[1])"); //create function
   fitppATLAS->SetParameters(1e10,-5,0);
   fitppATLAS->SetLineColor(kRed);   
   TF1 *fitppCMS = new TF1("fitppCMS","[0]*pow(x+[2],[1])"); //create function
   fitppCMS->SetParameters(1e10,-5,0);
   fitppCMS->SetLineColor(kBlue);   
   TF1 *fitppATLASHist = new TF1("fitppATLASHist","[0]*pow(x+[2],[1])"); //create function
   fitppATLASHist->SetParameters(1e10,-5,0);
   fitppATLASHist->SetLineColor(kGreen+1);   
      
   TGraphAsymmErrors *grae = new TGraphAsymmErrors(12);
   grae->SetName("/HepData/8719/d2x1y1");
   grae->SetTitle(" ");
   grae->SetFillColor(1);
   grae->SetMarkerStyle(33);
   grae->SetPoint(0,35,180);
   grae->SetPointError(0,4,4,29.95905,29.95905);
   grae->SetPoint(1,44.5,55.7);
   grae->SetPointError(1,5.5,5.5,7.828377,7.828377);
   grae->SetPoint(2,56.5,16.9);
   grae->SetPointError(2,6.5,6.5,2.625436,2.625436);
   grae->SetPoint(3,71,4.85);
   grae->SetPointError(3,8,8,0.6276957,0.6276957);
   grae->SetPoint(4,89.5,1.42);
   grae->SetPointError(4,10.5,10.5,0.1878054,0.1878054);
   grae->SetPoint(5,112.5,0.364);
   grae->SetPointError(5,12.5,12.5,0.04772427,0.04772427);
   grae->SetPoint(6,141.5,0.0882);
   grae->SetPointError(6,16.5,16.5,0.01103805,0.01103805);
   grae->SetPoint(7,178.5,0.0197);
   grae->SetPointError(7,20.5,20.5,0.002292152,0.002292152);
   grae->SetPoint(8,225,0.00406);
   grae->SetPointError(8,26,26,0.0004822521,0.0004822521);
   grae->SetPoint(9,283.5,0.000735);
   grae->SetPointError(9,32.5,32.5,8.981748e-05,8.981748e-05);
   grae->SetPoint(10,357,0.000114);
   grae->SetPointError(10,41,41,1.442494e-05,1.442494e-05);
   grae->SetPoint(11,449.5,1.41e-05);
   grae->SetPointError(11,51.5,51.5,1.98855e-06,1.98855e-06);
   
   TH1F *hATLASpp = new TH1F("hATLASpp"," ",100,50,450);
   hATLASpp->SetMinimum(1.090031e-05);
   hATLASpp->SetMaximum(230.955);
   hATLASpp->SetDirectory(0);
   hATLASpp->SetStats(0);

   Int_t ci;   // for color index setting
   ci = TColor::GetColor("#000099");
   hATLASpp->SetLineColor(ci);
   hATLASpp->GetXaxis()->SetTitle("ak R=0.4 Jet p_{T} (GeV/c)");
   hATLASpp->GetXaxis()->SetLabelFont(42);
   hATLASpp->GetXaxis()->SetLabelSize(0.035);
   hATLASpp->GetXaxis()->SetTitleSize(0.035);
   hATLASpp->GetXaxis()->SetTitleFont(42);
   hATLASpp->GetYaxis()->SetTitle("#frac{d^{2}#sigma}{dp_{T} d#eta} nb");
   hATLASpp->GetYaxis()->SetLabelFont(42);
   hATLASpp->GetYaxis()->SetLabelSize(0.035);
   hATLASpp->GetYaxis()->SetTitleSize(0.035);
   hATLASpp->GetYaxis()->SetTitleFont(42);
   hATLASpp->GetZaxis()->SetLabelFont(42);
   hATLASpp->GetZaxis()->SetLabelSize(0.035);
   hATLASpp->GetZaxis()->SetTitleSize(0.035);
   hATLASpp->GetZaxis()->SetTitleFont(42);
   grae->SetHistogram(hATLASpp);


Double_t xAxisATLASpp[13] = {31,39,50,63,79,100,125,158,199,251,316,398,501}; 
   TH1F *hATLASppHist = new TH1F("hATLASppHist"," ",12,xAxisATLASpp);
   hATLASppHist->SetMinimum(1.090031e-05);
   hATLASppHist->SetMaximum(230.955);
   hATLASppHist->SetDirectory(0);
   hATLASppHist->SetStats(0);
   hATLASppHist->SetBinContent(1,180);
   hATLASppHist->SetBinError(1,29.95905);
   hATLASppHist->SetBinContent(2,55.7);
   hATLASppHist->SetBinError(2,7.828377);
   hATLASppHist->SetBinContent(3,16.9);
   hATLASppHist->SetBinError(3,2.625436);
   hATLASppHist->SetBinContent(4,4.85);
   hATLASppHist->SetBinError(4,0.6276957);
   hATLASppHist->SetBinContent(5,1.42);
   hATLASppHist->SetBinError(5,0.1878054);
   hATLASppHist->SetBinContent(6,0.364);
   hATLASppHist->SetBinError(6,0.04772427);
   hATLASppHist->SetBinContent(7,0.0882);
   hATLASppHist->SetBinError(7,0.01103805);
   hATLASppHist->SetBinContent(8,0.0197);
   hATLASppHist->SetBinError(8,0.002292152);
   hATLASppHist->SetBinContent(9,0.00406);
   hATLASppHist->SetBinError(9,0.0004822521);
   hATLASppHist->SetBinContent(10,0.000735);
   hATLASppHist->SetBinError(10,8.981748e-05);
   hATLASppHist->SetBinContent(11,0.000114);
   hATLASppHist->SetBinError(11,1.442494e-05);
   hATLASppHist->SetBinContent(12,1.41e-05);
   hATLASppHist->SetBinError(12,1.98855e-06);
//    c1=new TCanvas();
// //   c1.cd();
//    hATLASppHist->Draw();
  // was grae
   for(int i=0; i<nfit; ++i){
     grae->Fit("fitppATLAS","","",FitStart,FitEnd); //fit function
   } 
   cout<<"now to fit hATLASppHist"<<endl;
   for(int ib=0; ib<nfit; ++ib){
     hATLASppHist->Fit("fitppATLASHist","IL","",FitStart,FitEnd); //fit function
   } 

   TCanvas *cATLAS_ppHist = new TCanvas("cATLAS_ppHist", "",0,0,1200,1000);
   cATLAS_ppHist->Range(-3.725291e-06,-5.878322,500,3.279288);
   cATLAS_ppHist->SetFillColor(0);
   cATLAS_ppHist->SetBorderMode(0);
   cATLAS_ppHist->SetBorderSize(2);
   cATLAS_ppHist->SetLogy();
   cATLAS_ppHist->SetFrameBorderMode(0);
   cATLAS_ppHist->SetFrameBorderMode(0);

//   grae->SetHistogram(hATLASpp);

   TLegend *leg = new TLegend(0.4,0.65,0.6,0.85,NULL,"BRNDC");
   leg->SetBorderSize(0);
   leg->SetTextSize(0.04);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(10);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("NULL","","h");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("hATLASppHist","ATLAS pp histogram","p");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(kGreen);
   entry->SetMarkerStyle(22);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("grae","ATLAS pp TGraphAsymErrors","p");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(33);
   entry->SetMarkerSize(1);
   
   leg->Draw();
   hATLASppHist->SetMarkerColor(kGreen);
   hATLASppHist->SetMarkerStyle(22);
   grae->SetMarkerStyle(21);
   grae->SetMarkerColor(1);
   hATLASpp->Draw();
   grae->Draw("ap,same");
//   uPP_R4_SVD->Draw("same E1");
   hATLASppHist->Draw("ap,same");
   
   TPaveText *pt = new TPaveText(0.4845652,0.94,0.5154348,0.995,"blNDC");
   pt->SetName("title");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetFillStyle(0);
   pt->SetTextFont(42);
   TText *text = pt->AddText(" ");
   pt->Draw();
   cATLAS_ppHist->Modified();
   cATLAS_ppHist->cd();
   cATLAS_ppHist->SetSelected(cATLAS_ppHist);
   
//     for(int ic=0; ic<nfit; ic++){
//       uPP_R4_SVD->Fit("fitppCMS","IL","",60,FitEnd); //fit function    
// //      uPP_R4_SVD->Fit("fitppCMS","IL","",50,300); //fit function
//     } 
   
//     hATLASpp->Draw();
//    grae->Draw("ap,same");
//    uPP_R4_SVD->Draw("same E1");
//    hATLASppHist->Draw("same E1");
   leg->Draw();
   cATLAS_ppHist->SaveAs("Plots/ATLASHistfit_spectra_pp.pdf");
   
   
   Double_t xAxis2086[101] = {0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, 290, 300, 310, 320, 330, 340, 350, 360, 370, 380, 390, 400, 410, 420, 430, 440, 450, 460, 470, 480, 490, 500, 510, 520, 530, 540, 550, 560, 570, 580, 590, 600, 610, 620, 630, 640, 650, 660, 670, 680, 690, 700, 710, 720, 730, 740, 750, 760, 770, 780, 790, 800, 810, 820, 830, 840, 850, 860, 870, 880, 890, 900, 910, 920, 930, 940, 950, 960, 970, 980, 990, 1000}; 
   
   TH1F *uPP_R4_SVD = new TH1F("uPP_R4_SVD","Unfold Matrix refpt jtpt from trigger addition R4 20_eta_20 ",100, xAxis2086);
   uPP_R4_SVD->SetBinContent(1,15.44572);
   uPP_R4_SVD->SetBinContent(2,81.73347);
   uPP_R4_SVD->SetBinContent(3,85.49986);
   uPP_R4_SVD->SetBinContent(4,90.07588);
   uPP_R4_SVD->SetBinContent(5,47.67952);
   uPP_R4_SVD->SetBinContent(6,18.31659);
   uPP_R4_SVD->SetBinContent(7,7.348095);
   uPP_R4_SVD->SetBinContent(8,3.295203);
   uPP_R4_SVD->SetBinContent(9,1.60486);
   uPP_R4_SVD->SetBinContent(10,0.8393627);
   uPP_R4_SVD->SetBinContent(11,0.4622419);
   uPP_R4_SVD->SetBinContent(12,0.265131);
   uPP_R4_SVD->SetBinContent(13,0.1587068);
   uPP_R4_SVD->SetBinContent(14,0.09774788);
   uPP_R4_SVD->SetBinContent(15,0.06153403);
   uPP_R4_SVD->SetBinContent(16,0.03981187);
   uPP_R4_SVD->SetBinContent(17,0.02620752);
   uPP_R4_SVD->SetBinContent(18,0.01766706);
   uPP_R4_SVD->SetBinContent(19,0.01206758);
   uPP_R4_SVD->SetBinContent(20,0.008403017);
   uPP_R4_SVD->SetBinContent(21,0.005956108);
   uPP_R4_SVD->SetBinContent(22,0.004267026);
   uPP_R4_SVD->SetBinContent(23,0.003102345);
   uPP_R4_SVD->SetBinContent(24,0.002273482);
   uPP_R4_SVD->SetBinContent(25,0.001699103);
   uPP_R4_SVD->SetBinContent(26,0.001281323);
   uPP_R4_SVD->SetBinContent(27,0.000971557);
   uPP_R4_SVD->SetBinContent(28,0.0007444665);
   uPP_R4_SVD->SetBinContent(29,0.0005746992);
   uPP_R4_SVD->SetBinContent(30,0.0004462709);
   uPP_R4_SVD->SetBinContent(31,0.0003483805);
   uPP_R4_SVD->SetBinContent(32,0.0002725941);
   uPP_R4_SVD->SetBinContent(33,0.0002141152);
   uPP_R4_SVD->SetBinContent(34,0.0001705039);
   uPP_R4_SVD->SetBinContent(35,0.0001352845);
   uPP_R4_SVD->SetBinContent(36,0.0001073623);
   uPP_R4_SVD->SetBinContent(37,8.559958e-05);
   uPP_R4_SVD->SetBinContent(38,6.847693e-05);
   uPP_R4_SVD->SetBinContent(39,5.506579e-05);
   uPP_R4_SVD->SetBinContent(40,4.404838e-05);
   uPP_R4_SVD->SetBinContent(41,3.566817e-05);
   uPP_R4_SVD->SetBinContent(42,2.88001e-05);
   uPP_R4_SVD->SetBinContent(43,2.33088e-05);
   uPP_R4_SVD->SetBinContent(44,1.897322e-05);
   uPP_R4_SVD->SetBinContent(45,1.546483e-05);
   uPP_R4_SVD->SetBinContent(46,1.251424e-05);
   uPP_R4_SVD->SetBinContent(47,1.020799e-05);
   uPP_R4_SVD->SetBinContent(48,8.267746e-06);
   uPP_R4_SVD->SetBinContent(49,6.760333e-06);
   uPP_R4_SVD->SetBinContent(50,5.504337e-06);
   uPP_R4_SVD->SetBinContent(51,4.514429e-06);
   uPP_R4_SVD->SetBinContent(52,3.665816e-06);
   uPP_R4_SVD->SetBinContent(53,3.010496e-06);
   uPP_R4_SVD->SetBinContent(54,2.463812e-06);
   uPP_R4_SVD->SetBinContent(55,2.01082e-06);
   uPP_R4_SVD->SetBinContent(56,1.624154e-06);
   uPP_R4_SVD->SetBinContent(57,1.334625e-06);
   uPP_R4_SVD->SetBinContent(58,1.088798e-06);
   uPP_R4_SVD->SetBinContent(59,8.896167e-07);
   uPP_R4_SVD->SetBinContent(60,7.305952e-07);
   uPP_R4_SVD->SetBinContent(61,5.930196e-07);
   uPP_R4_SVD->SetBinContent(62,4.863888e-07);
   uPP_R4_SVD->SetBinContent(63,3.941485e-07);
   uPP_R4_SVD->SetBinContent(64,3.221651e-07);
   uPP_R4_SVD->SetBinContent(65,2.636797e-07);
   uPP_R4_SVD->SetBinContent(66,2.146457e-07);
   uPP_R4_SVD->SetBinContent(67,1.742243e-07);
   uPP_R4_SVD->SetBinContent(68,1.409108e-07);
   uPP_R4_SVD->SetBinContent(69,1.142703e-07);
   uPP_R4_SVD->SetBinContent(70,9.293402e-08);
   uPP_R4_SVD->SetBinContent(71,7.511816e-08);
   uPP_R4_SVD->SetBinContent(72,6.013509e-08);
   uPP_R4_SVD->SetBinContent(73,4.927971e-08);
   uPP_R4_SVD->SetBinContent(74,3.992714e-08);
   uPP_R4_SVD->SetBinContent(75,3.176246e-08);
   uPP_R4_SVD->SetBinContent(76,2.560933e-08);
   uPP_R4_SVD->SetBinContent(77,2.039975e-08);
   uPP_R4_SVD->SetBinContent(78,1.627726e-08);
   uPP_R4_SVD->SetBinContent(79,1.272043e-08);
   uPP_R4_SVD->SetBinContent(80,1.022684e-08);
   uPP_R4_SVD->SetBinContent(81,8.172451e-09);
   uPP_R4_SVD->SetBinContent(82,6.570082e-09);
   uPP_R4_SVD->SetBinContent(83,5.205766e-09);
   uPP_R4_SVD->SetBinContent(84,4.075393e-09);
   uPP_R4_SVD->SetBinContent(85,3.265506e-09);
   uPP_R4_SVD->SetBinContent(86,2.62088e-09);
   uPP_R4_SVD->SetBinContent(87,2.003114e-09);
   uPP_R4_SVD->SetBinContent(88,1.535628e-09);
   uPP_R4_SVD->SetBinContent(89,1.063791e-09);
   uPP_R4_SVD->SetBinContent(90,9.092138e-10);
   uPP_R4_SVD->SetBinContent(91,6.803265e-10);
   uPP_R4_SVD->SetBinContent(92,4.778346e-10);
   uPP_R4_SVD->SetBinContent(93,3.988072e-10);
   uPP_R4_SVD->SetBinContent(94,2.474126e-10);
   uPP_R4_SVD->SetBinContent(95,2.140924e-10);
   uPP_R4_SVD->SetBinContent(96,1.623732e-10);
   uPP_R4_SVD->SetBinContent(97,1.45067e-10);
   uPP_R4_SVD->SetBinContent(98,9.186947e-11);
   uPP_R4_SVD->SetBinContent(99,6.040857e-11);
   uPP_R4_SVD->SetBinContent(100,6.157141e-11);
   uPP_R4_SVD->SetBinError(1,0.1237595);
   uPP_R4_SVD->SetBinError(2,0.6234048);
   uPP_R4_SVD->SetBinError(3,0.586929);
   uPP_R4_SVD->SetBinError(4,0.5173901);
   uPP_R4_SVD->SetBinError(5,0.2055361);
   uPP_R4_SVD->SetBinError(6,0.04990473);
   uPP_R4_SVD->SetBinError(7,0.01308245);
   uPP_R4_SVD->SetBinError(8,0.006804987);
   uPP_R4_SVD->SetBinError(9,0.003260532);
   uPP_R4_SVD->SetBinError(10,0.001534405);
   uPP_R4_SVD->SetBinError(11,0.001026545);
   uPP_R4_SVD->SetBinError(12,0.000705749);
   uPP_R4_SVD->SetBinError(13,0.0004784051);
   uPP_R4_SVD->SetBinError(14,0.0003483983);
   uPP_R4_SVD->SetBinError(15,0.0002598719);
   uPP_R4_SVD->SetBinError(16,0.0001903908);
   uPP_R4_SVD->SetBinError(17,0.0001387089);
   uPP_R4_SVD->SetBinError(18,0.0001040173);
   uPP_R4_SVD->SetBinError(19,7.981541e-05);
   uPP_R4_SVD->SetBinError(20,6.24475e-05);
   uPP_R4_SVD->SetBinError(21,4.937991e-05);
   uPP_R4_SVD->SetBinError(22,3.947987e-05);
   uPP_R4_SVD->SetBinError(23,3.254473e-05);
   uPP_R4_SVD->SetBinError(24,2.764293e-05);
   uPP_R4_SVD->SetBinError(25,2.429597e-05);
   uPP_R4_SVD->SetBinError(26,2.159774e-05);
   uPP_R4_SVD->SetBinError(27,1.917051e-05);
   uPP_R4_SVD->SetBinError(28,1.6997e-05);
   uPP_R4_SVD->SetBinError(29,1.498669e-05);
   uPP_R4_SVD->SetBinError(30,1.312744e-05);
   uPP_R4_SVD->SetBinError(31,1.142902e-05);
   uPP_R4_SVD->SetBinError(32,9.871913e-06);
   uPP_R4_SVD->SetBinError(33,8.480939e-06);
   uPP_R4_SVD->SetBinError(34,7.324674e-06);
   uPP_R4_SVD->SetBinError(35,6.255272e-06);
   uPP_R4_SVD->SetBinError(36,5.306614e-06);
   uPP_R4_SVD->SetBinError(37,4.495288e-06);
   uPP_R4_SVD->SetBinError(38,3.800242e-06);
   uPP_R4_SVD->SetBinError(39,3.214166e-06);
   uPP_R4_SVD->SetBinError(40,2.692884e-06);
   uPP_R4_SVD->SetBinError(41,2.275421e-06);
   uPP_R4_SVD->SetBinError(42,1.910914e-06);
   uPP_R4_SVD->SetBinError(43,1.60384e-06);
   uPP_R4_SVD->SetBinError(44,1.350324e-06);
   uPP_R4_SVD->SetBinError(45,1.135728e-06);
   uPP_R4_SVD->SetBinError(46,9.463317e-07);
   uPP_R4_SVD->SetBinError(47,7.933288e-07);
   uPP_R4_SVD->SetBinError(48,6.591956e-07);
   uPP_R4_SVD->SetBinError(49,5.520988e-07);
   uPP_R4_SVD->SetBinError(50,4.597711e-07);
   uPP_R4_SVD->SetBinError(51,3.851643e-07);
   uPP_R4_SVD->SetBinError(52,3.190695e-07);
   uPP_R4_SVD->SetBinError(53,2.670117e-07);
   uPP_R4_SVD->SetBinError(54,2.22444e-07);
   uPP_R4_SVD->SetBinError(55,1.84622e-07);
   uPP_R4_SVD->SetBinError(56,1.515098e-07);
   uPP_R4_SVD->SetBinError(57,1.263889e-07);
   uPP_R4_SVD->SetBinError(58,1.045901e-07);
   uPP_R4_SVD->SetBinError(59,8.662012e-08);
   uPP_R4_SVD->SetBinError(60,7.20551e-08);
   uPP_R4_SVD->SetBinError(61,5.920339e-08);
   uPP_R4_SVD->SetBinError(62,4.912298e-08);
   uPP_R4_SVD->SetBinError(63,4.024705e-08);
   uPP_R4_SVD->SetBinError(64,3.324212e-08);
   uPP_R4_SVD->SetBinError(65,2.747888e-08);
   uPP_R4_SVD->SetBinError(66,2.258106e-08);
   uPP_R4_SVD->SetBinError(67,1.849393e-08);
   uPP_R4_SVD->SetBinError(68,1.50859e-08);
   uPP_R4_SVD->SetBinError(69,1.233344e-08);
   uPP_R4_SVD->SetBinError(70,1.010825e-08);
   uPP_R4_SVD->SetBinError(71,8.230567e-09);
   uPP_R4_SVD->SetBinError(72,6.634947e-09);
   uPP_R4_SVD->SetBinError(73,5.473309e-09);
   uPP_R4_SVD->SetBinError(74,4.462479e-09);
   uPP_R4_SVD->SetBinError(75,3.571148e-09);
   uPP_R4_SVD->SetBinError(76,2.895626e-09);
   uPP_R4_SVD->SetBinError(77,2.318939e-09);
   uPP_R4_SVD->SetBinError(78,1.859689e-09);
   uPP_R4_SVD->SetBinError(79,1.460273e-09);
   uPP_R4_SVD->SetBinError(80,1.179314e-09);
   uPP_R4_SVD->SetBinError(81,9.46416e-10);
   uPP_R4_SVD->SetBinError(82,7.638915e-10);
   uPP_R4_SVD->SetBinError(83,6.075323e-10);
   uPP_R4_SVD->SetBinError(84,4.772801e-10);
   uPP_R4_SVD->SetBinError(85,3.836821e-10);
   uPP_R4_SVD->SetBinError(86,3.088773e-10);
   uPP_R4_SVD->SetBinError(87,2.367363e-10);
   uPP_R4_SVD->SetBinError(88,1.819577e-10);
   uPP_R4_SVD->SetBinError(89,1.263493e-10);
   uPP_R4_SVD->SetBinError(90,1.082238e-10);
   uPP_R4_SVD->SetBinError(91,8.113796e-11);
   uPP_R4_SVD->SetBinError(92,5.70881e-11);
   uPP_R4_SVD->SetBinError(93,4.772047e-11);
   uPP_R4_SVD->SetBinError(94,2.964495e-11);
   uPP_R4_SVD->SetBinError(95,2.568217e-11);
   uPP_R4_SVD->SetBinError(96,1.949672e-11);
   uPP_R4_SVD->SetBinError(97,1.743206e-11);
   uPP_R4_SVD->SetBinError(98,1.104588e-11);
   uPP_R4_SVD->SetBinError(99,7.265969e-12);
   uPP_R4_SVD->SetBinError(100,7.407249e-12);
   uPP_R4_SVD->SetEntries(100);
   uPP_R4_SVD->SetStats(0);

   ci = TColor::GetColor("#000099");
   uPP_R4_SVD->SetLineColor(ci);

//    ci = TColor::GetColor("#0000ff");
//    uPP_R4_SVD->SetMarkerColor(ci);
//    uPP_R4_SVD->SetMarkerStyle(24);
//    uPP_R4_SVD->GetXaxis()->CenterTitle(true);
//    uPP_R4_SVD->GetXaxis()->SetLabelFont(42);
//    uPP_R4_SVD->GetXaxis()->SetLabelSize(0.035);
//    uPP_R4_SVD->GetXaxis()->SetTitleSize(0.035);
//    uPP_R4_SVD->GetXaxis()->SetTitleFont(42);
//    uPP_R4_SVD->GetYaxis()->CenterTitle(true);
//    uPP_R4_SVD->GetYaxis()->SetLabelFont(42);
//    uPP_R4_SVD->GetYaxis()->SetLabelSize(0.035);
//    uPP_R4_SVD->GetYaxis()->SetTitleSize(0.035);
//    uPP_R4_SVD->GetYaxis()->SetTitleFont(42);
//    uPP_R4_SVD->GetZaxis()->SetLabelFont(42);
//    uPP_R4_SVD->GetZaxis()->SetLabelSize(0.035);
//    uPP_R4_SVD->GetZaxis()->SetTitleSize(0.035);
//    uPP_R4_SVD->GetZaxis()->SetTitleFont(42);
//    uPP_R4_SVD->Draw("same E1");
//    TBox *box = new TBox(60,7.108492,70,7.587699);
//    box->SetFillColor(2);
//    box->SetFillStyle(0);
//    box->SetLineColor(2);
//    box->Draw();
//    box = new TBox(70,3.186674,80,3.403731);
//    box->SetFillColor(2);
//    box->SetFillStyle(0);
//    box->SetLineColor(2);
//    box->Draw();
//    box = new TBox(80,1.551541,90,1.658179);
//    box->SetFillColor(2);
//    box->SetFillStyle(0);
//    box->SetLineColor(2);
//    box->Draw();
//    box = new TBox(90,0.8111346,100,0.8675909);
//    box->SetFillColor(2);
//    box->SetFillStyle(0);
//    box->SetLineColor(2);
//    box->Draw();
//    box = new TBox(100,0.4464541,110,0.4780297);
//    box->SetFillColor(2);
//    box->SetFillStyle(0);
//    box->SetLineColor(2);
//    box->Draw();
//    box = new TBox(110,0.2045159,130,0.2193219);
//    box->SetFillColor(2);
//    box->SetFillStyle(0);
//    box->SetLineColor(2);
//    box->Draw();
//    box = new TBox(130,0.07677678,150,0.08250514);
//    box->SetFillColor(2);
//    box->SetFillStyle(0);
//    box->SetLineColor(2);
//    box->Draw();
//    box = new TBox(150,0.03180206,170,0.03421734);
//    box->SetFillColor(2);
//    box->SetFillStyle(0);
//    box->SetLineColor(2);
//    box->Draw();
//    box = new TBox(170,0.01431415,190,0.01542048);
//    box->SetFillColor(2);
//    box->SetFillStyle(0);
//    box->SetLineColor(2);
//    box->Draw();
//    box = new TBox(190,0.006909775,210,0.007449351);
//    box->SetFillColor(2);
//    box->SetFillStyle(0);
//    box->SetLineColor(2);
//    box->Draw();
//    box = new TBox(210,0.003092187,240,0.003336382);
//    box->SetFillColor(2);
//    box->SetFillStyle(0);
//    box->SetLineColor(2);
//    box->Draw();
//    box = new TBox(240,0.001266417,270,0.001368238);
//    box->SetFillColor(2);
//    box->SetFillStyle(0);
//    box->SetLineColor(2);
//    box->Draw();
//    box = new TBox(270,0.00056544,300,0.0006115177);
//    box->SetFillColor(2);
//    box->SetFillStyle(0);
//    box->SetLineColor(2);
//    box->Draw();
   TCanvas *cATLAS_pp = new TCanvas("cATLAS_pp", "",0,0,1200,1000);
   cATLAS_pp->Range(-3.725291e-06,-5.878322,500,3.279288);
   cATLAS_pp->SetFillColor(0);
   cATLAS_pp->SetBorderMode(0);
   cATLAS_pp->SetBorderSize(2);
   cATLAS_pp->SetLogy();
   cATLAS_pp->SetFrameBorderMode(0);
   cATLAS_pp->SetFrameBorderMode(0);
   grae->SetHistogram(hATLASpp);
   hATLASpp->Draw();
   grae->Draw("ap,same");   
         
   TLegend *leg = new TLegend(0.4,0.65,0.6,0.85,NULL,"BRNDC");
   leg->SetBorderSize(0);
   leg->SetTextSize(0.04);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(10);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("NULL","","h");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("/HepData/8719/d2x1y1","ATLAS pp","p");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(33);
   entry->SetMarkerSize(1);
   entry=leg->AddEntry("uPP_R4_SVD","CMS pp","p");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);

   ci = TColor::GetColor("#0000ff");
   entry->SetMarkerColor(ci);
   entry->SetMarkerStyle(24);
   entry->SetMarkerSize(1);
   leg->Draw();


   
   TPaveText *pt = new TPaveText(0.4845652,0.94,0.5154348,0.995,"blNDC");
   pt->SetName("title");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetFillStyle(0);
   pt->SetTextFont(42);
   TText *text = pt->AddText(" ");
   pt->Draw();
   cATLAS_pp->Modified();
   cATLAS_pp->cd();
   cATLAS_pp->SetSelected(cATLAS_pp);
   
    for(int ic=0; ic<nfit; ic++){
      uPP_R4_SVD->Fit("fitppCMS","IL","",60,FitEnd); //fit function    
//      uPP_R4_SVD->Fit("fitppCMS","IL","",50,300); //fit function
    } 
   
    hATLASpp->Draw();
   grae->Draw("ap,same");
   uPP_R4_SVD->Draw("same E1");
   leg->Draw();
   cATLAS_pp->SaveAs("Plots/CMSfit_ATLASfit_spectra_pp.pdf");
   
   
   TCanvas *cCMS_pp = new TCanvas("cCMS_pp", "",0,0,1200,1000);
   cCMS_pp->Range(-3.725291e-06,-5.878322,500,3.279288);
   cCMS_pp->SetFillColor(0);
   cCMS_pp->SetBorderMode(0);
   cCMS_pp->SetBorderSize(2);
   cCMS_pp->SetLogy();
   cCMS_pp->SetLogx();
   cCMS_pp->SetFrameBorderMode(0);
   cCMS_pp->SetFrameBorderMode(0);
   uPP_R4_SVD->GetXaxis()->SetTitle("ak R=0.4 Jet p_{T} (GeV/c)");
   uPP_R4_SVD->GetXaxis()->SetLabelFont(42);
   uPP_R4_SVD->GetXaxis()->SetLabelSize(0.035);
   uPP_R4_SVD->GetXaxis()->SetTitleSize(0.035);
   uPP_R4_SVD->GetXaxis()->SetTitleFont(42);
   uPP_R4_SVD->GetXaxis()->SetRangeUser(50,450);
   uPP_R4_SVD->GetYaxis()->SetTitle("#frac{d^{2}#sigma}{dp_{T} d#eta} nb");
   uPP_R4_SVD->GetYaxis()->SetLabelFont(42);
   uPP_R4_SVD->GetYaxis()->SetLabelSize(0.035);
   uPP_R4_SVD->GetYaxis()->SetTitleSize(0.035);
   uPP_R4_SVD->GetYaxis()->SetTitleFont(42);
   uPP_R4_SVD->GetZaxis()->SetLabelFont(42);
   uPP_R4_SVD->GetZaxis()->SetLabelSize(0.035);
   uPP_R4_SVD->GetZaxis()->SetTitleSize(0.035);
   uPP_R4_SVD->GetZaxis()->SetTitleFont(42);
      
   uPP_R4_SVD->Draw();
      
   TLegend *leg = new TLegend(0.4,0.65,0.6,0.85,NULL,"BRNDC");
   leg->SetBorderSize(0);
   leg->SetTextSize(0.04);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(10);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("NULL","","h");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(33);
   entry->SetMarkerSize(1);
   entry=leg->AddEntry("uPP_R4_SVD","CMS pp","p");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);

   ci = TColor::GetColor("#0000ff");
   entry->SetMarkerColor(ci);
   entry->SetMarkerStyle(24);
   entry->SetMarkerSize(1);
   leg->Draw();   

   TPaveText *pt = new TPaveText(0.4845652,0.94,0.5154348,0.995,"blNDC");
   pt->SetName("title");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetFillStyle(0);
   pt->SetTextFont(42);
   TText *text = pt->AddText(" ");
   pt->Draw();
   cCMS_pp->Modified();
   cCMS_pp->cd();
   cCMS_pp->SetSelected(cCMS_pp);
   cCMS_pp->SaveAs("Plots/CMSfit_spectra_pp.pdf"); 

   TCanvas *cATLAS_lin_pp = new TCanvas("cATLAS_lin_pp", "",0,0,1200,1000);
   cATLAS_lin_pp->Range(-3.725291e-06,-5.878322,500,3.279288);
   cATLAS_lin_pp->SetFillColor(0);
   cATLAS_lin_pp->SetBorderMode(0);
   cATLAS_lin_pp->SetBorderSize(2);
   cATLAS_lin_pp->SetFrameBorderMode(0);
   cATLAS_lin_pp->SetFrameBorderMode(0);
   cATLAS_lin_pp->SetLogy();
   cATLAS_lin_pp->SetLogx();
   hATLASpp->Draw();
   grae->Draw("ap,same");
   TLegend *leg = new TLegend(0.4,0.65,0.6,0.85,NULL,"BRNDC");
   leg->SetBorderSize(0);
   leg->SetTextSize(0.04);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(10);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("NULL","","h");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(62);
   entry=leg->AddEntry("/HepData/8719/d2x1y1","ATLAS pp","p");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(33);
   entry->SetMarkerSize(1);
   entry=leg->AddEntry("uPP_R4_SVD","CMS pp","p");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);

   ci = TColor::GetColor("#0000ff");
   entry->SetMarkerColor(ci);
   entry->SetMarkerStyle(24);
   entry->SetMarkerSize(1);
   leg->Draw();
   
   TPaveText *pt = new TPaveText(0.4845652,0.94,0.5154348,0.995,"blNDC");
   pt->SetName("title");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetFillStyle(0);
   pt->SetTextFont(42);
   TText *text = pt->AddText(" ");
   pt->Draw();
   cATLAS_lin_pp->Modified();
   cATLAS_lin_pp->cd();
   cATLAS_lin_pp->SetSelected(cATLAS_lin_pp);
   
//     for(int ic=0; ic<nfit; ic++){
//       uPP_R4_SVD->Fit("fitppCMS","IL","",60,FitEnd); //fit function    
// //      uPP_R4_SVD->Fit("fitppCMS","IL","",50,300); //fit function
//     } 
   
    hATLASpp->Draw();
   grae->Draw("ap,same");
   uPP_R4_SVD->Draw("same E1");
   leg->Draw();
   cATLAS_lin_pp->SaveAs("Plots/CMSfit_ATLASfit_spectra_loglog_pp.pdf");  

   fitppCMS->SetBit(TF1::kNotDraw);
   fitppCMS->SetLineColor(0);
   uPP_R4_SVD->SetBit(TF1::kNotDraw);




   TH1F *hFitRatioATLAS = (TH1F*)functionHist(fitppCMS,uPP_R4_SVD,"hFitRatioATLAS"); //clone fitRatioATLAS from fitppCMS
//   hFitRatioATLAS->SetLineColor(0);
   TH1F *hRatioATLAS = (TH1F*)uPP_R4_SVD->Clone("hRatioATLAS"); //clone histogram hRatio from h

   TH1F *hfunctionATLAS = (TH1F*)functionHist(fitppATLAS,uPP_R4_SVD,"hfunctionATLAS");
   hFitRatioATLAS->Divide(hfunctionATLAS);
   hFitRatioATLAS->SetMarkerColor(kRed); 
   hFitRatioATLAS->SetMarkerStyle(21);
   hFitRatioATLAS->SetMarkerSize(1.2);
   hFitRatioATLAS->SetLineColor(0);  

   TH1F *hfunctionATLASHist = (TH1F*)functionHist(fitppATLASHist,uPP_R4_SVD,"hfunctionATLASHist");
   TH1F *hRatioATLASHist = (TH1F*)uPP_R4_SVD->Clone("hRatioATLASHist"); //clone histogram hRatio from h
   hRatioATLASHist->Divide(hfunctionATLASHist);
   hRatioATLASHist->SetMarkerColor(kGreen+1); 
   hRatioATLASHist->SetMarkerStyle(22);
   hRatioATLASHist->SetMarkerSize(1.2);
   hRatioATLASHist->SetLineColor(0); 
      
//   hfunctionATLAS->Draw();
//   hATLASpp->Draw();
   hRatioATLAS->Divide(hfunctionATLAS);
   TCanvas *cRatio_pp = new TCanvas("cRatio_pp", "",0,0,1200,1000);
   gStyle->SetOptFit(1);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   cRatio_pp->Range(-50.00001,-6.302699,538.2353,2.631555);
   cRatio_pp->SetFillColor(0);
   cRatio_pp->SetBorderMode(0);
   cRatio_pp->SetBorderSize(0);
   cRatio_pp->SetTickx(1);
   cRatio_pp->SetTicky(1);
   cRatio_pp->SetLeftMargin(0.17);
   cRatio_pp->SetRightMargin(0.15);
   cRatio_pp->SetTopMargin(0.03);
   cRatio_pp->SetBottomMargin(0.15);
   cRatio_pp->SetFrameLineColor(0);
   cRatio_pp->SetFrameBorderMode(0);
   cRatio_pp->SetFrameLineColor(0);
   cRatio_pp->SetFrameBorderMode(0);   
   TH1F *hRatioBlank = new TH1F("hRatioBlank"," ",100,50,300);
   hRatioBlank->SetMinimum(0);
   hRatioBlank->SetMaximum(1.2);
   hRatioBlank->SetDirectory(0);
   hRatioBlank->SetStats(0);
   hRatioBlank->SetFillColor(1);
   hRatioBlank->SetFillStyle(0);
   hRatioBlank->SetLineStyle(0);
   hRatioBlank->SetMarkerStyle(20);
   hRatioBlank->SetMarkerSize(1.2);
   hRatioBlank->GetXaxis()->SetTitle("ak R=0.4 Jet p_{T} (GeV/c)");
   hRatioBlank->GetXaxis()->SetLabelFont(42);
   hRatioBlank->GetXaxis()->SetLabelOffset(0.01);
   hRatioBlank->GetXaxis()->SetLabelSize(0.045);
   hRatioBlank->GetXaxis()->SetTitleSize(0.055);
   hRatioBlank->GetXaxis()->SetTitleFont(42);
   hRatioBlank->GetYaxis()->SetTitle("CMS/ATLAS #frac{d^{2}#sigma}{dp_{T} d#eta} nb");
   hRatioBlank->GetYaxis()->SetLabelFont(42);
   hRatioBlank->GetYaxis()->SetLabelOffset(0.01);
   hRatioBlank->GetYaxis()->SetLabelSize(0.045);
   hRatioBlank->GetYaxis()->SetTitleSize(0.055);
   hRatioBlank->GetYaxis()->SetTitleOffset(1.5);
   hRatioBlank->GetYaxis()->SetTitleFont(42);
   hRatioBlank->GetZaxis()->SetLabelFont(42);
   hRatioBlank->GetZaxis()->SetLabelSize(0.045);
   hRatioBlank->GetZaxis()->SetTitleSize(0.035);
   hRatioBlank->GetZaxis()->SetTitleFont(42);
   hRatioBlank->Draw();   
//   hRatioATLAS->Scale(5.3/4);
//   hFitRatioATLAS->Scale(5.3/4);
   hFitRatioATLAS->Draw("ap,same");
   hRatioATLAS->Draw("ap,same");
   hRatioATLASHist->Draw("ap,same");
   
   cRatio_pp->SaveAs("Plots/CMSfit_ATLASfit_ratio_pp.pdf");
   

   
}