Beispiel #1
0
int Mbb_reg(int type_int){
	gROOT->ProcessLine(".x /afs/cern.ch/work/n/nchernya/setTDRStyle.C");
	

//	int type_int; //double  =0; single=1
	
	TString type;
	if (type_int==0) type = "_double";
	if (type_int==1) type = "_single";
	TString text_type;
	if (type_int==0) text_type = "DoubleB";
	if (type_int==1) text_type = "SingleB";

	const int num_ss = 1;	

//	TString s_names[num_ss] = {"VBFHToBB_M-125_13TeV_powheg"};
	TString s_names[num_ss] = {"vbf_76"};
	TString tex_s_names[num_ss] = {"VBF powheg, m(H) = 125 GeV"};

	TFile *file_s1 =  new TFile("../output_hist/v14/golden/skimmed_tree_analysis"+type+s_names[0]+"_v14_final_74cmssw_woweight.root");
	TH1F *hist_Mbb = (TH1F*)file_s1->Get("hMbb");
	TH1F *hist_Mbb_reg = (TH1F*)file_s1->Get("hMbb_regVBF");
	TH1F *hist_Mbb_reg_fsr = (TH1F*)file_s1->Get("hMbb_regVBF_fsr");
	TF1 *gaus = new TF1("gaus","gaus",95,140);
	gaus->SetLineColor(4);
	gaus->SetLineWidth(1);
	
	hist_Mbb->Sumw2(kFALSE);
	hist_Mbb_reg->Sumw2(kFALSE);
	hist_Mbb_reg_fsr->Sumw2(kFALSE);
	hist_Mbb->Sumw2(kFALSE);


	hist_Mbb->Fit(gaus,"R");
	Float_t Mbb_mean = gaus->GetParameter(1);
	Float_t Mbb_rms = gaus->GetParameter(2);
	hist_Mbb_reg->Sumw2(kFALSE);
	gaus->SetLineColor(2);
	hist_Mbb_reg->Fit(gaus,"R");
	Float_t Mbb_reg_mean = gaus->GetParameter(1);
	Float_t Mbb_reg_rms = gaus->GetParameter(2);
	hist_Mbb_reg_fsr->Sumw2(kFALSE);
	gaus->SetLineColor(8);
	hist_Mbb_reg_fsr->Fit(gaus,"R");
	Float_t Mbb_reg_fsr_mean = gaus->GetParameter(1);
	Float_t Mbb_reg_fsr_rms = gaus->GetParameter(2);

/////
	/*
	Float_t Mbb_mean = hist_Mbb->GetMean(1);
	Float_t Mbb_rms = hist_Mbb->GetRMS(1);
	Float_t Mbb_reg_mean = hist_Mbb_reg->GetMean(1);
	Float_t Mbb_reg_rms = hist_Mbb_reg->GetRMS(1);
	Float_t Mbb_reg_fsr_mean = hist_Mbb_reg_fsr->GetMean(1);
	Float_t Mbb_reg_fsr_rms = hist_Mbb_reg_fsr->GetRMS(1);
*/
/////



	TCanvas *c1 = new TCanvas();
	c1->SetBottomMargin(.15);
	c1->SetRightMargin(.25);
	c1->cd();
	TH1F *frame2 = new TH1F("frame2","",50,0.,230.);
	frame2->SetMinimum(0.);
   frame2->SetMaximum(hist_Mbb->GetMaximum()*1.6);
//	if (type_int==1)  frame2->SetMaximum(0.005);
   frame2->SetStats(0);
	frame2->SetYTitle("Events / 5 GeV");
	frame2->SetXTitle("M_{bb} (GeV)");	
	frame2->GetYaxis()->SetNdivisions(505);
	frame2->GetXaxis()->SetLabelSize(0.0);
  	frame2->GetXaxis()->SetTitleSize(0.05);
  	frame2->GetXaxis()->SetLabelSize(0.04);
	frame2->Draw();
	TLatex* tex = new TLatex(0.75,0.95,"13 TeV");
   tex->SetNDC();
	tex->SetTextAlign(35);
   tex->SetTextFont(42);
   tex->SetTextSize(0.035);
   tex->SetLineWidth(2);
   TLatex *tex1 = new TLatex(0.17,0.95,"CMS");
   tex1->SetNDC();
   tex1->SetTextAlign(20);
   tex1->SetTextFont(61);
   tex1->SetTextSize(0.04);
   tex1->SetLineWidth(2);
   TLatex* tex2 = new TLatex(0.25,0.89,"Work in progress");
   tex2->SetNDC();
   tex2->SetTextAlign(20);
   tex2->SetTextFont(52);
   tex2->SetTextSize(0.035);
  	tex2->SetLineWidth(2);	
	TLatex* tex_file = new TLatex(0.36,0.95,text_type);
   tex_file->SetNDC();
	tex_file->SetTextAlign(35);
   tex_file->SetTextFont(42);
   tex_file->SetTextSize(0.04);
   tex_file->SetLineWidth(2);	
	tex->Draw();
	tex1->Draw();
	tex2->Draw();
//	tex_file->Draw();
	hist_Mbb->SetLineColor(4);
	hist_Mbb->SetLineWidth(2);
	hist_Mbb_reg->SetLineColor(2);
	hist_Mbb_reg->SetLineWidth(2);
	hist_Mbb_reg_fsr->SetLineColor(8);
	hist_Mbb_reg_fsr->SetLineWidth(2);
	hist_Mbb_reg->Draw("same");
	hist_Mbb_reg_fsr->Draw("same");
	hist_Mbb->Draw("same");

	TString leg_Mbb0 = "Nominal";
	TString leg_Mbb_reg0 = "Regressed";
	TString leg_Mbb_reg_fsr0 = "Regressed+FSR";
	TString leg_Mbb = "";
	TString leg_Mbb_reg = "";
	TString leg_Mbb_reg_fsr = "";
	TString leg_mean = "Mean=";
	TString leg_rms = ", RMS=";
	TString leg_mean = "#mu=";
	TString leg_rms = ", #sigma=";
	TString leg_ratio = ",#sigma/#mu=";
	TString temp_str;
	temp_str.Form("%2.1f",Mbb_mean);
	leg_Mbb.Append(leg_mean);
	leg_Mbb.Append(temp_str);
	leg_Mbb.Append(leg_rms);
	temp_str.Form("%2.1f",Mbb_rms);
	leg_Mbb.Append(temp_str);
	leg_Mbb.Append(leg_ratio);
	temp_str.Form("%2.2f",Mbb_rms/Mbb_mean);
	leg_Mbb.Append(temp_str);
///////
	temp_str.Form("%2.1f",Mbb_reg_mean);
	leg_Mbb_reg.Append(leg_mean);
	leg_Mbb_reg.Append(temp_str);
	leg_Mbb_reg.Append(leg_rms);
	temp_str.Form("%2.1f",Mbb_reg_rms);
	leg_Mbb_reg.Append(temp_str);
	leg_Mbb_reg.Append(leg_ratio);
	temp_str.Form("%2.2f",Mbb_reg_rms/Mbb_reg_mean);
	leg_Mbb_reg.Append(temp_str);
////////
	temp_str.Form("%2.1f",Mbb_reg_fsr_mean);
	leg_Mbb_reg_fsr.Append(leg_mean);
	leg_Mbb_reg_fsr.Append(temp_str);
	leg_Mbb_reg_fsr.Append(leg_rms);
	temp_str.Form("%2.1f",Mbb_reg_fsr_rms);
	leg_Mbb_reg_fsr.Append(temp_str);
	leg_Mbb_reg_fsr.Append(leg_ratio);
	temp_str.Form("%2.2f",Mbb_reg_fsr_rms/Mbb_reg_fsr_mean);
	leg_Mbb_reg_fsr.Append(temp_str);

	TLegend *leg = new TLegend(0.77,0.6,0.92,0.9);
	leg->SetFillColor(0);
	leg->SetBorderSize(0);
	leg->SetTextFont(42);
	leg->SetTextSize(0.025);
	leg->AddEntry(hist_Mbb,text_type,"");
	leg->AddEntry(hist_Mbb,leg_Mbb0,"L");
	leg->AddEntry(hist_Mbb,leg_Mbb,"");
	leg->AddEntry(hist_Mbb_reg,leg_Mbb_reg0,"L");
	leg->AddEntry(hist_Mbb_reg,leg_Mbb_reg,"");
	leg->AddEntry(hist_Mbb_reg_fsr,leg_Mbb_reg_fsr0,"L");
	leg->AddEntry(hist_Mbb_reg_fsr,leg_Mbb_reg_fsr,"");

	leg->Draw("same");
	c1->Print("plots/v14Mbb_regressed"+type+"_cmssw76.png");
		


	return 0;
}
Beispiel #2
0
TF1 *fit(TTree *nt, TTree *ntMC, Double_t ptmin, Double_t ptmax, int isMC,bool isPbPb,TF1* &total,Float_t centmin, Float_t centmax)
{
	//cout<<cut.Data()<<endl;
	static Int_t count=0;
	count++;
	TCanvas* c= new TCanvas(Form("c%d",count),"",600,600);
	TH1D* h = new TH1D(Form("h%d",count),"",nbinsmasshisto,minhisto,maxhisto);

	//   TF1* f = new TF1(Form("f%d",count),"[0]*Gaus(x,[1],[2])/(sqrt(2*3.14159)*[2]) + [3]*Gaus(x,[4],[5])/(sqrt(2*3.14159)*[5]) + [6]*Gaus(x,[7],[8])/(sqrt(2*3.14159)*[8]) + [9]+[10]*x ");
	//   TF1* f = new TF1(Form("f%d",count),"[0]*Gaus(x,[1],[2])/(sqrt(2*3.14159)*[2]) + [3]*Gaus(x,[4],[5])/(sqrt(2*3.14159)*[5]) + [9]+[10]*x ");
	TF1* f = new TF1(Form("f%d",count),"[0]*TMath::Erf((x-[1])/[2]) + [0] + [9]+[10]*x ");

	if(isMC==1) nt->Project(Form("h%d",count),"Bmass",Form("%s*(%s&&Bpt>%f&&Bpt<%f)","1",seldata.Data(),ptmin,ptmax));   
	else nt->Project(Form("h%d",count),"Bmass",Form("(%s&&Bpt>%f&&Bpt<%f)",seldata.Data(),ptmin,ptmax));   

	clean0(h);

	h->Draw();
	f->SetParLimits(0, 1e-2, 1e4);
	f->SetParLimits(1, 5.02, 5.06);
	f->SetParLimits(2, 0.001, 0.1);

	f->SetParLimits(3, 1e-2, 1e4);
	f->SetParLimits(4, 5.06, 5.10);
	f->SetParLimits(5, 0.001, 0.1);

	f->SetParLimits(6, 0, 1e4);
	f->SetParLimits(7, 5.3, 5.4);
	f->SetParLimits(8, 0.001, 0.5);

	f->SetParLimits(9, 0, 1e5);
	f->SetParLimits(10, -500,  100);

	f->SetParameter(0,1e2);
	f->SetParameter(1,5.03);
	f->SetParameter(2,0.05);

	f->SetParameter(0,1e2);
	f->SetParameter(1,5.03);
	f->SetParameter(2,0.05);

	f->SetParameter(3,1e2);
	f->SetParameter(4,5.07);
	f->SetParameter(5,0.05);

	f->SetParameter(6,1e2);
	f->SetParameter(7,5.35);
	f->SetParameter(8,0.05);

	f->SetParameter(9,1e3);
	f->SetParameter(10,-1);

	//error fn
	f->SetParLimits(0, 1e1, 1e3);
	f->SetParLimits(1, 5., 5.3);
	f->SetParLimits(2, -10, 0);
	f->SetParameter(0,100);
	f->SetParameter(1,5.1);
	f->SetParameter(2,0);

	h->GetEntries();

	h->Fit(Form("f%d",count),"q","",minhisto,maxhisto);
	h->Fit(Form("f%d",count),"q","",minhisto,maxhisto);
	h->Fit(Form("f%d",count),"L q","",minhisto,maxhisto);
	h->Fit(Form("f%d",count),"L q","",minhisto,maxhisto);
	h->Fit(Form("f%d",count),"L q","",minhisto,maxhisto);
	h->Fit(Form("f%d",count),"L m","",minhisto,maxhisto);
	h->SetMarkerSize(0.8);
	h->SetMarkerStyle(20);

	TF1 *background = new TF1(Form("background%d",count),"[0]+[1]*x");
	background->SetParameter(0,f->GetParameter(9));
	background->SetParameter(1,f->GetParameter(10));
	background->SetLineColor(4);
	background->SetRange(minhisto,maxhisto);
	background->SetLineStyle(2);

	//   TF1 *mass = new TF1(Form("fmass%d",count),"[0]*Gaus(x,[1],[2])/(sqrt(2*3.14159)*[2]) + [3]*Gaus(x,[4],[5])/(sqrt(2*3.14159)*[5]) + [6]*Gaus(x,[7],[8])/(sqrt(2*3.14159)*[8])");
	//   mass->SetParameters(f->GetParameter(0),f->GetParameter(1),f->GetParameter(2),f->GetParameter(3),f->GetParameter(4),f->GetParameter(5),f->GetParameter(6),f->GetParameter(7),f->GetParameter(8));
	//TF1 *mass = new TF1(Form("fmass%d",count),"[0]*Gaus(x,[1],[2])/(sqrt(2*3.14159)*[2]) + [3]*Gaus(x,[4],[5])/(sqrt(2*3.14159)*[5])");
	//mass->SetParameters(f->GetParameter(0),f->GetParameter(1),f->GetParameter(2),f->GetParameter(3),f->GetParameter(4),f->GetParameter(5));
	TF1 *mass = new TF1(Form("fmass%d",count),"[0]*TMath::Erf((x-[1])/[2]) + [0]");
	mass->SetParameters(f->GetParameter(0),f->GetParameter(1),f->GetParameter(2));
	//mass->SetParError(0,f->GetParError(0));
	//mass->SetParError(1,f->GetParError(1));
	//mass->SetParError(2,f->GetParError(2));
	mass->SetLineColor(2);

	h->SetXTitle("m_{#mu#muK} (GeV/c^{2})");
	h->SetYTitle("Entries / (5 MeV/c^{2})");
	h->GetXaxis()->CenterTitle();
	h->GetYaxis()->CenterTitle();
	h->SetAxisRange(0,h->GetMaximum()*1.4*1.2,"Y");
	h->GetXaxis()->SetTitleOffset(1.3);
	h->GetYaxis()->SetTitleOffset(1.8);
	h->GetXaxis()->SetLabelOffset(0.007);
	h->GetYaxis()->SetLabelOffset(0.007);
	h->GetXaxis()->SetTitleSize(0.045);
	h->GetYaxis()->SetTitleSize(0.045);
	h->GetXaxis()->SetTitleFont(42);
	h->GetYaxis()->SetTitleFont(42);
	h->GetXaxis()->SetLabelFont(42);
	h->GetYaxis()->SetLabelFont(42);
	h->GetXaxis()->SetLabelSize(0.04);
	h->GetYaxis()->SetLabelSize(0.04);
	h->SetMarkerSize(0.8);
	h->SetMarkerStyle(20);
	h->SetStats(0);
	h->Draw("e");
	background->Draw("same");   
	mass->SetRange(minhisto,maxhisto);
	mass->Draw("same");
	mass->SetLineStyle(2);
	mass->SetFillStyle(3004);
	mass->SetFillColor(2);
	f->Draw("same");

	Double_t yield = mass->Integral(minhisto,maxhisto)/binwidthmass;
	Double_t yieldErr = mass->Integral(minhisto,maxhisto)/binwidthmass*mass->GetParError(0)/mass->GetParameter(0);

	TLegend* leg = new TLegend(0.65,0.58,0.82,0.88,NULL,"brNDC");
	leg->SetBorderSize(0);
	leg->SetTextSize(0.04);
	leg->SetTextFont(42);
	leg->SetFillStyle(0);
	leg->AddEntry(h,"Data","pl");
	leg->AddEntry(f,"Fit","l");
	leg->AddEntry(mass,"Peaking BG","f");
	leg->AddEntry(background,"Combinatorial","l");
	leg->Draw("same");

	TLatex* texCms = new TLatex(0.18,0.93, "#scale[1.25]{CMS} Preliminary");
	texCms->SetNDC();
	texCms->SetTextAlign(12);
	texCms->SetTextSize(0.04);
	texCms->SetTextFont(42);
	texCms->Draw();

	TLatex* texCol;
	if(collisionsystem=="pp"||collisionsystem=="PP") texCol= new TLatex(0.96,0.93, Form("%s #sqrt{s_{NN}} = 5.02 TeV","pp"));
	else texCol= new TLatex(0.96,0.93, Form("%s #sqrt{s_{NN}} = 5.02 TeV","PbPb"));
	texCol->SetNDC();
	texCol->SetTextAlign(32);
	texCol->SetTextSize(0.04);
	texCol->SetTextFont(42);
	texCol->Draw();

	TLatex* tex;

	tex = new TLatex(0.22,0.78,Form("%.1f < p_{T} < %.1f GeV/c",ptmin,ptmax));
	tex->SetNDC();
	tex->SetTextFont(42);
	tex->SetTextSize(0.04);
	tex->SetLineWidth(2);
	tex->Draw();

	if(centMax>0){
		TString texper="%";
		tex = new TLatex(0.22,0.71,Form("Centrality %.0f-%.0f%s",centMin,centMax,texper.Data()));//0.2612903,0.8425793
		tex->SetNDC();
		tex->SetTextColor(1);
		tex->SetTextFont(42);
		tex->SetTextSize(0.045);
		tex->SetLineWidth(2);
		tex->Draw();
	}

	tex = new TLatex(0.22,0.83,"|y| < 2.4");
	tex->SetNDC();
	tex->SetTextFont(42);
	tex->SetTextSize(0.04);
	tex->SetLineWidth(2);
	tex->Draw();

	total=f;

	h->Write();
	f->Write();
	if(!isPbPb) c->SaveAs(Form("plotNP/BMass%s_%d.pdf",collisionsystem.Data(),count));
	else c->SaveAs(Form("plotNP/BMass%s_%.0f_%.0f_%d.pdf",collisionsystem.Data(),centMin,centMax,count));
	return mass;
}
void myPlot(TH1D* h_DY100,
            TH1D* h_DY200,
            TH1D* h_DY400,
            TH1D* h_DY600,
            TH1D* h_TTbar,
            TH1D* h_WW,
            TH1D* h_WZ,
            TH1D* h_ZZ,
            TH1D* h_data0,
	    TH1D* h_data1,
            Double_t scaleDY100,
            Double_t scaleDY200,
            Double_t scaleDY400,
            Double_t scaleDY600,
            Double_t scaleTTbar,
            Double_t scaleWW,
            Double_t scaleWZ,
            Double_t scaleZZ,
	    TH1D* h_data,
	    TH1D* h_bkg){

  h_data->Reset();
  h_data->Add(h_data0);
  h_data->Add(h_data1);

  TH1D* h_DY = (TH1D*)h_DY100->Clone("h_DY");

  h_DY->Reset();
  h_DY->Add(h_DY100, scaleDY100);
  h_DY->Add(h_DY200, scaleDY200);
  h_DY->Add(h_DY400, scaleDY400);
  h_DY->Add(h_DY600, scaleDY600);
  h_DY->SetFillColor(kOrange-3);
  h_DY->SetLineColor(kBlack);

  h_TTbar->Scale(scaleTTbar);
  h_TTbar->SetFillColor(kGreen);
  h_TTbar->SetLineColor(kBlack);

  h_WW->Scale(scaleWW);
  h_WW->SetFillColor(kYellow);
  h_WW->SetLineColor(kBlack);

  h_WZ->Scale(scaleWZ);
  h_WZ->SetFillColor(kCyan);
  h_WZ->SetLineColor(kBlack);

  h_ZZ->Scale(scaleZZ);
  h_ZZ->SetFillColor(kPink);
  h_ZZ->SetLineColor(kBlack);

  h_bkg->Reset();
  h_bkg->Add(h_DY);
  h_bkg->Add(h_TTbar);
  h_bkg->Add(h_WW);
  h_bkg->Add(h_WZ);
  h_bkg->Add(h_ZZ);

  THStack *h_stack = new THStack("h_stack", "");

  h_stack->Add(h_DY);
  h_stack->Add(h_TTbar);
  h_stack->Add(h_WW);
  h_stack->Add(h_WZ);
  h_stack->Add(h_ZZ);

  h_data->SetLineColor(kBlack);
  h_data->SetMarkerStyle(8);
  h_data->SetMarkerSize(1.5);
  h_data->GetYaxis()->SetTitleOffset(1.3);
  h_data->GetXaxis()->SetTitle("");
  h_data->GetXaxis()->SetLabelOffset(999);
  h_data->GetXaxis()->SetLabelSize(0);

  if( h_data->GetMaximum() < h_stack->GetMaximum() ){
  
    h_stack->Draw("histe");
    h_stack->GetHistogram()->GetYaxis()->SetTitle("Event Numbers");
    h_stack->GetHistogram()->GetYaxis()->SetTitleSize(h_data->GetYaxis()->GetTitleSize());
    h_stack->GetHistogram()->GetYaxis()->SetLabelSize(h_data->GetYaxis()->GetLabelSize());
    h_stack->GetHistogram()->GetYaxis()->SetTitleOffset(1.3);
    h_stack->GetHistogram()->GetXaxis()->SetTickLength(0);
    h_stack->GetHistogram()->GetXaxis()->SetLabelOffset(999);
    h_data->Draw("elsame");
  
  }
    
  else{

    h_data->GetYaxis()->SetTitle("Event Numbers");
    h_data->Draw("el");
    h_stack->Draw("histesame");
    h_data->Draw("elsame");

  }
  
  TLegend *leg = new TLegend(0.73, 0.60, 0.90, 0.87);
  
  leg->SetBorderSize(0);
  leg->SetFillColor(0);
  leg->SetFillStyle(0);
  leg->SetTextSize(0.04);
    
  leg->AddEntry(h_DY, "DY+Jets", "f");
  leg->AddEntry(h_TTbar, "t#bar{t}", "f");
  leg->AddEntry(h_WW, "WW", "f");
  leg->AddEntry(h_WZ, "WZ", "f");
  leg->AddEntry(h_ZZ, "ZZ", "f");
  leg->AddEntry(h_data, "Data", "lp");
  leg->Draw();

  TLatex *lar = new TLatex();

  lar->SetNDC(kTRUE);
  lar->SetTextSize(0.04);
  lar->SetLineWidth(5);
  lar->DrawLatex(0.14, 0.94, "CMS preliminary 2015");
  lar->DrawLatex(0.63, 0.94, "L = 2.08 fb^{-1} at #sqrt{s} = 13 TeV");

}
Beispiel #4
0
void Polarization(){

    TGraph *gObs;
    TGraph *gExp;
    TGraph *gObsL;
    TGraph *gExpL;
    TGraph *gObsR;
    TGraph *gExpR;
    
    TFile *fc = TFile::Open("Limits2DHistograms_T2tt_postfit.root");
    TFile *fl = TFile::Open("Limits2DHistograms_T2tt_lefthanded_postfit.root");
    TFile *fr = TFile::Open("Limits2DHistograms_T2tt_righthanded_postfit.root");
    
    TGraph *g;
    fc->cd();
    g = (TGraph*)fc->Get("gObs");
    gObs = (TGraph*)g->Clone("Obs");
    g = (TGraph*)fc->Get("gExp");
    gExp = (TGraph*)g->Clone("Exp");
    fl->cd();
    g = (TGraph*)fl->Get("gObs_2");
    gObsL = (TGraph*)g->Clone("ObsL");
    g = (TGraph*)fl->Get("gExp_2");
    gExpL = (TGraph*)g->Clone("ExpL");
    fr->cd();
    g = (TGraph*)fr->Get("gObs");
    gObsR = (TGraph*)g->Clone("ObsR");
    g = (TGraph*)fr->Get("gExp");
    gExpR = (TGraph*)g->Clone("ExpR");
    
    gObs->SetLineWidth(4);
    gExp->SetLineWidth(4);
    gObsL->SetLineWidth(2);
    gExpL->SetLineWidth(2);
    gObsR->SetLineWidth(2);
    gExpR->SetLineWidth(2);
    gObs->SetLineStyle(1);
    gExp->SetLineStyle(7);
    gObsL->SetLineStyle(1);
    gExpL->SetLineStyle(7);
    gObsR->SetLineStyle(1);
    gExpR->SetLineStyle(7);
    gObs->SetLineColor(kBlack);
    gExp->SetLineColor(kBlack);
    gObsL->SetLineColor(kBlue);
    gExpL->SetLineColor(kBlue);
    gObsR->SetLineColor(kRed);
    gExpR->SetLineColor(kRed);
    if(killlowdiag){
    for( int i = gObs->GetN()-1; i>=0;--i){
        double x,y;
        gObs->GetPoint(i,x,y);
        if(x-y<172.5) gObs->RemovePoint(i);
    }
    for( int i = gExp->GetN()-1; i>=0;--i){
        double x,y;
        gExp->GetPoint(i,x,y);
        if(x-y<172.5) gExp->RemovePoint(i);
    }
    }
    for( int i = gObsL->GetN()-1; i>=0;--i){
        double x,y;
        gObsL->GetPoint(i,x,y);
        if(x-y<172.5) gObsL->RemovePoint(i);
    }
    for( int i = gObsR->GetN()-1; i>=0;--i){
        double x,y;
        gObsR->GetPoint(i,x,y);
        if(x-y<172.5) gObsR->RemovePoint(i);
    }
    for( int i = gExpL->GetN()-1; i>=0;--i){
        double x,y;
        gExpL->GetPoint(i,x,y);
        if(x-y<172.5) gExpL->RemovePoint(i);
    }
    for( int i = gExpR->GetN()-1; i>=0;--i){
        double x,y;
        gExpR->GetPoint(i,x,y);
        if(x-y<172.5) gExpR->RemovePoint(i);
    }

    
   TCanvas *c1 = new TCanvas("c1", "c1",50,50,600,600);
   gStyle->SetOptFit(1);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   gStyle->SetErrorX(0.5); 
   //c1->Range(-6.311689,-1.891383,28.75325,4.56342);
   c1->SetFillColor(0);
   c1->SetBorderMode(0);
   c1->SetBorderSize(2);
   //c1->SetLogy();
   c1->SetTickx(1);
   c1->SetTicky(1);
   c1->SetLeftMargin(0.15);
   c1->SetRightMargin(0.05);
   c1->SetTopMargin(0.07);
   c1->SetBottomMargin(0.15);
   c1->SetFrameFillStyle(0);
   c1->SetFrameBorderMode(0);
   c1->SetFrameFillStyle(0);
   c1->SetFrameBorderMode(0);
   gStyle->SetHatchesLineWidth(0);

   TH1F *hSum = new TH1F("hSum","",10,150,950);
   hSum->SetMinimum(0.);
   hSum->SetMaximum(550);
   hSum->SetDirectory(0);
   hSum->SetStats(0);
    hSum->Draw();
    hSum->GetYaxis()->SetRangeUser(0,500);
    hSum->GetXaxis()->SetRangeUser(150,950);

   Int_t ci;   // for color index setting
   ci = TColor::GetColor("#000099");
   hSum->SetLineColor(ci);
   hSum->SetLineStyle(0);
   hSum->SetMarkerStyle(20);
   hSum->GetXaxis()->SetTitle("m_{#tilde{t}} [GeV]");
   //hSum->GetXaxis()->SetBit(TAxis::kLabelsVert);
   hSum->GetXaxis()->SetLabelFont(42);
   //hSum->GetXaxis()->SetLabelOffset(0.005);
   hSum->GetXaxis()->SetLabelSize(0.035);
   hSum->GetXaxis()->SetTitleSize(0.06);
   hSum->GetXaxis()->SetTitleOffset(1.2);
   hSum->GetXaxis()->SetTitleFont(42);
   hSum->GetYaxis()->SetTitle("m_{#tilde{#chi}}_{1}^{0} [GeV]");
   hSum->GetYaxis()->SetLabelFont(42);
   //hSum->GetYaxis()->SetLabelOffset(0.007);
   hSum->GetYaxis()->SetLabelSize(0.035);
   hSum->GetYaxis()->SetTitleSize(0.05);
   hSum->GetYaxis()->SetTitleOffset(1.3);
   hSum->GetYaxis()->SetTitleFont(42);
    
    //TLegend *leg = new TLegend(0.4992416,0.4811189,0.898906,0.7503497,NULL,"brNDC");
    //TLegend *leg = new TLegend(0.4992416,0.4811189,0.698906,0.7503497,NULL,"brNDC");
    //TLegend *leg = new TLegend(0.6992416,0.2811189,0.898906,0.4503497,NULL,"brNDC");
    //TLegend *leg = new TLegend(0.6992416,0.3311189,0.898906,0.7903497,NULL,"brNDC");
    //TLegend *leg = new TLegend(0.7582416,0.4211189,0.912,0.8043497,NULL,"brNDC");
    TLegend *legE = new TLegend(0.51,0.675,0.81,0.855,NULL,"brNDC");
    //leg-> SetNColumns(2);
    legE->SetBorderSize(0);
    legE->SetTextSize(0.04);
    legE->SetTextFont(42);
    legE->SetLineColor(1);
    legE->SetLineStyle(1);
    legE->SetLineWidth(2);
    legE->SetFillColor(0);
    legE->SetFillStyle(1001);
    legE->SetHeader("Expected");
    legE->AddEntry(gExp, "unpolarized","l");
    legE->AddEntry(gExpR, "right-handed","l");
    legE->AddEntry(gExpL, "left-handed","l");
    
    TLegend *legO = new TLegend(0.175,0.675,0.50,0.855,NULL,"brNDC");
    //legO-> SetNColumns(2);
    legO->SetBorderSize(0);
    legO->SetTextSize(0.04);
    legO->SetTextFont(42);
    legO->SetLineColor(1);
    legO->SetLineStyle(1);
    legO->SetLineWidth(2);
    legO->SetFillColor(0);
    legO->SetFillStyle(1001);
    legO->SetHeader("Observed");
    legO->AddEntry(gObs, "unpolarized","l");
    legO->AddEntry(gObsR, "right-handed","l");
    legO->AddEntry(gObsL, "left-handed","l");
    
    
    TGraph* graphWhite = new TGraph(5);
    graphWhite->SetName("white");
    graphWhite->SetTitle("white");
    graphWhite->SetFillColor(kWhite);
    graphWhite->SetFillStyle(1001);
    graphWhite->SetLineColor(kBlack);
    graphWhite->SetLineStyle(1);
    graphWhite->SetLineWidth(3);
    graphWhite->SetPoint(0,150, 500);
    graphWhite->SetPoint(1,950, 500);
    graphWhite->SetPoint(2,950, 500*0.6666666667);
    graphWhite->SetPoint(3,150, 500*0.6666666667);
    graphWhite->SetPoint(4,150, 500);
    
    Float_t diagX[4] = {175.+25.,175.+25.+5000,175.-25.+5000,175.-25.};
    Float_t diagY[4] = {0,5000,5000,0};
    TGraph *gdiagonal = new TGraph(4, diagX, diagY);
    gdiagonal->SetName("MtopDiagonal");
    gdiagonal->SetFillColor(kWhite);
    //#gdiagonal->SetFillColor(18);
    TLine* ldiagonal = new TLine(175,0.,650-25.,450);
    //TLine* ldiagonal = new TLine(175.,25,175+500,500);
    ldiagonal->SetLineColor(kGray);
    ldiagonal->SetLineStyle(2);
    TLatex* tdiagonal = new TLatex(400-2.5, 400-172.5,"m_{#tilde{t}} = m_{t} + m_{#tilde{#chi}_{1}^{0}}");
    //tdiagonal->SetTextAngle(TMath::RadToDeg()*TMath::ATan(float(800)/float(500)));
    tdiagonal->SetTextAngle(56.31);
    tdiagonal->SetTextColor(kGray+2);
    tdiagonal->SetTextAlign(11);
    tdiagonal->SetTextSize(0.025);

    TLine* l2 = new TLine(150,75,585,500);
    l2->SetLineColor(kGray);
    l2->SetLineStyle(2);
    if(killlowdiag){
        l2->SetX1(200); l2->SetY1(0); l2->SetX2(600); l2->SetY2(400);
    }
    TLatex *t2 = new TLatex(300, 300-72.5,"m_{#tilde{t}} = m_{W} + m_{#tilde{#chi}_{1}^{0}}");
    //t2->SetTextAngle(TMath::RadToDeg()*TMath::ATan(float(800)/float(500)));
    t2->SetTextAngle(56.31);
    t2->SetTextColor(kGray+2);
    t2->SetTextAlign(11);
    t2->SetTextSize(0.025);

    hSum->Draw("axis");
    
    gExpR->Draw("c");
    gExpL->Draw("c");
    gExp->Draw("c");
    gObsR->Draw("c");
    gObsL->Draw("c");
    gObs->Draw("c");

    gdiagonal->Draw("FSAME");
    ldiagonal->Draw("LSAME");
    l2->Draw();
    if(!killlowdiag) t2->Draw();
    tdiagonal->Draw("SAME");
    graphWhite->Draw("FSAME");
    graphWhite->Draw("LSAME");

    legE->Draw();
    legO->Draw();
    
    TLatex* textModelLabel= new TLatex(0.175,0.92,"pp #rightarrow #tilde{t} #tilde{t}*, #tilde{t} #rightarrow t #tilde{#chi}^{0}_{1}  NLO+NLL exclusion");
    //TLatex* textModelLabel= new TLatex(0.175,0.92,"pp #rightarrow #tilde{t} #tilde{t}*, #tilde{t} #rightarrow t #tilde{#chi}^{0}_{1}");
    //TLatex* textModelLabel= new TLatex(0.175,0.92,"#tilde{#chi} ");
    textModelLabel->SetNDC();
    textModelLabel->SetTextAlign(13);
    textModelLabel->SetTextFont(42);
    textModelLabel->SetTextSize(0.042);
    textModelLabel->Draw();
    
    //final CMS style
    TLatex *tLumi = new TLatex(0.95,0.944,"2.3 fb^{-1} (13 TeV)");
    tLumi->SetNDC();
    tLumi->SetTextAlign(31);
    tLumi->SetTextFont(42);
    tLumi->SetTextSize(0.042);
    tLumi->SetLineWidth(2);
    tLumi->Draw();
    TLatex *tCMS = new TLatex(0.152,0.944,"CMS");
    tCMS->SetNDC();
    tCMS->SetTextAlign(11);
    tCMS->SetTextFont(61);
    tCMS->SetTextSize(0.0525);
    tCMS->SetLineWidth(2);
    tCMS->Draw();
    TLatex *tPrel = new TLatex(0.265,0.944,"Preliminary");
    tPrel->SetNDC();
    tPrel->SetTextAlign(11);
    tPrel->SetTextFont(52);
    tPrel->SetTextSize(0.042);
    tPrel->SetLineWidth(2);
    tPrel->Draw();
    
   c1->Modified();
   c1->cd();
    c1->Update();
   c1->SetSelected(c1);

}
Beispiel #5
0
void SignfificanceT2tt(bool pval, int exp=0){


    TFile *f = TFile::Open("Significances2DHistograms_T2tt.root");
    TH2F *h;
    if(pval){
        if(exp==0) h = (TH2F*)f->Get("hpObs");
        else if(exp==1) h = (TH2F*)f->Get("hpExpPosteriori");
        else if(exp==2) h = (TH2F*)f->Get("hpExpPriori");
    }
    else {
        if(exp==0) h = (TH2F*)f->Get("hObs");
        else if(exp==1) h = (TH2F*)f->Get("hExpPosteriori");
        else if(exp==2) h = (TH2F*)f->Get("hExpPriori");
    }
    h->GetXaxis()->SetTitle("m_{#tilde{t}} [GeV]");
    h->GetXaxis()->SetLabelFont(42);
    h->GetXaxis()->SetLabelSize(0.035);
    h->GetXaxis()->SetTitleSize(0.05);
    h->GetXaxis()->SetTitleOffset(1.2);
    h->GetXaxis()->SetTitleFont(42);
    h->GetYaxis()->SetTitle("m_{#tilde{#chi}_{1}^{0}} [GeV]");
    h->GetYaxis()->SetLabelFont(42);
    h->GetYaxis()->SetLabelSize(0.035);
    h->GetYaxis()->SetTitleSize(0.05);
    h->GetYaxis()->SetTitleOffset(1.35);
    h->GetYaxis()->SetTitleFont(42);
    double maximum = h->GetMaximum();
    double minimum = h->GetMinimum();
    double sigmin = 99; int sigminx=-1; int sigminy=-1; if(pval) sigmin = -99;
    h->GetZaxis()->SetRangeUser(minimum,maximum);
    for(int x = 1; x<=h->GetNbinsX();++x){
        for(int y = 1; y<=h->GetNbinsX();++y){
            if(!pval&&h->GetBinContent(x,y)<sigmin){ sigmin =h->GetBinContent(x,y); sigminx = x; sigminy = y; }
            if( pval&&h->GetBinContent(x,y)>sigmin){ sigmin =h->GetBinContent(x,y); sigminx = x; sigminy = y; }
            if(!pval&&h->GetXaxis()->GetBinLowEdge(x)<h->GetYaxis()->GetBinLowEdge(y)+75) h->SetBinContent(x,y,-999);
            if(h->GetXaxis()->GetBinLowEdge(x)<374) continue;
            if(h->GetXaxis()->GetBinLowEdge(x)>424) continue;
            if(h->GetYaxis()->GetBinLowEdge(y)<199) continue;
            if(h->GetYaxis()->GetBinLowEdge(y)>249) continue;
            if(!pval&&h->GetBinContent(x,y)>0.3) h->SetBinContent(x,y,0.05);
        }
    }
    h->GetZaxis()->SetRangeUser(minimum,maximum);
    if(!pval) cout << "minimal significance " << sigmin << " at " << h->GetXaxis()->GetBinLowEdge(sigminx) << "-" << h->GetYaxis()->GetBinLowEdge(sigminy) << endl;
    else cout << "maximal p- value " << sigmin << " at " << h->GetXaxis()->GetBinLowEdge(sigminx) << "-" << h->GetYaxis()->GetBinLowEdge(sigminy) << endl;
    
   TCanvas *c1 = new TCanvas("c1", "c1",50,50,600,600);
   gStyle->SetOptFit(1);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   gStyle->SetErrorX(0.5); 
   //c1->Range(-6.311689,-1.891383,28.75325,4.56342);
   c1->SetFillColor(0);
   c1->SetBorderMode(0);
   c1->SetBorderSize(2);
   //c1->SetLogy();
   c1->SetTickx(1);
   c1->SetTicky(1);
   c1->SetLeftMargin(0.15);
//   c1->SetRightMargin(0.05);
    c1->SetRightMargin(0.15);
   c1->SetTopMargin(0.07);
   c1->SetBottomMargin(0.15);
   c1->SetFrameFillStyle(0);
   c1->SetFrameBorderMode(0);
   c1->SetFrameFillStyle(0);
   c1->SetFrameBorderMode(0);
   gStyle->SetHatchesLineWidth(0);

   TH1F *hSum = new TH1F("hSum","",10,100,900);
   hSum->SetMinimum(0.);
   hSum->SetMaximum(550);
   hSum->SetDirectory(0);
   hSum->SetStats(0);
    hSum->Draw();
    hSum->GetYaxis()->SetRangeUser(0,500);
    hSum->GetXaxis()->SetRangeUser(100,900);

   Int_t ci;   // for color index setting
   ci = TColor::GetColor("#000099");
   hSum->SetLineColor(ci);
   hSum->SetLineStyle(0);
   hSum->SetMarkerStyle(20);
   hSum->GetXaxis()->SetTitle("m_{#tilde{t}} [GeV]");
   //hSum->GetXaxis()->SetBit(TAxis::kLabelsVert);
   hSum->GetXaxis()->SetLabelFont(42);
   //hSum->GetXaxis()->SetLabelOffset(0.005);
   hSum->GetXaxis()->SetLabelSize(0.035);
   hSum->GetXaxis()->SetTitleSize(0.06);
   hSum->GetXaxis()->SetTitleOffset(1.2);
   hSum->GetXaxis()->SetTitleFont(42);
   hSum->GetYaxis()->SetTitle("m_{#tilde{#chi}}_{1}^{0} [GeV]");
   hSum->GetYaxis()->SetLabelFont(42);
   //hSum->GetYaxis()->SetLabelOffset(0.007);
   hSum->GetYaxis()->SetLabelSize(0.035);
   hSum->GetYaxis()->SetTitleSize(0.05);
   hSum->GetYaxis()->SetTitleOffset(1.3);
   hSum->GetYaxis()->SetTitleFont(42);
    
   /*
    TLegend *legO = new TLegend(0.175,0.675,0.50,0.855,NULL,"brNDC");
    //legO-> SetNColumns(2);
    legO->SetBorderSize(0);
    legO->SetTextSize(0.04);
    legO->SetTextFont(42);
    legO->SetLineColor(1);
    legO->SetLineStyle(1);
    legO->SetLineWidth(2);
    legO->SetFillColor(0);
    legO->SetFillStyle(1001);
    legO->SetHeader("Observed");
    legO->AddEntry(gObs, "unpolarized","l");
    legO->AddEntry(gObsR, "right-handed","l");
    legO->AddEntry(gObsL, "left-handed","l");
    */
    
    TGraph* graphWhite = new TGraph(5);
    graphWhite->SetName("white");
    graphWhite->SetTitle("white");
    graphWhite->SetFillColor(kWhite);
    graphWhite->SetFillStyle(1001);
    graphWhite->SetLineColor(kBlack);
    graphWhite->SetLineStyle(1);
    graphWhite->SetLineWidth(3);
    graphWhite->SetPoint(0,100, 500);
    graphWhite->SetPoint(1,900, 500);
    graphWhite->SetPoint(2,900, 500*0.75);
    graphWhite->SetPoint(3,100, 500*0.75);
    graphWhite->SetPoint(4,100, 500);
    
    Float_t diagX[4] = {175.+25.,175.+25.+5000,175.-25.+5000,175.-25.};
    Float_t diagY[4] = {0,5000,5000,0};
    TGraph *gdiagonal = new TGraph(4, diagX, diagY);
    gdiagonal->SetName("MtopDiagonal");
    gdiagonal->SetFillColor(kWhite);
    //#gdiagonal->SetFillColor(18);
    TLine* ldiagonal = new TLine(175,0.,650-25.,450);
    //TLine* ldiagonal = new TLine(175.,25,175+500,500);
    ldiagonal->SetLineColor(kGray);
    ldiagonal->SetLineStyle(2);
    TLatex* tdiagonal = new TLatex(400-2.5, 400-172.5,"m_{#tilde{t}} = m_{t} + m_{#tilde{#chi}_{1}^{0}}");
    //tdiagonal->SetTextAngle(TMath::RadToDeg()*TMath::ATan(float(800)/float(500)));
    tdiagonal->SetTextAngle(56.31);
    tdiagonal->SetTextColor(kGray+2);
    tdiagonal->SetTextAlign(11);
    tdiagonal->SetTextSize(0.025);

    TLine* l2 = new TLine(150,75,585,500);
    l2->SetLineColor(kGray);
    l2->SetLineStyle(2);
//    if(killlowdiag){
//        l2->SetX1(200); l2->SetY1(0); l2->SetX2(600); l2->SetY2(400);
//    }
    TLatex *t2 = new TLatex(300, 300-72.5,"m_{#tilde{t}} = m_{W} + m_{#tilde{#chi}_{1}^{0}}");
    //t2->SetTextAngle(TMath::RadToDeg()*TMath::ATan(float(800)/float(500)));
    t2->SetTextAngle(56.31);
    t2->SetTextColor(kGray+2);
    t2->SetTextAlign(11);
    t2->SetTextSize(0.025);
    
    


    hSum->Draw("axis");
    h->Draw("COLZsame");

    gdiagonal->Draw("FSAME");
    ldiagonal->Draw("LSAME");
    l2->Draw();
//    if(!killlowdiag) t2->Draw();
    tdiagonal->Draw("SAME");
    graphWhite->Draw("FSAME");
    graphWhite->Draw("LSAME");

    string textstring = "observed";
    if(exp!=0) textstring = "expected";
    TLatex* textOE= new TLatex(0.175,0.715,textstring.c_str() );
    textOE->SetNDC();
    textOE->SetTextAlign(13);
    textOE->SetTextFont(42);
    textOE->SetTextSize(0.042);
    textOE->Draw();
    

    TLatex* textModelLabel= new TLatex(0.175,0.92,"pp #rightarrow #tilde{t} #tilde{t}*, #tilde{t} #rightarrow t #tilde{#chi}^{0}_{1}");
    //TLatex* textModelLabel= new TLatex(0.175,0.92,"pp #rightarrow #tilde{t} #tilde{t}*, #tilde{t} #rightarrow t #tilde{#chi}^{0}_{1}");
    //TLatex* textModelLabel= new TLatex(0.175,0.92,"#tilde{#chi} ");
    textModelLabel->SetNDC();
    textModelLabel->SetTextAlign(13);
    textModelLabel->SetTextFont(42);
    textModelLabel->SetTextSize(0.042);
    textModelLabel->Draw();
    TLatex* textlLabel= new TLatex(0.175,0.85,"NLO+NLL significance");
    textlLabel->SetNDC();
    textlLabel->SetTextAlign(13);
    textlLabel->SetTextFont(42);
    textlLabel->SetTextSize(0.042);
    textlLabel->Draw();
    
    string psig = "significance [#sigma]";
    if(pval) psig = "p-value";
    TLatex * ztex = new TLatex(0.985,0.92,psig.c_str() );
    ztex->SetNDC();
    ztex->SetTextAlign(31);
    ztex->SetTextFont(42);
    ztex->SetTextSize(0.045);
    ztex->SetTextAngle(90);
    ztex->SetLineWidth(2);
    ztex->Draw();
    
    //final CMS style
    TLatex *tLumi = new TLatex(0.81,0.944,"2.3 fb^{-1} (13 TeV)");
    tLumi->SetNDC();
    tLumi->SetTextAlign(31);
    tLumi->SetTextFont(42);
    tLumi->SetTextSize(0.042);
    tLumi->SetLineWidth(2);
    tLumi->Draw();
    TLatex *tCMS = new TLatex(0.152,0.944,"CMS");
    tCMS->SetNDC();
    tCMS->SetTextAlign(11);
    tCMS->SetTextFont(61);
    tCMS->SetTextSize(0.0525);
    tCMS->SetLineWidth(2);
    tCMS->Draw();
    TLatex *tPrel = new TLatex(0.265,0.944,"Preliminary");
    tPrel->SetNDC();
    tPrel->SetTextAlign(11);
    tPrel->SetTextFont(52);
    tPrel->SetTextSize(0.042);
    tPrel->SetLineWidth(2);
    tPrel->Draw();
    
   c1->Modified();
   c1->cd();
    c1->Update();
   c1->SetSelected(c1);

}
Beispiel #6
0
void postprocess(TCanvas* c2, const char* name, Int_t rWrite, Int_t rPerformance,const char* system) {
    if (rPerformance){
        TLatex *alice = new TLatex(0.22,0.57,"Pb-Pb #sqrt{s_{NN}} = 2.76 TeV");
        alice->SetNDC();
        alice->SetTextColor(myDarkRed);
        //    alice->SetTextFont(42);
        alice->SetTextSize(0.05);
        alice->SetLineWidth(2);
        alice->Draw();

        TLatex *alice2 = new TLatex(0.62,0.41,"LHC10h - Pass2");
        alice2->SetNDC();
        alice2->SetTextColor(myDarkRed);
        //    alice->SetTextFont(42);
        alice2->SetTextSize(0.05);
        alice2->SetLineWidth(2);
        // alice2->Draw();

        TDatime now;
        int iDate = now.GetDate();
        int iYear=iDate/10000;
        int iMonth=(iDate%10000)/100;
        int iDay=iDate%100;
        char* cMonth[12]={"Jan","Feb","Mar","Apr","May","Jun",
                          "Jul","Aug","Sep","Oct","Nov","Dec"};
        char cStamp1[25],cStamp2[25];
        sprintf(cStamp1,"%i %s %i",iDay, cMonth[iMonth-1], iYear);
        sprintf(cStamp2,"%i/%.2d/%i",iDay, iMonth, iYear);


        TText *date = new TText(0.67,0.48,cStamp2);
        date->SetNDC();
        date->SetTextFont(42);
        date->SetTextSize(0.04);
        date->Draw();

//                 //Acquire canvas proportions
//                 Double_t AliLogo_LowX = 0.67;
//                 Double_t AliLogo_LowY = 0.53;
//                 Double_t AliLogo_Height = 0.22;
//                 //ALICE logo is a png file that is 821x798 pixels->should be wider than a square
//                 Double_t AliLogo_Width  = (821./798.) * AliLogo_Height * gPad->GetWh() / gPad->GetWw();

//                 TPad *myPadLogo = new TPad("myPadLogo", "Pad for ALICE Logo",AliLogo_LowX,AliLogo_LowY,AliLogo_LowX+AliLogo_Width,AliLogo_LowY+AliLogo_Height);
//                 //    myPadLogo->SetFillColor(2); // color to first figure out where is the pad then comment !
//                 myPadSetUp(myPadLogo,0,0,0,0);
//                 //myPadLogo->SetFixedAspectRatio(1);
//                 myPadLogo->Draw();
//                 myPadLogo->cd();
// //                TASImage *myAliceLogo = new TASImage("alice_performance.png");
//                 TASImage *myAliceLogo = new TASImage("alice_performance.eps");
// //    TASImage *myAliceLogo = new TASImage("alice_logo_transparent.png");
//                 myAliceLogo->Draw();

        DrawALICELogo(0,0.65,0.52,0.8,0.8);


    }

    if (rWrite == 1){
        c2->SaveAs(Form("%s_%s.png",name,system));
        //}
        //if (rWrite == 2)
        c2->SaveAs(Form("%s.eps",name));
    }
}
Beispiel #7
0
TF1* fit(Double_t ptmin, Double_t ptmax)
{
  TCanvas* c = new TCanvas(Form("c_%.0f_%.0f",ptmin,ptmax),"",600,600);
  TFile* infile = new TFile(Form("%s_%s_%.0f_%.0f.root",infname.Data(),collisionsystem.Data(),ptmin,ptmax));
  TH1D* h = (TH1D*)infile->Get("h");                    h->SetName(Form("h_%.0f_%.0f",ptmin,ptmax));
  TH1D* hMCSignal = (TH1D*)infile->Get("hMCSignal");    hMCSignal->SetName(Form("hMCSignal_%.0f_%.0f",ptmin,ptmax));
  TH1D* hMCSwapped = (TH1D*)infile->Get("hMCSwapped");  hMCSwapped->SetName(Form("hMCSwapped_%.0f_%.0f",ptmin,ptmax));
  TF1* f = new TF1(Form("f_%.0f_%.0f",ptmin,ptmax),"[0]*([7]*([9]*Gaus(x,[1],[2])/(sqrt(2*3.14159)*[2])+(1-[9])*Gaus(x,[1],[10])/(sqrt(2*3.14159)*[10]))+(1-[7])*Gaus(x,[1],[8])/(sqrt(2*3.14159)*[8]))+[3]*exp([4]*x)", 1.7, 2.0);

  f->SetParLimits(10,0.001,0.05);
  f->SetParLimits(2,0.01,0.1);
  f->SetParLimits(8,0.02,0.2);
  f->SetParLimits(7,0,1);
  f->SetParLimits(9,0,1);
  
  f->SetParameter(0,setparam0);
  f->SetParameter(1,setparam1);
  f->SetParameter(2,setparam2);
  f->SetParameter(10,setparam10);
  f->SetParameter(9,setparam9);

  f->FixParameter(8,setparam8);
  f->FixParameter(7,1);
  f->FixParameter(1,fixparam1);
  f->FixParameter(3,0);
  f->FixParameter(4,0);
  h->GetEntries();
  
  hMCSignal->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"q","",minhisto,maxhisto);
  hMCSignal->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"q","",minhisto,maxhisto);
  f->ReleaseParameter(1);
  hMCSignal->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"L q","",minhisto,maxhisto);
  hMCSignal->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"L q","",minhisto,maxhisto);
  hMCSignal->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"L m","",minhisto,maxhisto);
  
  f->FixParameter(1,f->GetParameter(1));
  f->FixParameter(2,f->GetParameter(2));
  f->FixParameter(10,f->GetParameter(10));
  f->FixParameter(9,f->GetParameter(9));
  f->FixParameter(7,0);
  f->ReleaseParameter(8);
  f->SetParameter(8,setparam8);
  
  hMCSwapped->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"L q","",minhisto,maxhisto);
  hMCSwapped->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"L q","",minhisto,maxhisto);
  hMCSwapped->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"L q","",minhisto,maxhisto);
  hMCSwapped->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"L m","",minhisto,maxhisto);
  
  f->SetParLimits(0,0,1.e+6);
  f->FixParameter(7,hMCSignal->Integral(0,1000)/(hMCSwapped->Integral(0,1000)+hMCSignal->Integral(0,1000)));
  f->FixParameter(8,f->GetParameter(8));
  f->ReleaseParameter(3);
  f->ReleaseParameter(4);
  f->SetParLimits(3,0,1.e+10);
  f->SetParameter(3,1.e+3);

  f->SetLineColor(kRed);
  
  h->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"q","",minhisto,maxhisto);
  h->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"q","",minhisto,maxhisto);
  f->ReleaseParameter(1);
  f->SetParLimits(1,1.85,1.90);
  //f->ReleaseParameter(2);                                     // you need to release these two parameters if you want to perform studies on the sigma shape
  //f->ReleaseParameter(10);                                   // you need to release these two parameters if you want to perform studies on the sigma shape
  h->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"L q","",minhisto,maxhisto);
  h->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"L q","",minhisto,maxhisto);
  h->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"L q","",minhisto,maxhisto);
  h->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"L m","",minhisto,maxhisto);
  
  TF1* background = new TF1(Form("background_%.0f_%.0f",ptmin,ptmax),"[0]*exp([1]*x)");
  background->SetParameter(0,f->GetParameter(3));
  background->SetParameter(1,f->GetParameter(4));
  background->SetLineColor(4);
  background->SetRange(minhisto,maxhisto);
  background->SetLineStyle(2);
  
  TF1* mass = new TF1(Form("fmass_%.0f_%.0f",ptmin,ptmax),"[0]*([3]*([4]*Gaus(x,[1],[2])/(sqrt(2*3.14159)*[2])+(1-[4])*Gaus(x,[1],[5])/(sqrt(2*3.14159)*[5])))");
  mass->SetParameters(f->GetParameter(0),f->GetParameter(1),f->GetParameter(2),f->GetParameter(7),f->GetParameter(9),f->GetParameter(10));
  mass->SetParError(0,f->GetParError(0));
  mass->SetParError(1,f->GetParError(1));
  mass->SetParError(2,f->GetParError(2));
  mass->SetParError(3,f->GetParError(7));
  mass->SetParError(4,f->GetParError(9));
  mass->SetParError(5,f->GetParError(10));
  mass->SetFillColor(kOrange-3);
  mass->SetFillStyle(3002);
  mass->SetLineColor(kOrange-3);
  mass->SetLineWidth(3);
  mass->SetLineStyle(2);
  
  TF1* massSwap = new TF1(Form("fmassSwap_%.0f_%.0f",ptmin,ptmax),"[0]*(1-[2])*Gaus(x,[1],[3])/(sqrt(2*3.14159)*[3])");
  massSwap->SetParameters(f->GetParameter(0),f->GetParameter(1),f->GetParameter(7),f->GetParameter(8));
  massSwap->SetParError(0,f->GetParError(0));
  massSwap->SetParError(1,f->GetParError(1));
  massSwap->SetParError(2,f->GetParError(7));
  massSwap->SetParError(3,f->GetParError(8));
  massSwap->SetFillColor(kGreen+4);
  massSwap->SetFillStyle(3005);
  massSwap->SetLineColor(kGreen+4);
  massSwap->SetLineWidth(3);
  massSwap->SetLineStyle(1);
  
  h->SetXTitle("m_{#piK} (GeV/c^{2})");
  h->SetYTitle("Entries / (5 MeV/c^{2})");
  h->GetXaxis()->CenterTitle();
  h->GetYaxis()->CenterTitle();
  h->SetAxisRange(0,h->GetMaximum()*1.4*1.2,"Y");
  h->GetXaxis()->SetTitleOffset(1.3);
  h->GetYaxis()->SetTitleOffset(1.8);
  h->GetXaxis()->SetLabelOffset(0.007);
  h->GetYaxis()->SetLabelOffset(0.007);
  h->GetXaxis()->SetTitleSize(0.045);
  h->GetYaxis()->SetTitleSize(0.045);
  h->GetXaxis()->SetTitleFont(42);
  h->GetYaxis()->SetTitleFont(42);
  h->GetXaxis()->SetLabelFont(42);
  h->GetYaxis()->SetLabelFont(42);
  h->GetXaxis()->SetLabelSize(0.04);
  h->GetYaxis()->SetLabelSize(0.04);
  h->SetMarkerSize(0.8);
  h->SetMarkerStyle(20);
  h->SetStats(0);
  h->Draw("e");

  background->Draw("same");   
  mass->SetRange(minhisto,maxhisto);	
  mass->Draw("same");
  massSwap->SetRange(minhisto,maxhisto);
  massSwap->Draw("same");
  f->Draw("same");
  
  Double_t yield = mass->Integral(minhisto,maxhisto)/binwidthmass;
  Double_t yieldErr = mass->Integral(minhisto,maxhisto)/binwidthmass*mass->GetParError(0)/mass->GetParameter(0);
  
  std::cout<<"YIELD="<<yield<<std::endl;

  TLegend* leg = new TLegend(0.65,0.58,0.82,0.88,NULL,"brNDC");
  leg->SetBorderSize(0);
  leg->SetTextSize(0.04);
  leg->SetTextFont(42);
  leg->SetFillStyle(0);
  leg->AddEntry(h,"Data","pl");
  leg->AddEntry(f,"Fit","l");
  leg->AddEntry(mass,"D^{0}+#bar{D^{#lower[0.2]{0}}} Signal","f");
  leg->AddEntry(massSwap,"K-#pi swapped","f");
  leg->AddEntry(background,"Combinatorial","l");
  leg->Draw("same");

  TLatex* texCms = new TLatex(0.18,0.93, "#scale[1.25]{CMS} Preliminary");
  texCms->SetNDC();
  texCms->SetTextAlign(12);
  texCms->SetTextSize(0.04);
  texCms->SetTextFont(42);
  texCms->Draw();

  TLatex* texCol = new TLatex(0.96,0.93, Form("%s #sqrt{s_{NN}} = 5.02 TeV",collisionsystem.Data()));
  texCol->SetNDC();
  texCol->SetTextAlign(32);
  texCol->SetTextSize(0.04);
  texCol->SetTextFont(42);
  texCol->Draw();

  TLatex* texPt = new TLatex(0.22,0.78,Form("%.1f < p_{T} < %.1f GeV/c",ptmin,ptmax));
  texPt->SetNDC();
  texPt->SetTextFont(42);
  texPt->SetTextSize(0.04);
  texPt->SetLineWidth(2);
  texPt->Draw();

  TLatex* texY = new TLatex(0.22,0.83,"|y| < 1.0");
  texY->SetNDC();
  texY->SetTextFont(42);
  texY->SetTextSize(0.04);
  texY->SetLineWidth(2);
  texY->Draw();

  TLatex* texYield = new TLatex(0.22,0.73,Form("N_{D} = %.0f #pm %.0f",yield,yieldErr));
  texYield->SetNDC();
  texYield->SetTextFont(42);
  texYield->SetTextSize(0.04);
  texYield->SetLineWidth(2);
  texYield->Draw();

  c->SaveAs(Form("plotFits/DMass_expo_%s_%.0f_%.0f.pdf",collisionsystem.Data(),ptmin,ptmax));
  
  TCanvas* cPull = new TCanvas(Form("cPull_%.0f_%.0f",ptmin,ptmax),"",600,700);
  TH1D* hPull = (TH1D*)h->Clone("hPull");
  for(int i=0;i<h->GetNbinsX();i++)
    {
      Double_t nfit = f->Integral(h->GetBinLowEdge(i+1),h->GetBinLowEdge(i+1)+h->GetBinWidth(i+1))/h->GetBinWidth(i+1);
      if(h->GetBinError(i+1)==0)
        {
          hPull->SetBinContent(i+1,0.);
        }
      else hPull->SetBinContent(i+1,(h->GetBinContent(i+1)-nfit)/h->GetBinError(i+1));
      hPull->SetBinError(i+1,0);
    }
  hPull->SetMinimum(-4.);
  hPull->SetMaximum(4.);
  hPull->SetYTitle("Pull");
  hPull->GetXaxis()->SetTitleOffset(1.);
  hPull->GetYaxis()->SetTitleOffset(0.65);
  hPull->GetXaxis()->SetLabelOffset(0.007);
  hPull->GetYaxis()->SetLabelOffset(0.007);
  hPull->GetXaxis()->SetTitleSize(0.12);
  hPull->GetYaxis()->SetTitleSize(0.12);
  hPull->GetXaxis()->SetLabelSize(0.1);
  hPull->GetYaxis()->SetLabelSize(0.1);
  hPull->GetYaxis()->SetNdivisions(504);
  TLine* lPull = new TLine(1.7, 0, 2., 0);
  lPull->SetLineWidth(1);
  lPull->SetLineStyle(7);
  lPull->SetLineColor(1);
  TPad* pFit = new TPad("pFit","",0,0.3,1,1);
  pFit->SetBottomMargin(0);
  pFit->Draw();
  pFit->cd();
  h->Draw("e");
  background->Draw("same");
  mass->Draw("same");
  massSwap->Draw("same");
  f->Draw("same");
  leg->Draw("same");
  texCms->Draw();
  texCol->Draw();
  texPt->Draw();
  texY->Draw();
  texYield->Draw();
  cPull->cd();
  TPad* pPull = new TPad("pPull","",0,0,1,0.3);
  pPull->SetTopMargin(0);
  pPull->SetBottomMargin(0.3);
  pPull->Draw();
  pPull->cd();
  hPull->Draw("p");
  lPull->Draw();
  cPull->cd();
  cPull->SaveAs(Form("plotFits/DMass_expo_%s_%.0f_%.0f_Pull.pdf",collisionsystem.Data(),ptmin,ptmax));

  return mass;
}
//this makes Z(nunu) prediction vs. MC truth plots for the AN.
//at the moment all numbers are hard-coded and this code needs major revision, the mc truth numbers are loaded from a root file created by ZnunuNumbers.C
//furthermore the stored root file is used for both producing the final result plots/tables and also interpretation
void ZinvVisualization(){

    const int gNMT2bins_2j0b_hHT                      = 6;
    double  gMT2bins_2j0b_hHT[gNMT2bins_2j0b_hHT+1]   = {120, 150, 200, 260, 350, 550, 900};
    const int gNMT2bins_2j1b_hHT                      = 2;
    double  gMT2bins_2j1b_hHT[gNMT2bins_2j1b_hHT+1]   = {100, 180, 350};
    const int gNMT2bins_3j0b_hHT                      = 7;
    double  gMT2bins_3j0b_hHT[gNMT2bins_3j0b_hHT+1]   = {160, 185, 220, 270, 350, 450, 650, 1000};
    const int gNMT2bins_3j1b_hHT                      = 4;
    double  gMT2bins_3j1b_hHT[gNMT2bins_3j1b_hHT+1]   = {150, 180, 230, 350, 550};
    const int gNMT2bins_3j2b_hHT                      = 2;
    double  gMT2bins_3j2b_hHT[gNMT2bins_3j2b_hHT+1]   = {130, 200, 350};
    const int gNMT2bins_6j0b_hHT                      = 3;
    double  gMT2bins_6j0b_hHT[gNMT2bins_6j0b_hHT+1]   = {160, 200, 300, 500};
    const int gNMT2bins_6j1b_hHT                      = 3;
    double  gMT2bins_6j1b_hHT[gNMT2bins_6j1b_hHT+1]   = {150, 200, 300, 500};
    const int gNMT2bins_6j2b_hHT                      = 2;
    double  gMT2bins_6j2b_hHT[gNMT2bins_6j2b_hHT+1]   = {130, 200, 350};
    const int gNMT2bins_3b_hHT                        = 1;
    double  gMT2bins_3b_hHT[gNMT2bins_3b_hHT+1]       = {125, 300};

    // HT > 750 && HT < 1200
    const int gNMT2bins_2j0b_mHT                      = 9;
    double  gMT2bins_2j0b_mHT[gNMT2bins_2j0b_mHT+1]   = {125, 150, 180, 220, 270, 325, 425, 580, 780, 1000};
    const int gNMT2bins_2j1b_mHT                      = 5;
    double  gMT2bins_2j1b_mHT[gNMT2bins_2j1b_mHT+1]   = {100, 135, 170, 260, 450, 700};
    const int gNMT2bins_3j0b_mHT                      = 9;
    double  gMT2bins_3j0b_mHT[gNMT2bins_3j0b_mHT+1]   = {160, 185, 215, 250, 300, 370, 480, 640, 800, 1000};
    const int gNMT2bins_3j1b_mHT                      = 6;
    double  gMT2bins_3j1b_mHT[gNMT2bins_3j1b_mHT+1]   = {150, 175, 210, 270, 380, 600, 900};
    const int gNMT2bins_3j2b_mHT                      = 5;
    double  gMT2bins_3j2b_mHT[gNMT2bins_3j2b_mHT+1]   = {130, 160, 200, 270, 370, 500};
    const int gNMT2bins_6j0b_mHT                      = 5;
    double  gMT2bins_6j0b_mHT[gNMT2bins_6j0b_mHT+1]   = {160, 200, 250, 325, 425, 600};
    const int gNMT2bins_6j1b_mHT                      = 4;
    double  gMT2bins_6j1b_mHT[gNMT2bins_6j1b_mHT+1]   = {150, 190, 250, 350, 500};
    const int gNMT2bins_6j2b_mHT                      = 4;
    double  gMT2bins_6j2b_mHT[gNMT2bins_6j2b_mHT+1]   = {130, 170, 220, 300, 450};
    const int gNMT2bins_3b_mHT                        = 3;
    double  gMT2bins_3b_mHT[gNMT2bins_3b_mHT+1]       = {125, 175, 275, 450};

    // HT > 450 && HT < 750
    const int gNMT2bins_2j0b_lHT                      = 8;
    double  gMT2bins_2j0b_lHT[gNMT2bins_2j0b_lHT+1]   = {200, 240, 290, 350, 420, 490, 570, 650, 750};
    const int gNMT2bins_2j1b_lHT                      = 6;
    double  gMT2bins_2j1b_lHT[gNMT2bins_2j1b_lHT+1]   = {200, 250, 310, 380, 450, 550, 700};
    const int gNMT2bins_3j0b_lHT                      = 8;
    double  gMT2bins_3j0b_lHT[gNMT2bins_3j0b_lHT+1]   = {200, 240, 290, 350, 420, 490, 570, 650, 750};
    const int gNMT2bins_3j1b_lHT                      = 6;
    double  gMT2bins_3j1b_lHT[gNMT2bins_3j1b_lHT+1]   = {200, 250, 310, 380, 460, 550, 700};
    const int gNMT2bins_3j2b_lHT                      = 4;
    double  gMT2bins_3j2b_lHT[gNMT2bins_3j2b_lHT+1]   = {200, 250, 325, 425, 550};
    const int gNMT2bins_6j0b_lHT                      = 3;
    double  gMT2bins_6j0b_lHT[gNMT2bins_6j0b_lHT+1]   = {200, 280, 380, 520};
    const int gNMT2bins_6j1b_lHT                      = 3;
    double  gMT2bins_6j1b_lHT[gNMT2bins_6j1b_lHT+1]   = {200, 250, 325, 450};
    const int gNMT2bins_6j2b_lHT                      = 3;
    double  gMT2bins_6j2b_lHT[gNMT2bins_6j2b_lHT+1]   = {200, 250, 300, 400};
    const int gNMT2bins_3b_lHT                        = 2;
    double  gMT2bins_3b_lHT  [gNMT2bins_3b_lHT+1]     = {200, 280, 400};

const int signalregionsize = 9;
string signal_region[signalregionsize] = {"2j0b", "2j1to2b", "3to5j0b", "3to5j1b", "3to5j2b", "6j0b", "6j1b", "6j2b", "3b"};
const int HTbinsize = 3;
string HT_bin[HTbinsize] = {"lowHT", "mediumHT", "highHT"};

    	gROOT->SetStyle("Plain");
	gStyle->SetPalette(1);
	gStyle->SetOptStat(0);

    TLegend *leg = new TLegend(0.6551724,0.7299578,0.8706897,0.8987342,NULL,"brNDC");
    leg->SetBorderSize(0);
    leg->SetTextFont(62);
    leg->SetTextSize(0.04575163);
    leg->SetLineColor(1);
    leg->SetLineStyle(1);
    leg->SetLineWidth(1);
    leg->SetFillColor(0);
    leg->SetFillStyle(1001);

//load MC truth numbers
TFile *fmctruth = TFile::Open("../Results/Filtered/GammaJetsPrediction/20130617_test/ZnunuNumbers.root");

	//define all histograms
	map<string, TH1D*>    histos;
	for(int i3 = 0; i3<HTbinsize;        ++i3){
	for(int i2 = 0; i2<signalregionsize; ++i2){
		int NMT2bins;
		if(i3==0){
			if(signal_region[i2]=="2j0b")    NMT2bins = gNMT2bins_2j0b_lHT;
			if(signal_region[i2]=="2j1to2b") NMT2bins = gNMT2bins_2j1b_lHT;
			if(signal_region[i2]=="3to5j0b") NMT2bins = gNMT2bins_3j0b_lHT;
			if(signal_region[i2]=="3to5j1b") NMT2bins = gNMT2bins_3j1b_lHT;
			if(signal_region[i2]=="3to5j2b") NMT2bins = gNMT2bins_3j2b_lHT;
			if(signal_region[i2]=="6j0b")    NMT2bins = gNMT2bins_6j0b_lHT;
			if(signal_region[i2]=="6j1b")    NMT2bins = gNMT2bins_6j1b_lHT;
			if(signal_region[i2]=="6j2b")    NMT2bins = gNMT2bins_6j2b_lHT;
			if(signal_region[i2]=="3b")      NMT2bins = gNMT2bins_3b_lHT;
		} if(i3==1){
			if(signal_region[i2]=="2j0b")    NMT2bins = gNMT2bins_2j0b_mHT;
			if(signal_region[i2]=="2j1to2b") NMT2bins = gNMT2bins_2j1b_mHT;
			if(signal_region[i2]=="3to5j0b") NMT2bins = gNMT2bins_3j0b_mHT;
			if(signal_region[i2]=="3to5j1b") NMT2bins = gNMT2bins_3j1b_mHT;
			if(signal_region[i2]=="3to5j2b") NMT2bins = gNMT2bins_3j2b_mHT;
			if(signal_region[i2]=="6j0b")    NMT2bins = gNMT2bins_6j0b_mHT;
			if(signal_region[i2]=="6j1b")    NMT2bins = gNMT2bins_6j1b_mHT;
			if(signal_region[i2]=="6j2b")    NMT2bins = gNMT2bins_6j2b_mHT;
			if(signal_region[i2]=="3b")      NMT2bins = gNMT2bins_3b_mHT;
		} if(i3==2){
			if(signal_region[i2]=="2j0b")    NMT2bins = gNMT2bins_2j0b_hHT;
			if(signal_region[i2]=="2j1to2b") NMT2bins = gNMT2bins_2j1b_hHT;
			if(signal_region[i2]=="3to5j0b") NMT2bins = gNMT2bins_3j0b_hHT;
			if(signal_region[i2]=="3to5j1b") NMT2bins = gNMT2bins_3j1b_hHT;
			if(signal_region[i2]=="3to5j2b") NMT2bins = gNMT2bins_3j2b_hHT;
			if(signal_region[i2]=="6j0b")    NMT2bins = gNMT2bins_6j0b_hHT;
			if(signal_region[i2]=="6j1b")    NMT2bins = gNMT2bins_6j1b_hHT;
			if(signal_region[i2]=="6j2b")    NMT2bins = gNMT2bins_6j2b_hHT;
			if(signal_region[i2]=="3b")      NMT2bins = gNMT2bins_3b_hHT;
		}
  		double MT2bins[NMT2bins+1];
		if(i3==0){
			if(signal_region[i2]=="2j0b")    { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_2j0b_lHT[i0]; }
			if(signal_region[i2]=="2j1to2b") { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_2j1b_lHT[i0]; }
			if(signal_region[i2]=="3to5j0b") { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_3j0b_lHT[i0]; }
			if(signal_region[i2]=="3to5j1b") { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_3j1b_lHT[i0]; }
			if(signal_region[i2]=="3to5j2b") { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_3j2b_lHT[i0]; }
			if(signal_region[i2]=="6j0b")    { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_6j0b_lHT[i0]; }
			if(signal_region[i2]=="6j1b")    { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_6j1b_lHT[i0]; }
			if(signal_region[i2]=="6j2b")    { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_6j2b_lHT[i0]; }
			if(signal_region[i2]=="3b")      { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_3b_lHT[i0];   }
		} if(i3==1){
			if(signal_region[i2]=="2j0b")    { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_2j0b_mHT[i0];  }
			if(signal_region[i2]=="2j1to2b") { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_2j1b_mHT[i0];  }
			if(signal_region[i2]=="3to5j0b") { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_3j0b_mHT[i0];  }
			if(signal_region[i2]=="3to5j1b") { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_3j1b_mHT[i0];  }
			if(signal_region[i2]=="3to5j2b") { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_3j2b_mHT[i0];  }
			if(signal_region[i2]=="6j0b")    { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_6j0b_mHT[i0];  }
			if(signal_region[i2]=="6j1b")    { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_6j1b_mHT[i0];  }
			if(signal_region[i2]=="6j2b")    { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_6j2b_mHT[i0];  }
			if(signal_region[i2]=="3b")      { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_3b_mHT[i0];    }
		} if(i3==2){
			if(signal_region[i2]=="2j0b")    { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_2j0b_hHT[i0];  }
			if(signal_region[i2]=="2j1to2b") { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_2j1b_hHT[i0];  }
			if(signal_region[i2]=="3to5j0b") { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_3j0b_hHT[i0];  }
			if(signal_region[i2]=="3to5j1b") { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_3j1b_hHT[i0];  }
			if(signal_region[i2]=="3to5j2b") { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_3j2b_hHT[i0];  }
			if(signal_region[i2]=="6j0b")    { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_6j0b_hHT[i0];  }
			if(signal_region[i2]=="6j1b")    { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_6j1b_hHT[i0];  }
			if(signal_region[i2]=="6j2b")    { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_6j2b_hHT[i0];  }
			if(signal_region[i2]=="3b")      { for(int i0 = 0; i0<=NMT2bins; ++i0) MT2bins[i0] = gMT2bins_3b_hHT[i0];    }
		}

		string hs = string("_") + HT_bin[i3] + string("_") + signal_region[i2];// + string("_") + sample_type[i1];
		string mapname = "MT2" + hs;
		TH1D *h = (TH1D*)fmctruth->Get(mapname.c_str());
		mapname = "MT2truth" + hs;
		if(histos.count(mapname) == 0 ) histos[mapname] = (TH1D*)h->Clone(mapname.c_str());
		histos[mapname]->SetFillColor(kViolet-3); histos[mapname]->SetFillStyle(3001);
		//get MC truth histo style
		if(i3==0&&i2==0) leg->AddEntry(histos[mapname], "MC truth", "f");
			histos[mapname]->GetXaxis()->SetTitle("M_{T2} [GeV]");
			histos[mapname]->GetXaxis()->SetLabelFont(42);
			histos[mapname]->GetXaxis()->SetLabelSize(0.06);
			histos[mapname]->GetXaxis()->SetTitleSize(0.06);
			histos[mapname]->GetXaxis()->SetLabelOffset(0.01);
			histos[mapname]->GetXaxis()->SetTitleOffset(1.2);
			histos[mapname]->GetXaxis()->SetTitleFont(42);
			histos[mapname]->GetYaxis()->SetTitle("Z(#nu#nu) yield");
			histos[mapname]->GetYaxis()->SetLabelFont(42);
			histos[mapname]->GetYaxis()->SetLabelSize(0.06);
			histos[mapname]->GetYaxis()->SetTitleSize(0.06);
			histos[mapname]->GetYaxis()->SetLabelOffset(0.01);
			histos[mapname]->GetYaxis()->SetTitleOffset(1.2);
			histos[mapname]->GetYaxis()->SetTitleFont(42);
			histos[mapname]->GetZaxis()->SetLabelFont(42);
			histos[mapname]->GetZaxis()->SetLabelSize(0.035);
			histos[mapname]->GetZaxis()->SetTitleSize(0.035);
			histos[mapname]->GetZaxis()->SetTitleFont(42);
		mapname = "MT2pred" + hs;
		if(histos.count(mapname) == 0 ) histos[mapname] = new TH1D(mapname.c_str(), "", NMT2bins, MT2bins);
		histos[mapname]->SetMarkerStyle(20), histos[mapname]->SetMarkerColor(kBlack); histos[mapname]->SetLineWidth(3); histos[mapname]->SetLineColor(kBlack);
		//get prediction histo style
		if(i3==0&&i2==0) leg->AddEntry(histos[mapname], "data prediction", "lp");
			histos[mapname]->GetXaxis()->SetTitle("M_{T2} [GeV]");
			histos[mapname]->GetXaxis()->SetLabelFont(42);
			histos[mapname]->GetXaxis()->SetLabelSize(0.06);
			histos[mapname]->GetXaxis()->SetTitleSize(0.06);
			histos[mapname]->GetXaxis()->SetLabelOffset(0.01);
			histos[mapname]->GetXaxis()->SetTitleOffset(1.2);
			histos[mapname]->GetXaxis()->SetTitleFont(42);
			histos[mapname]->GetYaxis()->SetTitle("Z(#nu#nu) yield");
			histos[mapname]->GetYaxis()->SetLabelFont(42);
			histos[mapname]->GetYaxis()->SetLabelSize(0.06);
			histos[mapname]->GetYaxis()->SetTitleSize(0.06);
			histos[mapname]->GetYaxis()->SetLabelOffset(0.01);
			histos[mapname]->GetYaxis()->SetTitleOffset(1.2);
			histos[mapname]->GetYaxis()->SetTitleFont(42);
			histos[mapname]->GetZaxis()->SetLabelFont(42);
			histos[mapname]->GetZaxis()->SetLabelSize(0.035);
			histos[mapname]->GetZaxis()->SetTitleSize(0.035);
			histos[mapname]->GetZaxis()->SetTitleFont(42);
	}}

	//hard-coded numbers
	for(int i3 = 0; i3<HTbinsize;        ++i3){
	for(int i2 = 0; i2<signalregionsize; ++i2){
	   string hs = string("_") + HT_bin[i3] + string("_") + signal_region[i2];
	   string mapname = "MT2pred" + hs;
	   if(i3==0&&i2==0){//lHT,2j,0b
		histos[mapname]->SetBinContent(1,304.27); histos[mapname]->SetBinError(1,sqrt(pow(11.84,2)+pow(62.55,2)));
		histos[mapname]->SetBinContent(2,236.52); histos[mapname]->SetBinError(2,sqrt(pow(10.55,2)+pow(48.41,2)));
		histos[mapname]->SetBinContent(3,182.98); histos[mapname]->SetBinError(3,sqrt(pow( 9.30,2)+pow(37.50,2)));
		histos[mapname]->SetBinContent(4,160.92); histos[mapname]->SetBinError(4,sqrt(pow( 9.09,2)+pow(50.38,2)));
		histos[mapname]->SetBinContent(5,116.69); histos[mapname]->SetBinError(5,sqrt(pow( 7.46,2)+pow(35.07,2)));
		histos[mapname]->SetBinContent(6, 47.95); histos[mapname]->SetBinError(6,sqrt(pow( 4.86,2)+pow(14.57,2)));
		histos[mapname]->SetBinContent(7, 11.74); histos[mapname]->SetBinError(7,sqrt(pow( 2.39,2)+pow( 3.56,2)));
		histos[mapname]->SetBinContent(8,  3.28); histos[mapname]->SetBinError(8,sqrt(pow( 1.24,2)+pow( 0.98,2)));
	   } if(i3==0&&i2==2){//lHT,35j,0b
		histos[mapname]->SetBinContent(1,458.79); histos[mapname]->SetBinError(1,sqrt(pow(16.03,2)+pow(97.64,2)));
		histos[mapname]->SetBinContent(2,366.96); histos[mapname]->SetBinError(2,sqrt(pow(14.70,2)+pow(80.26,2)));
		histos[mapname]->SetBinContent(3,301.04); histos[mapname]->SetBinError(3,sqrt(pow(12.94,2)+pow(62.16,2)));
		histos[mapname]->SetBinContent(4,173.25); histos[mapname]->SetBinError(4,sqrt(pow(10.18,2)+pow(54.86,2)));
		histos[mapname]->SetBinContent(5, 93.60); histos[mapname]->SetBinError(5,sqrt(pow( 7.29,2)+pow(28.28,2)));
		histos[mapname]->SetBinContent(6, 41.36); histos[mapname]->SetBinError(6,sqrt(pow( 4.88,2)+pow(12.64,2)));
		histos[mapname]->SetBinContent(7,  9.80); histos[mapname]->SetBinError(7,sqrt(pow( 2.38,2)+pow( 3.01,2)));
		histos[mapname]->SetBinContent(8,  2.73); histos[mapname]->SetBinError(8,sqrt(pow( 1.22,2)+pow( 0.82,2)));
	   } if(i3==0&&i2==5){//lHT,6j,0b
		histos[mapname]->SetBinContent(1, 12.02); histos[mapname]->SetBinError(1,sqrt(pow( 2.76,2)+pow( 2.58,2)));
		histos[mapname]->SetBinContent(2,  5.13); histos[mapname]->SetBinError(2,sqrt(pow( 1.95,2)+pow( 1.29,2)));
		histos[mapname]->SetBinContent(3,  3.53); histos[mapname]->SetBinError(3,sqrt(pow( 1.77,2)+pow( 1.24,2)));
	   } if(i3==1&&i2==0){//mHT,2j,0b
		histos[mapname]->SetBinContent(1, 76.13); histos[mapname]->SetBinError(1,sqrt(pow( 5.38,2)+pow(15.32,2)));
		histos[mapname]->SetBinContent(2, 62.24); histos[mapname]->SetBinError(2,sqrt(pow( 4.92,2)+pow(12.55,2)));
		histos[mapname]->SetBinContent(3, 38.49); histos[mapname]->SetBinError(3,sqrt(pow( 3.95,2)+pow( 7.78,2)));
		histos[mapname]->SetBinContent(4, 40.84); histos[mapname]->SetBinError(4,sqrt(pow( 4.19,2)+pow( 8.26,2)));
		histos[mapname]->SetBinContent(5, 20.11); histos[mapname]->SetBinError(5,sqrt(pow( 3.00,2)+pow( 4.08,2)));
		histos[mapname]->SetBinContent(6, 30.21); histos[mapname]->SetBinError(6,sqrt(pow( 3.82,2)+pow( 9.14,2)));
		histos[mapname]->SetBinContent(7, 12.73); histos[mapname]->SetBinError(7,sqrt(pow( 2.44,2)+pow( 3.84,2)));
		histos[mapname]->SetBinContent(8, 15.96); histos[mapname]->SetBinError(8,sqrt(pow( 2.79,2)+pow( 4.83,2)));
		histos[mapname]->SetBinContent(9,  2.83); histos[mapname]->SetBinError(9,sqrt(pow( 1.15,2)+pow( 0.85,2)));
	   } if(i3==1&&i2==2){//mHT,35j,0b
		histos[mapname]->SetBinContent(1, 88.17); histos[mapname]->SetBinError(1,sqrt(pow( 6.50,2)+pow(17.75,2)));
		histos[mapname]->SetBinContent(2, 73.11); histos[mapname]->SetBinError(2,sqrt(pow( 6.38,2)+pow(14.78,2)));
		histos[mapname]->SetBinContent(3, 63.34); histos[mapname]->SetBinError(3,sqrt(pow( 5.72,2)+pow(12.78,2)));
		histos[mapname]->SetBinContent(4, 59.03); histos[mapname]->SetBinError(4,sqrt(pow( 5.71,2)+pow(11.95,2)));
		histos[mapname]->SetBinContent(5, 50.85); histos[mapname]->SetBinError(5,sqrt(pow( 5.36,2)+pow(10.32,2)));
		histos[mapname]->SetBinContent(6, 43.54); histos[mapname]->SetBinError(6,sqrt(pow( 4.88,2)+pow(13.11,2)));
		histos[mapname]->SetBinContent(7, 23.40); histos[mapname]->SetBinError(7,sqrt(pow( 3.63,2)+pow( 7.07,2)));
		histos[mapname]->SetBinContent(8,  6.43); histos[mapname]->SetBinError(8,sqrt(pow( 1.85,2)+pow( 1.93,2)));
		histos[mapname]->SetBinContent(9,  2.68); histos[mapname]->SetBinError(9,sqrt(pow( 1.20,2)+pow( 0.81,2)));
	  } if(i3==1&&i2==5){//mHT,6j,0b
		histos[mapname]->SetBinContent(1, 10.51); histos[mapname]->SetBinError(1,sqrt(pow( 2.84,2)+pow( 2.43,2)));
		histos[mapname]->SetBinContent(2,  3.03); histos[mapname]->SetBinError(2,sqrt(pow( 1.35,2)+pow( 0.68,2)));
		histos[mapname]->SetBinContent(3,  4.05); histos[mapname]->SetBinError(3,sqrt(pow( 1.65,2)+pow( 0.94,2)));
		histos[mapname]->SetBinContent(4,  2.61); histos[mapname]->SetBinError(4,sqrt(pow( 1.51,2)+pow( 0.88,2)));
		histos[mapname]->SetBinContent(5,  0.66); histos[mapname]->SetBinError(5,sqrt(pow( 0.66,2)+pow( 0.23,2)));
	   } if(i3==2&&i2==0){//hHT,2j,0b
		histos[mapname]->SetBinContent(1, 10.05); histos[mapname]->SetBinError(1,sqrt(pow( 1.99,2)+pow( 2.09,2)));
		histos[mapname]->SetBinContent(2, 10.34); histos[mapname]->SetBinError(2,sqrt(pow( 2.07,2)+pow( 2.14,2)));
		histos[mapname]->SetBinContent(3,  9.22); histos[mapname]->SetBinError(3,sqrt(pow( 2.06,2)+pow( 1.97,2)));
		histos[mapname]->SetBinContent(4,  3.52); histos[mapname]->SetBinError(4,sqrt(pow( 1.25,2)+pow( 0.76,2)));
		histos[mapname]->SetBinContent(5,  2.94); histos[mapname]->SetBinError(5,sqrt(pow( 1.20,2)+pow( 0.91,2)));
		histos[mapname]->SetBinContent(6,  2.45); histos[mapname]->SetBinError(6,sqrt(pow( 1.10,2)+pow( 0.76,2)));
	   } if(i3==2&&i2==2){//hHT,35j,0b
		histos[mapname]->SetBinContent(1,  8.73); histos[mapname]->SetBinError(1,sqrt(pow( 2.13,2)+pow( 1.86,2)));
		histos[mapname]->SetBinContent(2, 11.85); histos[mapname]->SetBinError(2,sqrt(pow( 2.42,2)+pow( 2.48,2)));
		histos[mapname]->SetBinContent(3, 10.16); histos[mapname]->SetBinError(3,sqrt(pow( 2.33,2)+pow( 2.13,2)));
		histos[mapname]->SetBinContent(4,  8.54); histos[mapname]->SetBinError(4,sqrt(pow( 2.20,2)+pow( 1.82,2)));
		histos[mapname]->SetBinContent(5,  4.85); histos[mapname]->SetBinError(5,sqrt(pow( 1.73,2)+pow( 1.52,2)));
		histos[mapname]->SetBinContent(6,  2.88); histos[mapname]->SetBinError(6,sqrt(pow( 1.29,2)+pow( 0.88,2)));
		histos[mapname]->SetBinContent(7,  2.88); histos[mapname]->SetBinError(7,sqrt(pow( 1.29,2)+pow( 0.88,2)));
	   } if(i3==2&&i2==5){//hHT,6j,0b
		histos[mapname]->SetBinContent(1,  2.80); histos[mapname]->SetBinError(1,sqrt(pow( 1.40,2)+pow( 0.80,2)));
		histos[mapname]->SetBinContent(2,  3.43); histos[mapname]->SetBinError(2,sqrt(pow( 1.98,2)+pow( 0.93,2)));
	//	histos[mapname]->SetBinContent(3,); histos[mapname]->SetBinError(3,sqrt(pow(,2)+pow(,2)));
	  } if(i3==0&&i2==1){//lHT,2j,1b
		histos[mapname]->SetBinContent(1, 33.99); histos[mapname]->SetBinError(1,sqrt(pow( 1.21,2)+pow(10.70,2)));
		histos[mapname]->SetBinContent(2, 22.83); histos[mapname]->SetBinError(2,sqrt(pow( 1.00,2)+pow( 7.19,2)));
		histos[mapname]->SetBinContent(3, 17.90); histos[mapname]->SetBinError(3,sqrt(pow( 0.91,2)+pow( 6.97,2)));
		histos[mapname]->SetBinContent(4, 13.92); histos[mapname]->SetBinError(4,sqrt(pow( 0.82,2)+pow( 5.44,2)));
		histos[mapname]->SetBinContent(5,  9.25); histos[mapname]->SetBinError(5,sqrt(pow( 0.65,2)+pow( 3.56,2)));
		histos[mapname]->SetBinContent(6,  1.91); histos[mapname]->SetBinError(6,sqrt(pow( 0.30,2)+pow( 0.74,2)));
	   } if(i3==0&&i2==3){//lHT,35j,1b
		histos[mapname]->SetBinContent(1, 87.24); histos[mapname]->SetBinError(1,sqrt(pow( 2.82,2)+pow(22.79,2)));
		histos[mapname]->SetBinContent(2, 64.63); histos[mapname]->SetBinError(2,sqrt(pow( 2.45,2)+pow(16.77,2)));
		histos[mapname]->SetBinContent(3, 42.61); histos[mapname]->SetBinError(3,sqrt(pow( 1.94,2)+pow(14.56,2)));
		histos[mapname]->SetBinContent(4, 23.77); histos[mapname]->SetBinError(4,sqrt(pow( 1.52,2)+pow( 8.25,2)));
		histos[mapname]->SetBinContent(5, 11.56); histos[mapname]->SetBinError(5,sqrt(pow( 1.04,2)+pow( 3.90,2)));
		histos[mapname]->SetBinContent(6,  2.66); histos[mapname]->SetBinError(6,sqrt(pow( 0.50,2)+pow( 0.91,2)));
	   } if(i3==0&&i2==6){//lHT,6j,1b
		histos[mapname]->SetBinContent(1,  2.12); histos[mapname]->SetBinError(1,sqrt(pow( 0.61,2)+pow( 1.40,2)));
		histos[mapname]->SetBinContent(2,  1.84); histos[mapname]->SetBinError(2,sqrt(pow( 0.53,2)+pow( 1.22,2)));
		histos[mapname]->SetBinContent(3,  1.55); histos[mapname]->SetBinError(3,sqrt(pow( 0.64,2)+pow( 1.11,2)));
	   } if(i3==1&&i2==1){//mHT,2j,1b
		histos[mapname]->SetBinContent(1, 12.04); histos[mapname]->SetBinError(1,sqrt(pow( 0.61,2)+pow( 6.91,2)));
		histos[mapname]->SetBinContent(2,  8.03); histos[mapname]->SetBinError(2,sqrt(pow( 0.54,2)+pow( 4.61,2)));
		histos[mapname]->SetBinContent(3,  8.67); histos[mapname]->SetBinError(3,sqrt(pow( 0.58,2)+pow( 4.97,2)));
		histos[mapname]->SetBinContent(4,  5.38); histos[mapname]->SetBinError(4,sqrt(pow( 0.49,2)+pow( 3.31,2)));
		histos[mapname]->SetBinContent(5,  2.65); histos[mapname]->SetBinError(5,sqrt(pow( 0.34,2)+pow( 1.63,2)));
	   } if(i3==1&&i2==3){//mHT,35j,1b
		histos[mapname]->SetBinContent(1, 16.86); histos[mapname]->SetBinError(1,sqrt(pow( 1.14,2)+pow( 3.89,2)));
		histos[mapname]->SetBinContent(2, 15.66); histos[mapname]->SetBinError(2,sqrt(pow( 1.16,2)+pow( 3.62,2)));
		histos[mapname]->SetBinContent(3, 16.99); histos[mapname]->SetBinError(3,sqrt(pow( 1.18,2)+pow( 3.92,2)));
		histos[mapname]->SetBinContent(4, 13.70); histos[mapname]->SetBinError(4,sqrt(pow( 1.13,2)+pow( 3.17,2)));
		histos[mapname]->SetBinContent(5,  8.91); histos[mapname]->SetBinError(5,sqrt(pow( 0.89,2)+pow( 2.87,2)));
		histos[mapname]->SetBinContent(6,  2.27); histos[mapname]->SetBinError(6,sqrt(pow( 0.45,2)+pow( 0.73,2)));
	   } if(i3==1&&i2==6){//mHT,6j,1b
		histos[mapname]->SetBinContent(1,  2.41); histos[mapname]->SetBinError(1,sqrt(pow( 0.70,2)+pow( 1.39,2)));
		histos[mapname]->SetBinContent(2,  1.55); histos[mapname]->SetBinError(2,sqrt(pow( 0.52,2)+pow( 0.89,2)));
		histos[mapname]->SetBinContent(3,  1.11); histos[mapname]->SetBinError(3,sqrt(pow( 0.45,2)+pow( 0.64,2)));
		histos[mapname]->SetBinContent(4,  0.85); histos[mapname]->SetBinError(4,sqrt(pow( 0.42,2)+pow( 0.53,2)));
	   } if(i3==2&&i2==1){//hHT,2j,1b
		histos[mapname]->SetBinContent(1,  2.69); histos[mapname]->SetBinError(1,sqrt(pow( 0.31,2)+pow( 1.80,2)));
		histos[mapname]->SetBinContent(2,  2.25); histos[mapname]->SetBinError(2,sqrt(pow( 0.31,2)+pow( 1.51,2)));
	   } if(i3==2&&i2==3){//hHT,35j,1b
		histos[mapname]->SetBinContent(1,  2.16); histos[mapname]->SetBinError(1,sqrt(pow( 0.41,2)+pow( 0.61,2)));
		histos[mapname]->SetBinContent(2,  2.40); histos[mapname]->SetBinError(2,sqrt(pow( 0.43,2)+pow( 0.67,2)));
		histos[mapname]->SetBinContent(3,  2.57); histos[mapname]->SetBinError(3,sqrt(pow( 0.49,2)+pow( 0.72,2)));
		histos[mapname]->SetBinContent(4,  1.70); histos[mapname]->SetBinError(4,sqrt(pow( 0.40,2)+pow( 0.61,2)));
	   } if(i3==2&&i2==6){//hHT,6j,1b
		histos[mapname]->SetBinContent(1,  1.06); histos[mapname]->SetBinError(1,sqrt(pow( 0.44,2)+pow( 0.84,2)));
		histos[mapname]->SetBinContent(2,  0.92); histos[mapname]->SetBinError(2,sqrt(pow( 0.53,2)+pow( 0.73,2)));
	//	histos[mapname]->SetBinContent(3,); histos[mapname]->SetBinError(3,sqrt(pow(,2)+pow(,2)));
	   }
	}}

	cout << "Saving." << endl;
    	TFile *fsavefile = new TFile("../Results/Filtered/GammaJetsPrediction/20130617_test/ZinvPredictionNumbers.root","RECREATE");
	fsavefile->cd();
	for(map<string,TH1D*>::iterator h=histos.begin(); h!=histos.end();++h){
		h->second->Write();
	}
	fsavefile->Close();
	cout << "Saved histograms in " << fsavefile->GetName() << endl;

	//make the plots - not TDR style
    TLatex TitleBox;
	TitleBox.SetNDC();
    TitleBox.SetNDC();
    TitleBox.SetTextAlign(12);
    TitleBox.SetTextFont(42);
    TitleBox.SetTextSize(0.04219409);
    TitleBox.SetLineWidth(2);
	TString text;
    string outname;
    double max = 0.;
    double max1,max2;
    string outputdir = "../Results/Filtered/GammaJetsPrediction/20130617_test/ZinvPredictionPlots/";
    	Util::MakeOutputDir(outputdir);

   TCanvas *c1 = new TCanvas("c1", "c1",485,220,700,504);
   c1->Range(82.71719,-0.4425771,532.9945,2.212885);
    c1->SetFillColor(0);
    c1->SetBorderMode(0);
    c1->SetBorderSize(2);
   c1->SetLeftMargin(0.1494253);
   c1->SetRightMargin(0.07327586);
   c1->SetTopMargin(0.08016878);
   c1->SetBottomMargin(0.1666667);
    c1->SetFrameBorderMode(0);
    c1->SetFrameBorderMode(0);
	for(int i3 = 0; i3<HTbinsize;        ++i3){
	for(int i2 = 0; i2<signalregionsize; ++i2){
	   string hs = string("_") + HT_bin[i3] + string("_") + signal_region[i2];// + string("_") + sample_type[i1];
	   string mapname   = "MT2pred"  + hs;
	   string mapnameMC = "MT2truth" + hs;
	   if(i3==0&&i2==0){//lHT,2j,0b
		c1->Clear();
		c1->cd();
    		gPad->SetLogy(0);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 1.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(0.);
		histos[mapnameMC]->SetMinimum(0.);
		text = "2 jets, 0 b-jets, low H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + ".eps";
		c1->SaveAs(outname.c_str());

		c1->Clear();
		c1->cd();
    		gPad->SetLogy(1);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 2.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(1.);
		histos[mapnameMC]->SetMinimum(1.);
		text = "2 jets, 0 b-jets, low H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + "_log.eps";
		c1->SaveAs(outname.c_str());
		c1->Clear();
	   } if(i3==0&&i2==2){//lHT,35j,0b
		c1->Clear();
		c1->cd();
    		gPad->SetLogy(0);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 1.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(0.);
		histos[mapnameMC]->SetMinimum(0.);
		text = "3-5 jets, 0 b-jets, low H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + ".eps";
		c1->SaveAs(outname.c_str());

		c1->Clear();
		c1->cd();
    		gPad->SetLogy(1);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 2.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(1.);
		histos[mapnameMC]->SetMinimum(1.);
		text = "3-5 jets, 0 b-jets, low H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + "_log.eps";
		c1->SaveAs(outname.c_str());
		c1->Clear();
	   } if(i3==0&&i2==5){//lHT,6j,0b
		c1->Clear();
		c1->cd();
    		gPad->SetLogy(0);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 1.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(0.);
		histos[mapnameMC]->SetMinimum(0.);
		text = "#geq6 jets, 0 b-jets, low H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + ".eps";
		c1->SaveAs(outname.c_str());

		c1->Clear();
		c1->cd();
    		gPad->SetLogy(1);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 2.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(1.);
		histos[mapnameMC]->SetMinimum(1.);
		text = "#geq6 jets, 0 b-jets, low H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + "_log.eps";
		c1->SaveAs(outname.c_str());
		c1->Clear();
	   } if(i3==1&&i2==0){//mHT,2j,0b
		c1->Clear();
		c1->cd();
    		gPad->SetLogy(0);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 1.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(0.);
		histos[mapnameMC]->SetMinimum(0.);
		text = "2 jets, 0 b-jets, medium H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + ".eps";
		c1->SaveAs(outname.c_str());

		c1->Clear();
		c1->cd();
    		gPad->SetLogy(1);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 2.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(1.);
		histos[mapnameMC]->SetMinimum(1.);
		text = "2 jets, 0 b-jets, medium H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + "_log.eps";
		c1->SaveAs(outname.c_str());
		c1->Clear();
	   } if(i3==1&&i2==2){//mHT,35j,0b
		c1->Clear();
		c1->cd();
    		gPad->SetLogy(0);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 1.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(0.);
		histos[mapnameMC]->SetMinimum(0.);
		text = "3-5 jets, 0 b-jets, medium H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + ".eps";
		c1->SaveAs(outname.c_str());

		c1->Clear();
		c1->cd();
    		gPad->SetLogy(1);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 2.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(1.);
		histos[mapnameMC]->SetMinimum(1.);
		text = "3-5 jets, 0 b-jets, medium H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + "_log.eps";
		c1->SaveAs(outname.c_str());
		c1->Clear();
	   } if(i3==1&&i2==5){//mHT,6j,0b
		c1->Clear();
		c1->cd();
    		gPad->SetLogy(0);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 1.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(0.);
		histos[mapnameMC]->SetMinimum(0.);
		text = "#geq6 jets, 0 b-jets, medium H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + ".eps";
		c1->SaveAs(outname.c_str());

		c1->Clear();
		c1->cd();
    		gPad->SetLogy(1);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 2.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(0.2);
		histos[mapnameMC]->SetMinimum(0.2);
		text = "#geq6 jets, 0 b-jets, medium H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + "_log.eps";
		c1->SaveAs(outname.c_str());
		c1->Clear();
	   } if(i3==2&&i2==0){//hHT,2j,0b
		c1->Clear();
		c1->cd();
    		gPad->SetLogy(0);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 1.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(0.);
		histos[mapnameMC]->SetMinimum(0.);
		text = "2 jets, 0 b-jets, high H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + ".eps";
		c1->SaveAs(outname.c_str());

		c1->Clear();
		c1->cd();
    		gPad->SetLogy(1);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 2.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(1.);
		histos[mapnameMC]->SetMinimum(1.);
		text = "2 jets, 0 b-jets, high H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + "_log.eps";
		c1->SaveAs(outname.c_str());
		c1->Clear();
	   } if(i3==2&&i2==2){//hHT,35j,0b
		c1->Clear();
		c1->cd();
    		gPad->SetLogy(0);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 1.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(0.);
		histos[mapnameMC]->SetMinimum(0.);
		text = "3-5 jets, 0 b-jets, high H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + ".eps";
		c1->SaveAs(outname.c_str());

		c1->Clear();
		c1->cd();
    		gPad->SetLogy(1);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 2.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(1.);
		histos[mapnameMC]->SetMinimum(1.);
		text = "3-5 jets, 0 b-jets, high H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + "_log.eps";
		c1->SaveAs(outname.c_str());
		c1->Clear();
	   } if(i3==2&&i2==5){//hHT,6j,0b
		c1->Clear();
		c1->cd();
    		gPad->SetLogy(0);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
	//	max = 1.5*max;
		max = 5.5;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(0.);
		histos[mapnameMC]->SetMinimum(0.);
		text = "#geq6 jets, 0 b-jets, high H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + ".eps";
		c1->SaveAs(outname.c_str());

		c1->Clear();
		c1->cd();
    		gPad->SetLogy(1);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 2.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(1.);
		histos[mapnameMC]->SetMinimum(1.);
		text = "#geq6 jets, 0 b-jets, high H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + "_log.eps";
		c1->SaveAs(outname.c_str());
		c1->Clear();
	   } if(i3==0&&i2==1){//lHT,2j,1b
		c1->Clear();
		c1->cd();
    		gPad->SetLogy(0);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 1.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(0.);
		histos[mapnameMC]->SetMinimum(0.);
		text = "2 jets, #geq1 b-jets, low H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + ".eps";
		c1->SaveAs(outname.c_str());

		c1->Clear();
		c1->cd();
    		gPad->SetLogy(1);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 2.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(1.);
		histos[mapnameMC]->SetMinimum(1.);
		text = "2 jets, #geq1 b-jets, low H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + "_log.eps";
		c1->SaveAs(outname.c_str());
		c1->Clear();
	   } if(i3==0&&i2==3){//lHT,35j,1b
		c1->Clear();
		c1->cd();
    		gPad->SetLogy(0);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 1.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(0.);
		histos[mapnameMC]->SetMinimum(0.);
		text = "3-5 jets, 1 b-jet, low H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + ".eps";
		c1->SaveAs(outname.c_str());

		c1->Clear();
		c1->cd();
    		gPad->SetLogy(1);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 2.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(1.);
		histos[mapnameMC]->SetMinimum(1.);
		text = "3-5 jets, 1 b-jet, low H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + "_log.eps";
		c1->SaveAs(outname.c_str());
		c1->Clear();
	   } if(i3==0&&i2==6){//lHT,6j,1b
		c1->Clear();
		c1->cd();
    		gPad->SetLogy(0);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
	//	max = 1.5*max;
		max = 3.5;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(0.);
		histos[mapnameMC]->SetMinimum(0.);
		text = "#geq6 jets, 1 b-jet, low H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + ".eps";
		c1->SaveAs(outname.c_str());

		c1->Clear();
		c1->cd();
    		gPad->SetLogy(1);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 2.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(0.3);
		histos[mapnameMC]->SetMinimum(0.3);
		text = "#geq6 jets, 1 b-jet, low H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + "_log.eps";
		c1->SaveAs(outname.c_str());
		c1->Clear();
	   } if(i3==1&&i2==1){//mHT,2j,1b
		c1->Clear();
		c1->cd();
    		gPad->SetLogy(0);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 1.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(0.);
		histos[mapnameMC]->SetMinimum(0.);
		text = "2 jets, #geq1 b-jets, medium H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + ".eps";
		c1->SaveAs(outname.c_str());

		c1->Clear();
		c1->cd();
    		gPad->SetLogy(1);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 2.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(1.);
		histos[mapnameMC]->SetMinimum(1.);
		text = "2 jets, #geq1 b-jets, medium H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + "_log.eps";
		c1->SaveAs(outname.c_str());
		c1->Clear();
	   } if(i3==1&&i2==3){//mHT,35j,1b
		c1->Clear();
		c1->cd();
    		gPad->SetLogy(0);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 1.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(0.);
		histos[mapnameMC]->SetMinimum(0.);
		text = "3-5 jets, 1 b-jet, medium H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + ".eps";
		c1->SaveAs(outname.c_str());

		c1->Clear();
		c1->cd();
    		gPad->SetLogy(1);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 2.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(1.);
		histos[mapnameMC]->SetMinimum(1.);
		text = "3-5 jets, 1 b-jet, medium H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + "_log.eps";
		c1->SaveAs(outname.c_str());
		c1->Clear();
	   } if(i3==1&&i2==6){//mHT,6j,1b
		c1->Clear();
		c1->cd();
    		gPad->SetLogy(0);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 1.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(0.);
		histos[mapnameMC]->SetMinimum(0.);
		text = "#geq6 jets, 1 b-jet, medium H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + ".eps";
		c1->SaveAs(outname.c_str());

		c1->Clear();
		c1->cd();
    		gPad->SetLogy(1);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 2.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(0.3);
		histos[mapnameMC]->SetMinimum(0.3);
		text = "#geq6 jets, 1 b-jet, medium H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + "_log.eps";
		c1->SaveAs(outname.c_str());
		c1->Clear();
	   } if(i3==2&&i2==1){//hHT,2j,1b
		c1->Clear();
		c1->cd();
    		gPad->SetLogy(0);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
	//	max = 1.5*max;
		max = 6.5;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(0.);
		histos[mapnameMC]->SetMinimum(0.);
		text = "2 jets, #geq1 b-jets, high H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + ".eps";
		c1->SaveAs(outname.c_str());

		c1->Clear();
		c1->cd();
    		gPad->SetLogy(1);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 2.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(1.);
		histos[mapnameMC]->SetMinimum(1.);
		text = "2 jets, #geq1 b-jets, high H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + "_log.eps";
		c1->SaveAs(outname.c_str());
		c1->Clear();
	   } if(i3==2&&i2==3){//hHT,35j,1b
		c1->Clear();
		c1->cd();
    		gPad->SetLogy(0);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 1.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(0.);
		histos[mapnameMC]->SetMinimum(0.);
		text = "3-5 jets, 1 b-jet, high H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + ".eps";
		c1->SaveAs(outname.c_str());

		c1->Clear();
		c1->cd();
    		gPad->SetLogy(1);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 2.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(1.);
		histos[mapnameMC]->SetMinimum(1.);
		text = "3-5 jets, 1 b-jet, high H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + "_log.eps";
		c1->SaveAs(outname.c_str());
		c1->Clear();
	   } if(i3==2&&i2==6){//hHT,6j,1b
		c1->Clear();
		c1->cd();
    		gPad->SetLogy(0);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
	//	max = 1.5*max;
		max = 2.;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(0.);
		histos[mapnameMC]->SetMinimum(0.);
		text = "#geq6 jets, 1 b-jet, high H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + ".eps";
		c1->SaveAs(outname.c_str());

		c1->Clear();
		c1->cd();
    		gPad->SetLogy(1);
		max1=histos[mapname]  ->GetMaximum();
		max2=histos[mapnameMC]->GetMaximum();
		max  = (max1>max2)?max1:max2;
		max = 2.5*max;
		histos[mapname  ]->SetMaximum(max);
		histos[mapnameMC]->SetMaximum(max);
		histos[mapname  ]->SetMinimum(0.2);
		histos[mapnameMC]->SetMinimum(0.2);
		text = "#geq6 jets, 1 b-jet, high H_{T}";
		histos[mapnameMC]->Draw("E2");
		histos[mapname  ]->Draw("sameE1");
		leg->Draw();
		TitleBox.DrawLatex(0.1494253,0.9493671,text.Data());
		outname = histos[mapname  ]->GetName();outname = outputdir + outname + "_log.eps";
		c1->SaveAs(outname.c_str());
	//	c1->Clear();
	   }
	}}

}
int fitfunc(int *energy, int *gopt, int append, char* addname){
  if(setlogy==0){
    //double labelx[6]={380,800,1200,1700,2400,5000}, labely[6]={80,45,25,21,25,15}; //Position
  }else{
    //double labelx[6]={300,750,1400,1800,2700,5000}, labely[6]={130,75,50,30,25,5}; //Position
  }

  //void fitfunc(int energy[5], int gopt[5]){
  for(int i=0; i<6; i++){
    cout<<energy[i]<<" "<<gopt[i]<<endl;
  }
  
  if(histname=="p2p"){
    char* dirsim = "../output/rec";
  }else if(histname=="p3p"){
    //char* dirsim = "../output/rec_p3p";
    char* dirsim = "../output/rec";
    //char* direxp = "../expout/Feb12/h_SpectrumMINOS_wAdBk.root";
    //char* outname = Form("../output/fit/%i%i%i%i%i_%s%i",gopt[0],gopt[1],gopt[2],gopt[3],gopt[4],histname,energy[4]); // .pdf .png .C .root will be created
  }else{// if(histname=="h23"){
    char* dirsim = "../output/rec";
    //char* direxp = "../expout/Feb12/h_SpectrumMINOS_wAdBk.root";
    //char* outname = Form("../output/fit/%i%i%i%i%i_%s%i",gopt[0],gopt[1],gopt[2],gopt[3],gopt[4],histname,energy[4]); // .pdf .png .C .root will be created
  }

  char* outname = Form("../output/fit/%s_%i_%i_%i_%i_%i_%i%s",histname, energy[0],energy[1],energy[2],energy[3],energy[4],energy[5],addname); // .pdf .png .C .root will be created


  ofstream fpara(Form("%s_fitresult.txt",outname));
  if(append == 1){
    ofstream fitlist(Form("../output/fit/fitlist_%s%s.csv",histname,addname),ios_base::app);
  }else{
    ofstream fitlist(Form("../output/fit/fitlist_%s%s.csv",histname,addname));    
  fitlist<<"E0, E1, E2, E3, E4, E5, CS0, CS1, CS2, CS3, CS4, CS5, ER0, ER1, ER2, ER3, ER4, ER5, Chi-sq"<<endl;
  }
  
  gStyle->SetOptStat(kFALSE);
  
  gROOT->ProcessLine( ".L fit78Ni.h" );
  gStyle->SetOptStat(kFALSE);
  gStyle->SetPadGridX(false);
  gStyle->SetPadGridY(false);
  //gStyle->SetOptLogy(1);

  char temp[300];
  int minBin = 0;
  //int maxBin = 5500;
  int maxBin = 6000;
  int binning = 100;
  int numBin = (maxBin-minBin)/binning;
  
  //Id starts with one!!!
  int daliIDMin = 1;
  int daliIDMax = 186;

  //****************************************************************************
  // The simulated peaks
  TFile *sim[6];
  for(int i=0; i<6; i++){
    if(energy[i]>0){
      sim[i] = new TFile(Form("%s/%ikeV.root",dirsim,energy[i]));
    }else{
      sim[i] = new TFile(Form("%s/%ikeV.root",dirsim,2620));//dummy
      gopt[i] = 0;
    }
  }

  //The experimental data:
  TFile *exp[1];
  //exp[0] = new TFile(Form("%s/MINOStest.root",direxp));
  exp[0] = new TFile(direxp);

  TCanvas *fCanvas=new TCanvas("Canvas","Response function",700,700);
  fCanvas->SetBorderSize(0);
  fCanvas->SetBorderMode(0);
  fCanvas->SetFrameBorderMode(0);
  fCanvas->SetFrameFillColor(0);
  fCanvas->SetBottomMargin(0.15);
  fCanvas->SetLeftMargin(0.15);
  fCanvas->cd();

  TFile *fout = new TFile(Form("%s.root",outname),"RECREATE");
  fout->cd();

  // Main
  TPad *c_m = new TPad("c_m", "c_m",0.0,0.0,1.0,1.0);
  c_m->Draw();
  c_m->cd();
  c_m->SetFillColor(0);
  //c_m->SetFillStyle(0);
  c_m->SetBorderSize(0);
  c_m->SetRightMargin(0.05);
  c_m->SetTopMargin(0.03);
  c_m->SetBottomMargin(0.15);
  c_m->SetLeftMargin(0.15);
  if(setlogy>0) c_m->SetLogy();
  fCanvas->cd();

  //****************************************************************************
  //The simulated spectra:
  TH1F *hsim[6];
  for(int i=0;i<6;i++) {
    sprintf(temp,"hsim[%i]",i);  
    hsim[i] = new TH1F(temp,temp,numBin,minBin,maxBin);
    hsim[i] = (TH1F*)sim[i]->Get("h_doppler_addback[0]");
  }
  /*
  hsim[0] = (TH1F*)sim[0]->Get("h_doppler_addback[0]");
  hsim[1] = (TH1F*)sim[1]->Get("h_doppler_addback[0]");
  hsim[2] = (TH1F*)sim[2]->Get("h_doppler_addback[0]");
  hsim[3] = (TH1F*)sim[3]->Get("h_doppler_addback[0]");
  hsim[4] = (TH1F*)sim[4]->Get("h_doppler_addback[0]");
  */

  //The experimental spectra:
  TH1F *hexp[1];
  for(int i=0;i<1;i++) {
    sprintf(temp,"hexp[%i]",i);  
    hexp[i] = new TH1F(temp,temp,numBin,minBin,maxBin);
  }

  //Getting the experimental spectrum
  //78Ni
  hexp[0] = (TH1F*)exp[0]->Get(histname);
  //hexp[0] = (TH1F*)exp[0]->Get("h23;1");
  //hexp[0]->Rebin(2);

  
  for(int i=0;i<1;i++) {
    hexp[i]->SetStats(0);
    hexp[i]->SetFillColor(0);
    hexp[i]->SetLineColor(kBlue);
    hexp[i]->SetLineStyle(0);
    
    //hexp[i]->GetXaxis()->SetRangeUser(0,maxBin);
    hexp[i]->GetXaxis()->SetRangeUser(minBin,maxBin);
    //hexp[i]->GetXaxis()->SetRangeUser(0,6000);
    if(setlogy==0){
      hexp[i]->GetYaxis()->SetRangeUser(0,yrangemax);
    }else {
      hexp[i]->GetYaxis()->SetRangeUser(0.5,yrangemax);
    }

    hexp[i]->GetXaxis()->SetNdivisions(305);
    hexp[i]->GetYaxis()->SetNdivisions(305);
  
    hexp[i]->GetYaxis()->SetTitle(Form("Counts / %i keV",binning));
     hexp[i]->GetXaxis()->SetTitle("Energy (keV)");
    
    hexp[i]->GetXaxis()->SetTitleOffset(0.9);  
    hexp[i]->GetYaxis()->SetTitleOffset(0.9);
    
    hexp[i]->GetXaxis()->SetTitleFont(132);
    hexp[i]->GetYaxis()->SetTitleFont(132);
    
    /*
    hexp[i]->GetXaxis()->SetTitleSize(0.08);
    hexp[i]->GetYaxis()->SetTitleSize(0.08);
    
    hexp[i]->GetXaxis()->SetLabelSize(0.08);
    hexp[i]->GetYaxis()->SetLabelSize(0.08);
    */
    hexp[i]->GetXaxis()->SetTitleSize(0.05);
    hexp[i]->GetYaxis()->SetTitleSize(0.05);
    
    hexp[i]->GetXaxis()->SetLabelSize(0.05);
    hexp[i]->GetYaxis()->SetLabelSize(0.05);

    //How to get error bar for each bin
    hexp[i]->SetDefaultSumw2(kTRUE);
    

    hexp[i]->SetTitle("");
  }   
   
  //*****************************************************************************
  peak1g = new TGraph(hsim[0]);
  peak2g = new TGraph(hsim[1]);
  peak3g = new TGraph(hsim[2]);
  peak4g = new TGraph(hsim[3]);
  peak5g = new TGraph(hsim[4]);
  peak6g = new TGraph(hsim[5]);
  /*TGraph *peak1g = new TGraph(hsim[0]);
  TGraph *peak2g = new TGraph(hsim[1]);
  TGraph *peak3g = new TGraph(hsim[2]);
  TGraph *peak4g = new TGraph(hsim[3]);
  TGraph *peak5g = new TGraph(hsim[4]);
  */
  //******************Function Definition****************************************
  //*****************************************************************************
  const Double_t fitmin=300.;
  const Double_t fitmax=(Double_t)maxBin;//4000.;
   
  c_m->cd();
  TF1 *whole = new TF1( "whole", ex_respf,fitmin,fitmax,10);
  whole->SetParameters(0.0001,0.01,0.00,0.0001,0.001,0.001,3.,-1e-03,3,-1.e-3);
  //whole->SetParameters(0.0001,0.0001,0.0001, 5.9,-0.00080 );

  for(int i=0; i<6; i++){
    if(gopt[i]==1){
      whole->SetParLimits(i,0.0,parlimit[i]);
    }else{
      whole->FixParameter(i,0.0);
    }
  }
  whole->SetParLimits(6,0,10);
  whole->SetParLimits(7,-1e-02,0.);
  whole->SetParLimits(8,0,5);
  whole->SetParLimits(9,-1e-02,-1e-5);
  //whole->FixParameter(8,1.426);
  //whole->FixParameter(9,-8.1e-5);
  whole->SetLineColor(1);
  whole->SetLineWidth(2);
  whole->SetNpx(200); 
  hexp[0]->Fit(whole,"R LL");
  //hexp[0]->Fit(whole,"");
  //cout<<"test"<<endl;
  //hexp[0]->Draw("");

  //hexp[0]->GetXaxis()->SetRangeUser(0,5000);


  //fCanvas->Print(Form("%s.png",outname));

  fpara<<"Chisquare\t"<< whole->GetChisquare()<<endl;
  fpara<<"para\tvalue\terror\tfilename"<<endl;
  for(int para=0;para<10;para++){
    fpara<<para<<"\t"<<whole->GetParameter(para)<<"\t"<<whole->GetParError(para);
    if(para<6) {
      string strenergy =sim[para]->GetName();
      int itr = strenergy.find_last_of("/");
      strenergy.erase(0,itr+1);
      fpara<<"\t"<<strenergy;
    }
    fpara<<endl;
  }
  
  // fitlist<<"E0, E1, E2, E3, E4, CS0, CS1, CS2, CS3, CS4, ER0, ER1, ER2, ER3, ER4, Chi-sq"<<endl;
  for(int i=0; i<6; i++) gopt[i]==1? fitlist<<energy[i]<<", ": fitlist<<"0, ";
  for(int i=0; i<6; i++) gopt[i]==1? fitlist<<genevts*whole->GetParameter(i)*CSincl/tot78Ni<<", ": fitlist<<"0, ";
  for(int i=0; i<6; i++){gopt[i]==1?
      fitlist<<sqrt(pow(whole->GetParError(i)*CSincl,2.) //Error from fitting
		    //+whole->GetParameter(i)*pow(CSincl,2) //Statistical error for the events (included?
		    //+pow(whole->GetParameter(i)*CSinclerr,2) // Inclusive cross section error
		    )*genevts/tot78Ni<<", " 
      :fitlist<<"0, ";
      }
  fitlist<<whole->GetChisquare()<<endl;

  //RT end


  TF1 *peak1f= new TF1( "peak1f", resp1,fitmin,fitmax,1);
  peak1f->SetParameter(0,whole->GetParameter(0) );
  peak1f->SetLineColor(2);
  peak1f->SetLineWidth(2);
  peak1f->SetLineStyle(9);
  peak1f->Draw("same");

  TF1 *peak2f= new TF1( "peak2f", resp2,fitmin,fitmax,1);
  peak2f->SetParameter(0,whole->GetParameter(1) );
  peak2f->SetLineColor(2);
  peak2f->SetLineWidth(2);
  peak2f->SetLineStyle(9);
  peak2f->Draw("same");

  //
  TF1 *peak3f= new TF1( "peak3f", resp3,fitmin,fitmax,1);
  peak3f->SetParameter(0,whole->GetParameter(2) );
  peak3f->SetLineColor(2);
  peak3f->SetLineWidth(2);
  peak3f->SetLineStyle(9);
  peak3f->Draw("same");
  
  TF1 *peak4f= new TF1( "peak4f", resp4,fitmin,fitmax,1);
  peak4f->SetParameter(0,whole->GetParameter(3) );
  peak4f->SetLineColor(2);
  peak4f->SetLineWidth(2);
  peak4f->SetLineStyle(9);
  peak4f->Draw("same");
  
  TF1 *peak5f= new TF1( "peak5f", resp5,fitmin,fitmax,1);
  peak5f->SetParameter(0,whole->GetParameter(4) );
  peak5f->SetLineColor(2);
  peak5f->SetLineWidth(2);
  peak5f->SetLineStyle(9);
  peak5f->Draw("same");

  TF1 *peak6f= new TF1( "peak6f", resp6,fitmin,fitmax,1);
  peak6f->SetParameter(0,whole->GetParameter(5) );
  peak6f->SetLineColor(2);
  peak6f->SetLineWidth(2);
  peak6f->SetLineStyle(9);
  peak6f->Draw("same");


  TF1 *expon= new TF1( "expon",expf ,fitmin,fitmax,4);
  //expon->SetParameters(whole->GetParameter(5),whole->GetParameter(6),whole->GetParameter(7),whole->GetParameter(8));
  expon->SetParameters(whole->GetParameter(6),whole->GetParameter(7),whole->GetParameter(8),whole->GetParameter(9));
  expon->SetLineColor(4);
  expon->SetLineWidth(2);
  expon->SetLineStyle(7);
  expon->Draw("same");

  //hexp[0]->Draw("same");
  hexp[0]->Draw("EL same");
  
  /*TLatex *tex = new TLatex(2000,setlogy?130:60,Form("^{78}Ni (%s)",histname));
  tex->SetTextFont(132);
  tex->SetTextSize(0.07);
  tex->SetLineWidth(2);
  tex->Draw();
  */
  /*TLatex *tex = new TLatex(2700,setlogy?80:55,Form("Incl: %2.1f mbarn for %d cnts", CSincl, (int)tot78Ni));
  tex->SetTextFont(132);
  tex->SetTextSize(0.04);
  tex->SetLineWidth(2);
  tex->Draw();
  */
  for(int i =0; i<6; i++){
  if(gopt[i]==1){
    TLatex *tex = new TLatex(labelx[i],labely[i],
			     //Form("#splitline{%d keV }{%2.2f mbarn (%3.1f cnts)}",energy[i], genevts*whole->GetParameter(i)*CSincl/tot78Ni, genevts*whole->GetParameter(i)));
			     Form("%d keV",energy[i]));
    tex->SetTextFont(132);
    tex->SetTextSize(0.05);
    tex->SetLineWidth(2);
    tex->Draw();
    }
  }
    
  fCanvas->Print(Form("%s.C",outname));
  fCanvas->Print(Form("%s.png",outname));
  fCanvas->Print(Form("%s.pdf",outname));
  
  fCanvas->Write();
  hexp[0]->Write();
  fout->Write();
  fout->Close();

}
Beispiel #10
0
void ttbar_jet1CSV()
{
//=========Macro generated from canvas: c1/c1
//=========  (Sun Dec 11 15:16:19 2016) by ROOT version6.06/01
   TCanvas *c1 = new TCanvas("c1", "c1",1,1,1200,1416);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   c1->SetHighLightColor(2);
   c1->Range(0,0,1,1);
   c1->SetFillColor(0);
   c1->SetBorderMode(0);
   c1->SetBorderSize(2);
   c1->SetTickx(1);
   c1->SetTicky(1);
   c1->SetLeftMargin(0.15);
   c1->SetRightMargin(0.05);
   c1->SetTopMargin(0.07);
   c1->SetBottomMargin(0.13);
   c1->SetFrameFillStyle(0);
   c1->SetFrameBorderMode(0);
  
// ------------>Primitives in pad: pad1
   TPad *pad1 = new TPad("pad1", "pad1",0,0.3,1,1);
   pad1->Draw();
   pad1->cd();
   pad1->Range(-0.1875,0,1.0625,0.5424993);
   pad1->SetFillColor(0);
   pad1->SetBorderMode(0);
   pad1->SetBorderSize(2);
   pad1->SetTickx(1);
   pad1->SetTicky(1);
   pad1->SetLeftMargin(0.15);
   pad1->SetRightMargin(0.05);
   pad1->SetTopMargin(0.07);
   pad1->SetBottomMargin(0);
   pad1->SetFrameFillStyle(0);
   pad1->SetFrameBorderMode(0);
   pad1->SetFrameFillStyle(0);
   pad1->SetFrameBorderMode(0);
   
   THStack *h = new THStack();
   h->SetName("h");
   h->SetTitle("");
   h->SetMinimum(0);
   h->SetMaximum(0.4804993);
   
   TH1F *h_stack_21 = new TH1F("h_stack_21","",10,0,1);
   h_stack_21->SetMinimum(0);
   h_stack_21->SetMaximum(0.5045243);
   h_stack_21->SetDirectory(0);
   h_stack_21->SetStats(0);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#000099");
   h_stack_21->SetLineColor(ci);
   h_stack_21->GetXaxis()->SetLabelFont(42);
   h_stack_21->GetXaxis()->SetLabelOffset(0.007);
   h_stack_21->GetXaxis()->SetTitleSize(0.05);
   h_stack_21->GetXaxis()->SetTickLength(0.025);
   h_stack_21->GetXaxis()->SetTitleFont(42);
   h_stack_21->GetYaxis()->SetTitle("a.u.");
   h_stack_21->GetYaxis()->SetLabelFont(42);
   h_stack_21->GetYaxis()->SetLabelOffset(0.007);
   h_stack_21->GetYaxis()->SetTitleSize(0.05);
   h_stack_21->GetYaxis()->SetTickLength(0.025);
   h_stack_21->GetYaxis()->SetTitleOffset(1.5);
   h_stack_21->GetYaxis()->SetTitleFont(42);
   h_stack_21->GetZaxis()->SetLabelFont(42);
   h_stack_21->GetZaxis()->SetLabelOffset(0.007);
   h_stack_21->GetZaxis()->SetTitleSize(0.05);
   h_stack_21->GetZaxis()->SetTickLength(0.025);
   h_stack_21->GetZaxis()->SetTitleFont(42);
   h->SetHistogram(h_stack_21);
   
   
   TH1D *h_jet1CSV_QCD__241 = new TH1D("h_jet1CSV_QCD__241","",10,0,1);
   h_jet1CSV_QCD__241->SetBinContent(1,0.001669958);
   h_jet1CSV_QCD__241->SetBinContent(2,0.001297151);
   h_jet1CSV_QCD__241->SetBinContent(3,0.0001985037);
   h_jet1CSV_QCD__241->SetBinContent(4,0.001317617);
   h_jet1CSV_QCD__241->SetBinContent(5,0.001460061);
   h_jet1CSV_QCD__241->SetBinContent(6,0.0005098467);
   h_jet1CSV_QCD__241->SetBinContent(8,9.216642e-05);
   h_jet1CSV_QCD__241->SetBinContent(10,0.005040257);
   h_jet1CSV_QCD__241->SetBinError(1,0.001015339);
   h_jet1CSV_QCD__241->SetBinError(2,0.0006375418);
   h_jet1CSV_QCD__241->SetBinError(3,0.0001985037);
   h_jet1CSV_QCD__241->SetBinError(4,0.0007758122);
   h_jet1CSV_QCD__241->SetBinError(5,0.0009604397);
   h_jet1CSV_QCD__241->SetBinError(6,0.0005098467);
   h_jet1CSV_QCD__241->SetBinError(8,9.216642e-05);
   h_jet1CSV_QCD__241->SetBinError(10,0.002524985);
   h_jet1CSV_QCD__241->SetEntries(25);
   h_jet1CSV_QCD__241->SetStats(0);

   ci = TColor::GetColor("#cccccc");
   h_jet1CSV_QCD__241->SetFillColor(ci);
   h_jet1CSV_QCD__241->GetXaxis()->SetTitle("jet 1 CSV");
   h_jet1CSV_QCD__241->GetXaxis()->SetLabelFont(42);
   h_jet1CSV_QCD__241->GetXaxis()->SetLabelOffset(0.007);
   h_jet1CSV_QCD__241->GetXaxis()->SetTitleSize(0.05);
   h_jet1CSV_QCD__241->GetXaxis()->SetTickLength(0.025);
   h_jet1CSV_QCD__241->GetXaxis()->SetTitleFont(42);
   h_jet1CSV_QCD__241->GetYaxis()->SetTitle("a.u.");
   h_jet1CSV_QCD__241->GetYaxis()->SetLabelFont(42);
   h_jet1CSV_QCD__241->GetYaxis()->SetLabelOffset(0.007);
   h_jet1CSV_QCD__241->GetYaxis()->SetTitleSize(0.05);
   h_jet1CSV_QCD__241->GetYaxis()->SetTickLength(0.025);
   h_jet1CSV_QCD__241->GetYaxis()->SetTitleFont(42);
   h_jet1CSV_QCD__241->GetZaxis()->SetLabelFont(42);
   h_jet1CSV_QCD__241->GetZaxis()->SetLabelOffset(0.007);
   h_jet1CSV_QCD__241->GetZaxis()->SetTitleSize(0.05);
   h_jet1CSV_QCD__241->GetZaxis()->SetTickLength(0.025);
   h_jet1CSV_QCD__241->GetZaxis()->SetTitleFont(42);
   h->Add(h_jet1CSV_QCD,"");
   
   TH1D *h_jet1CSV_Diboson__242 = new TH1D("h_jet1CSV_Diboson__242","",10,0,1);
   h_jet1CSV_Diboson__242->SetBinContent(1,0.007902013);
   h_jet1CSV_Diboson__242->SetBinContent(2,0.01070993);
   h_jet1CSV_Diboson__242->SetBinContent(3,0.004898623);
   h_jet1CSV_Diboson__242->SetBinContent(4,0.00384298);
   h_jet1CSV_Diboson__242->SetBinContent(5,0.002613524);
   h_jet1CSV_Diboson__242->SetBinContent(6,0.002368716);
   h_jet1CSV_Diboson__242->SetBinContent(7,0.001456544);
   h_jet1CSV_Diboson__242->SetBinContent(8,0.001323376);
   h_jet1CSV_Diboson__242->SetBinContent(9,0.0003980073);
   h_jet1CSV_Diboson__242->SetBinContent(10,0.001279463);
   h_jet1CSV_Diboson__242->SetBinError(1,0.001211187);
   h_jet1CSV_Diboson__242->SetBinError(2,0.001421911);
   h_jet1CSV_Diboson__242->SetBinError(3,0.0009606959);
   h_jet1CSV_Diboson__242->SetBinError(4,0.0008875179);
   h_jet1CSV_Diboson__242->SetBinError(5,0.0007683429);
   h_jet1CSV_Diboson__242->SetBinError(6,0.0007114388);
   h_jet1CSV_Diboson__242->SetBinError(7,0.0005740134);
   h_jet1CSV_Diboson__242->SetBinError(8,0.0005780429);
   h_jet1CSV_Diboson__242->SetBinError(9,0.0002452434);
   h_jet1CSV_Diboson__242->SetBinError(10,0.000496194);
   h_jet1CSV_Diboson__242->SetEntries(227);
   h_jet1CSV_Diboson__242->SetStats(0);

   ci = TColor::GetColor("#9966cc");
   h_jet1CSV_Diboson__242->SetFillColor(ci);
   h_jet1CSV_Diboson__242->GetXaxis()->SetTitle("jet 1 CSV");
   h_jet1CSV_Diboson__242->GetXaxis()->SetLabelFont(42);
   h_jet1CSV_Diboson__242->GetXaxis()->SetLabelOffset(0.007);
   h_jet1CSV_Diboson__242->GetXaxis()->SetTitleSize(0.05);
   h_jet1CSV_Diboson__242->GetXaxis()->SetTickLength(0.025);
   h_jet1CSV_Diboson__242->GetXaxis()->SetTitleFont(42);
   h_jet1CSV_Diboson__242->GetYaxis()->SetTitle("a.u.");
   h_jet1CSV_Diboson__242->GetYaxis()->SetLabelFont(42);
   h_jet1CSV_Diboson__242->GetYaxis()->SetLabelOffset(0.007);
   h_jet1CSV_Diboson__242->GetYaxis()->SetTitleSize(0.05);
   h_jet1CSV_Diboson__242->GetYaxis()->SetTickLength(0.025);
   h_jet1CSV_Diboson__242->GetYaxis()->SetTitleFont(42);
   h_jet1CSV_Diboson__242->GetZaxis()->SetLabelFont(42);
   h_jet1CSV_Diboson__242->GetZaxis()->SetLabelOffset(0.007);
   h_jet1CSV_Diboson__242->GetZaxis()->SetTitleSize(0.05);
   h_jet1CSV_Diboson__242->GetZaxis()->SetTickLength(0.025);
   h_jet1CSV_Diboson__242->GetZaxis()->SetTitleFont(42);
   h->Add(h_jet1CSV_Diboson,"");
   
   TH1D *h_jet1CSV_ZpLjets__243 = new TH1D("h_jet1CSV_ZpLjets__243","",10,0,1);
   h_jet1CSV_ZpLjets__243->SetBinContent(1,0.0105581);
   h_jet1CSV_ZpLjets__243->SetBinContent(2,0.0149804);
   h_jet1CSV_ZpLjets__243->SetBinContent(3,0.006136762);
   h_jet1CSV_ZpLjets__243->SetBinContent(4,0.003962296);
   h_jet1CSV_ZpLjets__243->SetBinContent(5,0.003417574);
   h_jet1CSV_ZpLjets__243->SetBinContent(6,0.002305365);
   h_jet1CSV_ZpLjets__243->SetBinContent(7,0.001793532);
   h_jet1CSV_ZpLjets__243->SetBinContent(8,0.001236405);
   h_jet1CSV_ZpLjets__243->SetBinContent(9,0.001335452);
   h_jet1CSV_ZpLjets__243->SetBinContent(10,0.001687921);
   h_jet1CSV_ZpLjets__243->SetBinError(1,0.0002993944);
   h_jet1CSV_ZpLjets__243->SetBinError(2,0.0003673727);
   h_jet1CSV_ZpLjets__243->SetBinError(3,0.0002261915);
   h_jet1CSV_ZpLjets__243->SetBinError(4,0.0001994505);
   h_jet1CSV_ZpLjets__243->SetBinError(5,0.000185805);
   h_jet1CSV_ZpLjets__243->SetBinError(6,0.0001426398);
   h_jet1CSV_ZpLjets__243->SetBinError(7,0.0001285193);
   h_jet1CSV_ZpLjets__243->SetBinError(8,0.0001016587);
   h_jet1CSV_ZpLjets__243->SetBinError(9,0.0001150635);
   h_jet1CSV_ZpLjets__243->SetBinError(10,0.0001437861);
   h_jet1CSV_ZpLjets__243->SetEntries(24915);
   h_jet1CSV_ZpLjets__243->SetStats(0);

   ci = TColor::GetColor("#3399cc");
   h_jet1CSV_ZpLjets__243->SetFillColor(ci);
   h_jet1CSV_ZpLjets__243->GetXaxis()->SetTitle("jet 1 CSV");
   h_jet1CSV_ZpLjets__243->GetXaxis()->SetLabelFont(42);
   h_jet1CSV_ZpLjets__243->GetXaxis()->SetLabelOffset(0.007);
   h_jet1CSV_ZpLjets__243->GetXaxis()->SetTitleSize(0.05);
   h_jet1CSV_ZpLjets__243->GetXaxis()->SetTickLength(0.025);
   h_jet1CSV_ZpLjets__243->GetXaxis()->SetTitleFont(42);
   h_jet1CSV_ZpLjets__243->GetYaxis()->SetTitle("a.u.");
   h_jet1CSV_ZpLjets__243->GetYaxis()->SetLabelFont(42);
   h_jet1CSV_ZpLjets__243->GetYaxis()->SetLabelOffset(0.007);
   h_jet1CSV_ZpLjets__243->GetYaxis()->SetTitleSize(0.05);
   h_jet1CSV_ZpLjets__243->GetYaxis()->SetTickLength(0.025);
   h_jet1CSV_ZpLjets__243->GetYaxis()->SetTitleFont(42);
   h_jet1CSV_ZpLjets__243->GetZaxis()->SetLabelFont(42);
   h_jet1CSV_ZpLjets__243->GetZaxis()->SetLabelOffset(0.007);
   h_jet1CSV_ZpLjets__243->GetZaxis()->SetTitleSize(0.05);
   h_jet1CSV_ZpLjets__243->GetZaxis()->SetTickLength(0.025);
   h_jet1CSV_ZpLjets__243->GetZaxis()->SetTitleFont(42);
   h->Add(h_jet1CSV_Z+jets,"");
   
   TH1D *h_jet1CSV_WpLjets__244 = new TH1D("h_jet1CSV_WpLjets__244","",10,0,1);
   h_jet1CSV_WpLjets__244->SetBinContent(1,0.0105647);
   h_jet1CSV_WpLjets__244->SetBinContent(2,0.01249913);
   h_jet1CSV_WpLjets__244->SetBinContent(3,0.007002216);
   h_jet1CSV_WpLjets__244->SetBinContent(4,0.004496839);
   h_jet1CSV_WpLjets__244->SetBinContent(5,0.003373536);
   h_jet1CSV_WpLjets__244->SetBinContent(6,0.00194438);
   h_jet1CSV_WpLjets__244->SetBinContent(7,0.001499895);
   h_jet1CSV_WpLjets__244->SetBinContent(8,0.001552581);
   h_jet1CSV_WpLjets__244->SetBinContent(9,0.001498434);
   h_jet1CSV_WpLjets__244->SetBinContent(10,0.001251066);
   h_jet1CSV_WpLjets__244->SetBinError(1,0.0007887323);
   h_jet1CSV_WpLjets__244->SetBinError(2,0.0008242009);
   h_jet1CSV_WpLjets__244->SetBinError(3,0.0006456304);
   h_jet1CSV_WpLjets__244->SetBinError(4,0.0005750342);
   h_jet1CSV_WpLjets__244->SetBinError(5,0.0004846149);
   h_jet1CSV_WpLjets__244->SetBinError(6,0.0003336262);
   h_jet1CSV_WpLjets__244->SetBinError(7,0.0003618074);
   h_jet1CSV_WpLjets__244->SetBinError(8,0.000356322);
   h_jet1CSV_WpLjets__244->SetBinError(9,0.000315267);
   h_jet1CSV_WpLjets__244->SetBinError(10,0.0002636669);
   h_jet1CSV_WpLjets__244->SetEntries(3309);
   h_jet1CSV_WpLjets__244->SetStats(0);

   ci = TColor::GetColor("#66cc66");
   h_jet1CSV_WpLjets__244->SetFillColor(ci);
   h_jet1CSV_WpLjets__244->GetXaxis()->SetTitle("jet 1 CSV");
   h_jet1CSV_WpLjets__244->GetXaxis()->SetLabelFont(42);
   h_jet1CSV_WpLjets__244->GetXaxis()->SetLabelOffset(0.007);
   h_jet1CSV_WpLjets__244->GetXaxis()->SetTitleSize(0.05);
   h_jet1CSV_WpLjets__244->GetXaxis()->SetTickLength(0.025);
   h_jet1CSV_WpLjets__244->GetXaxis()->SetTitleFont(42);
   h_jet1CSV_WpLjets__244->GetYaxis()->SetTitle("a.u.");
   h_jet1CSV_WpLjets__244->GetYaxis()->SetLabelFont(42);
   h_jet1CSV_WpLjets__244->GetYaxis()->SetLabelOffset(0.007);
   h_jet1CSV_WpLjets__244->GetYaxis()->SetTitleSize(0.05);
   h_jet1CSV_WpLjets__244->GetYaxis()->SetTickLength(0.025);
   h_jet1CSV_WpLjets__244->GetYaxis()->SetTitleFont(42);
   h_jet1CSV_WpLjets__244->GetZaxis()->SetLabelFont(42);
   h_jet1CSV_WpLjets__244->GetZaxis()->SetLabelOffset(0.007);
   h_jet1CSV_WpLjets__244->GetZaxis()->SetTitleSize(0.05);
   h_jet1CSV_WpLjets__244->GetZaxis()->SetTickLength(0.025);
   h_jet1CSV_WpLjets__244->GetZaxis()->SetTitleFont(42);
   h->Add(h_jet1CSV_W+jets,"");
   
   TH1D *h_jet1CSV_TopsPoPLFcP__245 = new TH1D("h_jet1CSV_TopsPoPLFcP__245","",10,0,1);
   h_jet1CSV_TopsPoPLFcP__245->SetBinContent(1,0.05724676);
   h_jet1CSV_TopsPoPLFcP__245->SetBinContent(2,0.09449115);
   h_jet1CSV_TopsPoPLFcP__245->SetBinContent(3,0.04295219);
   h_jet1CSV_TopsPoPLFcP__245->SetBinContent(4,0.02886478);
   h_jet1CSV_TopsPoPLFcP__245->SetBinContent(5,0.02197153);
   h_jet1CSV_TopsPoPLFcP__245->SetBinContent(6,0.01676184);
   h_jet1CSV_TopsPoPLFcP__245->SetBinContent(7,0.01344738);
   h_jet1CSV_TopsPoPLFcP__245->SetBinContent(8,0.01147171);
   h_jet1CSV_TopsPoPLFcP__245->SetBinContent(9,0.01188168);
   h_jet1CSV_TopsPoPLFcP__245->SetBinContent(10,0.02899011);
   h_jet1CSV_TopsPoPLFcP__245->SetBinError(1,0.000729733);
   h_jet1CSV_TopsPoPLFcP__245->SetBinError(2,0.0009659214);
   h_jet1CSV_TopsPoPLFcP__245->SetBinError(3,0.000703275);
   h_jet1CSV_TopsPoPLFcP__245->SetBinError(4,0.0005973511);
   h_jet1CSV_TopsPoPLFcP__245->SetBinError(5,0.0005112767);
   h_jet1CSV_TopsPoPLFcP__245->SetBinError(6,0.0004554214);
   h_jet1CSV_TopsPoPLFcP__245->SetBinError(7,0.000425343);
   h_jet1CSV_TopsPoPLFcP__245->SetBinError(8,0.0004081547);
   h_jet1CSV_TopsPoPLFcP__245->SetBinError(9,0.0004352084);
   h_jet1CSV_TopsPoPLFcP__245->SetBinError(10,0.0006914391);
   h_jet1CSV_TopsPoPLFcP__245->SetEntries(45754);
   h_jet1CSV_TopsPoPLFcP__245->SetStats(0);

   ci = TColor::GetColor("#cc33cc");
   h_jet1CSV_TopsPoPLFcP__245->SetFillColor(ci);
   h_jet1CSV_TopsPoPLFcP__245->GetXaxis()->SetTitle("jet 1 CSV");
   h_jet1CSV_TopsPoPLFcP__245->GetXaxis()->SetLabelFont(42);
   h_jet1CSV_TopsPoPLFcP__245->GetXaxis()->SetLabelOffset(0.007);
   h_jet1CSV_TopsPoPLFcP__245->GetXaxis()->SetTitleSize(0.05);
   h_jet1CSV_TopsPoPLFcP__245->GetXaxis()->SetTickLength(0.025);
   h_jet1CSV_TopsPoPLFcP__245->GetXaxis()->SetTitleFont(42);
   h_jet1CSV_TopsPoPLFcP__245->GetYaxis()->SetTitle("a.u.");
   h_jet1CSV_TopsPoPLFcP__245->GetYaxis()->SetLabelFont(42);
   h_jet1CSV_TopsPoPLFcP__245->GetYaxis()->SetLabelOffset(0.007);
   h_jet1CSV_TopsPoPLFcP__245->GetYaxis()->SetTitleSize(0.05);
   h_jet1CSV_TopsPoPLFcP__245->GetYaxis()->SetTickLength(0.025);
   h_jet1CSV_TopsPoPLFcP__245->GetYaxis()->SetTitleFont(42);
   h_jet1CSV_TopsPoPLFcP__245->GetZaxis()->SetLabelFont(42);
   h_jet1CSV_TopsPoPLFcP__245->GetZaxis()->SetLabelOffset(0.007);
   h_jet1CSV_TopsPoPLFcP__245->GetZaxis()->SetTitleSize(0.05);
   h_jet1CSV_TopsPoPLFcP__245->GetZaxis()->SetTickLength(0.025);
   h_jet1CSV_TopsPoPLFcP__245->GetZaxis()->SetTitleFont(42);
   h->Add(h_jet1CSV_Top (LF),"");
   
   TH1D *h_jet1CSV_TopsPoPHFcP__246 = new TH1D("h_jet1CSV_TopsPoPHFcP__246","",10,0,1);
   h_jet1CSV_TopsPoPHFcP__246->SetBinContent(1,0.03716431);
   h_jet1CSV_TopsPoPHFcP__246->SetBinContent(2,0.06356179);
   h_jet1CSV_TopsPoPHFcP__246->SetBinContent(3,0.03422285);
   h_jet1CSV_TopsPoPHFcP__246->SetBinContent(4,0.02759495);
   h_jet1CSV_TopsPoPHFcP__246->SetBinContent(5,0.02467271);
   h_jet1CSV_TopsPoPHFcP__246->SetBinContent(6,0.02266566);
   h_jet1CSV_TopsPoPHFcP__246->SetBinContent(7,0.02783972);
   h_jet1CSV_TopsPoPHFcP__246->SetBinContent(8,0.03184351);
   h_jet1CSV_TopsPoPHFcP__246->SetBinContent(9,0.05887917);
   h_jet1CSV_TopsPoPHFcP__246->SetBinContent(10,0.2020009);
   h_jet1CSV_TopsPoPHFcP__246->SetBinError(1,0.0006192109);
   h_jet1CSV_TopsPoPHFcP__246->SetBinError(2,0.0008097774);
   h_jet1CSV_TopsPoPHFcP__246->SetBinError(3,0.0006131987);
   h_jet1CSV_TopsPoPHFcP__246->SetBinError(4,0.0005808687);
   h_jet1CSV_TopsPoPHFcP__246->SetBinError(5,0.0005375401);
   h_jet1CSV_TopsPoPHFcP__246->SetBinError(6,0.0005302149);
   h_jet1CSV_TopsPoPHFcP__246->SetBinError(7,0.0006356258);
   h_jet1CSV_TopsPoPHFcP__246->SetBinError(8,0.0006542281);
   h_jet1CSV_TopsPoPHFcP__246->SetBinError(9,0.0009161931);
   h_jet1CSV_TopsPoPHFcP__246->SetBinError(10,0.001553901);
   h_jet1CSV_TopsPoPHFcP__246->SetEntries(77950);
   h_jet1CSV_TopsPoPHFcP__246->SetStats(0);

   ci = TColor::GetColor("#ff9900");
   h_jet1CSV_TopsPoPHFcP__246->SetFillColor(ci);
   h_jet1CSV_TopsPoPHFcP__246->GetXaxis()->SetTitle("jet 1 CSV");
   h_jet1CSV_TopsPoPHFcP__246->GetXaxis()->SetLabelFont(42);
   h_jet1CSV_TopsPoPHFcP__246->GetXaxis()->SetLabelOffset(0.007);
   h_jet1CSV_TopsPoPHFcP__246->GetXaxis()->SetTitleSize(0.05);
   h_jet1CSV_TopsPoPHFcP__246->GetXaxis()->SetTickLength(0.025);
   h_jet1CSV_TopsPoPHFcP__246->GetXaxis()->SetTitleFont(42);
   h_jet1CSV_TopsPoPHFcP__246->GetYaxis()->SetTitle("a.u.");
   h_jet1CSV_TopsPoPHFcP__246->GetYaxis()->SetLabelFont(42);
   h_jet1CSV_TopsPoPHFcP__246->GetYaxis()->SetLabelOffset(0.007);
   h_jet1CSV_TopsPoPHFcP__246->GetYaxis()->SetTitleSize(0.05);
   h_jet1CSV_TopsPoPHFcP__246->GetYaxis()->SetTickLength(0.025);
   h_jet1CSV_TopsPoPHFcP__246->GetYaxis()->SetTitleFont(42);
   h_jet1CSV_TopsPoPHFcP__246->GetZaxis()->SetLabelFont(42);
   h_jet1CSV_TopsPoPHFcP__246->GetZaxis()->SetLabelOffset(0.007);
   h_jet1CSV_TopsPoPHFcP__246->GetZaxis()->SetTitleSize(0.05);
   h_jet1CSV_TopsPoPHFcP__246->GetZaxis()->SetTickLength(0.025);
   h_jet1CSV_TopsPoPHFcP__246->GetZaxis()->SetTitleFont(42);
   h->Add(h_jet1CSV_Top (HF),"");
   h->Draw("hist");
   
   TH1D *hsum__247 = new TH1D("hsum__247","",10,0,1);
   hsum__247->SetBinContent(1,0.1251058);
   hsum__247->SetBinContent(2,0.1975396);
   hsum__247->SetBinContent(3,0.09541114);
   hsum__247->SetBinContent(4,0.07007946);
   hsum__247->SetBinContent(5,0.05750894);
   hsum__247->SetBinContent(6,0.04655581);
   hsum__247->SetBinContent(7,0.04603708);
   hsum__247->SetBinContent(8,0.04751975);
   hsum__247->SetBinContent(9,0.07399275);
   hsum__247->SetBinContent(10,0.2402497);
   hsum__247->SetBinError(1,0.002031146);
   hsum__247->SetBinError(2,0.002198023);
   hsum__247->SetBinError(3,0.001516888);
   hsum__247->SetBinError(4,0.001566606);
   hsum__247->SetBinError(5,0.00152726);
   hsum__247->SetBinError(6,0.001177403);
   hsum__247->SetBinError(7,0.001030461);
   hsum__247->SetBinError(8,0.001036597);
   hsum__247->SetBinError(9,0.001096172);
   hsum__247->SetBinError(10,0.003099137);
   hsum__247->SetEntries(45);
   hsum__247->SetStats(0);

   ci = 1200;
   color = new TColor(ci, 0, 0, 0, " ", 0.99);
   hsum__247->SetFillColor(ci);
   hsum__247->SetFillStyle(3003);
   hsum__247->SetLineWidth(0);
   hsum__247->GetXaxis()->SetTitle("jet 1 CSV");
   hsum__247->GetXaxis()->SetLabelFont(42);
   hsum__247->GetXaxis()->SetLabelOffset(0.007);
   hsum__247->GetXaxis()->SetTitleSize(0.05);
   hsum__247->GetXaxis()->SetTickLength(0.025);
   hsum__247->GetXaxis()->SetTitleFont(42);
   hsum__247->GetYaxis()->SetTitle("a.u.");
   hsum__247->GetYaxis()->SetLabelFont(42);
   hsum__247->GetYaxis()->SetLabelOffset(0.007);
   hsum__247->GetYaxis()->SetTitleSize(0.05);
   hsum__247->GetYaxis()->SetTickLength(0.025);
   hsum__247->GetYaxis()->SetTitleFont(42);
   hsum__247->GetZaxis()->SetLabelFont(42);
   hsum__247->GetZaxis()->SetLabelOffset(0.007);
   hsum__247->GetZaxis()->SetTitleSize(0.05);
   hsum__247->GetZaxis()->SetTickLength(0.025);
   hsum__247->GetZaxis()->SetTitleFont(42);
   hsum__247->Draw("e2 same");
   
   TH1D *h_jet1CSV_Data__248 = new TH1D("h_jet1CSV_Data__248","",10,0,1);
   h_jet1CSV_Data__248->SetBinContent(1,0.1217846);
   h_jet1CSV_Data__248->SetBinContent(2,0.2002261);
   h_jet1CSV_Data__248->SetBinContent(3,0.09935928);
   h_jet1CSV_Data__248->SetBinContent(4,0.07382455);
   h_jet1CSV_Data__248->SetBinContent(5,0.06336568);
   h_jet1CSV_Data__248->SetBinContent(6,0.04781871);
   h_jet1CSV_Data__248->SetBinContent(7,0.04861962);
   h_jet1CSV_Data__248->SetBinContent(8,0.04786582);
   h_jet1CSV_Data__248->SetBinContent(9,0.07109206);
   h_jet1CSV_Data__248->SetBinContent(10,0.2260435);
   h_jet1CSV_Data__248->SetBinError(1,0.002395312);
   h_jet1CSV_Data__248->SetBinError(2,0.003071329);
   h_jet1CSV_Data__248->SetBinError(3,0.002163566);
   h_jet1CSV_Data__248->SetBinError(4,0.001864946);
   h_jet1CSV_Data__248->SetBinError(5,0.001727798);
   h_jet1CSV_Data__248->SetBinError(6,0.001500945);
   h_jet1CSV_Data__248->SetBinError(7,0.001513463);
   h_jet1CSV_Data__248->SetBinError(8,0.001501684);
   h_jet1CSV_Data__248->SetBinError(9,0.001830107);
   h_jet1CSV_Data__248->SetBinError(10,0.003263337);
   h_jet1CSV_Data__248->SetEntries(21226);
   h_jet1CSV_Data__248->SetStats(0);
   h_jet1CSV_Data__248->SetLineWidth(3);
   h_jet1CSV_Data__248->SetMarkerStyle(20);
   h_jet1CSV_Data__248->SetMarkerSize(2);
   h_jet1CSV_Data__248->GetXaxis()->SetTitle("jet 1 CSV");
   h_jet1CSV_Data__248->GetXaxis()->SetLabelFont(42);
   h_jet1CSV_Data__248->GetXaxis()->SetLabelOffset(0.007);
   h_jet1CSV_Data__248->GetXaxis()->SetTitleSize(0.05);
   h_jet1CSV_Data__248->GetXaxis()->SetTickLength(0.025);
   h_jet1CSV_Data__248->GetXaxis()->SetTitleFont(42);
   h_jet1CSV_Data__248->GetYaxis()->SetTitle("a.u.");
   h_jet1CSV_Data__248->GetYaxis()->SetLabelFont(42);
   h_jet1CSV_Data__248->GetYaxis()->SetLabelOffset(0.007);
   h_jet1CSV_Data__248->GetYaxis()->SetTitleSize(0.05);
   h_jet1CSV_Data__248->GetYaxis()->SetTickLength(0.025);
   h_jet1CSV_Data__248->GetYaxis()->SetTitleFont(42);
   h_jet1CSV_Data__248->GetZaxis()->SetLabelFont(42);
   h_jet1CSV_Data__248->GetZaxis()->SetLabelOffset(0.007);
   h_jet1CSV_Data__248->GetZaxis()->SetTitleSize(0.05);
   h_jet1CSV_Data__248->GetZaxis()->SetTickLength(0.025);
   h_jet1CSV_Data__248->GetZaxis()->SetTitleFont(42);
   h_jet1CSV_Data__248->Draw("elp same");
   
   TLegend *leg = new TLegend(0.6,0.55,0.88,0.9,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(0);
   TLegendEntry *entry=leg->AddEntry("h_jet1CSV_Data","Data","ELP");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(20);
   entry->SetMarkerSize(2);
   entry->SetTextFont(42);
   entry=leg->AddEntry("h_jet1CSV_Top (HF)","Top (HF)","F");

   ci = TColor::GetColor("#ff9900");
   entry->SetFillColor(ci);
   entry->SetFillStyle(1001);
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("h_jet1CSV_Top (LF)","Top (LF)","F");

   ci = TColor::GetColor("#cc33cc");
   entry->SetFillColor(ci);
   entry->SetFillStyle(1001);
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("h_jet1CSV_W+jets","W+jets","F");

   ci = TColor::GetColor("#66cc66");
   entry->SetFillColor(ci);
   entry->SetFillStyle(1001);
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("h_jet1CSV_Z+jets","Z+jets","F");

   ci = TColor::GetColor("#3399cc");
   entry->SetFillColor(ci);
   entry->SetFillStyle(1001);
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("h_jet1CSV_Diboson","Diboson","F");

   ci = TColor::GetColor("#9966cc");
   entry->SetFillColor(ci);
   entry->SetFillStyle(1001);
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("h_jet1CSV_QCD","QCD","F");

   ci = TColor::GetColor("#cccccc");
   entry->SetFillColor(ci);
   entry->SetFillStyle(1001);
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   
   leg = new TLegend(0.6,0.55,0.88,0.9,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(0);
   entry=leg->AddEntry("h_jet1CSV_Data","Data","ELP");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(20);
   entry->SetMarkerSize(2);
   entry->SetTextFont(42);
   entry=leg->AddEntry("h_jet1CSV_Top (HF)","Top (HF)","F");

   ci = TColor::GetColor("#ff9900");
   entry->SetFillColor(ci);
   entry->SetFillStyle(1001);
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("h_jet1CSV_Top (LF)","Top (LF)","F");

   ci = TColor::GetColor("#cc33cc");
   entry->SetFillColor(ci);
   entry->SetFillStyle(1001);
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("h_jet1CSV_W+jets","W+jets","F");

   ci = TColor::GetColor("#66cc66");
   entry->SetFillColor(ci);
   entry->SetFillStyle(1001);
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("h_jet1CSV_Z+jets","Z+jets","F");

   ci = TColor::GetColor("#3399cc");
   entry->SetFillColor(ci);
   entry->SetFillStyle(1001);
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("h_jet1CSV_Diboson","Diboson","F");

   ci = TColor::GetColor("#9966cc");
   entry->SetFillColor(ci);
   entry->SetFillStyle(1001);
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("h_jet1CSV_QCD","QCD","F");

   ci = TColor::GetColor("#cccccc");
   entry->SetFillColor(ci);
   entry->SetFillStyle(1001);
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   TLatex *   tex = new TLatex(0.18,0.85,"CMS");
tex->SetNDC();
   tex->SetTextSize(0.06);
   tex->SetLineWidth(2);
   tex->Draw();
      tex = new TLatex(0.28,0.85,"Preliminary");
tex->SetNDC();
   tex->SetTextFont(52);
   tex->SetTextSize(0.06);
   tex->SetLineWidth(2);
   tex->Draw();
      tex = new TLatex(0.9,0.94,"36.6 fb^{-1} (13 TeV)");
tex->SetNDC();
   tex->SetTextAlign(31);
   tex->SetTextFont(42);
   tex->SetTextSize(0.04);
   tex->SetLineWidth(2);
   tex->Draw();
   pad1->Modified();
   c1->cd();
  
// ------------>Primitives in pad: pad2
   TPad *pad2 = new TPad("pad2", "pad2",0,0.05,1,0.3);
   pad2->Draw();
   pad2->cd();
   pad2->Range(-0.1875,-0.8914286,1.0625,0.48);
   pad2->SetFillColor(0);
   pad2->SetBorderMode(0);
   pad2->SetBorderSize(2);
   pad2->SetGridy();
   pad2->SetTickx(1);
   pad2->SetTicky(1);
   pad2->SetLeftMargin(0.15);
   pad2->SetRightMargin(0.05);
   pad2->SetTopMargin(0);
   pad2->SetBottomMargin(0.3);
   pad2->SetFrameFillStyle(0);
   pad2->SetFrameBorderMode(0);
   pad2->SetFrameFillStyle(0);
   pad2->SetFrameBorderMode(0);
   
   TH1D *ratio__249 = new TH1D("ratio__249","",10,0,1);
   ratio__249->SetBinContent(1,-0.02654743);
   ratio__249->SetBinContent(2,0.01360023);
   ratio__249->SetBinContent(3,0.04138029);
   ratio__249->SetBinContent(4,0.05344069);
   ratio__249->SetBinContent(5,0.1018405);
   ratio__249->SetBinContent(6,0.02712655);
   ratio__249->SetBinContent(7,0.05609691);
   ratio__249->SetBinContent(8,0.007282734);
   ratio__249->SetBinContent(9,-0.03920245);
   ratio__249->SetBinContent(10,-0.05913073);
   ratio__249->SetBinError(1,0.0001);
   ratio__249->SetBinError(2,0.0001);
   ratio__249->SetBinError(3,0.0001);
   ratio__249->SetBinError(4,0.0001);
   ratio__249->SetBinError(5,0.0001);
   ratio__249->SetBinError(6,0.0001);
   ratio__249->SetBinError(7,0.0001);
   ratio__249->SetBinError(8,0.0001);
   ratio__249->SetBinError(9,0.0001);
   ratio__249->SetBinError(10,0.0001);
   ratio__249->SetMinimum(-0.48);
   ratio__249->SetMaximum(0.48);
   ratio__249->SetEntries(21236);
   ratio__249->SetStats(0);
   ratio__249->SetLineWidth(3);
   ratio__249->SetMarkerStyle(20);
   ratio__249->SetMarkerSize(2);
   ratio__249->GetXaxis()->SetTitle("jet 1 CSV");
   ratio__249->GetXaxis()->SetLabelFont(43);
   ratio__249->GetXaxis()->SetLabelOffset(0.007);
   ratio__249->GetXaxis()->SetLabelSize(30);
   ratio__249->GetXaxis()->SetTitleSize(40);
   ratio__249->GetXaxis()->SetTickLength(0.025);
   ratio__249->GetXaxis()->SetTitleOffset(5);
   ratio__249->GetXaxis()->SetTitleFont(43);
   ratio__249->GetYaxis()->SetTitle("#frac{Data-Exp}{Exp}");
   ratio__249->GetYaxis()->SetNdivisions(5);
   ratio__249->GetYaxis()->SetLabelFont(43);
   ratio__249->GetYaxis()->SetLabelOffset(0.007);
   ratio__249->GetYaxis()->SetLabelSize(30);
   ratio__249->GetYaxis()->SetTitleSize(40);
   ratio__249->GetYaxis()->SetTickLength(0.025);
   ratio__249->GetYaxis()->SetTitleOffset(2.5);
   ratio__249->GetYaxis()->SetTitleFont(43);
   ratio__249->GetZaxis()->SetLabelFont(42);
   ratio__249->GetZaxis()->SetLabelOffset(0.007);
   ratio__249->GetZaxis()->SetTitleSize(0.05);
   ratio__249->GetZaxis()->SetTickLength(0.025);
   ratio__249->GetZaxis()->SetTitleFont(42);
   ratio__249->Draw("elp");
   
   TH1D *zero__250 = new TH1D("zero__250","",10,0,1);
   zero__250->SetBinError(1,0.002395312);
   zero__250->SetBinError(2,0.003071329);
   zero__250->SetBinError(3,0.002163566);
   zero__250->SetBinError(4,0.001864946);
   zero__250->SetBinError(5,0.001727798);
   zero__250->SetBinError(6,0.001500945);
   zero__250->SetBinError(7,0.001513463);
   zero__250->SetBinError(8,0.001501684);
   zero__250->SetBinError(9,0.001830107);
   zero__250->SetBinError(10,0.003263337);
   zero__250->SetEntries(21236);
   zero__250->SetStats(0);
   zero__250->SetLineWidth(3);
   zero__250->SetMarkerStyle(20);
   zero__250->SetMarkerSize(2);
   zero__250->GetXaxis()->SetTitle("jet 1 CSV");
   zero__250->GetXaxis()->SetLabelFont(42);
   zero__250->GetXaxis()->SetLabelOffset(0.007);
   zero__250->GetXaxis()->SetTitleSize(0.05);
   zero__250->GetXaxis()->SetTickLength(0.025);
   zero__250->GetXaxis()->SetTitleFont(42);
   zero__250->GetYaxis()->SetTitle("a.u.");
   zero__250->GetYaxis()->SetLabelFont(42);
   zero__250->GetYaxis()->SetLabelOffset(0.007);
   zero__250->GetYaxis()->SetTitleSize(0.05);
   zero__250->GetYaxis()->SetTickLength(0.025);
   zero__250->GetYaxis()->SetTitleFont(42);
   zero__250->GetZaxis()->SetLabelFont(42);
   zero__250->GetZaxis()->SetLabelOffset(0.007);
   zero__250->GetZaxis()->SetTitleSize(0.05);
   zero__250->GetZaxis()->SetTickLength(0.025);
   zero__250->GetZaxis()->SetTitleFont(42);
   zero__250->Draw("hist same");
   
   TH1D *sumratioup__251 = new TH1D("sumratioup__251","",10,0,1);
   sumratioup__251->SetBinContent(1,0.01623542);
   sumratioup__251->SetBinContent(2,0.011127);
   sumratioup__251->SetBinContent(3,0.01589844);
   sumratioup__251->SetBinContent(4,0.02235471);
   sumratioup__251->SetBinContent(5,0.02655692);
   sumratioup__251->SetBinContent(6,0.02529014);
   sumratioup__251->SetBinContent(7,0.02238329);
   sumratioup__251->SetBinContent(8,0.02181402);
   sumratioup__251->SetBinContent(9,0.01481459);
   sumratioup__251->SetBinContent(10,0.01289965);
   sumratioup__251->SetBinError(1,0.002031146);
   sumratioup__251->SetBinError(2,0.002198023);
   sumratioup__251->SetBinError(3,0.001516888);
   sumratioup__251->SetBinError(4,0.001566606);
   sumratioup__251->SetBinError(5,0.00152726);
   sumratioup__251->SetBinError(6,0.001177403);
   sumratioup__251->SetBinError(7,0.001030461);
   sumratioup__251->SetBinError(8,0.001036597);
   sumratioup__251->SetBinError(9,0.001096172);
   sumratioup__251->SetBinError(10,0.003099137);
   sumratioup__251->SetEntries(55);
   sumratioup__251->SetStats(0);

   ci = 1200;
   color = new TColor(ci, 0, 0, 0, " ", 0.99);
   sumratioup__251->SetFillColor(ci);
   sumratioup__251->SetFillStyle(3003);
   sumratioup__251->GetXaxis()->SetTitle("jet 1 CSV");
   sumratioup__251->GetXaxis()->SetLabelFont(42);
   sumratioup__251->GetXaxis()->SetLabelOffset(0.007);
   sumratioup__251->GetXaxis()->SetTitleSize(0.05);
   sumratioup__251->GetXaxis()->SetTickLength(0.025);
   sumratioup__251->GetXaxis()->SetTitleFont(42);
   sumratioup__251->GetYaxis()->SetTitle("a.u.");
   sumratioup__251->GetYaxis()->SetLabelFont(42);
   sumratioup__251->GetYaxis()->SetLabelOffset(0.007);
   sumratioup__251->GetYaxis()->SetTitleSize(0.05);
   sumratioup__251->GetYaxis()->SetTickLength(0.025);
   sumratioup__251->GetYaxis()->SetTitleFont(42);
   sumratioup__251->GetZaxis()->SetLabelFont(42);
   sumratioup__251->GetZaxis()->SetLabelOffset(0.007);
   sumratioup__251->GetZaxis()->SetTitleSize(0.05);
   sumratioup__251->GetZaxis()->SetTickLength(0.025);
   sumratioup__251->GetZaxis()->SetTitleFont(42);
   sumratioup__251->Draw("hist same");
   
   TH1D *sumratiodown__252 = new TH1D("sumratiodown__252","",10,0,1);
   sumratiodown__252->SetBinContent(1,-0.01623542);
   sumratiodown__252->SetBinContent(2,-0.011127);
   sumratiodown__252->SetBinContent(3,-0.01589844);
   sumratiodown__252->SetBinContent(4,-0.02235471);
   sumratiodown__252->SetBinContent(5,-0.02655692);
   sumratiodown__252->SetBinContent(6,-0.02529014);
   sumratiodown__252->SetBinContent(7,-0.02238329);
   sumratiodown__252->SetBinContent(8,-0.02181402);
   sumratiodown__252->SetBinContent(9,-0.01481459);
   sumratiodown__252->SetBinContent(10,-0.01289965);
   sumratiodown__252->SetBinError(1,0.002031146);
   sumratiodown__252->SetBinError(2,0.002198023);
   sumratiodown__252->SetBinError(3,0.001516888);
   sumratiodown__252->SetBinError(4,0.001566606);
   sumratiodown__252->SetBinError(5,0.00152726);
   sumratiodown__252->SetBinError(6,0.001177403);
   sumratiodown__252->SetBinError(7,0.001030461);
   sumratiodown__252->SetBinError(8,0.001036597);
   sumratiodown__252->SetBinError(9,0.001096172);
   sumratiodown__252->SetBinError(10,0.003099137);
   sumratiodown__252->SetEntries(55);
   sumratiodown__252->SetStats(0);

   ci = 1200;
   color = new TColor(ci, 0, 0, 0, " ", 0.99);
   sumratiodown__252->SetFillColor(ci);
   sumratiodown__252->SetFillStyle(3003);
   sumratiodown__252->GetXaxis()->SetTitle("jet 1 CSV");
   sumratiodown__252->GetXaxis()->SetLabelFont(42);
   sumratiodown__252->GetXaxis()->SetLabelOffset(0.007);
   sumratiodown__252->GetXaxis()->SetTitleSize(0.05);
   sumratiodown__252->GetXaxis()->SetTickLength(0.025);
   sumratiodown__252->GetXaxis()->SetTitleFont(42);
   sumratiodown__252->GetYaxis()->SetTitle("a.u.");
   sumratiodown__252->GetYaxis()->SetLabelFont(42);
   sumratiodown__252->GetYaxis()->SetLabelOffset(0.007);
   sumratiodown__252->GetYaxis()->SetTitleSize(0.05);
   sumratiodown__252->GetYaxis()->SetTickLength(0.025);
   sumratiodown__252->GetYaxis()->SetTitleFont(42);
   sumratiodown__252->GetZaxis()->SetLabelFont(42);
   sumratiodown__252->GetZaxis()->SetLabelOffset(0.007);
   sumratiodown__252->GetZaxis()->SetTitleSize(0.05);
   sumratiodown__252->GetZaxis()->SetTickLength(0.025);
   sumratiodown__252->GetZaxis()->SetTitleFont(42);
   sumratiodown__252->Draw("hist same");
   
   Double_t Graph0_fx1021[10] = {
   0.05,
   0.15,
   0.25,
   0.35,
   0.45,
   0.55,
   0.65,
   0.75,
   0.85,
   0.95};
   Double_t Graph0_fy1021[10] = {
   -0.02654743,
   0.01360023,
   0.04138029,
   0.05344069,
   0.1018405,
   0.02712655,
   0.05609691,
   0.007282734,
   -0.03920245,
   -0.05913073};
   Double_t Graph0_fex1021[10] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Graph0_fey1021[10] = {
   0.01914628,
   0.01554792,
   0.02267624,
   0.02661188,
   0.03004399,
   0.0322397,
   0.03287486,
   0.03160127,
   0.0247336,
   0.01358311};
   TGraphErrors *gre = new TGraphErrors(10,Graph0_fx1021,Graph0_fy1021,Graph0_fex1021,Graph0_fey1021);
   gre->SetName("Graph0");
   gre->SetTitle("Graph");
   gre->SetFillColor(1);
   gre->SetLineWidth(3);
   
   TH1F *Graph_Graph1021 = new TH1F("Graph_Graph1021","Graph",100,0,1.04);
   Graph_Graph1021->SetMinimum(-0.09317367);
   Graph_Graph1021->SetMaximum(0.1523443);
   Graph_Graph1021->SetDirectory(0);
   Graph_Graph1021->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph1021->SetLineColor(ci);
   Graph_Graph1021->GetXaxis()->SetLabelFont(42);
   Graph_Graph1021->GetXaxis()->SetLabelOffset(0.007);
   Graph_Graph1021->GetXaxis()->SetTitleSize(0.05);
   Graph_Graph1021->GetXaxis()->SetTickLength(0.025);
   Graph_Graph1021->GetXaxis()->SetTitleFont(42);
   Graph_Graph1021->GetYaxis()->SetLabelFont(42);
   Graph_Graph1021->GetYaxis()->SetLabelOffset(0.007);
   Graph_Graph1021->GetYaxis()->SetTitleSize(0.05);
   Graph_Graph1021->GetYaxis()->SetTickLength(0.025);
   Graph_Graph1021->GetYaxis()->SetTitleFont(42);
   Graph_Graph1021->GetZaxis()->SetLabelFont(42);
   Graph_Graph1021->GetZaxis()->SetLabelOffset(0.007);
   Graph_Graph1021->GetZaxis()->SetTitleSize(0.05);
   Graph_Graph1021->GetZaxis()->SetTickLength(0.025);
   Graph_Graph1021->GetZaxis()->SetTitleFont(42);
   gre->SetHistogram(Graph_Graph1021);
   
   gre->Draw("pe0");
   pad2->Modified();
   c1->cd();
   c1->Modified();
   c1->cd();
   c1->SetSelected(c1);
}
Beispiel #11
0
void combine()
{
   gROOT->SetBatch(1);

   SetPlotStyle();

   std::string tag = "CSVM";
   std::string tagName = "CSVv2M";
//   std::string tag = "CMVAT";
//   std::string tagName = "cMVAv2T";

//   const int nPT = 15;
/*   const int nPT = 14;
   std::string pt[nPT] = 
     {
	"pt20t30",
	"pt30t40",
	"pt40t50",
	"pt50t60",
	"pt60t70",
	"pt70t80",
	"pt80t100",
	"pt100t120",
	"pt120t160",
	"pt160t210",
	"pt210t260",
	"pt260t320",
	"pt320t400",
	"pt400t500"
//	"pt500t670"
     };*/
   
/*   const int nPT = 7;
   std::string pt[nPT] =
     {
	"pt30t50",
	"pt50t70",
	"pt70t100",
	"pt100t140",
	"pt140t200",
	"pt200t300",
	"pt300t670"
     };*/

/*   const int nPT = 5;
   std::string pt[nPT] =
     {
	"pt200t220",
	"pt220t250",
	"pt250t300",
	"pt300t400",
	"pt400t650"
     };*/

   const int nPT = 5;
   std::string pt[nPT] =
     {
	"pt30t80",
	"pt80t140",
	"pt140t180",
	"pt180t240",
	"pt240t420"
     };

/*   int ptb[nPT+1] =
     {
	30,50,70,100,140,200,300,670
     };*/

/*   int ptb[nPT+1] =
     {
	200,220,250,300,400,650
     };*/

   int ptb[nPT+1] =
     {
	30,80,140,180,240,420
     };
   
   float xbins[nPT];
   for(int j=0;j<=nPT;j++)
     {
	xbins[j] = ptb[j]/1000.;
     }
   
   TH1F *h_SF = new TH1F("h_SF","h_SF",nPT,xbins);
   TH1F *h_SF_TOTAL_UP = new TH1F("h_SF_TOTAL_UP","h_SF_TOTAL_UP",nPT,xbins);
   TH1F *h_SF_TOTAL_DOWN = new TH1F("h_SF_TOTAL_DOWN","h_SF_TOTAL_DOWN",nPT,xbins);
   
   TH1F *h_frb = new TH1F("h_frb","h_frb",nPT,xbins);
   TH1F *h_frb_TOTAL_UP = new TH1F("h_frb_TOTAL_UP","h_frb_TOTAL_UP",nPT,xbins);
   TH1F *h_frb_TOTAL_DOWN = new TH1F("h_frb_TOTAL_DOWN","h_frb_TOTAL_DOWN",nPT,xbins);
   TH1F *h_frc = new TH1F("h_frc","h_frc",nPT,xbins);
   TH1F *h_frc_TOTAL_UP = new TH1F("h_frc_TOTAL_UP","h_frc_TOTAL_UP",nPT,xbins);
   TH1F *h_frc_TOTAL_DOWN = new TH1F("h_frc_TOTAL_DOWN","h_frc_TOTAL_DOWN",nPT,xbins);
   TH1F *h_frl = new TH1F("h_frl","h_frl",nPT,xbins);
   TH1F *h_frl_TOTAL_UP = new TH1F("h_frl_TOTAL_UP","h_frl_TOTAL_UP",nPT,xbins);
   TH1F *h_frl_TOTAL_DOWN = new TH1F("h_frl_TOTAL_DOWN","h_frl_TOTAL_DOWN",nPT,xbins);
   
   TH1F *h_frb_tag = new TH1F("h_frb_tag","h_frb_tag",nPT,xbins);
   TH1F *h_frb_tag_TOTAL_UP = new TH1F("h_frb_tag_TOTAL_UP","h_frb_tag_TOTAL_UP",nPT,xbins);
   TH1F *h_frb_tag_TOTAL_DOWN = new TH1F("h_frb_tag_TOTAL_DOWN","h_frb_tag_TOTAL_DOWN",nPT,xbins);
   TH1F *h_frc_tag = new TH1F("h_frc_tag","h_frc_tag",nPT,xbins);
   TH1F *h_frc_tag_TOTAL_UP = new TH1F("h_frc_tag_TOTAL_UP","h_frc_tag_TOTAL_UP",nPT,xbins);
   TH1F *h_frc_tag_TOTAL_DOWN = new TH1F("h_frc_tag_TOTAL_DOWN","h_frc_tag_TOTAL_DOWN",nPT,xbins);
   TH1F *h_frl_tag = new TH1F("h_frl_tag","h_frl_tag",nPT,xbins);
   TH1F *h_frl_tag_TOTAL_UP = new TH1F("h_frl_tag_TOTAL_UP","h_frl_tag_TOTAL_UP",nPT,xbins);
   TH1F *h_frl_tag_TOTAL_DOWN = new TH1F("h_frl_tag_TOTAL_DOWN","h_frl_tag_TOTAL_DOWN",nPT,xbins);
   
   std::string head = "CSV;OperatingPoint,measurementType,sysType,jetFlavor,etaMin,etaMax,ptMin,ptMax,discrMin,discrMax,formula";
   std::string fname = "results/CSV_13TEV_"+SFver+"_"+tagName+"_LT.csv";
   std::ofstream sfComb(fname.c_str());
   sfComb << head << std::endl;

   std::vector<std::vector<float> > Comb_sigma_syst;
   std::vector<std::vector<std::string> > Comb_sigma_syst_name;
   std::vector<float> Comb_sf;
   std::vector<int> Comb_op;
   std::vector<std::string> Comb_type;
   std::vector<int> Comb_flav;
   std::vector<float> Comb_etaMin;
   std::vector<float> Comb_etaMax;
   std::vector<float> Comb_discMin;
   std::vector<float> Comb_discMax;
   std::vector<int> Comb_ptMin;
   std::vector<int> Comb_ptMax;
   
   for(int ipt=0;ipt<nPT;ipt++)
     {
	if( tag == "CSVL" || tag == "CMVAL" ) Comb_op.push_back(0);
	else if( tag == "CSVM" || tag == "CMVAM" ) Comb_op.push_back(1);
	else if( tag == "CSVT" || tag == "CMVAT" ) Comb_op.push_back(2);
	
	Comb_type.push_back("lt");
	Comb_flav.push_back(0);
	Comb_etaMin.push_back(0.0);
	Comb_etaMax.push_back(2.4);
	Comb_discMin.push_back(0.0);
	Comb_discMax.push_back(1.0);
	
	std::vector<int> run;
	std::vector<float> sf;
	std::vector<float> frb;
	std::vector<float> frbTag;
	std::vector<float> frc;
	std::vector<float> frcTag;
	std::vector<float> frl;
	std::vector<float> frlTag;
	
	int idxNom = -666;

	for(int is=0;is<=2;is++) // FIXME !!!
	  {
	     std::string prefix;
	     if( is == 0 ) prefix = "results_"+tag+"_MJBOOSTS1_SUB/";
	     else if( is == 1 ) prefix = "results_"+tag+"_MJBOOSTS2_SUB/";
//	     if( is == 0 ) prefix = "results/";
//	     if( is == 0 ) prefix = "results_"+tag+"_MJ/";
//	     else if( is == 1 ) prefix = "results_"+tag+"_MJAWAY/";
//	     else if( is == 2 ) prefix = "results_"+tag+"_MJ1/";
//	     else if( is == 2 ) prefix = "results_"+tag+"_MJIAWAY/";
	     else continue;
	     
	     // read result files
	     std::string fname = prefix+pt[ipt]+"_"+tag+".csv";
	     std::ifstream f(fname.c_str());
	     if( !f.is_open() ) continue;
	     std::cout << fname << std::endl;
	     
	     int iline = 0;
	     while( !f.eof() )
	       {	     
		  std::string line;
		  f >> line;
		  if( iline == 0 ) {iline++; continue;}
		  std::stringstream ss(line);
		  std::string item;
		  int idx = 0;
		  while( std::getline(ss,item,',') )
		    {
		       int run_v = -1;
		       if( idx == 3 ) run_v = atoi(item.c_str());
		       
		       if( is == 0 && idx == 3 && run_v == 0 ) idxNom = iline-1;

		       if( (iline == 1 && is == 1) || 
			   (iline == 1 && is == 2) ||
			   (iline == 1 && is == 3) ||
			   is == 0 )
			 {			    
			    if( is == 1 ) run_v = 200;
			    if( is == 2 ) run_v = 201;
			    if( is == 3 ) run_v = 202;
			    
			    if( idx == 3 ) run.push_back(run_v);
			    
			    if( idx == 24 ) 
			      {
				 sf.push_back(atof(item.c_str())); // FIXME IF FORMAT CHANGES
			      }

			    if( idx == 14 ) frb.push_back(atof(item.c_str()));
			    if( idx == 15 ) frbTag.push_back(atof(item.c_str()));
			    if( idx == 16 ) frc.push_back(atof(item.c_str()));
			    if( idx == 17 ) frcTag.push_back(atof(item.c_str()));
			    if( idx == 18 ) frl.push_back(atof(item.c_str()));
			    if( idx == 19 ) frlTag.push_back(atof(item.c_str()));
			    
			    if( iline == 1 && is == 0 && (run_v < 100 || run_v >= 666) )
			      {
				 if( idx == 0 ) Comb_ptMin.push_back(atoi(item.c_str()));
				 if( idx == 1 ) Comb_ptMax.push_back(atoi(item.c_str()));
			      }		  
			 }		       
		       
		       idx++;
		    }
		  
		  iline++;
	       }
	     
	     f.close();
	  }	
	
	// do calculations
	int nRES = run.size();
	
	float sigma_syst_up = 0.;
	float sigma_syst_down = 0.;
	float sigma_total_up = 0.;
	float sigma_total_down = 0.;
	float sigma_stat = 0.;
	float sf_stat_sum = 0.;
	float istat = 0;

	float frb_sigma_total_up = 0.;
	float frb_sigma_total_down = 0.;
	float frc_sigma_total_up = 0.;
	float frc_sigma_total_down = 0.;
	float frl_sigma_total_up = 0.;
	float frl_sigma_total_down = 0.;
	
	float frb_sigma_syst_up = 0.;
	float frb_sigma_syst_down = 0.;
	float frc_sigma_syst_up = 0.;
	float frc_sigma_syst_down = 0.;
	float frl_sigma_syst_up = 0.;
	float frl_sigma_syst_down = 0.;

	float frb_tag_sigma_total_up = 0.;
	float frb_tag_sigma_total_down = 0.;
	float frc_tag_sigma_total_up = 0.;
	float frc_tag_sigma_total_down = 0.;
	float frl_tag_sigma_total_up = 0.;
	float frl_tag_sigma_total_down = 0.;
	
	float frb_tag_sigma_syst_up = 0.;
	float frb_tag_sigma_syst_down = 0.;
	float frc_tag_sigma_syst_up = 0.;
	float frc_tag_sigma_syst_down = 0.;
	float frl_tag_sigma_syst_up = 0.;
	float frl_tag_sigma_syst_down = 0.;
	
	float frb_stat_sum = 0.;
	float sigma_frb_stat = 0.;
	float frc_stat_sum = 0.;
	float sigma_frc_stat = 0.;
	float frl_stat_sum = 0.;
	float sigma_frl_stat = 0.;

	float frbTag_stat_sum = 0.;
	float sigma_frbTag_stat = 0.;
	float frcTag_stat_sum = 0.;
	float sigma_frcTag_stat = 0.;
	float frlTag_stat_sum = 0.;
	float sigma_frlTag_stat = 0.;
	
	std::vector<float> sigma_syst_sep;
	std::vector<std::string> sigma_syst_name;
	float sigma_syst_add = 0.;
	float frb_sigma_syst_add = 0.;
	float frc_sigma_syst_add = 0.;
	float frl_sigma_syst_add = 0.;

	float frb_tag_sigma_syst_add = 0.;
	float frc_tag_sigma_syst_add = 0.;
	float frl_tag_sigma_syst_add = 0.;
	
	std::vector<float> frb_sigma_syst_sep;
	std::vector<float> frc_sigma_syst_sep;
	std::vector<float> frl_sigma_syst_sep;

	std::vector<float> frb_tag_sigma_syst_sep;
	std::vector<float> frc_tag_sigma_syst_sep;
	std::vector<float> frl_tag_sigma_syst_sep;
	
	std::vector<std::string> frb_sigma_syst_name;
	std::vector<std::string> frc_sigma_syst_name;
	std::vector<std::string> frl_sigma_syst_name;

	std::vector<std::string> frb_tag_sigma_syst_name;
	std::vector<std::string> frc_tag_sigma_syst_name;
	std::vector<std::string> frl_tag_sigma_syst_name;
	
	for(int i=0;i<nRES;i++)
	  {
	     if( i == idxNom )
	       {
		  sigma_syst_sep.push_back(sf[idxNom]);
		  sigma_syst_name.push_back(getSysName(run[i]));
		  continue;
	       }	     
	     
	     if( run[i] < 666 )
	       {	
		  float delta = sf[idxNom]-sf[i];
		  bool isUp = (delta < 0);
		  float err = delta*delta;
		  if( run[i] < 100 )
		    {		       
		       if( isUp ) sigma_syst_up += err;		  
		       else sigma_syst_down += err;
		    }
		  if( run[i] >= 100 && run[i] <= 202 )
		    {
		       sigma_syst_up += pow(delta,2);
		       sigma_syst_down += pow(delta,2);
		    }		  

		  if( run[i] < 100 )
		    {		       
		       if( isUp ) sigma_syst_sep.push_back(sf[idxNom]+sqrt(err));
		       else sigma_syst_sep.push_back(sf[idxNom]-sqrt(err));
		       sigma_syst_name.push_back(getSysName(run[i]));
		    }		  		  
		  if( run[i] >= 100 && run[i] <= 202 )
		    {
		       sigma_syst_add += pow(delta,2);
		    }	
		  
		  // frb
		  float delta_frb = frb[idxNom]-frb[i];
		  bool isUp_frb = (delta_frb < 0);
		  float err_frb = delta_frb*delta_frb;
		  if( isUp_frb ) frb_sigma_syst_up += err_frb;
		  else frb_sigma_syst_down += err_frb;
		  if( run[i] < 100 )
		    {		       
		       if( isUp_frb ) frb_sigma_syst_sep.push_back(frb[idxNom]+sqrt(err_frb));
		       else frb_sigma_syst_sep.push_back(frb[idxNom]-sqrt(err_frb));
		       frb_sigma_syst_name.push_back(getSysName(run[i]));
		    }		  		  
		  if( run[i] >= 100 && run[i] <= 202 )
		    {
		       frb_sigma_syst_add += pow(delta_frb,2);
		    }	

		  // frbTag
		  float delta_frb_tag = frbTag[idxNom]-frbTag[i];
		  bool isUp_frb_tag = (delta_frb_tag < 0);
		  float err_frb_tag = delta_frb_tag*delta_frb_tag;
		  if( isUp_frb_tag ) frb_tag_sigma_syst_up += err_frb_tag;
		  else frb_tag_sigma_syst_down += err_frb_tag;
		  if( run[i] < 100 )
		    {		       
		       if( isUp_frb_tag ) frb_tag_sigma_syst_sep.push_back(frbTag[idxNom]+sqrt(err_frb_tag));
		       else frb_tag_sigma_syst_sep.push_back(frbTag[idxNom]-sqrt(err_frb_tag));
		       frb_tag_sigma_syst_name.push_back(getSysName(run[i]));
		    }		  		  
		  if( run[i] >= 100 && run[i] <= 202 )
		    {
		       frb_tag_sigma_syst_add += pow(delta_frb_tag,2);
		    }	
		  
		  // frc
		  float delta_frc = frc[idxNom]-frc[i];
		  bool isUp_frc = (delta_frc < 0);
		  float err_frc = delta_frc*delta_frc;
		  if( isUp_frc ) frc_sigma_syst_up += err_frc;
		  else frc_sigma_syst_down += err_frc;
		  if( run[i] < 100 )
		    {		       
		       if( isUp_frc ) frc_sigma_syst_sep.push_back(frc[idxNom]+sqrt(err_frc));
		       else frc_sigma_syst_sep.push_back(frc[idxNom]-sqrt(err_frc));
		       frc_sigma_syst_name.push_back(getSysName(run[i]));
		    }		  		  
		  if( run[i] >= 100 && run[i] <= 202 )
		    {
		       frc_sigma_syst_add += pow(delta_frc,2);
		    }	

		  // frcTag
		  float delta_frc_tag = frcTag[idxNom]-frcTag[i];
		  bool isUp_frc_tag = (delta_frc_tag < 0);
		  float err_frc_tag = delta_frc_tag*delta_frc_tag;
		  if( isUp_frc_tag ) frc_tag_sigma_syst_up += err_frc_tag;
		  else frc_tag_sigma_syst_down += err_frc_tag;
		  if( run[i] < 100 )
		    {		       
		       if( isUp_frc_tag ) frc_tag_sigma_syst_sep.push_back(frcTag[idxNom]+sqrt(err_frc_tag));
		       else frc_tag_sigma_syst_sep.push_back(frcTag[idxNom]-sqrt(err_frc_tag));
		       frc_tag_sigma_syst_name.push_back(getSysName(run[i]));
		    }		  		  
		  if( run[i] >= 100 && run[i] <= 202 )
		    {
		       frc_tag_sigma_syst_add += pow(delta_frc_tag,2);
		    }	
		  
		  // frl
		  float delta_frl = frl[idxNom]-frl[i];
		  bool isUp_frl = (delta_frl < 0);
		  float err_frl = delta_frl*delta_frl;
		  if( isUp_frl ) frl_sigma_syst_up += err_frl;
		  else frl_sigma_syst_down += err_frl;
		  if( run[i] < 100 )
		    {		       
		       if( isUp_frl ) frl_sigma_syst_sep.push_back(frl[idxNom]+sqrt(err_frl));
		       else frl_sigma_syst_sep.push_back(frl[idxNom]-sqrt(err_frl));
		       frl_sigma_syst_name.push_back(getSysName(run[i]));
		    }		  		  
		  if( run[i] >= 100 && run[i] <= 202 )
		    {
		       frl_sigma_syst_add += pow(delta_frl,2);
		    }	

		  // frlTag
		  float delta_frl_tag = frlTag[idxNom]-frlTag[i];
		  bool isUp_frl_tag = (delta_frl_tag < 0);
		  float err_frl_tag = delta_frl_tag*delta_frl_tag;
		  if( isUp_frl_tag ) frl_tag_sigma_syst_up += err_frl_tag;
		  else frl_tag_sigma_syst_down += err_frl_tag;
		  if( run[i] < 100 )
		    {		       
		       if( isUp_frl_tag ) frl_tag_sigma_syst_sep.push_back(frlTag[idxNom]+sqrt(err_frl_tag));
		       else frl_tag_sigma_syst_sep.push_back(frlTag[idxNom]-sqrt(err_frl_tag));
		       frl_tag_sigma_syst_name.push_back(getSysName(run[i]));
		    }		  		  
		  if( run[i] >= 100 && run[i] <= 202 )
		    {
		       frl_tag_sigma_syst_add += pow(delta_frl_tag,2);
		    }	
	       }
	     else
	       {
		  sf_stat_sum += sf[i];
		  frb_stat_sum += frb[i];
		  frc_stat_sum += frc[i];
		  frl_stat_sum += frl[i];
		  frbTag_stat_sum += frbTag[i];
		  frcTag_stat_sum += frcTag[i];
		  frlTag_stat_sum += frlTag[i];
		  istat++;
	       }	     
	  }
	sigma_syst_add = sqrt(sigma_syst_add);
	frb_sigma_syst_add = sqrt(frb_sigma_syst_add);
	frc_sigma_syst_add = sqrt(frc_sigma_syst_add);
	frl_sigma_syst_add = sqrt(frl_sigma_syst_add);

	frb_tag_sigma_syst_add = sqrt(frb_tag_sigma_syst_add);
	frc_tag_sigma_syst_add = sqrt(frc_tag_sigma_syst_add);
	frl_tag_sigma_syst_add = sqrt(frl_tag_sigma_syst_add);
	
	Comb_sf.push_back(sf[idxNom]);
	
	sf_stat_sum /= istat;	
	frb_stat_sum /= istat;
	frc_stat_sum /= istat;
	frl_stat_sum /= istat;
	frbTag_stat_sum /= istat;
	frcTag_stat_sum /= istat;
	frlTag_stat_sum /= istat;

	float sfcbsys = 0.;
	// add Cb systematics
	if( inclCB )
	  {	     
	     float cb = getCb(tag,"bjet",ipt+1);
//	     float cb = getCb(tag,"bjet",ipt+1+1); //FIXME if include 20-30 bin
	     float cbsys = (1-cb)*0.5/cb;
	     sfcbsys = pow(cbsys*sf[idxNom],2);
	     
	     sigma_syst_up += sfcbsys;
	     sigma_syst_down += sfcbsys;
	  }
	
	// add add
//	sigma_syst_up += sigma_syst_add*sigma_syst_add;
//	sigma_syst_down += sigma_syst_add*sigma_syst_add;
	
	for(int i=0;i<istat;i++)
	  {	     
	     sigma_stat += pow(sf_stat_sum-sf[i],2)/istat;
	     sigma_frb_stat += pow(frb_stat_sum-frb[i],2)/istat;
	     sigma_frc_stat += pow(frc_stat_sum-frc[i],2)/istat;
	     sigma_frl_stat += pow(frl_stat_sum-frl[i],2)/istat;
	     sigma_frbTag_stat += pow(frbTag_stat_sum-frbTag[i],2)/istat;
	     sigma_frcTag_stat += pow(frcTag_stat_sum-frcTag[i],2)/istat;
	     sigma_frlTag_stat += pow(frlTag_stat_sum-frlTag[i],2)/istat;
	  }
	sigma_stat = sqrt(sigma_stat);
	sigma_frb_stat = sqrt(sigma_frb_stat);
	sigma_frc_stat = sqrt(sigma_frc_stat);
	sigma_frl_stat = sqrt(sigma_frl_stat);
	sigma_frbTag_stat = sqrt(sigma_frbTag_stat);
	sigma_frcTag_stat = sqrt(sigma_frcTag_stat);
	sigma_frlTag_stat = sqrt(sigma_frlTag_stat);
	
	sigma_syst_up = sqrt(sigma_syst_up);
	sigma_syst_down = sqrt(sigma_syst_down);

	frb_sigma_syst_up = sqrt(frb_sigma_syst_up);
	frb_sigma_syst_down = sqrt(frb_sigma_syst_down);
	frc_sigma_syst_up = sqrt(frc_sigma_syst_up);
	frc_sigma_syst_down = sqrt(frc_sigma_syst_down);
	frl_sigma_syst_up = sqrt(frl_sigma_syst_up);
	frl_sigma_syst_down = sqrt(frl_sigma_syst_down);

	frb_tag_sigma_syst_up = sqrt(frb_tag_sigma_syst_up);
	frb_tag_sigma_syst_down = sqrt(frb_tag_sigma_syst_down);
	frc_tag_sigma_syst_up = sqrt(frc_tag_sigma_syst_up);
	frc_tag_sigma_syst_down = sqrt(frc_tag_sigma_syst_down);
	frl_tag_sigma_syst_up = sqrt(frl_tag_sigma_syst_up);
	frl_tag_sigma_syst_down = sqrt(frl_tag_sigma_syst_down);
	
	sigma_total_up = sqrt(sigma_stat*sigma_stat+sigma_syst_up*sigma_syst_up);
	sigma_total_down = sqrt(sigma_stat*sigma_stat+sigma_syst_down*sigma_syst_down);

	frb_sigma_total_up = sqrt(sigma_frb_stat*sigma_frb_stat+frb_sigma_syst_up*frb_sigma_syst_up);
	frb_sigma_total_down = sqrt(sigma_frb_stat*sigma_frb_stat+frb_sigma_syst_down*frb_sigma_syst_down);
	frc_sigma_total_up = sqrt(sigma_frc_stat*sigma_frc_stat+frc_sigma_syst_up*frc_sigma_syst_up);
	frc_sigma_total_down = sqrt(sigma_frc_stat*sigma_frc_stat+frc_sigma_syst_down*frc_sigma_syst_down);
	frl_sigma_total_up = sqrt(sigma_frl_stat*sigma_frl_stat+frl_sigma_syst_up*frl_sigma_syst_up);
	frl_sigma_total_down = sqrt(sigma_frl_stat*sigma_frl_stat+frl_sigma_syst_down*frl_sigma_syst_down);

	frb_tag_sigma_total_up = sqrt(sigma_frbTag_stat*sigma_frbTag_stat+frb_tag_sigma_syst_up*frb_tag_sigma_syst_up);
	frb_tag_sigma_total_down = sqrt(sigma_frbTag_stat*sigma_frbTag_stat+frb_tag_sigma_syst_down*frb_tag_sigma_syst_down);
	frc_tag_sigma_total_up = sqrt(sigma_frcTag_stat*sigma_frcTag_stat+frc_tag_sigma_syst_up*frc_tag_sigma_syst_up);
	frc_tag_sigma_total_down = sqrt(sigma_frcTag_stat*sigma_frcTag_stat+frc_tag_sigma_syst_down*frc_tag_sigma_syst_down);
	frl_tag_sigma_total_up = sqrt(sigma_frlTag_stat*sigma_frlTag_stat+frl_tag_sigma_syst_up*frl_tag_sigma_syst_up);
	frl_tag_sigma_total_down = sqrt(sigma_frlTag_stat*sigma_frlTag_stat+frl_tag_sigma_syst_down*frl_tag_sigma_syst_down);
	
	float SF = sf[idxNom];
	float SF_STAT = SF+sigma_stat;
	float SF_SYST_UP = SF+sigma_syst_up;
	float SF_SYST_DOWN = SF-sigma_syst_down;
	float SF_TOTAL_UP = SF+sigma_total_up;
	float SF_TOTAL_DOWN = SF-sigma_total_down;
	
	h_SF->SetBinContent(ipt+1,SF);
	h_SF->SetBinError(ipt+1,sigma_stat);
	
	h_SF_TOTAL_UP->SetBinContent(ipt+1,SF_TOTAL_UP);
	h_SF_TOTAL_DOWN->SetBinContent(ipt+1,SF_TOTAL_DOWN);

	float FRB = frb[idxNom];
	float FRB_STAT = FRB+sigma_frb_stat;
	float FRB_SYST_UP = FRB+frb_sigma_syst_up;
	float FRB_SYST_DOWN = FRB-frb_sigma_syst_down;
	float FRB_TOTAL_UP = FRB+frb_sigma_total_up;
	float FRB_TOTAL_DOWN = FRB-frb_sigma_total_down;
	
	h_frb->SetBinContent(ipt+1,FRB);
	h_frb->SetBinError(ipt+1,sigma_frb_stat);
	h_frb_TOTAL_UP->SetBinContent(ipt+1,FRB_TOTAL_UP);
	h_frb_TOTAL_DOWN->SetBinContent(ipt+1,FRB_TOTAL_DOWN);

	float FRC = frc[idxNom];
	float FRC_STAT = FRC+sigma_frc_stat;
	float FRC_SYST_UP = FRC+frc_sigma_syst_up;
	float FRC_SYST_DOWN = FRC-frc_sigma_syst_down;
	float FRC_TOTAL_UP = FRC+frc_sigma_total_up;
	float FRC_TOTAL_DOWN = FRC-frc_sigma_total_down;
	
	h_frc->SetBinContent(ipt+1,FRC);
	h_frc->SetBinError(ipt+1,sigma_frc_stat);
	h_frc_TOTAL_UP->SetBinContent(ipt+1,FRC_TOTAL_UP);
	h_frc_TOTAL_DOWN->SetBinContent(ipt+1,FRC_TOTAL_DOWN);

	float FRL = frl[idxNom];
	float FRL_STAT = FRL+sigma_frl_stat;
	float FRL_SYST_UP = FRL+frl_sigma_syst_up;
	float FRL_SYST_DOWN = FRL-frl_sigma_syst_down;
	float FRL_TOTAL_UP = FRL+frl_sigma_total_up;
	float FRL_TOTAL_DOWN = FRL-frl_sigma_total_down;
	
	h_frl->SetBinContent(ipt+1,FRL);
	h_frl->SetBinError(ipt+1,sigma_frl_stat);
	h_frl_TOTAL_UP->SetBinContent(ipt+1,FRL_TOTAL_UP);
	h_frl_TOTAL_DOWN->SetBinContent(ipt+1,FRL_TOTAL_DOWN);

	float FRB_TAG = frbTag[idxNom];
	float FRB_TAG_STAT = FRB_TAG+sigma_frbTag_stat;
	float FRB_TAG_SYST_UP = FRB_TAG+frb_tag_sigma_syst_up;
	float FRB_TAG_SYST_DOWN = FRB_TAG-frb_tag_sigma_syst_down;
	float FRB_TAG_TOTAL_UP = FRB_TAG+frb_tag_sigma_total_up;
	float FRB_TAG_TOTAL_DOWN = FRB_TAG-frb_tag_sigma_total_down;
	
	h_frb_tag->SetBinContent(ipt+1,FRB_TAG);
	h_frb_tag->SetBinError(ipt+1,sigma_frbTag_stat);
	h_frb_tag_TOTAL_UP->SetBinContent(ipt+1,FRB_TAG_TOTAL_UP);
	h_frb_tag_TOTAL_DOWN->SetBinContent(ipt+1,FRB_TAG_TOTAL_DOWN);

	float FRC_TAG = frcTag[idxNom];
	float FRC_TAG_STAT = FRC_TAG+sigma_frcTag_stat;
	float FRC_TAG_SYST_UP = FRC_TAG+frc_tag_sigma_syst_up;
	float FRC_TAG_SYST_DOWN = FRC_TAG-frc_tag_sigma_syst_down;
	float FRC_TAG_TOTAL_UP = FRC_TAG+frc_tag_sigma_total_up;
	float FRC_TAG_TOTAL_DOWN = FRC_TAG-frc_tag_sigma_total_down;
	
	h_frc_tag->SetBinContent(ipt+1,FRC_TAG);
	h_frc_tag->SetBinError(ipt+1,sigma_frcTag_stat);
	h_frc_tag_TOTAL_UP->SetBinContent(ipt+1,FRC_TAG_TOTAL_UP);
	h_frc_tag_TOTAL_DOWN->SetBinContent(ipt+1,FRC_TAG_TOTAL_DOWN);

	float FRL_TAG = frlTag[idxNom];
	float FRL_TAG_STAT = FRL_TAG+sigma_frlTag_stat;
	float FRL_TAG_SYST_UP = FRL_TAG+frl_tag_sigma_syst_up;
	float FRL_TAG_SYST_DOWN = FRL_TAG-frl_tag_sigma_syst_down;
	float FRL_TAG_TOTAL_UP = FRL_TAG+frl_tag_sigma_total_up;
	float FRL_TAG_TOTAL_DOWN = FRL_TAG-frl_tag_sigma_total_down;
	
	h_frl_tag->SetBinContent(ipt+1,FRL_TAG);
	h_frl_tag->SetBinError(ipt+1,sigma_frlTag_stat);
	h_frl_tag_TOTAL_UP->SetBinContent(ipt+1,FRL_TAG_TOTAL_UP);
	h_frl_tag_TOTAL_DOWN->SetBinContent(ipt+1,FRL_TAG_TOTAL_DOWN);
	
	// additional uncertainties
	
	// stat
	sigma_syst_name.push_back("up_statistic");
	sigma_syst_sep.push_back(SF+sigma_stat);
	sigma_syst_name.push_back("down_statistic");
	sigma_syst_sep.push_back(SF-sigma_stat);
	
	// cb
	sigma_syst_name.push_back("up_cb");
	sigma_syst_sep.push_back(SF+sqrt(sfcbsys));
	sigma_syst_name.push_back("down_cb");
	sigma_syst_sep.push_back(SF-sqrt(sfcbsys));

	// add
	sigma_syst_name.push_back("up_add");
	sigma_syst_sep.push_back(SF+sigma_syst_add);
	sigma_syst_name.push_back("down_add");
	sigma_syst_sep.push_back(SF-sigma_syst_add);

	// total
	sigma_syst_name.push_back("up");
	sigma_syst_sep.push_back(SF_TOTAL_UP);
	sigma_syst_name.push_back("down");
	sigma_syst_sep.push_back(SF_TOTAL_DOWN);
	
	Comb_sigma_syst.push_back(sigma_syst_sep);
	Comb_sigma_syst_name.push_back(sigma_syst_name);
     }
   
   // draw SF
   TCanvas *c1 = new TCanvas("c1","c1",0,0,600,500);
   c1->SetGrid(1);
   
   std::string csv = "#bf{"+tagName+"}";
   
   const int np = 2*(nPT+2)+1;
   double xp_sysTot_SF[np];
   double yp_sysTot_SF[np];
   for(int k=0;k<nPT+2;k++)
     {
	float addw = h_SF->GetBinWidth(k)/2.0;
	if( k == 0 ) addw = 0.0;
	if( k == nPT+1 ) addw = h_SF->GetBinWidth(k-1);
	
	int ib = k+1;
	if( k > 0 ) ib--;
	if( k == nPT+1 ) ib--;
	
	xp_sysTot_SF[k] = addw + h_SF->GetXaxis()->GetBinLowEdge(ib);
	yp_sysTot_SF[k] = h_SF_TOTAL_UP->GetBinContent(ib);
	yp_sysTot_SF[nPT+2+k] = h_SF_TOTAL_DOWN->GetBinContent(nPT-(ib-1));
     }      
   for(int k=0;k<nPT+2;k++)
     {
	xp_sysTot_SF[nPT+2+k] = xp_sysTot_SF[nPT+2-k-1];
     }	
   xp_sysTot_SF[np-1] = xp_sysTot_SF[0];   
   yp_sysTot_SF[np-1] = yp_sysTot_SF[0];
   
   TPolyLine *sysTot_SF = new TPolyLine(np,xp_sysTot_SF,yp_sysTot_SF);
   sysTot_SF->SetFillColor(kYellow);
	
   if( !doSFc ) h_SF->GetYaxis()->SetTitle("SF_{b}");
   else h_SF->GetYaxis()->SetTitle("SF_{c}");
   h_SF->GetXaxis()->SetTitle("p_{T} [TeV]");
   h_SF->SetMarkerSize(0.8);

   h_SF->Draw("e1p");
	
   h_SF->GetXaxis()->SetMoreLogLabels();
   h_SF->GetXaxis()->SetNoExponent();
   h_SF->GetYaxis()->SetRangeUser(0.40,1.30);
	
   sysTot_SF->Draw("fSAME");
   h_SF->Draw("e1p same");
   
   TLegend *leg;
   leg = new TLegend(0.35,0.45,0.70,0.20);
   leg->SetFillColor(253);
   leg->SetBorderSize(0);
   
   TLatex *legl = new TLatex();
   legl->SetNDC();
   legl->SetTextAlign(22);
   legl->SetTextFont(63);
   legl->SetTextSizePixels(30);
   legl->DrawLatex(0.55,0.82,csv.c_str());
   
   leg->AddEntry(h_SF,"Scale factor","p");
   leg->AddEntry(h_SF,"stat","l");
   leg->AddEntry(sysTot_SF,"stat #oplus syst","f");
   
   c1->RedrawAxis("g");
   
   leg->Draw();
   
//   c1->SetLogx(1);
//   TLatex *lab = CMSLABEL();
//   lab->Draw("same");
   
   TLatex *tex = new TLatex(0.1969,0.906825,"CMS");
   tex->SetNDC();
   tex->SetTextAlign(13);
   tex->SetTextFont(61);
   tex->SetTextSize(0.07475);
   tex->SetLineWidth(2);
   tex->Draw();

   TLatex *tex2 = new TLatex(0.1969,0.817125,"Preliminary");
   tex2->SetNDC();
   tex2->SetTextAlign(13);
   tex2->SetTextFont(52);
   tex2->SetTextSize(0.05681);
   tex2->SetLineWidth(2);
   tex2->Draw();

   TLatex *text1 = new TLatex(0.98,0.95125,"#sqrt{s} = 13 TeV, 25 ns");
   text1->SetNDC();
   text1->SetTextAlign(31);
   text1->SetTextFont(42);
   text1->SetTextSize(0.04875);
   text1->SetLineWidth(2);
   text1->Draw();
   
   std::string picname = "pics/SF_"+tag+".eps";
   c1->Print(picname.c_str());
   c1->Clear();
   
   delete sysTot_SF;
   
   delete c1;
   delete leg;
   delete legl;

   // draw fractions noTag
   TCanvas *c2 = new TCanvas("c2","c2",0,0,600,500);
   c2->SetGrid(1);

   // frb
   double xp_sysTot_FRB[np];
   double yp_sysTot_FRB[np];
   for(int k=0;k<nPT+2;k++)
     {
	float addw = h_frb->GetBinWidth(k)/2.0;
	if( k == 0 ) addw = 0.0;
	if( k == nPT+1 ) addw = h_frb->GetBinWidth(k-1);
	
	int ib = k+1;
	if( k > 0 ) ib--;
	if( k == nPT+1 ) ib--;
	
	xp_sysTot_FRB[k] = addw + h_frb->GetXaxis()->GetBinLowEdge(ib);
	yp_sysTot_FRB[k] = h_frb_TOTAL_UP->GetBinContent(ib);
	yp_sysTot_FRB[nPT+2+k] = h_frb_TOTAL_DOWN->GetBinContent(nPT-(ib-1));
     }      
   for(int k=0;k<nPT+2;k++)
     {
	xp_sysTot_FRB[nPT+2+k] = xp_sysTot_FRB[nPT+2-k-1];
     }	
   xp_sysTot_FRB[np-1] = xp_sysTot_FRB[0];
   yp_sysTot_FRB[np-1] = yp_sysTot_FRB[0];
   
   TPolyLine *sysTot_FRB = new TPolyLine(np,xp_sysTot_FRB,yp_sysTot_FRB);
   sysTot_FRB->SetFillColor(kRed);
   sysTot_FRB->SetLineColor(kRed);
//   sysTot_FRB->SetFillStyle(0);
   
   // frc
   double xp_sysTot_FRC[np];
   double yp_sysTot_FRC[np];
   for(int k=0;k<nPT+2;k++)
     {
	float addw = h_frc->GetBinWidth(k)/2.0;
	if( k == 0 ) addw = 0.0;
	if( k == nPT+1 ) addw = h_frc->GetBinWidth(k-1);
	
	int ib = k+1;
	if( k > 0 ) ib--;
	if( k == nPT+1 ) ib--;
	
	xp_sysTot_FRC[k] = addw + h_frc->GetXaxis()->GetBinLowEdge(ib);
	yp_sysTot_FRC[k] = h_frc_TOTAL_UP->GetBinContent(ib);
	yp_sysTot_FRC[nPT+2+k] = h_frc_TOTAL_DOWN->GetBinContent(nPT-(ib-1));
     }      
   for(int k=0;k<nPT+2;k++)
     {
	xp_sysTot_FRC[nPT+2+k] = xp_sysTot_FRC[nPT+2-k-1];
     }	
   xp_sysTot_FRC[np-1] = xp_sysTot_FRC[0];
   yp_sysTot_FRC[np-1] = yp_sysTot_FRC[0];
   
   TPolyLine *sysTot_FRC = new TPolyLine(np,xp_sysTot_FRC,yp_sysTot_FRC);
   sysTot_FRC->SetFillColor(kGreen);
   sysTot_FRC->SetLineColor(kGreen);
//   sysTot_FRC->SetFillStyle(0);

   // frl
   double xp_sysTot_FRL[np];
   double yp_sysTot_FRL[np];
   for(int k=0;k<nPT+2;k++)
     {
	float addw = h_frl->GetBinWidth(k)/2.0;
	if( k == 0 ) addw = 0.0;
	if( k == nPT+1 ) addw = h_frl->GetBinWidth(k-1);
	
	int ib = k+1;
	if( k > 0 ) ib--;
	if( k == nPT+1 ) ib--;
	
	xp_sysTot_FRL[k] = addw + h_frl->GetXaxis()->GetBinLowEdge(ib);
	yp_sysTot_FRL[k] = h_frl_TOTAL_UP->GetBinContent(ib);
	yp_sysTot_FRL[nPT+2+k] = h_frl_TOTAL_DOWN->GetBinContent(nPT-(ib-1));
     }      
   for(int k=0;k<nPT+2;k++)
     {
	xp_sysTot_FRL[nPT+2+k] = xp_sysTot_FRL[nPT+2-k-1];
     }	
   xp_sysTot_FRL[np-1] = xp_sysTot_FRL[0];
   yp_sysTot_FRL[np-1] = yp_sysTot_FRL[0];
   
   TPolyLine *sysTot_FRL = new TPolyLine(np,xp_sysTot_FRL,yp_sysTot_FRL);
   sysTot_FRL->SetFillColor(kBlue);
   sysTot_FRL->SetLineColor(kBlue);
   
   h_frb->GetYaxis()->SetTitle("Fit fraction");
   h_frb->GetXaxis()->SetTitle("p_{T} [TeV]");
   
   h_frb->SetMarkerSize(1.0);
   h_frc->SetMarkerSize(1.0);
   h_frl->SetMarkerSize(1.0);

   h_frb->SetMarkerStyle(20);
   h_frc->SetMarkerStyle(22);
   h_frl->SetMarkerStyle(24);
   
   h_frb->SetMarkerColor(0);
   h_frc->SetMarkerColor(0);
   h_frl->SetMarkerColor(0);

   h_frb->SetLineColor(0);
   h_frc->SetLineColor(0);
   h_frl->SetLineColor(0);
   
   h_frb->Draw("e1p");
   h_frc->Draw("e1p same");
   h_frl->Draw("e1p same");
	
   h_frb->GetXaxis()->SetMoreLogLabels();
   h_frb->GetXaxis()->SetNoExponent();
   h_frb->GetYaxis()->SetRangeUser(0.00,1.50);

   sysTot_FRB->Draw("fSAME");
   sysTot_FRC->Draw("fSAME");
   sysTot_FRL->Draw("fSAME");
   h_frb->Draw("e1p same");
   h_frc->Draw("e1p same");
   h_frl->Draw("e1p same");
   
   TLegend *leg2;
   leg2 = new TLegend(0.70,0.85,0.95,0.70);
   leg2->SetFillColor(253);
   leg2->SetBorderSize(0);
   
   TLatex *legl2 = new TLatex();
   legl2->SetNDC();
   legl2->SetTextAlign(22);
   legl2->SetTextFont(63);
   legl2->SetTextSizePixels(30);
//   legl2->DrawLatex(0.55,0.82,csv.c_str());
   legl2->DrawLatex(0.55,0.82,"Pre-tag");
   
   TH1D *h_frb_clone = (TH1D*)h_frb->Clone("h_frb_clone");
   TH1D *h_frc_clone = (TH1D*)h_frc->Clone("h_frc_clone");
   TH1D *h_frl_clone = (TH1D*)h_frl->Clone("h_frl_clone");
   
   h_frb_clone->SetMarkerColor(2);
   h_frc_clone->SetMarkerColor(3);
   h_frl_clone->SetMarkerColor(4);
  
   h_frb_clone->SetLineColor(2);
   h_frc_clone->SetLineColor(3);
   h_frl_clone->SetLineColor(4);

   leg2->AddEntry(h_frb_clone,"b-jets","lp");
   leg2->AddEntry(h_frc_clone,"c-jets","lp");
   leg2->AddEntry(h_frl_clone,"udsg-jets","lp");
   
   c2->RedrawAxis("g");
   
   leg2->Draw();
   
   c2->SetLogx(1);

   tex->Draw();
   tex2->Draw();
   text1->Draw();
   
   picname = "pics/Fr_noTag.eps";
   c2->Print(picname.c_str());
   c2->Clear();

   // draw fractions Tag
   TCanvas *c3 = new TCanvas("c3","c3",0,0,600,500);
   c3->SetGrid(1);

   // frb
   double xp_sysTot_FRB_TAG[np];
   double yp_sysTot_FRB_TAG[np];
   for(int k=0;k<nPT+2;k++)
     {
	float addw = h_frb_tag->GetBinWidth(k)/2.0;
	if( k == 0 ) addw = 0.0;
	if( k == nPT+1 ) addw = h_frb_tag->GetBinWidth(k-1);
	
	int ib = k+1;
	if( k > 0 ) ib--;
	if( k == nPT+1 ) ib--;
	
	xp_sysTot_FRB_TAG[k] = addw + h_frb_tag->GetXaxis()->GetBinLowEdge(ib);
	yp_sysTot_FRB_TAG[k] = h_frb_tag_TOTAL_UP->GetBinContent(ib);
	yp_sysTot_FRB_TAG[nPT+2+k] = h_frb_tag_TOTAL_DOWN->GetBinContent(nPT-(ib-1));
     }      
   for(int k=0;k<nPT+2;k++)
     {
	xp_sysTot_FRB_TAG[nPT+2+k] = xp_sysTot_FRB_TAG[nPT+2-k-1];
     }	
   xp_sysTot_FRB_TAG[np-1] = xp_sysTot_FRB_TAG[0];
   yp_sysTot_FRB_TAG[np-1] = yp_sysTot_FRB_TAG[0];
   
   TPolyLine *sysTot_FRB_TAG = new TPolyLine(np,xp_sysTot_FRB_TAG,yp_sysTot_FRB_TAG);
   sysTot_FRB_TAG->SetFillColor(kRed);
   sysTot_FRB_TAG->SetLineColor(kRed);
   
   // frc
   double xp_sysTot_FRC_TAG[np];
   double yp_sysTot_FRC_TAG[np];
   for(int k=0;k<nPT+2;k++)
     {
	float addw = h_frc_tag->GetBinWidth(k)/2.0;
	if( k == 0 ) addw = 0.0;
	if( k == nPT+1 ) addw = h_frc_tag->GetBinWidth(k-1);
	
	int ib = k+1;
	if( k > 0 ) ib--;
	if( k == nPT+1 ) ib--;
	
	xp_sysTot_FRC_TAG[k] = addw + h_frc_tag->GetXaxis()->GetBinLowEdge(ib);
	yp_sysTot_FRC_TAG[k] = h_frc_tag_TOTAL_UP->GetBinContent(ib);
	yp_sysTot_FRC_TAG[nPT+2+k] = h_frc_tag_TOTAL_DOWN->GetBinContent(nPT-(ib-1));
     }      
   for(int k=0;k<nPT+2;k++)
     {
	xp_sysTot_FRC_TAG[nPT+2+k] = xp_sysTot_FRC_TAG[nPT+2-k-1];
     }	
   xp_sysTot_FRC_TAG[np-1] = xp_sysTot_FRC_TAG[0];
   yp_sysTot_FRC_TAG[np-1] = yp_sysTot_FRC_TAG[0];
   
   TPolyLine *sysTot_FRC_TAG = new TPolyLine(np,xp_sysTot_FRC_TAG,yp_sysTot_FRC_TAG);
   sysTot_FRC_TAG->SetFillColor(kGreen);
   sysTot_FRC_TAG->SetLineColor(kGreen);

   // frl
   double xp_sysTot_FRL_TAG[np];
   double yp_sysTot_FRL_TAG[np];
   for(int k=0;k<nPT+2;k++)
     {
	float addw = h_frl_tag->GetBinWidth(k)/2.0;
	if( k == 0 ) addw = 0.0;
	if( k == nPT+1 ) addw = h_frl_tag->GetBinWidth(k-1);
	
	int ib = k+1;
	if( k > 0 ) ib--;
	if( k == nPT+1 ) ib--;
	
	xp_sysTot_FRL_TAG[k] = addw + h_frl_tag->GetXaxis()->GetBinLowEdge(ib);
	yp_sysTot_FRL_TAG[k] = h_frl_tag_TOTAL_UP->GetBinContent(ib);
	yp_sysTot_FRL_TAG[nPT+2+k] = h_frl_tag_TOTAL_DOWN->GetBinContent(nPT-(ib-1));
     }      
   for(int k=0;k<nPT+2;k++)
     {
	xp_sysTot_FRL_TAG[nPT+2+k] = xp_sysTot_FRL_TAG[nPT+2-k-1];
     }	
   xp_sysTot_FRL_TAG[np-1] = xp_sysTot_FRL_TAG[0];
   yp_sysTot_FRL_TAG[np-1] = yp_sysTot_FRL_TAG[0];
   
   TPolyLine *sysTot_FRL_TAG = new TPolyLine(np,xp_sysTot_FRL_TAG,yp_sysTot_FRL_TAG);
   sysTot_FRL_TAG->SetFillColor(kBlue);
   sysTot_FRL_TAG->SetLineColor(kBlue);
   
   h_frb_tag->GetYaxis()->SetTitle("Fit fraction");
   h_frb_tag->GetXaxis()->SetTitle("p_{T} [TeV]");
   
   h_frb_tag->SetMarkerSize(1.0);
   h_frc_tag->SetMarkerSize(1.0);
   h_frl_tag->SetMarkerSize(1.0);

   h_frb_tag->SetMarkerStyle(20);
   h_frc_tag->SetMarkerStyle(22);
   h_frl_tag->SetMarkerStyle(24);
   
   h_frb_tag->SetMarkerColor(0);
   h_frc_tag->SetMarkerColor(0);
   h_frl_tag->SetMarkerColor(0);

   h_frb_tag->SetLineColor(0);
   h_frc_tag->SetLineColor(0);
   h_frl_tag->SetLineColor(0);
   
   h_frb_tag->Draw("e1p");
   h_frc_tag->Draw("e1p same");
   h_frl_tag->Draw("e1p same");
	
   h_frb_tag->GetXaxis()->SetMoreLogLabels();
   h_frb_tag->GetXaxis()->SetNoExponent();
   h_frb_tag->GetYaxis()->SetRangeUser(0.00,1.50);

   sysTot_FRB_TAG->Draw("fSAME");
   sysTot_FRC_TAG->Draw("fSAME");
   sysTot_FRL_TAG->Draw("fSAME");
   h_frb_tag->Draw("e1p same");
   h_frc_tag->Draw("e1p same");
   h_frl_tag->Draw("e1p same");
   
   TLegend *leg3;
   leg3 = new TLegend(0.70,0.85,0.95,0.70);
   leg3->SetFillColor(253);
   leg3->SetBorderSize(0);
   
   TLatex *legl3 = new TLatex();
   legl3->SetNDC();
   legl3->SetTextAlign(22);
   legl3->SetTextFont(63);
   legl3->SetTextSizePixels(30);
   legl3->DrawLatex(0.55,0.82,csv.c_str());

   TH1D *h_frb_tag_clone = (TH1D*)h_frb_tag->Clone("h_frb_tag_clone");
   TH1D *h_frc_tag_clone = (TH1D*)h_frc_tag->Clone("h_frc_tag_clone");
   TH1D *h_frl_tag_clone = (TH1D*)h_frl_tag->Clone("h_frl_tag_clone");
   
   h_frb_tag_clone->SetMarkerColor(2);
   h_frc_tag_clone->SetMarkerColor(3);
   h_frl_tag_clone->SetMarkerColor(4);
  
   h_frb_tag_clone->SetLineColor(2);
   h_frc_tag_clone->SetLineColor(3);
   h_frl_tag_clone->SetLineColor(4);
   
   leg3->AddEntry(h_frb_tag_clone,"b-jets","lp");
   leg3->AddEntry(h_frc_tag_clone,"c-jets","lp");
   leg3->AddEntry(h_frl_tag_clone,"udsg-jets","lp");
   
   c3->RedrawAxis("g");
   
   leg3->Draw();
   
   c3->SetLogx(1);

   tex->Draw();
   tex2->Draw();
   text1->Draw();
   
   picname = "pics/Fr_"+tag+".eps";
   c3->Print(picname.c_str());
   c3->Clear();
   
   std::ofstream fsf("results/SFSYS.tex");

   std::string header = "\n \
\\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|} \n \
Beispiel #12
0
void plot_lj1lj2_pT()
{
  gStyle -> SetStripDecimals(kFALSE);
  gStyle -> SetPadTickX(1);
  gStyle -> SetPadTickY(1);
  gStyle -> SetOptTitle(0);
  gStyle -> SetOptStat(0);

float y1=0. , y2=50000;
float y1=0. , y3=50000;
float x1=0,    x2=1500.;
Double_t t1=0.4395973,t2=0.8;
Double_t t3=t1, t4=0.7302697;


TFile *data = new TFile("/Users/asifsaddique/CMS_BH/QCD_13TeV/output_qcd/QCD_madgraph.root", "READ");
TH1F *lj1_pT50   = (TH1F*)gDirectory -> Get("general/LJ1_pT50");
TH1F *lj2_pT50   = (TH1F*)gDirectory -> Get("general/LJ2_pT50");

lj1_pT50  ->GetSumw2()->Set(0);
lj2_pT50->GetSumw2()->Set(0);

lj1_pT50->Scale(1000); 
lj2_pT50->Scale(1000); 

 TCanvas *c1 = new TCanvas("c1","c1",600,600);
 c1->SetLeftMargin(0.1442953);
 TCanvas *c2 = new TCanvas("c2","c2",600,600);
 c2->SetLeftMargin(0.1442953);
c1->cd();
  lj1_pT50 -> GetYaxis()->SetTitle("# Entries"); lj1_pT50 -> GetXaxis()->SetTitle("1st Leading Jet p_{T}");
  lj1_pT50 -> GetYaxis()->SetTitleSize(0.04);
  lj1_pT50 -> GetXaxis()->SetTitleSize(0.04);
  lj1_pT50 -> GetXaxis()->SetTitleOffset(1.1);
  lj1_pT50 -> GetYaxis()->SetTitleOffset(1.75);
  lj1_pT50 -> SetLineWidth(2);
  lj1_pT50 -> GetXaxis()->SetRangeUser(x1,x2);
  lj1_pT50 -> GetYaxis()->SetRangeUser(y1,y3);
  lj1_pT50 -> Draw("");
  float tsize = 0.04;
   tex = new TLatex(t1,t2,"#sqrt[]{s} = 13 TeV, #intLdt = 1000 pb^{-1}");
   tex->SetNDC();
   tex->SetTextFont(42);
   tex->SetTextSize(tsize);
   tex->SetLineWidth(2);
   tex->Draw();
   TLatex *   tex = new TLatex(t3,t4,"Jets: p_{T} > 20 GeV, |#eta| < 2.4");
   tex->SetNDC();
   tex->SetTextFont(42);
   tex->SetTextSize(tsize);
   tex->SetLineWidth(2);
   tex->Draw();
c2->cd();
  lj2_pT50 -> GetYaxis()->SetTitle("# Entries");
  lj2_pT50 -> GetXaxis()->SetTitle("Second Leading Jet p_{T} ");
  lj2_pT50 -> GetYaxis()->SetTitleSize(0.04);
  lj2_pT50 -> GetXaxis()->SetTitleSize(0.04);
  lj2_pT50 -> GetXaxis()->SetTitleOffset(1.1);
  lj2_pT50 -> GetYaxis()->SetTitleOffset(1.75);
  lj2_pT50 -> SetLineWidth(2);
  lj2_pT50 -> GetXaxis()->SetRangeUser(x1,x2);
  lj2_pT50 -> GetYaxis()->SetRangeUser(y1,y2);
  lj2_pT50 -> Draw("");
   tex = new TLatex(t1,t2,"#sqrt[]{s} = 13 TeV, #intLdt = 1000 pb^{-1}");
   tex->SetNDC();
   tex->SetTextFont(42);
   tex->SetTextSize(tsize);
   tex->SetLineWidth(2);
   tex->Draw();
   TLatex *   tex = new TLatex(t3,t4,"Jets: p_{T} > 50 GeV, |#eta| < 2.4");
   tex->SetNDC();
   tex->SetTextFont(42);
   tex->SetTextSize(tsize);
   tex->SetLineWidth(2);
   tex->Draw();

   c1->SaveAs("/Users/asifsaddique/CMS_BH/QCD_13TeV/Macros/bh_plots/pTeT/lj1_pT50.eps");
   c2->SaveAs("/Users/asifsaddique/CMS_BH/QCD_13TeV/Macros/bh_plots/pTeT/lj2_pT50.eps");

}
Beispiel #13
0
//void VHPlotter(string title="", int plot=0) {
void VHPlotter(string title="", int plot=0,   TCanvas* c1=0 ) {


string subdir="0";
string postfix="";
string dirbSel="";

double norm11 = ((Lumi2016_ele * Xsec_dy_amc1) / Ngen_dy_amc1);
double norm12 = ((Lumi2016_ele * Xsec_dy_amc2) / Ngen_dy_amc2);
double norm13 = ((Lumi2016_ele * Xsec_dy_amc3) / Ngen_dy_amc3);
double norm14 = ((Lumi2016_ele * Xsec_dy_amc4) / Ngen_dy_amc4);

double norm2 = ((Lumi2016_ele * Xsec_tt) / Ngen_tt);
double norm3 = ((Lumi2016_ele * Xsec_zz) / Ngen_zz);
double norm4 = ((Lumi2016_ele * Xsec_wz) / Ngen_wz);
double norm6 = ((Lumi2016_ele * Xsec_ww) / Ngen_ww);
double norm7 = ((Lumi2016_ele * Xsec_zhm) / Ngen_zhm);
double norm8 = ((Lumi2016_ele * Xsec_zhp) / Ngen_zhp);

//if (ilepton==1) Lumi2016 = Lumi2016_ele;

/*double enorm1 = ((Lumi2012 * eXsec_dy) / Ngen_dy);
double enorm1_amc = ((Lumi2012 * eXsec_dy_amc) / Ngen_dy_amc);
double enorm1_1 = ((Lumi2012 * eXsec_dy_1) / Ngen_dy_1);
double enorm1_2=0;
double enorm2 = ((Lumi2012 * eXsec_tt) / Ngen_tt);
double enorm4 = ((Lumi2012 * eXsec_wz) / Ngen_wz);
double enorm5 = ((Lumi2012 * eXsec_qcd) / Ngen_qcd);
double enorm6 = ((Lumi2012 * eXsec_ww) / Ngen_ww);
double enorm7 = ((Lumi2012 * eXsec_wj) / Ngen_wj);
double enorm8 = ((Lumi2012 * eXsec_tS) / Ngen_tS);
double enorm9 = ((Lumi2012 * eXsec_tT) / Ngen_tT);
double enorm10 = ((Lumi2012 * eXsec_tW) / Ngen_tW);
double enorm11 = ((Lumi2012 * eXsec_tSb) / Ngen_tSb);
double enorm12 = ((Lumi2012 * eXsec_tTb) / Ngen_tTb);
double enorm13 = ((Lumi2012 * eXsec_tWb) / Ngen_tWb);
*/

TFile* mc11 = TFile::Open((path + "DYJetsToLL_M-50_HT-100to200_13TeV.root").c_str());
TH1F* h_mc11 = (TH1F*)gDirectory->Get(title.c_str());
TFile* mc12 = TFile::Open((path + "DYJetsToLL_M-50_HT-200to400_13TeV.root").c_str());
TH1F* h_mc12 = (TH1F*)gDirectory->Get(title.c_str());
TFile* mc13 = TFile::Open((path + "DYJetsToLL_M-50_HT-400to600_13TeV.root").c_str());
TH1F* h_mc13 = (TH1F*)gDirectory->Get(title.c_str());
TFile* mc14 = TFile::Open((path + "DYJetsToLL_M-50_HT-600toInf_13TeV.root").c_str());
TH1F* h_mc14 = (TH1F*)gDirectory->Get(title.c_str());
TFile* mc2 = TFile::Open((path + "TT_TuneCUETP8M1_13TeV.root").c_str());
TH1F* h_mc2 = (TH1F*)gDirectory->Get(title.c_str());
TFile* mc3 = TFile::Open((path + "ZZ_TuneCUETP8M1_13TeV.root").c_str());
TH1F* h_mc3 = (TH1F*)gDirectory->Get(title.c_str());
TFile* mc4 = TFile::Open((path + "WZ_TuneCUETP8M1_13TeV.root").c_str());
TH1F* h_mc4 = (TH1F*)gDirectory->Get(title.c_str());
TFile* mc6 = TFile::Open((path + "WW_TuneCUETP8M1_13TeV.root").c_str());
TH1F* h_mc6 = (TH1F*)gDirectory->Get(title.c_str());
TFile* mc7 = TFile::Open((path + "ZH_HToBB_ZToLL_M125_13TeV_amcatnlo.root").c_str());
TH1F* h_mc7 = (TH1F*)gDirectory->Get(title.c_str());
TFile* mc8 = TFile::Open((path + "ZH_HToBB_ZToLL_M125_13TeV_powheg.root").c_str());
TH1F* h_mc8 = (TH1F*)gDirectory->Get(title.c_str());

//TFile* data = TFile::Open((path + "SingleMuon-Run2016B-v2.root").c_str());
//TH1F* h_data = (TH1F*)gDirectory->Get(title.c_str());

TFile* data_runB = TFile::Open((path + "SingleMuon-Run2016B-v2.root").c_str());
TH1F* h_data_runB = (TH1F*)gDirectory->Get(title.c_str());

TFile* data_runC = TFile::Open((path + "SingleMuon-Run2016C-v2.root").c_str());
TH1F* h_data_runC = (TH1F*)gDirectory->Get(title.c_str());

TFile* data_runD = TFile::Open((path + "SingleMuon-Run2016D-v2.root").c_str());
TH1F* h_data_runD = (TH1F*)gDirectory->Get(title.c_str());

TH1F* h_data = (TH1F*)h_data_runB ->Clone("h_data");
h_data->Reset();
h_data->Add( h_data_runB );
h_data->Add( h_data_runC );
h_data->Add( h_data_runD );


h_mc2 -> SetLineColor(kBlack);
h_mc2 -> SetFillColor(kBlue);
//h_mc2 -> SetFillStyle(3004);

h_mc3 -> SetLineColor(kBlack);
h_mc3 -> SetFillColor(kGray+2);
//h_mc3 -> SetFillStyle(3004);

//h_mc4 -> SetLineColor(kBlack);
//h_mc4 -> SetFillColor(kGray+3);
//h_mc4 -> SetFillStyle(3004);

//h_mc6 -> SetLineColor(kBlack);
//h_mc6 -> SetFillColor(kRed+2);
//h_mc6 -> SetFillStyle(3004);

h_mc7 -> SetLineColor(kBlack);
h_mc7 -> SetFillColor(kMagenta);
//h_mc7 -> SetFillStyle(3004);

h_mc8 -> SetLineColor(kGreen);
//h_mc8 -> SetLineColor(kBlack);
//h_mc8 -> SetFillColor(kPink);
//h_mc8 -> SetFillStyle(3004);
h_mc8 ->SetLineWidth(3);

h_mc11->Scale(norm11);
h_mc12->Scale(norm12);
h_mc13->Scale(norm13);
h_mc14->Scale(norm14);
h_mc2->Scale(norm2);
h_mc3->Scale(norm3);
h_mc4->Scale(norm4);
h_mc6->Scale(norm6);
h_mc7->Scale(norm7);
h_mc8->Scale(norm8);

TH1F* h_mcDY = (TH1F*)h_mc11->Clone("h_mcDY");
h_mcDY->Reset();
h_mcDY->Add(h_mc14);
h_mcDY->Add(h_mc13);
h_mcDY->Add(h_mc12);
h_mcDY->Add(h_mc11);

h_mcDY -> SetLineColor(kBlack);
h_mcDY -> SetFillColor(kYellow-4);
//h_mcDY -> SetFillStyle(3004);

TH1F* h_mcDiboson = (TH1F*)h_mc3->Clone("h_mcDiboson");
h_mcDiboson->Reset();
h_mcDiboson->Add(h_mc3);
h_mcDiboson->Add(h_mc4);
h_mcDiboson->Add(h_mc6);

TH1F *ht = (TH1F*)h_mcDY->Clone("ht");
ht->Reset();
//ht->Add(h_mc8);
ht->Add(h_mc7);
//ht->Add(h_mc6);
//ht->Add(h_mc4);
//ht->Add(h_mc3);
ht->Add(h_mcDiboson);
ht->Add(h_mc2);
ht->Add(h_mcDY);

THStack *hs = new THStack("hs","");
//hs->Add(h_mc8); // ZH powheg
hs->Add(h_mc7);   // ZH madgraph
//hs->Add(h_mc6);
//hs->Add(h_mc4);
//hs->Add(h_mc3);
hs->Add(h_mcDiboson);
hs->Add(h_mc2);
hs->Add(h_mcDY);

//TCanvas* c1 = 0;
//c1 = new TCanvas("c","c",10,10,800,600);
c1->cd();

TPad *pad1 = new TPad("pad1","pad1",0.0,0.3,1.0,1.0);
pad1->SetBottomMargin(0.001);
pad1->Draw();
pad1->cd();

if( title=="FATjetSDmass" || title=="FATjetSDmassCorr" || title=="FATjetPRmass" || title=="FATjetPRmassCorr" || title=="FATnSubjet" || title=="ZHmass" )
{pad1->SetLogy();}

hs->Draw("HIST");
hs->GetYaxis()->SetTitle("Events");
hs->GetYaxis()->SetTitleSize(0.05);
hs->GetYaxis()->SetLabelSize(0.045);
hs->GetYaxis()->SetTitleOffset(1.0);// 0.7
//hs->SetMinimum(8);
hs->SetMinimum(0.1);
hs->SetMaximum(1.2*hs->GetMaximum());
if (title=="ZHmass") { hs->GetXaxis()->SetRangeUser(0, 3000); }

h_mc8->Draw("same hist");


h_data->Draw("EPX0SAMES");
h_data->SetMarkerColor(kBlack);
h_data->SetMarkerStyle(20);
h_data->SetMarkerSize (1.0);
h_data->SetStats(0);

TLegend *leg;

if (title=="FATjetTau2dvTau1") { leg = new TLegend(0.15, 0.547, 0.41, 0.88); }
else { leg = new TLegend(0.65, 0.547, 0.91, 0.88);}
//leg = new TLegend(0.65, 0.547, 0.91, 0.88);
leg->SetBorderSize(0);
leg->SetEntrySeparation(0.01);
leg->SetFillColor(0);
leg->SetFillStyle(0);

leg->AddEntry(h_data,"Data","p");
leg->AddEntry(h_mcDY,"DY","f");
leg->AddEntry(h_mc2,"t#bar{t}","f");
//leg->AddEntry(h_mc3,"ZZ","f");
//leg->AddEntry(h_mc4,"WZ","f");
//leg->AddEntry(h_mc6,"WW","f");
leg->AddEntry(h_mcDiboson,"Diboson","f");
leg->AddEntry(h_mc7,"ZH madgraph","f");
leg->AddEntry(h_mc8,"ZH powheg (not in stack)","f");

leg->Draw();

TLatex *lar = new TLatex();
lar->SetNDC(kTRUE);
lar->SetTextSize(0.04);
lar->SetLineWidth(5);
lar->DrawLatex(0.14, 0.94, "CMS #it{#bf{2016}}");
lar->DrawLatex(0.60, 0.94, "L = 12.8 fb^{-1} at #sqrt{s} = 13 TeV");

pad1->Update();
c1->Update();

c1->cd();

TH1F *h_ratio = (TH1F*)h_data->Clone("h_ratio");

TPad *pad2 = new TPad("pad2","pad2",0,0,1,0.3);// 0.3
pad2->SetTopMargin(0);
pad2->SetBottomMargin(0.3);
pad2->Draw();
pad2->cd();
h_ratio->SetTitle("");
h_ratio->SetStats(0);

if (title=="Zpt") {
  h_ratio->GetXaxis ()->SetTitle("p_{T}(Z) [GeV/c]");
} else if (title=="Zmass") {
  h_ratio->GetXaxis ()->SetTitle("M(Z) [GeV/c^{2}]");// 
} else if (title=="ZRapidity") {
  h_ratio->GetXaxis ()->SetTitle("y(Z)");
} else if (title=="Zeta") {
  h_ratio->GetXaxis ()->SetTitle("#eta(Z)");
} else if (title=="nVtx") {
  h_ratio->GetXaxis ()->SetTitle("Number of Vertices");
}


  else if (title=="leadElePt") {
  h_ratio->GetXaxis ()->SetTitle("Leading Electron p_{T} [GeV/c]");
} else if (title=="subleadElePt") {
  h_ratio->GetXaxis ()->SetTitle("Sub-Leading Electron p_{T} [GeV/c]");
} else if (title=="leadEleEta") {
  h_ratio->GetXaxis ()->SetTitle("Leading Electron #eta");
} else if (title=="subleadEleEta") {
  h_ratio->GetXaxis ()->SetTitle("Sub-Leading Electron #eta");
}

  else if (title=="leadMuPt") {
  h_ratio->GetXaxis ()->SetTitle("Leading Muon p_{T} [GeV/c]");
} else if (title=="subleadMuPt") {
  h_ratio->GetXaxis ()->SetTitle("Sub-Leading Muon p_{T} [GeV/c]");
} else if (title=="leadMuEta") {
  h_ratio->GetXaxis ()->SetTitle("Leading Muon #eta");
} else if (title=="subleadMuEta") {
  h_ratio->GetXaxis ()->SetTitle("Sub-Leading Muon #eta");
}


  else if (title=="FATjetPt") {
  h_ratio->GetXaxis ()->SetTitle("FAT Jet p_{T} [GeV/c]");
} else if (title=="FATjetEta") {
  h_ratio->GetXaxis ()->SetTitle("FAT Jet #eta");
} else if (title=="FATjetCISVV2") {
  h_ratio->GetXaxis ()->SetTitle("FAT Jet CSVv2");
} else if (title=="FATjetSDmass") {
  h_ratio->GetXaxis ()->SetTitle("FAT Jet Soft Drop Mass [GeV/c^{2}]");
} else if (title=="FATjetSDmassCorr") {
  h_ratio->GetXaxis ()->SetTitle("FAT Jet Corrected Soft Drop Mass [GeV/c^{2}]");
}  else if (title=="FATjetPRmass") {
  h_ratio->GetXaxis ()->SetTitle("FAT Jet Pruned Mass [GeV/c^{2}]");
} else if (title=="FATjetPRmassCorr") {
  h_ratio->GetXaxis ()->SetTitle("FAT Jet L2L3 Corrected Pruned Mass [GeV/c^{2}]");
} else if (title=="FATjetTau1") {
  h_ratio->GetXaxis ()->SetTitle("FAT Jet #tau_{1}");
} else if (title=="FATjetTau2") {
  h_ratio->GetXaxis ()->SetTitle("FAT Jet #tau_{2}");
} else if (title=="FATjetTau2dvTau1") {
  h_ratio->GetXaxis ()->SetTitle("FAT Jet #tau_{21}");
} else if (title=="FATnSubjet") {
  h_ratio->GetXaxis ()->SetTitle("Number of Subjets");
} else if (title=="FATsubjetLeadingPt") {
  h_ratio->GetXaxis ()->SetTitle("Leading SubJet p_{T} [GeV/c]");
} else if (title=="FATsubjetLeadingEta") {
  h_ratio->GetXaxis ()->SetTitle("Leading SubJet #eta");
} else if (title=="FATsubjetLeadingSDCSV") {
  h_ratio->GetXaxis ()->SetTitle("Leading SubJet Soft Drop CSV");
} else if (title=="FATsubjetSubLeadingPt") {
  h_ratio->GetXaxis ()->SetTitle("Sub-Leading SubJet p_{T} [GeV/c]");
} else if (title=="FATsubjetSubLeadingEta") {
  h_ratio->GetXaxis ()->SetTitle("Sub-Leading SubJet #eta");
} else if (title=="FATsubjetSubLeadingSDCSV") {
  h_ratio->GetXaxis ()->SetTitle("Sub-Leading SubJet Soft Drop CSV");
} else if (title=="ADDjet_DoubleSV") {
  h_ratio->GetXaxis ()->SetTitle("ADDjet double b-tagger discriminator");
} else if (title=="ZHmass") {
  h_ratio->GetXaxis ()->SetTitle("ZH invariant mass [GeV/c^{2}]");
}

if (title=="ZHmass") { h_ratio->GetXaxis()->SetRangeUser(0, 3000); }
h_ratio->GetXaxis()->SetTitleSize(0.11);
h_ratio->GetXaxis()->SetLabelFont(42);
h_ratio->GetXaxis()->SetLabelSize(0.10);
h_ratio->GetXaxis()->SetTitleFont(42);
h_ratio->GetYaxis()->SetTitle("Data/MC");
h_ratio->GetYaxis()->SetNdivisions(505);
h_ratio->GetYaxis()->SetTitleSize(0.11);
h_ratio->GetYaxis()->SetLabelSize(0.10);
h_ratio->GetYaxis()->SetRangeUser(0.2, 2);
h_ratio->GetYaxis()->SetTitleOffset(0.33);

h_ratio->Divide(ht);
h_ratio->SetMarkerStyle(20);
h_ratio->Draw("E0PX0");

TLine *OLine = new TLine(h_ratio->GetXaxis()->GetXmin(),1.,h_ratio->GetXaxis()->GetXmax(),1.);
OLine->SetLineColor(kRed);
OLine->SetLineWidth(2);
OLine->Draw();

/*
TLatex *lar = new TLatex();
lar->SetNDC(kTRUE);
lar->SetTextSize(0.04);
lar->SetLineWidth(5);
lar->DrawLatex(0.14, 0.94, "CMS #it{#bf{2016}}");
lar->DrawLatex(0.60, 0.94, "L = 4.327 fb^{-1} at #sqrt{s} = 13 TeV");
*/

c1->cd();
//c1->SaveAs((path + title + ".pdf").c_str());

}
void Final_av_Lambda_VarCoupling_40Percent()
{
//=========Macro generated from canvas: c/c
//=========  (Mon Feb 22 19:41:13 2016) by ROOT version6.04/06
   TCanvas *c = new TCanvas("c", "c",0,0,800,700);
   c->SetHighLightColor(2);
   c->Range(-0.4813593,1.111111,3.148656,8.518519);
   c->SetFillColor(0);
   c->SetBorderMode(0);
   c->SetBorderSize(2);
   c->SetLogx();
   c->SetLogy();
   c->SetTickx(1);
   c->SetTicky(1);
   c->SetLeftMargin(0.12);
   c->SetRightMargin(0.04);
   c->SetTopMargin(0.07);
   c->SetBottomMargin(0.12);
   c->SetFrameBorderMode(0);
   c->SetFrameBorderMode(0);
   
   TMultiGraph *multigraph = new TMultiGraph();
   multigraph->SetName("");
   multigraph->SetTitle("");
   
   Double_t Graph_fx1[12] = {
   1,
   10,
   100,
   400,
   700,
   1000,
   1000,
   700,
   400,
   100,
   10,
   1};
   Double_t Graph_fy1[12] = {
   881.525,
   896.549,
   871.907,
   667.806,
   471.744,
   308.777,
   382.832,
   584.437,
   826.374,
   1079.16,
   1110.85,
   1092.23};
   TGraph *graph = new TGraph(12,Graph_fx1,Graph_fy1);
   graph->SetName("Graph");
   graph->SetTitle("");

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

   ci = TColor::GetColor("#ff6666");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph1 = new TH1F("Graph_Graph1","",100,0.9,1099.9);
   Graph_Graph1->SetMinimum(228.5697);
   Graph_Graph1->SetMaximum(1191.057);
   Graph_Graph1->SetDirectory(0);
   Graph_Graph1->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph1->SetLineColor(ci);
   Graph_Graph1->GetXaxis()->SetLabelFont(42);
   Graph_Graph1->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph1->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph1->GetXaxis()->SetTitleFont(42);
   Graph_Graph1->GetYaxis()->SetLabelFont(42);
   Graph_Graph1->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph1->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph1->GetYaxis()->SetTitleFont(42);
   Graph_Graph1->GetZaxis()->SetLabelFont(42);
   Graph_Graph1->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph1->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph1->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph1);
   
   multigraph->Add(graph,"");
   multigraph->Draw("af");
   multigraph->GetXaxis()->SetTitle("M_{#chi} (GeV)");
   multigraph->GetXaxis()->SetRange(0,96);
   multigraph->GetXaxis()->SetLabelFont(42);
   multigraph->GetXaxis()->SetTitleSize(0.05);
   multigraph->GetXaxis()->SetTitleOffset(1.1);
   multigraph->GetXaxis()->SetTitleFont(42);
   multigraph->GetYaxis()->SetTitle("#Lambda (GeV)");
   multigraph->GetYaxis()->SetLabelFont(42);
   multigraph->GetYaxis()->SetTitleSize(0.05);
   multigraph->GetYaxis()->SetTitleOffset(1.05);
   multigraph->GetYaxis()->SetTitleFont(42);
   
   multigraph = new TMultiGraph();
   multigraph->SetName("");
   multigraph->SetTitle("");
   
   Double_t Graph_fx2[6] = {
   1,
   10,
   100,
   400,
   700,
   1000};
   Double_t Graph_fy2[6] = {
   1092.23,
   1110.85,
   1079.16,
   826.374,
   584.437,
   382.832};
   graph = new TGraph(6,Graph_fx2,Graph_fy2);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#ff6666");
   graph->SetLineColor(ci);
   
   TH1F *Graph_Graph2 = new TH1F("Graph_Graph2","Graph",100,0.9,1099.9);
   Graph_Graph2->SetMinimum(310.0302);
   Graph_Graph2->SetMaximum(1183.652);
   Graph_Graph2->SetDirectory(0);
   Graph_Graph2->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph2->SetLineColor(ci);
   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()->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);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx3[6] = {
   1,
   10,
   100,
   400,
   700,
   1000};
   Double_t Graph_fy3[6] = {
   980.038,
   996.742,
   968.943,
   742.067,
   524.44,
   343.371};
   graph = new TGraph(6,Graph_fx3,Graph_fy3);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#ff6666");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph3 = new TH1F("Graph_Graph3","Graph",100,0.9,1099.9);
   Graph_Graph3->SetMinimum(278.0339);
   Graph_Graph3->SetMaximum(1062.079);
   Graph_Graph3->SetDirectory(0);
   Graph_Graph3->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph3->SetLineColor(ci);
   Graph_Graph3->GetXaxis()->SetLabelFont(42);
   Graph_Graph3->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph3->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph3->GetXaxis()->SetTitleFont(42);
   Graph_Graph3->GetYaxis()->SetLabelFont(42);
   Graph_Graph3->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph3->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph3->GetYaxis()->SetTitleFont(42);
   Graph_Graph3->GetZaxis()->SetLabelFont(42);
   Graph_Graph3->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph3->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph3->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph3);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx4[6] = {
   1,
   10,
   100,
   400,
   700,
   1000};
   Double_t Graph_fy4[6] = {
   881.525,
   896.549,
   871.907,
   667.806,
   471.744,
   308.777};
   graph = new TGraph(6,Graph_fx4,Graph_fy4);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#ff6666");
   graph->SetLineColor(ci);
   
   TH1F *Graph_Graph4 = new TH1F("Graph_Graph4","Graph",100,0.9,1099.9);
   Graph_Graph4->SetMinimum(249.9998);
   Graph_Graph4->SetMaximum(955.3262);
   Graph_Graph4->SetDirectory(0);
   Graph_Graph4->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph4->SetLineColor(ci);
   Graph_Graph4->GetXaxis()->SetLabelFont(42);
   Graph_Graph4->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph4->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph4->GetXaxis()->SetTitleFont(42);
   Graph_Graph4->GetYaxis()->SetLabelFont(42);
   Graph_Graph4->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph4->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph4->GetYaxis()->SetTitleFont(42);
   Graph_Graph4->GetZaxis()->SetLabelFont(42);
   Graph_Graph4->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph4->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph4->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph4);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx5[6] = {
   1,
   10,
   100,
   400,
   700,
   1000};
   Double_t Graph_fy5[6] = {
   1028.6,
   1012.32,
   1016.7,
   751.989,
   524.44,
   360.443};
   graph = new TGraph(6,Graph_fx5,Graph_fy5);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph5 = new TH1F("Graph_Graph5","Graph",100,0.9,1099.9);
   Graph_Graph5->SetMinimum(293.6273);
   Graph_Graph5->SetMaximum(1095.416);
   Graph_Graph5->SetDirectory(0);
   Graph_Graph5->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph5->SetLineColor(ci);
   Graph_Graph5->GetXaxis()->SetLabelFont(42);
   Graph_Graph5->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph5->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph5->GetXaxis()->SetTitleFont(42);
   Graph_Graph5->GetYaxis()->SetLabelFont(42);
   Graph_Graph5->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph5->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph5->GetYaxis()->SetTitleFont(42);
   Graph_Graph5->GetZaxis()->SetLabelFont(42);
   Graph_Graph5->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph5->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph5->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph5);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx6[35] = {
   3.981,
   4.365,
   4.786,
   5.248,
   5.754,
   6.31,
   6.918,
   7.586,
   8.318,
   9.12,
   10,
   10.965,
   12.023,
   13.183,
   14.454,
   15.849,
   17.378,
   19.055,
   20.893,
   22.909,
   25.119,
   31.623,
   39.811,
   50.119,
   63.096,
   79.433,
   100,
   125.893,
   158.489,
   199.526,
   251.189,
   316.228,
   1000,
   3162.278,
   10000};
   Double_t Graph_fy6[35] = {
   19.76533,
   32.58338,
   47.96959,
   63.10164,
   79.00995,
   95.55754,
   111.9766,
   129.0118,
   146.2376,
   163.5577,
   179.3658,
   194.9584,
   209.5672,
   223.2999,
   236.0683,
   247.7404,
   258.366,
   268.0662,
   277.1383,
   285.1146,
   292.3901,
   306.3527,
   314.441,
   317.1059,
   314.8684,
   308.9039,
   300.2537,
   289.8022,
   278.2241,
   266.1082,
   253.7422,
   241.4337,
   184.6404,
   139.2985,
   104.656};
   graph = new TGraph(35,Graph_fx6,Graph_fy6);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#6666ff");
   graph->SetLineColor(ci);
   graph->SetLineStyle(6);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph6 = new TH1F("Graph_Graph6","Graph",100,3.5829,10999.6);
   Graph_Graph6->SetMinimum(17.78879);
   Graph_Graph6->SetMaximum(346.84);
   Graph_Graph6->SetDirectory(0);
   Graph_Graph6->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph6->SetLineColor(ci);
   Graph_Graph6->GetXaxis()->SetLabelFont(42);
   Graph_Graph6->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph6->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph6->GetXaxis()->SetTitleFont(42);
   Graph_Graph6->GetYaxis()->SetLabelFont(42);
   Graph_Graph6->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph6->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph6->GetYaxis()->SetTitleFont(42);
   Graph_Graph6->GetZaxis()->SetLabelFont(42);
   Graph_Graph6->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph6->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph6->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph6);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx7[33] = {
   5.050109,
   5.570498,
   6.092375,
   6.79836,
   7.629504,
   8.933253,
   10.64203,
   12.05014,
   13.68495,
   14.93901,
   17.1131,
   19.54765,
   22.0792,
   25.65551,
   29.39341,
   34.84152,
   41.41884,
   48.68491,
   59.2071,
   75.34994,
   97.26741,
   131.0246,
   163.9459,
   202.8261,
   243.2248,
   309.5828,
   383.0166,
   473.8718,
   622.2993,
   833.6,
   1028.448,
   1283.339,
   2026.806};
   Double_t Graph_fy7[33] = {
   71.77067,
   88.82209,
   110.1401,
   130.7052,
   154.2557,
   185.7482,
   213.1504,
   232.735,
   248.5277,
   258.1632,
   268.4587,
   280.1818,
   286.5229,
   293.3758,
   296.7995,
   299.6924,
   299.6947,
   297.0875,
   293.2892,
   285.6511,
   275.8293,
   262.4571,
   252.7364,
   243.3346,
   234.001,
   222.0121,
   212.1495,
   202.5032,
   189.9106,
   177.908,
   168.9168,
   159.7122,
   142.9221};
   graph = new TGraph(33,Graph_fx7,Graph_fy7);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#ff9900");
   graph->SetLineColor(ci);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph7 = new TH1F("Graph_Graph7","Graph",100,4.545098,2228.982);
   Graph_Graph7->SetMinimum(48.97827);
   Graph_Graph7->SetMaximum(322.4871);
   Graph_Graph7->SetDirectory(0);
   Graph_Graph7->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph7->SetLineColor(ci);
   Graph_Graph7->GetXaxis()->SetLabelFont(42);
   Graph_Graph7->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph7->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph7->GetXaxis()->SetTitleFont(42);
   Graph_Graph7->GetYaxis()->SetLabelFont(42);
   Graph_Graph7->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph7->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph7->GetYaxis()->SetTitleFont(42);
   Graph_Graph7->GetZaxis()->SetLabelFont(42);
   Graph_Graph7->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph7->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph7->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph7);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx8[90] = {
   18.74425,
   19.90368,
   20.73627,
   21.82644,
   23.00752,
   24.07546,
   25.0827,
   25.71454,
   26.71212,
   27.99356,
   28.53122,
   29.59491,
   30.69819,
   31.93543,
   33.71249,
   35.53626,
   36.69926,
   39.48566,
   41.74415,
   44.52103,
   47.27444,
   49.54151,
   51.99283,
   54.56543,
   56.59926,
   59.57426,
   61.97591,
   64.94736,
   67.7638,
   72.165,
   77.52983,
   78.67276,
   79.25885,
   79.50015,
   79.8577,
   79.98559,
   80.10781,
   80.93361,
   82.97299,
   85.0636,
   87.3346,
   89.6657,
   93.68976,
   97.60831,
   101.0972,
   103.4923,
   107.3498,
   111.0254,
   114.4909,
   118.2376,
   120.3333,
   131.3772,
   140.9375,
   145.9754,
   148.1289,
   150.9739,
   154.3249,
   158.6761,
   165.3121,
   170.7206,
   172.2259,
   173.4824,
   174.2374,
   175.2489,
   175.7591,
   179.6599,
   186.3538,
   196.4347,
   207.6675,
   217.3037,
   228.0541,
   241.4457,
   256.7473,
   271.0309,
   292.4573,
   319.2919,
   352.6953,
   387.3116,
   421.6106,
   459.6163,
   505.4719,
   563.2603,
   635.9718,
   692.2802,
   745.897,
   789.6904,
   831.1771,
   886.4295,
   950.901,
   983.4362};
   Double_t Graph_fy8[90] = {
   190.042,
   192.3104,
   192.9376,
   195.179,
   197.2136,
   198.0799,
   199.3876,
   199.4802,
   201.01,
   204.4632,
   204.529,
   206.7971,
   208.8441,
   208.9712,
   209.8662,
   210.2649,
   211.3333,
   212.7612,
   214.3898,
   216.0449,
   217.1898,
   218.8107,
   219.1693,
   219.524,
   220.873,
   221.9988,
   223.3628,
   223.7069,
   225.3419,
   225.4478,
   225.5616,
   225.584,
   239.8787,
   256.2561,
   271.2293,
   293.7999,
   304.8973,
   307.0445,
   308.5203,
   309.6434,
   310.7722,
   310.8221,
   310.5429,
   310.2559,
   309.9569,
   309.996,
   311.8566,
   313.3588,
   314.1336,
   315.2763,
   316.7668,
   317.2607,
   317.3559,
   317.4016,
   319.264,
   319.2881,
   319.6855,
   319.7195,
   318.6591,
   318.3273,
   317.9688,
   309.2591,
   300.7849,
   289.5104,
   286.1793,
   286.2011,
   285.5743,
   285.6238,
   285.3433,
   284.0635,
   283.1184,
   281.2031,
   278.656,
   277.7288,
   275.8579,
   273.0541,
   270.9095,
   265.6796,
   261.7535,
   256.9895,
   253.7797,
   247.4406,
   240.1473,
   234.4071,
   229.3303,
   226.7081,
   224.3734,
   220.2731,
   215.7486,
   213.7682};
   graph = new TGraph(90,Graph_fx8,Graph_fy8);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#cc33ff");
   graph->SetLineColor(ci);
   graph->SetLineStyle(6);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph8 = new TH1F("Graph_Graph8","Graph",100,16.86982,1079.905);
   Graph_Graph8->SetMinimum(177.0742);
   Graph_Graph8->SetMaximum(332.6873);
   Graph_Graph8->SetDirectory(0);
   Graph_Graph8->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph8->SetLineColor(ci);
   Graph_Graph8->GetXaxis()->SetLabelFont(42);
   Graph_Graph8->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph8->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph8->GetXaxis()->SetTitleFont(42);
   Graph_Graph8->GetYaxis()->SetLabelFont(42);
   Graph_Graph8->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph8->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph8->GetYaxis()->SetTitleFont(42);
   Graph_Graph8->GetZaxis()->SetLabelFont(42);
   Graph_Graph8->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph8->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph8->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph8);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx9[5] = {
   250,
   500,
   1000,
   3000,
   5000};
   Double_t Graph_fy9[5] = {
   597.2217,
   587.5585,
   450.4588,
   245.3363,
   177.6733};
   graph = new TGraph(5,Graph_fx9,Graph_fy9);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#3399ff");
   graph->SetLineColor(ci);
   graph->SetLineStyle(4);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph9 = new TH1F("Graph_Graph9","Graph",100,225,5475);
   Graph_Graph9->SetMinimum(135.7185);
   Graph_Graph9->SetMaximum(639.1765);
   Graph_Graph9->SetDirectory(0);
   Graph_Graph9->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph9->SetLineColor(ci);
   Graph_Graph9->GetXaxis()->SetLabelFont(42);
   Graph_Graph9->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph9->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph9->GetXaxis()->SetTitleFont(42);
   Graph_Graph9->GetYaxis()->SetLabelFont(42);
   Graph_Graph9->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph9->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph9->GetYaxis()->SetTitleFont(42);
   Graph_Graph9->GetZaxis()->SetLabelFont(42);
   Graph_Graph9->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph9->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph9->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph9);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx10[518] = {
   6.04,
   6.04,
   6.04,
   6.04,
   6.05,
   6.08,
   6.11,
   6.12,
   6.12,
   6.13,
   6.16,
   6.16,
   6.16,
   6.19,
   6.2,
   6.2,
   6.2,
   6.21,
   6.24,
   6.27,
   6.28,
   6.28,
   6.28,
   6.28,
   6.28,
   6.29,
   6.34,
   6.37,
   6.37,
   6.37,
   6.37,
   6.37,
   6.38,
   6.43,
   6.45,
   6.45,
   6.45,
   6.45,
   6.45,
   6.45,
   6.46,
   6.53,
   6.54,
   6.54,
   6.54,
   6.54,
   6.54,
   6.54,
   6.62,
   6.62,
   6.62,
   6.62,
   6.62,
   6.62,
   6.64,
   6.69,
   6.71,
   6.71,
   6.71,
   6.71,
   6.71,
   6.72,
   6.78,
   6.8,
   6.8,
   6.8,
   6.8,
   6.8,
   6.81,
   6.87,
   6.89,
   6.89,
   6.89,
   6.89,
   6.89,
   6.91,
   6.94,
   6.97,
   6.98,
   6.98,
   7,
   7.05,
   7.08,
   7.09,
   7.15,
   7.17,
   7.19,
   7.24,
   7.27,
   7.28,
   7.34,
   7.37,
   7.37,
   7.45,
   7.46,
   7.47,
   7.55,
   7.56,
   7.57,
   7.65,
   7.66,
   7.67,
   7.76,
   7.77,
   7.77,
   7.86,
   7.88,
   7.95,
   7.99,
   8.05,
   8.1,
   8.15,
   8.19,
   8.24,
   8.27,
   8.31,
   8.38,
   8.43,
   8.48,
   8.52,
   8.58,
   8.61,
   8.65,
   8.71,
   8.75,
   8.81,
   8.84,
   8.88,
   8.93,
   8.97,
   9,
   9.05,
   9.12,
   9.17,
   9.24,
   9.29,
   9.36,
   9.42,
   9.49,
   9.54,
   9.62,
   9.67,
   9.74,
   9.8,
   9.87,
   9.93,
   10,
   10.2,
   10.3,
   10.5,
   10.6,
   10.8,
   10.9,
   10.9,
   11,
   11.2,
   11.2,
   11.3,
   11.5,
   11.6,
   11.8,
   11.9,
   12.1,
   12.2,
   12.4,
   12.6,
   12.7,
   12.9,
   13.1,
   13.3,
   13.5,
   13.5,
   13.6,
   13.8,
   14,
   14.2,
   14.4,
   14.5,
   14.5,
   14.8,
   15,
   15.2,
   15.3,
   15.3,
   15.6,
   15.8,
   15.9,
   16,
   16.2,
   16.5,
   16.6,
   16.9,
   17.2,
   17.3,
   17.6,
   17.9,
   18,
   18.3,
   18.6,
   18.7,
   19,
   19.3,
   19.4,
   19.5,
   19.8,
   20.6,
   21.4,
   21.8,
   22,
   22.2,
   22.6,
   22.9,
   23.2,
   23.5,
   23.8,
   24.1,
   24.5,
   24.8,
   25.1,
   25.5,
   25.8,
   26.1,
   26.5,
   26.8,
   27.2,
   27.6,
   28.1,
   28.7,
   29.1,
   29.4,
   29.8,
   30.8,
   31.7,
   32.4,
   32.9,
   34.2,
   35.3,
   35.8,
   36.4,
   36.9,
   37.4,
   38.3,
   38.9,
   39.4,
   40.4,
   41,
   41.6,
   42.6,
   43.2,
   43.8,
   44.4,
   45,
   45.6,
   46.2,
   46.8,
   47.5,
   48.1,
   48.7,
   49.4,
   50.1,
   50.7,
   51.4,
   52.1,
   53.3,
   54.8,
   55.7,
   56.4,
   57.2,
   57.9,
   58.7,
   59.5,
   60.3,
   61.1,
   61.9,
   62.7,
   63.5,
   64.4,
   65.3,
   66.3,
   67.6,
   68.8,
   69.7,
   70.7,
   71.6,
   72.8,
   74.2,
   75.5,
   76.5,
   77.5,
   78.8,
   80.3,
   81.8,
   82.8,
   84,
   85.1,
   86.4,
   88.2,
   89.7,
   90.9,
   92.1,
   93.6,
   95.5,
   97.1,
   98.4,
   100,
   102,
   104,
   105,
   108,
   110,
   112,
   114,
   115,
   118,
   120,
   122,
   124,
   127,
   130,
   132,
   134,
   137,
   139,
   142,
   145,
   147,
   150,
   152,
   155,
   157,
   161,
   164,
   167,
   170,
   173,
   176,
   179,
   182,
   187,
   190,
   194,
   197,
   200,
   205,
   208,
   213,
   216,
   222,
   225,
   231,
   234,
   240,
   244,
   253,
   262,
   267,
   272,
   278,
   283,
   289,
   295,
   301,
   307,
   312,
   317,
   323,
   329,
   334,
   341,
   347,
   353,
   358,
   367,
   374,
   381,
   387,
   395,
   403,
   411,
   419,
   427,
   436,
   445,
   454,
   463,
   475,
   485,
   494,
   504,
   514,
   528,
   545,
   564,
   583,
   603,
   615,
   628,
   639,
   649,
   662,
   675,
   689,
   701,
   712,
   726,
   741,
   756,
   771,
   786,
   802,
   818,
   833,
   846,
   863,
   878,
   892,
   910,
   935,
   964,
   992,
   1030,
   1050,
   1070,
   1090,
   1110,
   1150,
   1190,
   1210,
   1230,
   1260,
   1280,
   1310,
   1340,
   1370,
   1400,
   1430,
   1460,
   1490,
   1520,
   1550,
   1600,
   1650,
   1690,
   1720,
   1750,
   1790,
   1850,
   1910,
   1950,
   1990,
   2030,
   2070,
   2130,
   2170,
   2210,
   2260,
   2300,
   2370,
   2410,
   2460,
   2540,
   2630,
   2680,
   2730,
   2820,
   2920,
   3020,
   3120,
   3190,
   3240,
   3320,
   3370,
   3490,
   3610,
   3690,
   3750,
   3880,
   4020,
   4100,
   4180,
   4270,
   4350,
   4440,
   4530,
   4620,
   4690,
   4810,
   4880,
   5000,
   5080,
   5200,
   5310,
   5420,
   5520,
   5640,
   5750,
   5860,
   5980,
   6100,
   6220,
   6330,
   6440,
   6560,
   6700,
   6830,
   7050,
   7300,
   7450,
   7590,
   7840,
   8110,
   8380,
   8670,
   8850,
   8990,
   9210,
   9390,
   9610};
   Double_t Graph_fy10[518] = {
   10.38676,
   10.50231,
   10.59957,
   10.7015,
   10.89364,
   11.07546,
   11.20647,
   11.30821,
   11.41342,
   11.62109,
   11.82995,
   11.96215,
   12.07818,
   12.17911,
   12.30743,
   12.414,
   12.52534,
   12.76538,
   12.97118,
   13.12865,
   13.25128,
   13.37442,
   13.49524,
   13.62174,
   13.74534,
   13.99711,
   14.24146,
   14.40622,
   14.54013,
   14.67427,
   14.8083,
   14.94868,
   15.22224,
   15.47959,
   15.6669,
   15.80805,
   15.95581,
   16.10083,
   16.2527,
   16.40114,
   16.65049,
   17.00656,
   17.18103,
   17.34867,
   17.50979,
   17.663,
   17.82315,
   18.09534,
   18.48112,
   18.68225,
   18.85134,
   19.02836,
   19.21403,
   19.38419,
   19.72512,
   20.07365,
   20.32073,
   20.51337,
   20.68111,
   20.89181,
   21.0759,
   21.47197,
   21.82747,
   22.10836,
   22.30316,
   22.50687,
   22.72023,
   22.88709,
   23.32871,
   23.73763,
   24.00677,
   24.23435,
   24.45738,
   24.68282,
   24.91041,
   25.36578,
   25.78503,
   26.09729,
   26.34398,
   26.58842,
   27.06598,
   27.53896,
   27.86668,
   28.37133,
   28.86478,
   29.20029,
   29.71859,
   30.24769,
   30.60227,
   31.15273,
   31.68307,
   32.06927,
   32.5362,
   33.23597,
   33.60661,
   34.0793,
   34.82676,
   35.19988,
   35.69491,
   36.46783,
   36.87798,
   37.44003,
   38.20997,
   38.65276,
   39.20006,
   40.07932,
   40.8414,
   41.55343,
   42.4036,
   43.14178,
   44.02907,
   44.76045,
   45.25133,
   46.05417,
   46.59723,
   47.07559,
   47.84267,
   48.80958,
   49.64402,
   50.16063,
   51.06094,
   51.65136,
   52.17979,
   52.98822,
   53.58735,
   54.51024,
   55.15295,
   55.7454,
   56.61769,
   57.29215,
   57.83828,
   58.59123,
   59.58957,
   60.25911,
   61.2608,
   61.9507,
   63.01658,
   63.72388,
   64.8542,
   65.56339,
   66.64773,
   67.45883,
   68.57788,
   69.38042,
   70.52167,
   71.44279,
   73.10832,
   74.86664,
   76.70132,
   78.48531,
   80.39639,
   82.27539,
   83.96915,
   84.81317,
   86.19446,
   88.02168,
   88.90821,
   90.11315,
   92.12023,
   94.32802,
   96.50886,
   98.84577,
   100.8332,
   102.8086,
   104.7116,
   106.793,
   108.8109,
   110.7898,
   112.9515,
   115.1677,
   117.0762,
   118.1521,
   119.1161,
   120.7506,
   122.937,
   125.5722,
   127.4196,
   128.5312,
   129.6638,
   131.542,
   134.0308,
   136.1693,
   137.3979,
   138.4952,
   140.691,
   142.7079,
   144.0108,
   145.2215,
   146.8251,
   149.5702,
   150.7827,
   152.4733,
   155.2857,
   156.5944,
   158.387,
   161.2726,
   162.6707,
   164.4505,
   167.5191,
   168.8856,
   170.7937,
   172.6887,
   174.1507,
   175.4199,
   177.3078,
   182.9573,
   187.7626,
   189.8365,
   190.4369,
   191.0454,
   193.294,
   195.0114,
   196.8028,
   198.6746,
   200.6337,
   202.4317,
   204.8624,
   205.4538,
   206.0518,
   208.4005,
   210.5569,
   212.4997,
   214.5452,
   216.3183,
   218.547,
   220.4993,
   222.5493,
   224.7033,
   226.9325,
   229.2592,
   231.2259,
   233.3437,
   236.0739,
   236.692,
   237.8515,
   240.2765,
   242.669,
   242.8986,
   243.7,
   244.4396,
   245.1237,
   245.324,
   246.1552,
   246.9239,
   247.738,
   248.6028,
   249.34,
   250.183,
   251.0113,
   251.7779,
   252.4054,
   252.4402,
   252.4741,
   252.5072,
   252.5394,
   252.576,
   252.6065,
   251.8236,
   251.565,
   251.5977,
   251.9175,
   252.7618,
   252.7922,
   253.0667,
   254.0334,
   254.1442,
   254.1704,
   254.1995,
   254.2243,
   254.2519,
   254.2788,
   254.305,
   254.3305,
   254.3554,
   254.3796,
   254.4032,
   254.4291,
   254.4543,
   254.2526,
   253.4561,
   253.3367,
   253.3588,
   252.5675,
   252.295,
   252.1031,
   251.2675,
   251.223,
   250.3929,
   250.0624,
   249.8782,
   249.0786,
   249.0366,
   248.174,
   247.9263,
   247.944,
   247.6981,
   246.9351,
   246.8915,
   246.9084,
   246.0196,
   245.5296,
   244.7362,
   244.6935,
   243.8445,
   243.6187,
   242.4377,
   241.8683,
   241.295,
   240.1783,
   239.0772,
   238.001,
   237.4805,
   236.957,
   236.4553,
   236.9969,
   237.012,
   234.4527,
   232.994,
   232.0529,
   231.124,
   230.6725,
   229.7764,
   228.8918,
   227.5962,
   226.7575,
   226.3463,
   225.53,
   224.7235,
   224.3345,
   223.5489,
   222.4,
   221.6514,
   220.9151,
   220.5568,
   219.4781,
   218.4252,
   218.4349,
   217.4066,
   216.4078,
   215.7535,
   214.7888,
   214.4764,
   213.537,
   212.6227,
   211.7229,
   210.5545,
   209.6973,
   208.5851,
   207.767,
   206.7044,
   205.9222,
   204.9054,
   204.1581,
   202.7048,
   200.6119,
   199.4946,
   198.6241,
   197.7734,
   196.9394,
   195.9209,
   195.126,
   194.1531,
   193.393,
   192.6467,
   192.2811,
   191.5566,
   190.8456,
   190.4965,
   189.8054,
   189.1259,
   188.7928,
   187.9657,
   186.9986,
   186.3681,
   185.748,
   185.29,
   184.688,
   183.8008,
   183.0782,
   182.0883,
   181.3984,
   180.4531,
   179.6626,
   178.8891,
   178.132,
   176.4223,
   175.5989,
   174.7941,
   174.0077,
   173.2387,
   171.644,
   170.3208,
   168.5686,
   167.267,
   165.4898,
   164.7208,
   163.9695,
   163.8889,
   163.1556,
   162.5181,
   161.6606,
   160.976,
   160.9779,
   160.2332,
   159.5059,
   158.7245,
   158.0995,
   157.2843,
   156.6211,
   155.8431,
   155.2095,
   155.1483,
   154.4668,
   153.8004,
   153.7418,
   153.0319,
   152.3957,
   150.9962,
   149.8166,
   148.4291,
   146.8649,
   146.1595,
   145.5618,
   144.8424,
   144.2273,
   143.077,
   141.5716,
   140.9059,
   140.2935,
   139.6204,
   138.999,
   138.3208,
   137.7278,
   136.5779,
   135.9239,
   135.2852,
   134.6612,
   134.0513,
   133.455,
   132.8717,
   131.7421,
   130.3946,
   129.6185,
   129.1138,
   128.6188,
   127.8935,
   126.9576,
   125.6149,
   124.9697,
   124.5488,
   123.9302,
   123.3267,
   122.1621,
   121.6,
   121.0507,
   120.5136,
   119.9882,
   118.9705,
   118.3154,
   117.8359,
   116.905,
   115.7187,
   115.1476,
   114.5904,
   113.7792,
   112.4881,
   111.6267,
   110.4508,
   109.8856,
   109.4437,
   108.7971,
   108.3764,
   107.6595,
   106.4832,
   106.0117,
   105.4593,
   104.657,
   103.6329,
   103.0581,
   102.6571,
   102.1086,
   101.7257,
   101.2013,
   100.7625,
   100.2622,
   99.77413,
   99.29779,
   98.89833,
   98.37802,
   97.9966,
   97.43805,
   97.13459,
   96.65859,
   96.25151,
   95.79658,
   95.35219,
   94.91791,
   94.49337,
   94.02686,
   93.6217,
   93.27425,
   93.07861,
   92.78892,
   92.31587,
   91.94598,
   91.2278,
   90.24254,
   89.78968,
   89.42747,
   88.72436,
   87.79184,
   87.11485,
   86.19591,
   85.77034,
   85.35504,
   84.91885,
   84.61402,
   84.25532};
   graph = new TGraph(518,Graph_fx10,Graph_fy10);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#66ccff");
   graph->SetLineColor(ci);
   graph->SetLineStyle(5);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph10 = new TH1F("Graph_Graph10","Graph",518,5.436,10570.4);
   Graph_Graph10->SetMinimum(9.348083);
   Graph_Graph10->SetMaximum(278.861);
   Graph_Graph10->SetDirectory(0);
   Graph_Graph10->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph10->SetLineColor(ci);
   Graph_Graph10->GetXaxis()->SetLabelFont(42);
   Graph_Graph10->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph10->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph10->GetXaxis()->SetTitleFont(42);
   Graph_Graph10->GetYaxis()->SetLabelFont(42);
   Graph_Graph10->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph10->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph10->GetYaxis()->SetTitleFont(42);
   Graph_Graph10->GetZaxis()->SetLabelFont(42);
   Graph_Graph10->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph10->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph10->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph10);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx11[35] = {
   3.98,
   4.37,
   4.79,
   5.25,
   5.75,
   6.31,
   6.92,
   7.59,
   8.32,
   9.12,
   10,
   10.96,
   12.02,
   13.18,
   14.45,
   15.85,
   17.38,
   19.05,
   20.89,
   22.91,
   25.12,
   31.62,
   39.81,
   50.12,
   63.1,
   79.43,
   100,
   125.89,
   158.49,
   199.53,
   251.19,
   316.23,
   1000,
   3162.3,
   10000};
   Double_t Graph_fy11[35] = {
   64.47703,
   92.96188,
   120.9916,
   144.7661,
   171.1873,
   194.8983,
   219.9867,
   244.5213,
   267.5613,
   289.6608,
   311.7509,
   330.2783,
   345.9273,
   362.605,
   376.5173,
   387.5872,
   398.0475,
   406.9399,
   414.3522,
   421.5604,
   426.3119,
   433.1181,
   435.0014,
   429.503,
   421.4079,
   411.5566,
   398.3919,
   383.7713,
   369.2768,
   352.1727,
   335.9504,
   319.8066,
   245.9105,
   185.1913,
   139.1868};
   graph = new TGraph(35,Graph_fx11,Graph_fy11);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#66cc66");
   graph->SetLineColor(ci);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph11 = new TH1F("Graph_Graph11","Graph",100,3.582,10999.6);
   Graph_Graph11->SetMinimum(27.4246);
   Graph_Graph11->SetMaximum(472.0538);
   Graph_Graph11->SetDirectory(0);
   Graph_Graph11->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph11->SetLineColor(ci);
   Graph_Graph11->GetXaxis()->SetLabelFont(42);
   Graph_Graph11->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph11->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph11->GetXaxis()->SetTitleFont(42);
   Graph_Graph11->GetYaxis()->SetLabelFont(42);
   Graph_Graph11->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph11->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph11->GetYaxis()->SetTitleFont(42);
   Graph_Graph11->GetZaxis()->SetLabelFont(42);
   Graph_Graph11->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph11->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph11->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph11);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx12[35] = {
   4,
   5,
   6,
   7,
   8,
   9,
   10,
   12,
   14,
   16,
   18,
   20,
   24,
   28,
   32,
   36,
   40,
   44,
   48,
   52,
   56,
   60,
   65,
   70,
   75,
   80,
   85,
   90,
   95,
   100,
   150,
   200,
   300,
   400,
   500};
   Double_t Graph_fy12[35] = {
   91.75045,
   115.9467,
   132.4599,
   144.0692,
   152.856,
   159.9043,
   165.4462,
   172.653,
   177.2831,
   179.5654,
   180.8904,
   181.5836,
   181.5776,
   181.2419,
   178.737,
   176.8406,
   175.2212,
   173.4303,
   171.2294,
   169.3498,
   167.5194,
   165.3283,
   163.1921,
   161.2337,
   159.198,
   157.2876,
   155.7156,
   153.813,
   152.3262,
   150.9621,
   138.5165,
   129.9907,
   118.4184,
   110.7202,
   104.9163};
   graph = new TGraph(35,Graph_fx12,Graph_fy12);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#333399");
   graph->SetLineColor(ci);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph12 = new TH1F("Graph_Graph12","Graph",100,3.6,549.6);
   Graph_Graph12->SetMinimum(82.76714);
   Graph_Graph12->SetMaximum(190.5669);
   Graph_Graph12->SetDirectory(0);
   Graph_Graph12->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph12->SetLineColor(ci);
   Graph_Graph12->GetXaxis()->SetLabelFont(42);
   Graph_Graph12->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph12->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph12->GetXaxis()->SetTitleFont(42);
   Graph_Graph12->GetYaxis()->SetLabelFont(42);
   Graph_Graph12->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph12->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph12->GetYaxis()->SetTitleFont(42);
   Graph_Graph12->GetZaxis()->SetLabelFont(42);
   Graph_Graph12->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph12->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph12->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph12);
   
   multigraph->Add(graph,"");
   multigraph->Draw("L");
   
   TLegend *leg = new TLegend(0.185,0.5,0.59,0.79,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextSize(0.03);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("NULL","Razor-0#mu 90% CL limit: AV EFT operator","h");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","Expected limit, with uncertainty","lf");

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

   ci = TColor::GetColor("#ff6666");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","Observed limit","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   
   leg = new TLegend(0.7,0.5,0.95,0.79,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextSize(0.03);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   entry=leg->AddEntry("Graph","IceCube W^{+}W^{-}","l");

   ci = TColor::GetColor("#3399ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(4);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","COUPP 2012","l");

   ci = TColor::GetColor("#6666ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(6);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","SIMPLE 2012","l");

   ci = TColor::GetColor("#ff9900");
   entry->SetLineColor(ci);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","Super-K W^{+}W^{-}","l");

   ci = TColor::GetColor("#cc33ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(6);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","XENON 100","l");

   ci = TColor::GetColor("#66ccff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(5);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","PICO","l");

   ci = TColor::GetColor("#66cc66");
   entry->SetLineColor(ci);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","PICASSO","l");

   ci = TColor::GetColor("#333399");
   entry->SetLineColor(ci);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   TLatex *   tex = new TLatex(0.955,0.945,"18.8 fb^{-1} (8 TeV)");
tex->SetNDC();
   tex->SetTextAlign(31);
   tex->SetTextFont(42);
   tex->SetTextSize(0.045);
   tex->SetLineWidth(2);
   tex->Draw();
      tex = new TLatex(0.27,0.867,"CMS");
tex->SetNDC();
   tex->SetTextAlign(31);
   tex->SetTextFont(61);
   tex->SetTextSize(0.045);
   tex->SetLineWidth(2);
   tex->Draw();
   
   TH1F *_copy__1 = new TH1F("_copy__1","",100,0.9,1049.95);
   _copy__1->SetMinimum(100);
   _copy__1->SetMaximum(1e+08);
   _copy__1->SetDirectory(0);
   _copy__1->SetStats(0);

   ci = TColor::GetColor("#000099");
   _copy__1->SetLineColor(ci);
   _copy__1->GetXaxis()->SetTitle("M_{#chi} (GeV)");
   _copy__1->GetXaxis()->SetRange(0,96);
   _copy__1->GetXaxis()->SetLabelFont(42);
   _copy__1->GetXaxis()->SetTitleSize(0.05);
   _copy__1->GetXaxis()->SetTitleOffset(1.1);
   _copy__1->GetXaxis()->SetTitleFont(42);
   _copy__1->GetYaxis()->SetTitle("#Lambda (GeV)");
   _copy__1->GetYaxis()->SetLabelFont(42);
   _copy__1->GetYaxis()->SetTitleSize(0.05);
   _copy__1->GetYaxis()->SetTitleOffset(1.05);
   _copy__1->GetYaxis()->SetTitleFont(42);
   _copy__1->GetZaxis()->SetLabelFont(42);
   _copy__1->GetZaxis()->SetLabelSize(0.035);
   _copy__1->GetZaxis()->SetTitleSize(0.035);
   _copy__1->GetZaxis()->SetTitleFont(42);
   _copy__1->Draw("sameaxis");
   c->Modified();
   c->cd();
   c->SetSelected(c);
}