Esempio n. 1
0
void grshade() {
   TCanvas *c1 = new TCanvas("c1","A Simple Graph Example",200,10,700,500);

   c1->SetGrid();
   c1->DrawFrame(0,0,2.2,12);
   
   const Int_t n = 20;
   Double_t x[n], y[n],ymin[n], ymax[n];
   Int_t i;
   for (i=0;i<n;i++) {
     x[i] = 0.1+i*0.1;
     ymax[i] = 10*sin(x[i]+0.2);
     ymin[i] = 8*sin(x[i]+0.1);
     y[i] = 9*sin(x[i]+0.15);
   }
   TGraph *grmin = new TGraph(n,x,ymin);
   TGraph *grmax = new TGraph(n,x,ymax);
   TGraph *gr    = new TGraph(n,x,y);
   TGraph *grshade = new TGraph(2*n);
   for (i=0;i<n;i++) {
      grshade->SetPoint(i,x[i],ymax[i]);
      grshade->SetPoint(n+i,x[n-i-1],ymin[n-i-1]);
   }
   grshade->SetFillStyle(3013);
   grshade->SetFillColor(16);
   grshade->Draw("f");
   grmin->Draw("l");
   grmax->Draw("l");
   gr->SetLineWidth(4);
   gr->SetMarkerColor(4);
   gr->SetMarkerStyle(21);
   gr->Draw("CP");
}
TGraph* getContourFilledX(TH2D* inputHisto, TCanvas* goodCanvas, int Width, int Style, int FillStyle, double X){
       TCanvas* c1 = new TCanvas("temp", "temp",600,600);

       TH2D* histo = (TH2D*)inputHisto->Clone("temp");

       double levels[] = {X};
       histo->SetContour(1, levels);
       histo->Draw("CONT LIST");
       c1->Update();
       TObjArray* contours = (TObjArray*)gROOT->GetListOfSpecials()->FindObject("contours");
       Int_t ncontours     = contours->GetSize();
       TList *list         = (TList*)contours->At(0);
       delete c1;

       goodCanvas->cd();
       printf("list size = %i\n", (int)list->GetSize());
       if(list->GetSize()<=0)return new TGraph(0);

       for(unsigned int i=0;i<list->GetSize();i++){
       TGraph* EXCLUSION   = (TGraph*)(list->At(i)->Clone("copy"));
       EXCLUSION->SetLineColor(1);
       EXCLUSION->SetLineWidth(Width);
       EXCLUSION->SetLineStyle(Style);
       EXCLUSION->SetFillColor(kBlack);
       EXCLUSION->SetFillStyle(FillStyle);
       //EXCLUSION->Draw("CL F same");
       }

       return EXCLUSION;
}
void DummyLegendExpected(TLegend* leg, TString what,  Int_t fillColor, Int_t fillStyle, Int_t lineColor, Int_t lineStyle, Int_t lineWidth) {

    TGraph* gr = new TGraph();
    gr->SetFillColor(fillColor);
    gr->SetFillStyle(fillStyle);
    gr->SetLineColor(lineColor);
    gr->SetLineStyle(lineStyle);
    gr->SetLineWidth(lineWidth);
    leg->AddEntry(gr,what,"LF");
}
Esempio n. 4
0
void contour(Double_t x1,Double_t x2,Double_t s1, Double_t s2,Double_t rho,TString name, bool charge) {

    // MC values
    Double_t th1=0.322;
    Double_t th2=0.225;

    // by hand
    /*
    // lookup the 2x2 covariance matrix elements for these variables
    Double_t x1= 0.310;//par1->getVal();
    Double_t x2= 0.171;//par2->getVal();
    Double_t s1= 0.038;//par1->getError();
    Double_t s2= 0.125;//par2->getError();
    Double_t rho= -0.3;//correlation(parName1, parName2);
    */
    RooPlot *contour1=ellipse(x1,x2,s1,s2,rho,"E");
    //RooPlot *contour2=ellipse(x1,x2,0.04,0.13,rho,"EC",th1,th2);

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

    TCanvas *c= new TCanvas(name,name,600,600);
    contour1->Draw();
    if(charge==true) {
        contour1->GetXaxis()->SetTitle("(f_{L} - f_{R})^{ +}");
        contour1->GetYaxis()->SetTitle("f_{0}^{ +}");
    }
    else {
        contour1->GetXaxis()->SetTitle("(f_{L}} - f_{R})^{ -}");
        contour1->GetYaxis()->SetTitle("f_{0}^{ -}");
    }
    contour1->GetXaxis()->SetTitleSize(0.05);
    contour1->GetYaxis()->SetTitleSize(0.05);
    contour1->GetXaxis()->SetTitleOffset(.9);
    contour1->GetYaxis()->SetTitleOffset(.85);

    const  int n = 2000;
    Double_t x[n], y[n];
    for (Int_t i=0; i<n; i++) {
        x[i] = -1+i*0.001;
        y[i] = i*0.001;
        if(i*0.001>1) y[i] = 2-i*0.001;
        //cout << " x :"<<x[i]  << " y :"<< y[i]  <<endl;
    }

    TGraph * excl = new TGraph(n,x,y);
    excl->SetLineWidth(9903);
    excl->SetFillStyle(3005);
    excl->Draw("SAMEC");
    // contour2->Draw("SAME");
}
Esempio n. 5
0
TGraph *
GetHydroSpectrum(TFile *file, Int_t part, Int_t charge, Int_t cent)
{
  TGraph *h = (TGraph *)file->Get(Form("%s_C%d", HydroPartName[part], cent));
  if (!h) return NULL;
  h->SetTitle("Hydro");
  h->SetLineWidth(2);
  h->SetLineColor(kYellow+1);
  h->SetMarkerStyle(24);
  h->SetMarkerColor(kYellow+1);
  h->SetFillStyle(0);
  h->SetFillColor(0);
  return h;
}
Esempio n. 6
0
void SetStyle(TGraph& g, double size, int color, int style, int fillstyle=0, int linestyle=1){
	g.SetMarkerSize(size);
	g.SetMarkerColor(color);
	g.SetLineColor(color);
	g.SetMarkerStyle(style);
	g.SetFillStyle(fillstyle);
	g.SetLineStyle(linestyle);
	g.GetXaxis()->SetTitleFont(42);
	g.GetYaxis()->SetTitleFont(42);
	g.GetXaxis()->SetTitleSize(0.048);
	g.GetYaxis()->SetTitleSize(0.048);
	g.GetXaxis()->CenterTitle();
	g.GetYaxis()->CenterTitle();
}
Esempio n. 7
0
void auto_lednic_input_new()
{
  gROOT->SetStyle("Plain");
  Double_t ZR_min = 0.5;
  Double_t ZR_max = 3.0;
  const Int_t n   = 100;

  // lednic_input default values (ZT = 0.01, V = 0.001)
  Double_t ZT_min = 0.001;
  Double_t ZT_max = 2.0;
  Double_t V_min  = 0.0001;
  Double_t V_max  = 0.3;

  Double_t x[n], y_min[n], y_max[n], step = (ZR_max - ZR_min)/n;
  for (Int_t i = 0; i < n; i++) {
    x[i]     = ZR_min + i*step;
    y_min[i] = CalcLednicR(x[i], ZT_min, V_min);
    y_max[i] = CalcLednicR(x[i], ZT_max, V_max);
  }

  TGraph *g_min = new TGraph(n, x, y_min);
  TGraph *g_max = new TGraph(n, x, y_max);
  TGraph *gg    = new TGraph(2*n);
  for (Int_t i = 0; i < n; i++) {
    gg->SetPoint(i, x[i], y_max[i]);
    gg->SetPoint(n+i, x[n-i-1], y_min[n-i-1]);
  }

  gg->SetTitle(";r_{0} [fm];R (k = 0.02 GeV/c)");
  gg->GetYaxis()->CenterTitle(); gg->SetMinimum(0); gg->SetFillStyle(3003);
  gg->Draw("AF");
  g_min->Draw("C");
  g_max->SetLineStyle(2);
  g_max->Draw("C");
  TLegend *leg = new TLegend(0.50, 0.70, 0.85, 0.85);
  leg->AddEntry(g_min, Form("t_{0} = %.3f fm, v = %.4fc", ZT_min, V_min), "L");
  leg->AddEntry(g_max, Form("t_{0} = %.3f fm, v = %.4fc", ZT_max, V_max), "L");
  leg->SetFillColor(0);
  leg->Draw();
  gPad->Print("pp_correl_r0.pdf");
}
TGraph *draw_schiavilla(Int_t opt = 0){

	Double_t x, y, dy;

	Double_t gen[26];
	Double_t Q2[26];
	Double_t tau;
	Int_t i;

	FILE *f = fopen("figure_input/GEn_Schiavilla.dat", "r");

	for( i = 0; i < 13; i++ ){
		fscanf( f, "%lf%lf%lf", &x, &y, &dy );

		Q2[i]    = x;
		Q2[25-i] = x;

		if( opt == 0 ){
			gen[i]   = y+dy;
			gen[25-i]= y-dy;
		}

		if( opt == 1 ){
			gen[i]   = y;
			gen[25-i]= y;
		}
	}	

	TGraph *g = new TGraph( 20, Q2, gen );

	g->SetFillColor(kCyan-10);
	g->SetFillStyle(1001);
	g->SetLineColor(kGreen);

	g->SetMarkerStyle(23);

	return g;
}
    TGraph*
DrawExpectedBand( TGraph* gr1,  TGraph* gr2, Int_t fillColor, Int_t fillStyle, Int_t cut = 0)
{
    //  TGraph* gr1 = new TGraph( *graph1 );
    //  TGraph* gr2 = new TGraph( *graph2 );

    int number_of_bins = max(gr1->GetN(),gr2->GetN());

    const Int_t gr1N = gr1->GetN();
    const Int_t gr2N = gr2->GetN();

    const Int_t N = number_of_bins;
    Double_t x1[N], y1[N], x2[N], y2[N];

    Double_t xx0, yy0;

    for(int j=0; j<gr1N; j++) {
        gr1->GetPoint(j,xx0,yy0);
        x1[j] = xx0;
        y1[j] = yy0;
    }
    if (gr1N < N) {
        for(int i=gr1N; i<N; i++) {
            x1[i] = x1[gr1N-1];
            y1[i] = y1[gr1N-1];
        }
    }

    Double_t xx1, yy1;

    for(int j=0; j<gr2N; j++) {
        gr2->GetPoint(j,xx1,yy1);
        x2[j] = xx1;
        y2[j] = yy1;
    }
    if (gr2N < N) {
        for(int i=gr2N; i<N; i++) {
            x2[i] = x2[gr1N-1];
            y2[i] = y2[gr1N-1];
        }
    }

    TGraph *grshade = new TGraphAsymmErrors(2*N);
    for (int i=0;i<N;i++) {

        if (x1[i] > cut)
            grshade->SetPoint(i,x1[i],y1[i]);
        //cout<<"grshade x1="<< x1[i] <<" y1="<<y1[i]<<endl;

        if (x2[N-i-1] > cut)
            grshade->SetPoint(N+i,x2[N-i-1],y2[N-i-1]);
    }


    // Apply the cut in the shade plot if there is something that doesn't look good...
    int Nshade = grshade->GetN();
    double x0, y0;
    double x00, y00;

    for(int j=0; j<Nshade; j++) {
        grshade->GetPoint(j,x0,y0);
        if ((x0 != 0) && (y0 != 0)) {
            x00 = x0;
            y00 = y0;
            break;
        }
    }

    for(int j=0; j<Nshade; j++) {
        grshade->GetPoint(j,x0,y0);
        if ((x0 == 0) && (y0 == 0))
            grshade->SetPoint(j,x00,y00);
    }


    // Now draw the plot...
    grshade->SetFillStyle(fillStyle);
    grshade->SetFillColor(fillColor);
    grshade->SetMarkerStyle(21);
    grshade->Draw("F");

    return grshade;
}
void makePlots()
{
 // **********************************************
 // *            Input parameters                *
 // **********************************************
 // switch to include/exclude sytematics uncertainties 
  bool plot7TeV = false;
  bool plot10TeV = true;

 // array of signal efficiencies
 Double_t S_eff[5] = {0.36, 0.43, 0.54, 0.59, 0.66};
 
 // array of N_background for 100 pb^-1
 Double_t N_bkg_100[5] = {10.35, 6.37, 2.83, 1.27, 1.27};
 Double_t N_bkg_100_7TeV[5] = {4.068, 1.937, 0.816, 0.3841, 0.3841};
 
 // arrays of leptoquark masses
 string mass[5] = {"m250", "m300", "m400", "m500", "m600"};
 Double_t m[5] = {250, 300, 400, 500, 600};
 
 
 // array of theoretical cross-sections for different leptoquark mass
 Double_t xsTh[5] = {9.64045, 3.6081, 0.691125, 0.176217, 0.0538333};
 Double_t xs7Th[10] = {3.48, 1.21, 0.206, 0.0463, 0.0124, 0.00676, 0.00377, 0.00124, 0.000437, 0.00016};
 
 // arrays of beta^2 ranges that contain 95% CL exclusion of different leptoquark mass hypotheses
 Double_t rangeMin[5] = {0.018, 0.03, 0.09, 0.3,  0.9};
 Double_t rangeMax[5] = { 0.03, 0.08,  0.2, 0.55, 1.5};
 Double_t rangeMin_7TeV[5] = {0.03,  0.08,  0.35,  1.0, 3.5};
 Double_t rangeMax_7TeV[5] = {0.08, 0.25,  0.55, 1.5, 5.0};

 // number of points used for interpolation
 Int_t NPts = 5;
  
 // filename for the final plot (NB: changing the name extension changes the file format)
 string fileName = "beta_vs_m_excl.eps";
 if (plot7TeV && !plot10TeV) fileName = "7TeV_beta_vs_m_excl.eps";
 if (!plot7TeV && plot10TeV) fileName = "10TeV_beta_vs_m_excl.eps";
  
 // axes labels for the final plot 
 string title = ";m (GeV/c^{2});#beta";

 TH2F *bg = new TH2F("bg",title.c_str(), 100, 200., 650., 100, 0., 1.);
 bg->SetStats(kFALSE);
 bg->SetTitleOffset(1.,"X");
 bg->SetTitleOffset(1.5,"Y");

 //TF1 *fit1 = new TF1("fit1","[0]*exp([1]*x)",200,600);
 TF1 *fit1 = new TF1("fit1","[0]+[1]*x+[2]*pow(x,2)",200,600);

 //TF1 *fit2 = new TF1("fit2","[0]*exp([1]*x)",200,600);
 TF1 *fit2 = new TF1("fit2","[0]+[1]*x+[2]*pow(x,2)",200,600);
 
 // region excluded by Tevatron limits
 Double_t x_shaded[14] = {200,205,210,215,220,225,230,235,240,245,250,255,256,200};  // 250 pb-1
 Double_t y_shaded[14] = {sqrt(0.0267547),sqrt(0.0380903),sqrt(0.0531225),sqrt(0.0736446),sqrt(0.10221),sqrt(0.142373),sqrt(0.194058),sqrt(0.265091),sqrt(0.385415),sqrt(0.520114),sqrt(0.721552),sqrt(0.945015),1,1};
 Double_t NEW_x_shaded[14] = {216,220,225,231,235,254,268,276,284,289,293,296,297,299};
 Double_t NEW_y_shaded[14] = {0.02,0.04,0.06,0.08,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1};  // 1 fb-1

 // **********************************************
 // *  Don't change anything below this point!   *
 // **********************************************
 
  // turn on/off batch mode
 gROOT->SetBatch(kTRUE);
 // set ROOT style
 style();
 
 TCanvas *c = new TCanvas("c","",800,800);
 c->cd();

 bg->Draw();
 
 TGraph *grexcl = new TGraph(14,x_shaded,y_shaded);
 grexcl->SetFillColor(kGray+1);
 grexcl->Draw("f");
 TGraph *NEWexcl = new TGraph(14,NEW_x_shaded,NEW_y_shaded);
 NEWexcl->SetLineStyle(6);
 NEWexcl->SetLineWidth(3);
 NEWexcl->Draw("C");

 Int_t size = sizeof(S_eff)/sizeof(*S_eff);

 // array of minimum beta^2 values for 95% CL exclusion
//  Double_t beta[size];
 Double_t beta[5] = {0.156865, 0.214541, 0.382863, 0.655572, 1.11471};
 Double_t beta_ln[5] = {log(0.156865), log(0.214541), log(0.382863), log(0.655572), log(1.11471)};
 Double_t beta_7TeV[5] = {0.221188, 0.307225, 0.59993, 1.14052, 2.08235};
 Double_t beta_7TeV_ln[5] = {log(0.221188), log(0.307225), log(0.59993), log(1.14052), log(2.08235)};

//  for(Int_t i = 0; i < size; i++){
  
//   beta_7TeV[i] = beta_for_exclusion(NPts, xs7Th[i], rangeMin_7TeV[i], rangeMax_7TeV[i], 0, S_eff[i], 0, N_bkg_100_7TeV[i], 0, mass[i]);
//   beta_7TeV_ln[i] = log(beta_7TeV[i]);
//  }

 TGraph *beta_vs_m = new TGraph(size, m, beta);
 TGraph *beta_vs_m_fit = new TGraph(size, m, beta_ln);
 beta_vs_m->SetLineWidth(2);
 beta_vs_m->SetLineStyle(7);
 beta_vs_m->SetLineColor(kBlue);
 beta_vs_m->SetMarkerSize(.9);
 beta_vs_m->SetMarkerStyle(22);
 beta_vs_m->SetMarkerColor(kBlue); 
 beta_vs_m_fit->Fit("fit1");
 TF1 *final1 = new TF1("final1","exp(fit1)",200,600);
 final1->SetLineWidth(2);
 final1->SetLineStyle(7);
 final1->SetLineColor(kBlue);
 final1->SetRange(200,600);

 TGraph *beta_vs_m_7TeV = new TGraph(size, m, beta_7TeV);
 TGraph *beta_vs_m_7TeV_fit = new TGraph(size, m, beta_7TeV_ln);
 beta_vs_m_7TeV->SetLineWidth(2);
 beta_vs_m_7TeV->SetLineStyle(7);
 beta_vs_m_7TeV->SetLineColor(kRed);
 beta_vs_m_7TeV->SetMarkerSize(.9);
 beta_vs_m_7TeV->SetMarkerStyle(22);
 beta_vs_m_7TeV->SetMarkerColor(kRed); 
 beta_vs_m_7TeV_fit->Fit("fit2");
 TF1 *final2 = new TF1("final2","exp(fit2)",200,600);
 final2->SetLineWidth(2);
 final2->SetLineStyle(7);
 final2->SetLineColor(kRed);
 final2->SetRange(200,600);

 const Int_t n = 21;
 Double_t x[n], ymin[n], ymin_sys[n], ymax[n];
 for(Int_t i=0;i<n;i++) {
   x[i] = 200+20*i;
   if (plot10TeV) ymin[i] = final1->Eval(x[i]);
   else if (plot7TeV) ymin[i] = final2->Eval(x[i]);
   ymax[i] = 1;
 }
 TGraph *grshade = new TGraph(2*n);
 TGraph *grshade_sys = new TGraph(2*n);
 for(Int_t i=0;i<n;i++) {
    grshade->SetPoint(i,x[i],ymax[i]);
    grshade->SetPoint(n+i,x[n-i-1],ymin[n-i-1]);
    grshade_sys->SetPoint(i,x[i],ymax[i]);
    grshade_sys->SetPoint(n+i,x[n-i-1],ymin_sys[n-i-1]);
 }
 grshade->SetFillStyle(3004);
 if (plot10TeV) grshade->SetFillColor(kBlue);
 if (plot10TeV) grshade->SetLineColor(kBlue);
 if (plot7TeV) grshade->SetFillColor(kRed);
 if (plot7TeV) grshade->SetLineColor(kRed);
 grshade->Draw("F");
 
 gPad->RedrawAxis();
 
 if (plot10TeV) beta_vs_m->Draw("P");
 if (plot10TeV) final1->Draw("same");
 if (plot7TeV) beta_vs_m_7TeV->Draw("Psame");
 if (plot7TeV) final2->Draw("same");
 
 TLegend *legend = new TLegend(.14,.65,.54,.85);
 legend->SetBorderSize(1);
 legend->SetFillColor(0);
 //legend->SetFillStyle(0);
 legend->SetMargin(0.2);
 legend->SetHeader("LQ #rightarrow eq");
 legend->AddEntry(grexcl,"Tevatron exclusion (250 pb^{-1})","f");
 legend->AddEntry(NEWexcl,"Tevatron exclusion (1 fb^{-1})","l");
 if (plot10TeV) legend->AddEntry(beta_vs_m,"95% C.L. (no sys. unc.)","lp");
 if (plot7TeV) legend->AddEntry(beta_vs_m_7TeV,"95% C.L. (no sys. unc.)","lp");
 legend->Draw();

 TLatex l1;
 l1.SetTextAlign(12);
 l1.SetTextSize(0.04);
 l1.SetTextFont(62);
 l1.SetNDC();
 l1.DrawLatex(0.6,0.34,"CMS Preliminary");

 TLatex l2;
 l2.SetTextAlign(12);
 l2.SetTextSize(0.04);
 l2.SetTextFont(62);
 l2.SetNDC();
 l2.DrawLatex(0.6,0.25,"#intLdt=100 pb^{-1}");

 if (plot7TeV){
 TLatex l3;
 l3.SetTextAlign(12);
 l3.SetTextSize(0.035);
 l3.SetTextFont(62);
 l3.SetNDC();
 l3.DrawLatex(0.4,0.16,"EXO-08-010 scaled to #sqrt{s} = 7 TeV");
 }

 c->SetGridx();
 c->SetGridy();
 c->SaveAs(fileName.c_str());

 
 delete fit1;
 delete final1;
 delete fit2;
 delete grexcl;
 delete grshade;
 delete legend;
 delete beta_vs_m;
 delete beta_vs_m_fit;
 delete bg;
 delete c;
}
Esempio n. 11
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);

}
Esempio n. 12
0
void runBATCalculator()
{
    // Definiton of a RooWorkspace containing the statistics model. Later the
    // information for BATCalculator is retrieved from the workspace. This is
    // certainly a bit of overhead but better from an educative point of view.
    cout << "preparing the RooWorkspace object" << endl;

    RooWorkspace* myWS = new RooWorkspace("myWS", true);

    // combined prior for signal contribution
    myWS->factory("Product::signal({sigma_s[0,20],L[5,15],epsilon[0,1]})");
    myWS->factory("N_bkg[0,3]");
    // define prior functions
    // uniform prior for signal crosssection
    myWS->factory("Uniform::prior_sigma_s(sigma_s)");
    // (truncated) prior for efficiency
    myWS->factory("Gaussian::prior_epsilon(epsilon,0.51,0.0765)");
    // (truncated) Gaussian prior for luminosity
    myWS->factory("Gaussian::prior_L(L,10,1)");
    // (truncated) Gaussian prior for bkg crosssection
    myWS->factory("Gaussian::prior_N_bkg(N_bkg,0.52,0.156)");

    // Poisson distribution with mean signal+bkg
    myWS->factory("Poisson::model(n[0,300],sum(signal,N_bkg))");

    // define the global prior function
    myWS->factory("PROD::prior(prior_sigma_s,prior_epsilon,prior_L,prior_N_bkg)");

    // Definition of observables and parameters of interest
    myWS->defineSet("obsSet", "n");
    myWS->defineSet("poiSet", "sigma_s");
    myWS->defineSet("nuisanceSet", "N_bkg,L,epsilon");

    // ->model complete (Additional information can be found in the
    // RooStats manual)

    //  feel free to vary the parameters, but don't forget to choose reasonable ranges for the
    // variables. Currently the Bayesian methods will often not work well if the variable ranges
    // are either too short (for obvious reasons) or too large (for technical reasons).

    // A ModelConfig object is used to associate parts of your workspace with their statistical
    // meaning (it is also possible to initialize BATCalculator directly with elements from the
    // workspace but if you are sharing your workspace with others or if you want to use several
    // different methods the use of ModelConfig will most often turn out to be the better choice.)

    // setup the ModelConfig object
    cout << "preparing the ModelConfig object" << endl;

    ModelConfig modelconfig("modelconfig", "ModelConfig for this example");
    modelconfig.SetWorkspace(*myWS);

    modelconfig.SetPdf(*(myWS->pdf("model")));
    modelconfig.SetParametersOfInterest(*(myWS->set("poiSet")));
    modelconfig.SetPriorPdf(*(myWS->pdf("prior")));
    modelconfig.SetNuisanceParameters(*(myWS->set("nuisanceSet")));
    modelconfig.SetObservables(*(myWS->set("obsSet")));


    // use BATCalculator to the derive credibility intervals as a function of the observed number of
    // events in the hypothetical experiment

    // define vector with tested numbers of events
    TVectorD obsEvents;
    // define vectors which will be filled with the lower and upper limits for each tested number
    // of observed events
    TVectorD BATul;
    TVectorD BATll;

    // fix upper limit of tested observed number of events
    int obslimit = 10;

    obsEvents.ResizeTo(obslimit);
    BATul.ResizeTo(obslimit);
    BATll.ResizeTo(obslimit);


    cout << "starting the calculation of Bayesian credibility intervals with BATCalculator" << endl;
    // loop over observed number of events in the hypothetical experiment
    for (int obs = 1; obs <= obslimit; obs++) {

        obsEvents[obs - 1] = (static_cast<double>(obs));

        // prepare data input for the the observed number of events
        // adjust number of observed events in the workspace. This is communicated to ModelConfig!
        myWS->var("n")->setVal(obs);
        // create data
        RooDataSet data("data", "", *(modelconfig.GetObservables()));
        data.add( *(modelconfig.GetObservables()));

        // prepare BATCalulator
        BATCalculator batcalc(data, modelconfig);

        // give the BATCalculator a unique name (always a good idea in ROOT)
        TString namestring = "mybatc_";
        namestring += obs;
        batcalc.SetName(namestring);

        // fix amount of posterior probability in the calculated interval.
        // the name confidence level is incorrect here
        batcalc.SetConfidenceLevel(0.90);

        // fix length of the Markov chain. (in general: the longer the Markov chain the more
        // precise will be the results)
        batcalc.SetnMCMC(20000);

        // retrieve SimpleInterval object containing the information about the interval (this
        // triggers the actual calculations)
        SimpleInterval* interval = batcalc.GetInterval1D("sigma_s");

        std::cout << "BATCalculator: 90% credibility interval: [ " << interval->LowerLimit() << " - " << interval->UpperLimit() << " ] or 95% credibility upper limit\n";

        // add the interval borders for the current number of observed events to the vectors
        // containing the lower and upper limits
        BATll[obs - 1] = interval->LowerLimit();
        BATul[obs - 1] = interval->UpperLimit();

        // clean up for next loop element
        batcalc.CleanCalculatorForNewData();
        delete interval;
    }
    cout << "all limits calculated" << endl;

    // summarize the results in a plot

    TGraph* grBATll = new TGraph(obsEvents, BATll);
    grBATll->SetLineColor(kGreen);
    grBATll->SetLineWidth(200);
    grBATll->SetFillStyle(3001);
    grBATll->SetFillColor(kGreen);

    TGraph* grBATul = new TGraph(obsEvents, BATul);
    grBATul->SetLineColor(kGreen);
    grBATul->SetLineWidth(-200);
    grBATul->SetFillStyle(3001);
    grBATul->SetFillColor(kGreen);

    // create and draw multigraph
    TMultiGraph* mg = new TMultiGraph("BayesianLimitsBATCalculator", "BayesianLimitsBATCalculator");
    mg->SetTitle("example of Bayesian credibility intervals derived with BATCAlculator ");

    mg->Add(grBATll);
    mg->Add(grBATul);

    mg->Draw("AC");

    mg->GetXaxis()->SetTitle ("# observed events");
    mg->GetYaxis()->SetTitle("limits on signal S (size of test: 0.1)");

    mg->Draw("AC");
}
void rsLimit7TeV(){

  setTDRStyle();

//=========Macro generated from canvas: cLimit/Limit
//=========  (Mon Feb 22 22:44:48 2010) by ROOT version5.18/00a
//   TCanvas *cLimit = new TCanvas("cLimit", "Limit",450,40,800,550);
//  TCanvas *cLimit = new TCanvas("cLimit", "Limit",100,122,600,600);
  cLimit = new TCanvas("cLimit","cLimit",800,600);

   gStyle->SetOptStat(0);
   //   cLimit->Range(595.5973,-0.03483694,1345.283,0.2539571);
   cLimit->SetFillColor(0);
   cLimit->SetBorderMode(0);
   cLimit->SetBorderSize(2);
   cLimit->SetLeftMargin(0.139262);
   cLimit->SetRightMargin(0.0604027);
   cLimit->SetTopMargin(0.0804196);
   cLimit->SetBottomMargin(0.120629);
   cLimit->SetFrameBorderMode(0);
   cLimit->SetFrameBorderMode(0);
   
   TGraph *graph = new TGraph(11);
   graph->SetName("Graph");
   graph->SetTitle("");
   graph->SetFillColor(1);


   Int_t ci;   // for color index setting
   ci = TColor::GetColor("#ff0000");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);

   ci = TColor::GetColor("#ff0000");
   graph->SetMarkerColor(ci);
   graph->SetMarkerStyle(20);
   graph->SetMarkerSize(1.0);
   graph->SetPoint(0,  863,0.01);
   graph->SetPoint(1, 1132,0.02);
   graph->SetPoint(2, 1274,0.03);
   graph->SetPoint(3, 1395,0.04);
   graph->SetPoint(4, 1503,0.05);
   graph->SetPoint(5, 1597,0.06);
   graph->SetPoint(6, 1676,0.07);
   graph->SetPoint(7, 1742,0.08);
   graph->SetPoint(8, 1801,0.09);
   graph->SetPoint(9, 1844,0.1);
   graph->SetPoint(10,1881,0.11);
   
   cout << " Don't forget to change this..." << endl;
   TH1 *Graph6 = new TH1F("Graph6","",100,863,1881);
   Graph6->SetMinimum(0);
   Graph6->SetMaximum(0.12);
   Graph6->SetDirectory(0);
   Graph6->SetStats(0);
   Graph6->GetXaxis()->SetTitle("M_{1} [GeV]");
   Graph6->GetYaxis()->SetTitle("Coupling k/#bar{M}_{Pl}");
   Graph6->GetXaxis()->SetLabelFont(42);
   Graph6->GetYaxis()->SetLabelFont(42);
   Graph6->GetYaxis()->SetTitleOffset(1.8);
   graph->SetHistogram(Graph6);
   
   graph->GetYaxis()->SetTitleOffset(1.19);
   graph->Draw("al");


   TGraph* graph2 = new TGraph(11);
   graph2->SetMarkerColor(ci);
   graph2->SetMarkerStyle(20);
   graph2->SetMarkerSize(0.0);
   graph2->SetPoint(0,  845,0.01);
   graph2->SetPoint(1, 1133,0.02);
   graph2->SetPoint(2, 1275,0.03);
   graph2->SetPoint(3, 1396,0.04);
   graph2->SetPoint(4, 1504,0.05);
   graph2->SetPoint(5, 1598,0.06);
   graph2->SetPoint(6, 1677,0.07);
   graph2->SetPoint(7, 1743,0.08);
   graph2->SetPoint(8, 1801,0.09);
   graph2->SetPoint(9, 1844,0.1);
   graph2->SetPoint(10,1881,0.11);
   graph2->SetLineStyle(kDashed);
   graph2->SetLineColor(ci);
   graph2->SetLineWidth(3);
   graph2->GetXaxis()->SetLabelFont(42);
   graph2->GetYaxis()->SetLabelFont(42);
   graph2->Draw("plsame");


//    graph = new TGraph(3);
//    graph->SetName("Graph");
//    graph->SetTitle("");
//    graph->SetFillColor(1);

//    ci = TColor::GetColor("#0000ff");
//    graph->SetLineColor(ci);
//    graph->SetLineWidth(3);

//    ci = TColor::GetColor("#0000ff");
//    graph->SetMarkerColor(ci);
//    graph->SetMarkerStyle(22);
//    graph->SetMarkerSize(1.4);
//    graph->SetPoint(0,750,0.03355478);
//    graph->SetPoint(1,1000,0.07617687);
//    graph->SetPoint(2,1250,0.1542326);
   
//    TH1 *Graph7 = new TH1F("Graph7","",100,700,1300);
//    Graph7->SetMinimum(0.021487);
//    Graph7->SetMaximum(0.1663004);
//    Graph7->SetDirectory(0);
//    Graph7->SetStats(0);
//    Graph7->GetXaxis()->SetTitle("Graviton Mass (GeV)");
//    Graph7->GetYaxis()->SetTitle("Coupling k/#bar{M}_{Pl}");
//    graph->SetHistogram(Graph7);
   
//    graph->Draw("pc");
   
//    graph = new TGraph(3);
//    graph->SetName("Graph");
//    graph->SetTitle("");
//    graph->SetFillColor(1);

//    ci = TColor::GetColor("#00ff00");
//    graph->SetLineColor(ci);
//    graph->SetLineWidth(3);

//    ci = TColor::GetColor("#00ff00");
//    graph->SetMarkerColor(ci);
//    graph->SetMarkerStyle(21);
//    graph->SetMarkerSize(1.3);
//    graph->SetPoint(0,750,0.02431275);
//    graph->SetPoint(1,1000,0.05519538);
//    graph->SetPoint(2,1250,0.1117521);
   
//    TH1 *Graph8 = new TH1F("Graph8","",100,700,1300);
//    Graph8->SetMinimum(0.01556881);
//    Graph8->SetMaximum(0.1204961);
//    Graph8->SetDirectory(0);
//    Graph8->SetStats(0);
//    Graph8->GetXaxis()->SetTitle("Graviton Mass (GeV/c^{2})");
//    Graph8->GetYaxis()->SetTitle("Coupling k/#bar{M}_{Pl}");
//    graph->SetHistogram(Graph8);
   
//    graph->Draw("pc");
   
//    TF1 *LambdaPi = new TF1("LambdaPi","pol1",500,2500);
//    LambdaPi->SetFillColor(15);
//    LambdaPi->SetFillStyle(3004);
//    LambdaPi->SetLineColor(15);
//    LambdaPi->SetLineWidth(1);
//    LambdaPi->SetParameter(0,0);
//    LambdaPi->SetParError(0,0);
//    LambdaPi->SetParLimits(0,0,0);
//    LambdaPi->SetParameter(1,2.61097e-05);
//    LambdaPi->SetParError(1,0);
//    LambdaPi->SetParLimits(1,0,0);
//    LambdaPi->Draw("same");
// 
    TF1 *LambdaPi = new TF1("LambdaPi","pol1",250,2500);
    LambdaPi->SetFillColor(15);
    LambdaPi->SetFillStyle(3004);
    LambdaPi->SetLineColor(15);
    LambdaPi->SetLineWidth(1);
    LambdaPi->SetParameter(0,0);
    LambdaPi->SetParError(0,0);
    LambdaPi->SetParLimits(0,0,0);
    LambdaPi->SetParameter(1,2.61097e-05);
    LambdaPi->SetParError(1,0);
    LambdaPi->SetParLimits(1,0,0);
    LambdaPi->GetXaxis()->SetLabelFont(42);
    LambdaPi->GetYaxis()->SetLabelFont(42);
    LambdaPi->Draw("same");
   
    graph = new TGraph(27);
    graph->SetName("Graph");
    graph->SetTitle("Graph");
    graph->SetFillColor(1);
    graph->SetFillStyle(3004);    
    graph->SetLineStyle(5);
    graph->SetLineWidth(3);
    graph->SetPoint(0,180,0.1071);
    graph->SetPoint(1,183,0.1062);
    graph->SetPoint(2,190,0.1043);
    graph->SetPoint(3,200,0.1016);
    graph->SetPoint(4,210,0.0989);
    graph->SetPoint(5,220,0.0963);
    graph->SetPoint(6,230,0.0938);
    graph->SetPoint(7,240,0.0913);
    graph->SetPoint(8,250,0.0889);
    graph->SetPoint(9,260,0.0866);
    graph->SetPoint(10,270,0.0843);
    graph->SetPoint(11,280,0.0821);
    graph->SetPoint(12,290,0.0799);
    graph->SetPoint(13,300,0.0778);
    graph->SetPoint(14,400,0.0603);
    graph->SetPoint(15,500,0.0481);
    graph->SetPoint(16,600,0.0397);
    graph->SetPoint(17,700,0.0337);
    graph->SetPoint(18,800,0.0292);
    graph->SetPoint(19,900,0.0258);
    graph->SetPoint(20,1000,0.0231);
    graph->SetPoint(21,1100,0.0209);
    graph->SetPoint(22,1200,0.0191);
    graph->SetPoint(23,1300,0.0176);
    graph->SetPoint(24,1400,0.0163);
    graph->SetPoint(25,1500,0.0152);
    graph->SetPoint(26,2200,0.01);
    graph->GetXaxis()->SetLabelFont(42);
    graph->GetYaxis()->SetLabelFont(42);
    graph->SetFillColor(kBlack);
    graph->SetFillStyle(3004);
    graph->SetLineWidth(1);
    graph->SetFillStyle(3002);
    graph->SetFillColor(kBlack);
    graph->SetLineWidth(-10000);

    graph->Draw("c");
    //    graph->Draw("same");

//    TPaveText *pt = new TPaveText(0.194631,0.748252,0.436242,0.816434,"blNDC");
//    pt->SetName("95% CL Limit");
//    pt->SetFillColor(0);
//    pt->SetBorderSize(1);
//    pt->SetLineColor(0);
//    pt->SetTextSize(0.04);
//    TText *text = pt->AddText("95% CL Limit");
//    pt->Draw();
  
   TLegend *leg = new TLegend(0.2072864,0.4667832,0.4007538,0.7517483,NULL,"brNDC");
   //    TLegend *leg = new TLegend(0.2072864,0.5332168,0.4007538,0.7517483,NULL,"brNDC"); 
    //   TLegend *leg = new TLegend(0.2110553,0.4248252,0.4120603,0.6433566,NULL,"brNDC");
   //   TLegend *leg = new TLegend(0.2181208,0.5297203,0.4194631,0.7482517,NULL,"brNDC");
   leg->SetBorderSize(1);
   leg->SetTextFont(62);
   leg->SetTextSize(0.05);
   leg->SetLineColor(0);
   leg->SetLineStyle(0);
   leg->SetLineWidth(0);
   leg->SetFillColor(0);
   leg->SetFillStyle(0);
   //   TLegendEntry *entry=leg->AddEntry("graph","50/pb","pl");

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

    entry=leg->AddEntry("graph","Electroweak Limits","lf");
    entry->SetLineColor(1);
    entry->SetLineStyle(5);
    entry->SetLineWidth(3);
    entry->SetMarkerColor(1);
    entry->SetMarkerStyle(21);
    entry->SetMarkerSize(1);

    ci = TColor::GetColor("#ff0000");
    entry->SetMarkerColor(ci);
    entry->SetMarkerStyle(20);
    entry->SetMarkerSize(1.3);
    entry=leg->AddEntry("Graph","95% CL Limit","l");


    leg->AddEntry(graph2,"Expected Limit","l");
    ci = TColor::GetColor("#00ff00");
    entry->SetMarkerColor(ci);
    entry->SetMarkerStyle(21);
    entry->SetMarkerSize(1.3);
    //    entry=leg->AddEntry("LambdaPi","#Lambda_{#pi}> 10TeV","lf");
    entry=leg->AddEntry("LambdaPi","M_{D} > 10TeV","lf");

//     entry->SetFillColor(15);
//     entry->SetFillStyle(3004);
//     entry->SetLineColor(15);
//     entry->SetLineStyle(1);
//     entry->SetLineWidth(1);
//     entry->SetMarkerColor(1);
//     entry->SetMarkerStyle(1);
//     entry->SetMarkerSize(1);

    leg->Draw();
   
   TPaveText *pt = new TPaveText(0.2236181,0.7884615,0.4736181,0.8583916,"blNDC");
   //   TPaveText *pt = new TPaveText(0.1959799,0.7954545,0.4459799,0.8653846,"blNDC");
   //   TPaveText *pt = new TPaveText(0.2130872,0.8339161,0.4630872,0.9038462,"blNDC");
   pt->SetName("CMS Preliminary");
   pt->SetBorderSize(1);
   pt->SetLineColor(0);
   pt->SetFillColor(0);
   //   pt->SetTextFont(72);
   pt->SetTextSize(0.06);
   text = pt->AddText("CMS Preliminary");
   pt->Draw();
   
   pt = new TPaveText(0.629397,0.798951,0.8002513,0.8653846,"blNDC");
   //   pt = new TPaveText(0.6005025,0.8059441,0.7713568,0.8723776,"blNDC");
   //   pt = new TPaveText(0.2738693,0.7027972,0.4447236,0.7692308,"blNDC");
   //   pt = new TPaveText(0.2416107,0.7727273,0.4127517,0.8391608,"blNDC");
   pt->SetFillColor(0);
   pt->SetBorderSize(1);
   pt->SetLineColor(0);
   pt->SetTextSize(0.06);
   text = pt->AddText("2.2 fb^{-1} at 7 TeV");
   pt->Draw();

   //   pt = new TPaveText(0.6879195,0.8129371,0.7885906,0.9108392,"blNDC");
   //   pt->SetFillColor(0);
   //   pt->SetBorderSize(1);
   //   pt->SetLineColor(0);
   //   pt->SetTextSize(0.0454545);
   //   text = pt->AddText("L = 1091 pb^{-1}");
   //  pt->Draw();


   cLimit->Modified();
   cLimit->cd();
   cLimit->SetSelected(cLimit);
}
Esempio n. 14
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);

}
Esempio n. 15
0
void wmj_fit_stack()
{
//=========Macro generated from canvas: default_Canvas/defaultCanvas
//=========  (Tue May  3 07:35:30 2016) by ROOT version6.04/10
   TCanvas *default_Canvas = new TCanvas("default_Canvas", "defaultCanvas",0,0,700,500);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   default_Canvas->SetHighLightColor(2);
   default_Canvas->Range(0,0,1,1);
   default_Canvas->SetFillColor(0);
   default_Canvas->SetBorderMode(0);
   default_Canvas->SetBorderSize(2);
   default_Canvas->SetTickx(1);
   default_Canvas->SetTicky(1);
   default_Canvas->SetLeftMargin(0.14);
   default_Canvas->SetRightMargin(0.05);
   default_Canvas->SetTopMargin(0.05);
   default_Canvas->SetBottomMargin(0.16);
   default_Canvas->SetFrameLineWidth(2);
   default_Canvas->SetFrameBorderMode(0);
  
// ------------>Primitives in pad: upperPad
   TPad *upperPad = new TPad("upperPad", "upperPad",0.005,0.05,0.995,0.995);
   upperPad->Draw();
   upperPad->cd();
   upperPad->Range(-0.1730123,-5358.989,1.06279,32919.5);
   upperPad->SetFillColor(0);
   upperPad->SetFillStyle(4000);
   upperPad->SetBorderMode(0);
   upperPad->SetBorderSize(2);
   upperPad->SetTickx(1);
   upperPad->SetTicky(1);
   upperPad->SetLeftMargin(0.14);
   upperPad->SetRightMargin(0.05);
   upperPad->SetTopMargin(0.05);
   upperPad->SetBottomMargin(0.14);
   upperPad->SetFrameLineWidth(2);
   upperPad->SetFrameBorderMode(0);
   upperPad->SetFrameLineWidth(2);
   upperPad->SetFrameBorderMode(0);
   
   Double_t h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_fx3005[20] = {
   0.025,
   0.075,
   0.125,
   0.175,
   0.225,
   0.275,
   0.325,
   0.375,
   0.425,
   0.475,
   0.525,
   0.575,
   0.625,
   0.675,
   0.725,
   0.775,
   0.825,
   0.875,
   0.925,
   0.975};
   Double_t h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_fy3005[20] = {
   0,
   0,
   9,
   26,
   118,
   315,
   881,
   1812,
   3086,
   4575,
   5856,
   6537,
   6824,
   6348,
   5662,
   4769,
   4941,
   6726,
   13179,
   28019};
   Double_t h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_felx3005[20] = {
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025};
   Double_t h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_fely3005[20] = {
   0,
   0,
   2.943461,
   5.066015,
   10.37428,
   17.25528,
   29.18586,
   42.07053,
   55.05403,
   67.14059,
   76.02614,
   80.35326,
   82.10902,
   79.17591,
   74.74792,
   68.55976,
   69.79403,
   81.51372,
   114.3009,
   166.8895};
   Double_t h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_fehx3005[20] = {
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025};
   Double_t h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_fehy3005[20] = {
   1.147874,
   1.147874,
   4.110204,
   6.164324,
   11.37428,
   18.25528,
   30.18586,
   43.07053,
   56.05403,
   68.14059,
   77.02614,
   81.35326,
   83.10902,
   80.17591,
   75.74792,
   69.55976,
   70.79403,
   82.51372,
   115.3009,
   167.8895};
   TGraphAsymmErrors *grae = new TGraphAsymmErrors(20,h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_fx3005,h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_fy3005,h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_felx3005,h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_fehx3005,h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_fely3005,h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_fehy3005);
   grae->SetName("h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]");
   grae->SetTitle("Histogram of combData_plot__muminus_ISO_");
   grae->SetFillColor(1);
   grae->SetFillStyle(0);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(20);
   
   TH1F *Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005 = new TH1F("Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005","Histogram of combData_plot__muminus_ISO_",100,0,1.1);
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->SetMinimum(0);
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->SetMaximum(31005.58);
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->SetDirectory(0);
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->SetStats(0);
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->SetLineWidth(2);
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->SetMarkerStyle(0);
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->GetXaxis()->SetTitle("#it{p}_{T}^{#it{#mu}} / #it{p}_{T}^{#it{#mu}-jet}   ");
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->GetXaxis()->SetRange(1,91);
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->GetXaxis()->SetNdivisions(1005);
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->GetXaxis()->SetLabelFont(132);
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->GetXaxis()->SetLabelOffset(0.02);
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->GetXaxis()->SetLabelSize(0.05);
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->GetXaxis()->SetTitleSize(0.06);
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->GetXaxis()->SetTitleFont(132);
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->GetYaxis()->SetTitle("Events / (0.05)");
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->GetYaxis()->SetLabelFont(132);
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->GetYaxis()->SetLabelSize(0.05);
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->GetYaxis()->SetTitleSize(0.06);
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->GetYaxis()->SetTitleOffset(1.1);
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->GetYaxis()->SetTitleFont(132);
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->GetZaxis()->SetLabelFont(132);
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->GetZaxis()->SetLabelSize(0.05);
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->GetZaxis()->SetTitleSize(0.06);
   Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]56300130023005);
   
   grae->Draw("e1pa");
   
   Double_t h5_fx7[47] = {
   -0.02439024,
   -0.02439024,
   0,
   1.0201e-08,
   0.04999999,
   0.05000001,
   0.09999999,
   0.1,
   0.15,
   0.15,
   0.2,
   0.2,
   0.25,
   0.25,
   0.3,
   0.3,
   0.35,
   0.35,
   0.4,
   0.4,
   0.45,
   0.45,
   0.5,
   0.5,
   0.55,
   0.55,
   0.6,
   0.6,
   0.65,
   0.65,
   0.7,
   0.7,
   0.75,
   0.75,
   0.8,
   0.8,
   0.85,
   0.85,
   0.9,
   0.9,
   0.95,
   0.95,
   1,
   1,
   1,
   1.02439,
   1.02439};
   Double_t h5_fy7[47] = {
   0,
   0,
   0,
   8.630173e-06,
   8.630173e-06,
   8.630173e-06,
   8.630173e-06,
   8.630173e-06,
   8.630173e-06,
   3.789762,
   3.789762,
   71.12063,
   71.12063,
   211.4394,
   211.4394,
   857.7007,
   857.7007,
   1798.534,
   1798.534,
   3099.609,
   3099.609,
   4425.901,
   4425.901,
   5601.584,
   5601.584,
   6533.687,
   6533.687,
   6910.208,
   6910.208,
   6392.171,
   6392.171,
   5777.193,
   5777.193,
   5020.919,
   5020.919,
   5207.834,
   5207.834,
   6798.159,
   6798.159,
   13033.98,
   13033.98,
   27939.27,
   27939.27,
   0,
   0,
   0,
   0};
   TGraph *graph = new TGraph(47,h5_fx7,h5_fy7);
   graph->SetName("h5");
   graph->SetTitle("Projection of ");

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

   ci = TColor::GetColor("#3333ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(2);

   ci = TColor::GetColor("#3333ff");
   graph->SetMarkerColor(ci);
   graph->SetMarkerStyle(0);
   
   TH1F *Graph_h57 = new TH1F("Graph_h57","Projection of ",100,-0.1292683,1.129268);
   Graph_h57->SetMinimum(0);
   Graph_h57->SetMaximum(30733.2);
   Graph_h57->SetDirectory(0);
   Graph_h57->SetStats(0);
   Graph_h57->SetLineWidth(2);
   Graph_h57->SetMarkerStyle(0);
   Graph_h57->GetXaxis()->SetTitle("#it{p}_{T}^{#it{#mu}} / #it{p}_{T}^{#it{#mu}-jet}   ");
   Graph_h57->GetXaxis()->SetRange(11,90);
   Graph_h57->GetXaxis()->SetNdivisions(1005);
   Graph_h57->GetXaxis()->SetLabelFont(132);
   Graph_h57->GetXaxis()->SetLabelOffset(0.02);
   Graph_h57->GetXaxis()->SetLabelSize(0.05);
   Graph_h57->GetXaxis()->SetTitleSize(0.06);
   Graph_h57->GetXaxis()->SetTitleFont(132);
   Graph_h57->GetYaxis()->SetTitle("Events / (0.05)");
   Graph_h57->GetYaxis()->SetLabelFont(132);
   Graph_h57->GetYaxis()->SetLabelSize(0.05);
   Graph_h57->GetYaxis()->SetTitleSize(0.06);
   Graph_h57->GetYaxis()->SetTitleFont(132);
   Graph_h57->GetZaxis()->SetLabelFont(132);
   Graph_h57->GetZaxis()->SetLabelSize(0.05);
   Graph_h57->GetZaxis()->SetTitleSize(0.06);
   Graph_h57->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_h57);
   
   graph->Draw("f");
   
   Double_t sumBkgPdf_totbkg_fitW_fx8[47] = {
   -0.02439024,
   -0.02439024,
   0,
   1.0201e-08,
   0.04999999,
   0.05000001,
   0.09999999,
   0.1,
   0.15,
   0.15,
   0.2,
   0.2,
   0.25,
   0.25,
   0.3,
   0.3,
   0.35,
   0.35,
   0.4,
   0.4,
   0.45,
   0.45,
   0.5,
   0.5,
   0.55,
   0.55,
   0.6,
   0.6,
   0.65,
   0.65,
   0.7,
   0.7,
   0.75,
   0.75,
   0.8,
   0.8,
   0.85,
   0.85,
   0.9,
   0.9,
   0.95,
   0.95,
   1,
   1,
   1,
   1.02439,
   1.02439};
   Double_t sumBkgPdf_totbkg_fitW_fy8[47] = {
   0,
   0,
   0,
   2.878569e-06,
   2.878569e-06,
   2.878569e-06,
   2.878569e-06,
   2.878569e-06,
   2.878569e-06,
   3.789757,
   3.789757,
   71.12063,
   71.12063,
   211.4394,
   211.4394,
   855.0132,
   855.0132,
   1794.513,
   1794.513,
   3088.88,
   3088.88,
   4399.772,
   4399.772,
   5568.272,
   5568.272,
   6460.972,
   6460.972,
   6790.725,
   6790.725,
   6142.168,
   6142.168,
   5333.208,
   5333.208,
   4062.953,
   4062.953,
   3103.771,
   3103.771,
   2394.858,
   2394.858,
   1734.507,
   1734.507,
   1650.883,
   1650.883,
   0,
   0,
   0,
   0};
   graph = new TGraph(47,sumBkgPdf_totbkg_fitW_fx8,sumBkgPdf_totbkg_fitW_fy8);
   graph->SetName("sumBkgPdf_totbkg_fitW");
   graph->SetTitle("Projection of ");

   ci = TColor::GetColor("#ffff66");
   graph->SetFillColor(ci);

   ci = TColor::GetColor("#ffff66");
   graph->SetLineColor(ci);
   graph->SetLineWidth(2);

   ci = TColor::GetColor("#ffff66");
   graph->SetMarkerColor(ci);
   graph->SetMarkerStyle(0);
   
   TH1F *Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618 = new TH1F("Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618","Projection of ",100,-0.1292683,1.129268);
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->SetMinimum(0);
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->SetMaximum(7469.797);
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->SetDirectory(0);
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->SetStats(0);
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->SetLineWidth(2);
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->SetMarkerStyle(0);
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->GetXaxis()->SetTitle("#it{p}_{T}^{#it{#mu}} / #it{p}_{T}^{#it{#mu}-jet}   ");
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->GetXaxis()->SetRange(11,90);
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->GetXaxis()->SetNdivisions(1005);
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->GetXaxis()->SetLabelFont(132);
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->GetXaxis()->SetLabelOffset(0.02);
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->GetXaxis()->SetLabelSize(0.05);
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->GetXaxis()->SetTitleSize(0.06);
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->GetXaxis()->SetTitleFont(132);
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->GetYaxis()->SetTitle("Events / (0.05)");
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->GetYaxis()->SetLabelFont(132);
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->GetYaxis()->SetLabelSize(0.05);
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->GetYaxis()->SetTitleSize(0.06);
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->GetYaxis()->SetTitleFont(132);
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->GetZaxis()->SetLabelFont(132);
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->GetZaxis()->SetLabelSize(0.05);
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->GetZaxis()->SetTitleSize(0.06);
   Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_Graph_Graph_Graph_sumBkgPdf_totbkg_fitW131618);
   
   graph->Draw("f");
   
   Double_t sumPdf_Norm[muminus_ISO_]_fx9[47] = {
   -0.02439024,
   -0.02439024,
   0,
   1.0201e-08,
   0.04999999,
   0.05000001,
   0.09999999,
   0.1,
   0.15,
   0.15,
   0.2,
   0.2,
   0.25,
   0.25,
   0.3,
   0.3,
   0.35,
   0.35,
   0.4,
   0.4,
   0.45,
   0.45,
   0.5,
   0.5,
   0.55,
   0.55,
   0.6,
   0.6,
   0.65,
   0.65,
   0.7,
   0.7,
   0.75,
   0.75,
   0.8,
   0.8,
   0.85,
   0.85,
   0.9,
   0.9,
   0.95,
   0.95,
   1,
   1,
   1,
   1.02439,
   1.02439};
   Double_t sumPdf_Norm[muminus_ISO_]_fy9[47] = {
   0,
   0,
   0,
   8.630165e-06,
   8.630165e-06,
   8.630165e-06,
   8.630165e-06,
   8.630165e-06,
   8.630165e-06,
   3.789756,
   3.789756,
   71.12054,
   71.12054,
   211.4391,
   211.4391,
   857.6998,
   857.6998,
   1798.532,
   1798.532,
   3099.606,
   3099.606,
   4425.897,
   4425.897,
   5601.578,
   5601.578,
   6533.68,
   6533.68,
   6910.201,
   6910.201,
   6392.164,
   6392.164,
   5777.187,
   5777.187,
   5020.914,
   5020.914,
   5207.829,
   5207.829,
   6798.152,
   6798.152,
   13033.97,
   13033.97,
   27939.24,
   27939.24,
   0,
   0,
   0,
   0};
   graph = new TGraph(47,sumPdf_Norm[muminus_ISO_]_fx9,sumPdf_Norm[muminus_ISO_]_fy9);
   graph->SetName("sumPdf_Norm[muminus_ISO_]");
   graph->SetTitle("Projection of ");

   ci = TColor::GetColor("#ff0000");
   graph->SetFillColor(ci);
   graph->SetFillStyle(0);

   ci = TColor::GetColor("#ff0000");
   graph->SetLineColor(ci);
   graph->SetLineWidth(2);

   ci = TColor::GetColor("#ff0000");
   graph->SetMarkerColor(ci);
   graph->SetMarkerStyle(0);
   
   TH1F *Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839 = new TH1F("Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839","Projection of ",100,-0.1292683,1.129268);
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->SetMinimum(0);
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->SetMaximum(30733.17);
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->SetDirectory(0);
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->SetStats(0);
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->SetLineWidth(2);
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->SetMarkerStyle(0);
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->GetXaxis()->SetTitle("#it{p}_{T}^{#it{#mu}} / #it{p}_{T}^{#it{#mu}-jet}   ");
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->GetXaxis()->SetRange(11,90);
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->GetXaxis()->SetNdivisions(1005);
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->GetXaxis()->SetLabelFont(132);
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->GetXaxis()->SetLabelOffset(0.02);
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->GetXaxis()->SetLabelSize(0.05);
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->GetXaxis()->SetTitleSize(0.06);
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->GetXaxis()->SetTitleFont(132);
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->GetYaxis()->SetTitle("Events / (0.05)");
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->GetYaxis()->SetLabelFont(132);
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->GetYaxis()->SetLabelSize(0.05);
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->GetYaxis()->SetTitleSize(0.06);
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->GetYaxis()->SetTitleFont(132);
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->GetZaxis()->SetLabelFont(132);
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->GetZaxis()->SetLabelSize(0.05);
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->GetZaxis()->SetTitleSize(0.06);
   Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_Graph_Graph_Graph_sumPdf_Norm[muminus_ISO_]151839);
   
   graph->Draw("");
   
   Double_t h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_fx3006[20] = {
   0.025,
   0.075,
   0.125,
   0.175,
   0.225,
   0.275,
   0.325,
   0.375,
   0.425,
   0.475,
   0.525,
   0.575,
   0.625,
   0.675,
   0.725,
   0.775,
   0.825,
   0.875,
   0.925,
   0.975};
   Double_t h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_fy3006[20] = {
   0,
   0,
   9,
   26,
   118,
   315,
   881,
   1812,
   3086,
   4575,
   5856,
   6537,
   6824,
   6348,
   5662,
   4769,
   4941,
   6726,
   13179,
   28019};
   Double_t h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_felx3006[20] = {
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025};
   Double_t h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_fely3006[20] = {
   0,
   0,
   2.943461,
   5.066015,
   10.37428,
   17.25528,
   29.18586,
   42.07053,
   55.05403,
   67.14059,
   76.02614,
   80.35326,
   82.10902,
   79.17591,
   74.74792,
   68.55976,
   69.79403,
   81.51372,
   114.3009,
   166.8895};
   Double_t h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_fehx3006[20] = {
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025};
   Double_t h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_fehy3006[20] = {
   1.147874,
   1.147874,
   4.110204,
   6.164324,
   11.37428,
   18.25528,
   30.18586,
   43.07053,
   56.05403,
   68.14059,
   77.02614,
   81.35326,
   83.10902,
   80.17591,
   75.74792,
   69.55976,
   70.79403,
   82.51372,
   115.3009,
   167.8895};
   grae = new TGraphAsymmErrors(20,h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_fx3006,h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_fy3006,h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_felx3006,h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_fehx3006,h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_fely3006,h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_fehy3006);
   grae->SetName("h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]");
   grae->SetTitle("Histogram of combData_plot__muminus_ISO_");
   grae->SetFillColor(1);
   grae->SetFillStyle(0);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(20);
   
   TH1F *Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006 = new TH1F("Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006","Histogram of combData_plot__muminus_ISO_",100,0,1.1);
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->SetMinimum(0);
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->SetMaximum(31005.58);
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->SetDirectory(0);
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->SetStats(0);
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->SetLineWidth(2);
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->SetMarkerStyle(0);
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->GetXaxis()->SetTitle("#it{p}_{T}^{#it{#mu}} / #it{p}_{T}^{#it{#mu}-jet}   ");
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->GetXaxis()->SetRange(1,91);
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->GetXaxis()->SetNdivisions(1005);
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->GetXaxis()->SetLabelFont(132);
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->GetXaxis()->SetLabelOffset(0.02);
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->GetXaxis()->SetLabelSize(0.05);
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->GetXaxis()->SetTitleSize(0.06);
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->GetXaxis()->SetTitleFont(132);
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->GetYaxis()->SetTitle("Events / (0.05)");
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->GetYaxis()->SetLabelFont(132);
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->GetYaxis()->SetLabelSize(0.05);
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->GetYaxis()->SetTitleSize(0.06);
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->GetYaxis()->SetTitleOffset(1.1);
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->GetYaxis()->SetTitleFont(132);
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->GetZaxis()->SetLabelFont(132);
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->GetZaxis()->SetLabelSize(0.05);
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->GetZaxis()->SetTitleSize(0.06);
   Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_Graph_Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]563001300230053006);
   
   grae->Draw("e1p");
   
   TLegend *leg = new TLegend(0.2,0.53,0.6,0.78,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextFont(132);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(2);
   leg->SetFillColor(10);
   leg->SetFillStyle(0);
   TLegendEntry *entry=leg->AddEntry("h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]","Data, #sqrt{s}=8 TeV","lep");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(2);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(20);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   entry=leg->AddEntry("h5","Electroweak","f");

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

   ci = TColor::GetColor("#3333ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(2);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   entry=leg->AddEntry("sumBkgPdf_totbkg_fitW","QCD","f");

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

   ci = TColor::GetColor("#ffff66");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(2);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   entry=leg->AddEntry("sumPdf_Norm[muminus_ISO_]","Fit","l");

   ci = TColor::GetColor("#ff0000");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(2);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   leg->Draw();
   
   TPaveText *pt = new TPaveText(0.2,0.8,0.4,0.87,"brNDC");
   pt->SetBorderSize(0);
   pt->SetFillStyle(0);
   pt->SetLineWidth(2);
   pt->SetTextFont(132);
   TText *AText = pt->AddText("LHCb");
   pt->Draw();
   
   TH1F *Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy = new TH1F("Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy","Histogram of combData_plot__muminus_ISO_",100,0,1.1);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->SetMinimum(0);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->SetMaximum(31005.58);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->SetDirectory(0);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->SetStats(0);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->SetLineWidth(2);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->SetMarkerStyle(0);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->GetXaxis()->SetTitle("#it{p}_{T}^{#it{#mu}} / #it{p}_{T}^{#it{#mu}-jet}   ");
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->GetXaxis()->SetRange(1,91);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->GetXaxis()->SetNdivisions(1005);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->GetXaxis()->SetLabelFont(132);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->GetXaxis()->SetLabelOffset(0.02);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->GetXaxis()->SetLabelSize(0.05);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->GetXaxis()->SetTitleSize(0.06);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->GetXaxis()->SetTitleFont(132);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->GetYaxis()->SetTitle("Events / (0.05)");
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->GetYaxis()->SetLabelFont(132);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->GetYaxis()->SetLabelSize(0.05);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->GetYaxis()->SetTitleSize(0.06);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->GetYaxis()->SetTitleOffset(1.1);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->GetYaxis()->SetTitleFont(132);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->GetZaxis()->SetLabelFont(132);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->GetZaxis()->SetLabelSize(0.05);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->GetZaxis()->SetTitleSize(0.06);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->GetZaxis()->SetTitleFont(132);
   Graph_Graph_Graph_Graph_h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]5630013002_copy->Draw("sameaxis");
   upperPad->Modified();
   default_Canvas->cd();
   default_Canvas->Modified();
   default_Canvas->cd();
   default_Canvas->SetSelected(default_Canvas);
}
void cms_jps_ppb_pt_y120_fb()
{
//=========Macro generated from canvas: w6/Two Graphs
//=========  (Tue Jul 21 12:15:03 2015) by ROOT version6.02/08
   TCanvas *w6 = new TCanvas("w6", "Two Graphs",0,0,600,500);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   w6->Range(-2.944785,-0.197647,21.59509,1.449412);
   w6->SetFillColor(0);
   w6->SetBorderMode(0);
   w6->SetBorderSize(0);
   w6->SetTickx(1);
   w6->SetTicky(1);
   w6->SetLeftMargin(0.12);
   w6->SetRightMargin(0.065);
   w6->SetTopMargin(0.03);
   w6->SetBottomMargin(0.12);
   w6->SetFrameBorderMode(0);
   w6->SetFrameBorderMode(0);
   
   TH2F *hr15 = new TH2F("hr15","",10,0,20,20,0,1.4);
   hr15->SetStats(0);
   hr15->SetMarkerStyle(20);
   hr15->SetMarkerSize(0.8);
   hr15->GetXaxis()->SetTitle("p_{T} (GeV)");
   hr15->GetXaxis()->SetLabelFont(42);
   hr15->GetXaxis()->SetTitleSize(0.048);
   hr15->GetXaxis()->SetTitleOffset(1.15);
   hr15->GetXaxis()->SetTitleFont(42);
   hr15->GetYaxis()->SetTitle("R_{F/B}(p_{T})");
   hr15->GetYaxis()->SetLabelFont(42);
   hr15->GetYaxis()->SetTitleSize(0.048);
   hr15->GetYaxis()->SetTitleOffset(1.2);
   hr15->GetYaxis()->SetTitleFont(42);
   hr15->GetZaxis()->SetLabelFont(42);
   hr15->GetZaxis()->SetTitleSize(0.048);
   hr15->GetZaxis()->SetTitleFont(42);
   hr15->Draw("");
   TLine *line = new TLine(0,1,20,1);
   line->SetLineStyle(2);
   line->SetLineWidth(2);
   line->Draw();
   
   Double_t Graph0_fx19[202] = {
   0,
   0.2,
   0.4,
   0.6,
   0.8,
   1,
   1.2,
   1.4,
   1.6,
   1.8,
   2,
   2.2,
   2.4,
   2.6,
   2.8,
   3,
   3.2,
   3.4,
   3.6,
   3.8,
   4,
   4.2,
   4.4,
   4.6,
   4.8,
   5,
   5.2,
   5.4,
   5.6,
   5.8,
   6,
   6.2,
   6.4,
   6.6,
   6.8,
   7,
   7.2,
   7.4,
   7.6,
   7.8,
   8,
   8.2,
   8.4,
   8.6,
   8.8,
   9,
   9.2,
   9.4,
   9.6,
   9.8,
   10,
   10.2,
   10.4,
   10.6,
   10.8,
   11,
   11.2,
   11.4,
   11.6,
   11.8,
   12,
   12.2,
   12.4,
   12.6,
   12.8,
   13,
   13.2,
   13.4,
   13.6,
   13.8,
   14,
   14.2,
   14.4,
   14.6,
   14.8,
   15,
   15.2,
   15.4,
   15.6,
   15.8,
   16,
   16.2,
   16.4,
   16.6,
   16.8,
   17,
   17.2,
   17.4,
   17.6,
   17.8,
   18,
   18.2,
   18.4,
   18.6,
   18.8,
   19,
   19.2,
   19.4,
   19.6,
   19.8,
   20,
   20,
   19.8,
   19.6,
   19.4,
   19.2,
   19,
   18.8,
   18.6,
   18.4,
   18.2,
   18,
   17.8,
   17.6,
   17.4,
   17.2,
   17,
   16.8,
   16.6,
   16.4,
   16.2,
   16,
   15.8,
   15.6,
   15.4,
   15.2,
   15,
   14.8,
   14.6,
   14.4,
   14.2,
   14,
   13.8,
   13.6,
   13.4,
   13.2,
   13,
   12.8,
   12.6,
   12.4,
   12.2,
   12,
   11.8,
   11.6,
   11.4,
   11.2,
   11,
   10.8,
   10.6,
   10.4,
   10.2,
   10,
   9.8,
   9.6,
   9.4,
   9.2,
   9,
   8.8,
   8.6,
   8.4,
   8.2,
   8,
   7.8,
   7.6,
   7.4,
   7.2,
   7,
   6.8,
   6.6,
   6.4,
   6.2,
   6,
   5.8,
   5.6,
   5.4,
   5.2,
   5,
   4.8,
   4.6,
   4.4,
   4.2,
   4,
   3.8,
   3.6,
   3.4,
   3.2,
   3,
   2.8,
   2.6,
   2.4,
   2.2,
   2,
   1.8,
   1.6,
   1.4,
   1.2,
   1,
   0.8,
   0.6,
   0.4,
   0.2,
   0};
   Double_t Graph0_fy19[202] = {
   0.7836116,
   0.7849605,
   0.7890441,
   0.7960007,
   0.8050498,
   0.8167735,
   0.8300575,
   0.8452002,
   0.8619987,
   0.8807459,
   0.9021495,
   0.9246587,
   0.9466882,
   0.9677902,
   0.9873606,
   1.005105,
   1.020489,
   1.034496,
   1.046629,
   1.056756,
   1.065291,
   1.07222,
   1.077599,
   1.081701,
   1.084619,
   1.086399,
   1.087587,
   1.087911,
   1.087583,
   1.086931,
   1.085589,
   1.083939,
   1.082079,
   1.079999,
   1.077674,
   1.075349,
   1.072884,
   1.070253,
   1.067714,
   1.065077,
   1.062516,
   1.059969,
   1.057297,
   1.054821,
   1.052444,
   1.050207,
   1.048025,
   1.045796,
   1.043635,
   1.041604,
   1.039704,
   1.037764,
   1.036079,
   1.035669,
   1.034046,
   1.032574,
   1.031119,
   1.028118,
   1.029684,
   1.028311,
   1.027041,
   1.025734,
   1.021696,
   1.020552,
   1.019435,
   1.018406,
   1.017385,
   1.016385,
   1.015442,
   1.014516,
   1.01361,
   1.01286,
   1.012027,
   1.010085,
   1.009291,
   1.008518,
   1.007851,
   1.007156,
   1.006384,
   1.006829,
   1.005424,
   1.005196,
   1.00472,
   1.004196,
   1.003665,
   1.003069,
   1.00299,
   1.002556,
   1.002045,
   1.001584,
   1.001056,
   1.000688,
   1.000323,
   1.001406,
   1.001104,
   1.000703,
   1.00038,
   1.000079,
   0.9995836,
   0.9994524,
   0.998044,
   0.98814,
   0.9884034,
   0.9886794,
   0.9891242,
   0.9894025,
   0.9898343,
   0.9902166,
   0.9905252,
   0.989151,
   0.9895018,
   0.9897906,
   0.9902928,
   0.9905996,
   0.9910855,
   0.9914598,
   0.9918003,
   0.9923394,
   0.9927511,
   0.9933418,
   0.9938143,
   0.9940813,
   0.9946064,
   0.9916484,
   0.9922249,
   0.9926801,
   0.9932256,
   0.9939071,
   0.9944708,
   0.9971189,
   0.9978028,
   1.000243,
   1.000843,
   1.001674,
   1.002392,
   1.003123,
   1.003888,
   1.004742,
   1.00556,
   1.006438,
   1.007393,
   1.00833,
   1.009289,
   1.010278,
   1.011384,
   1.014266,
   1.015427,
   1.018355,
   1.019471,
   1.017416,
   1.018688,
   1.019543,
   1.020883,
   1.022327,
   1.023688,
   1.025378,
   1.026693,
   1.02837,
   1.029833,
   1.031425,
   1.033004,
   1.034583,
   1.036058,
   1.037694,
   1.039377,
   1.040921,
   1.042288,
   1.0433,
   1.044562,
   1.045229,
   1.045828,
   1.046172,
   1.046288,
   1.045823,
   1.044877,
   1.043403,
   1.041006,
   1.038207,
   1.034468,
   1.030057,
   1.024525,
   1.01786,
   1.010107,
   1.001152,
   0.9908252,
   0.9792781,
   0.9666836,
   0.9521021,
   0.9356231,
   0.917281,
   0.8971312,
   0.8755481,
   0.8532729,
   0.8310423,
   0.809078,
   0.7885787,
   0.7699812,
   0.7537228,
   0.7407956,
   0.7310664,
   0.7253095,
   0.7232547};
   TGraph *graph = new TGraph(202,Graph0_fx19,Graph0_fy19);
   graph->SetName("Graph0");
   graph->SetTitle("Graph");
   graph->SetFillColor(2);
   graph->SetFillStyle(3004);
   graph->SetLineColor(2);
   graph->SetMarkerStyle(20);
   graph->SetMarkerSize(0.8);
   
   TH1F *Graph_Graph19 = new TH1F("Graph_Graph19","Graph",202,0,22);
   Graph_Graph19->SetMinimum(0.686789);
   Graph_Graph19->SetMaximum(1.124377);
   Graph_Graph19->SetDirectory(0);
   Graph_Graph19->SetStats(0);
   Graph_Graph19->SetMarkerStyle(20);
   Graph_Graph19->SetMarkerSize(0.8);
   Graph_Graph19->GetXaxis()->SetLabelFont(42);
   Graph_Graph19->GetXaxis()->SetTitleSize(0.048);
   Graph_Graph19->GetXaxis()->SetTitleOffset(1.15);
   Graph_Graph19->GetXaxis()->SetTitleFont(42);
   Graph_Graph19->GetYaxis()->SetLabelFont(42);
   Graph_Graph19->GetYaxis()->SetTitleSize(0.048);
   Graph_Graph19->GetYaxis()->SetTitleOffset(1.2);
   Graph_Graph19->GetYaxis()->SetTitleFont(42);
   Graph_Graph19->GetZaxis()->SetLabelFont(42);
   Graph_Graph19->GetZaxis()->SetTitleSize(0.048);
   Graph_Graph19->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph19);
   
   graph->Draw("f");
   
   Double_t Graph1_fx20[101] = {
   0,
   0.2,
   0.4,
   0.6,
   0.8,
   1,
   1.2,
   1.4,
   1.6,
   1.8,
   2,
   2.2,
   2.4,
   2.6,
   2.8,
   3,
   3.2,
   3.4,
   3.6,
   3.8,
   4,
   4.2,
   4.4,
   4.6,
   4.8,
   5,
   5.2,
   5.4,
   5.6,
   5.8,
   6,
   6.2,
   6.4,
   6.6,
   6.8,
   7,
   7.2,
   7.4,
   7.6,
   7.8,
   8,
   8.2,
   8.4,
   8.6,
   8.8,
   9,
   9.2,
   9.4,
   9.6,
   9.8,
   10,
   10.2,
   10.4,
   10.6,
   10.8,
   11,
   11.2,
   11.4,
   11.6,
   11.8,
   12,
   12.2,
   12.4,
   12.6,
   12.8,
   13,
   13.2,
   13.4,
   13.6,
   13.8,
   14,
   14.2,
   14.4,
   14.6,
   14.8,
   15,
   15.2,
   15.4,
   15.6,
   15.8,
   16,
   16.2,
   16.4,
   16.6,
   16.8,
   17,
   17.2,
   17.4,
   17.6,
   17.8,
   18,
   18.2,
   18.4,
   18.6,
   18.8,
   19,
   19.2,
   19.4,
   19.6,
   19.8,
   20};
   Double_t Graph1_fy20[101] = {
   0.7836116,
   0.7849605,
   0.7890441,
   0.7960007,
   0.8050498,
   0.8167735,
   0.8300575,
   0.8452002,
   0.8619987,
   0.8807459,
   0.9021495,
   0.9246587,
   0.9466882,
   0.9677902,
   0.9873606,
   1.005105,
   1.020489,
   1.034496,
   1.046629,
   1.056756,
   1.065291,
   1.07222,
   1.077599,
   1.081701,
   1.084619,
   1.086399,
   1.087587,
   1.087911,
   1.087583,
   1.086931,
   1.085589,
   1.083939,
   1.082079,
   1.079999,
   1.077674,
   1.075349,
   1.072884,
   1.070253,
   1.067714,
   1.065077,
   1.062516,
   1.059969,
   1.057297,
   1.054821,
   1.052444,
   1.050207,
   1.048025,
   1.045796,
   1.043635,
   1.041604,
   1.039704,
   1.037764,
   1.036079,
   1.035669,
   1.034046,
   1.032574,
   1.031119,
   1.028118,
   1.029684,
   1.028311,
   1.027041,
   1.025734,
   1.021696,
   1.020552,
   1.019435,
   1.018406,
   1.017385,
   1.016385,
   1.015442,
   1.014516,
   1.01361,
   1.01286,
   1.012027,
   1.010085,
   1.009291,
   1.008518,
   1.007851,
   1.007156,
   1.006384,
   1.006829,
   1.005424,
   1.005196,
   1.00472,
   1.004196,
   1.003665,
   1.003069,
   1.00299,
   1.002556,
   1.002045,
   1.001584,
   1.001056,
   1.000688,
   1.000323,
   1.001406,
   1.001104,
   1.000703,
   1.00038,
   1.000079,
   0.9995836,
   0.9994524,
   0.998044};
   graph = new TGraph(101,Graph1_fx20,Graph1_fy20);
   graph->SetName("Graph1");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);
   graph->SetLineColor(2);
   graph->SetMarkerStyle(20);
   graph->SetMarkerSize(0.8);
   
   TH1F *Graph_Graph20 = new TH1F("Graph_Graph20","Graph",101,0,22);
   Graph_Graph20->SetMinimum(0.7531816);
   Graph_Graph20->SetMaximum(1.118341);
   Graph_Graph20->SetDirectory(0);
   Graph_Graph20->SetStats(0);
   Graph_Graph20->SetMarkerStyle(20);
   Graph_Graph20->SetMarkerSize(0.8);
   Graph_Graph20->GetXaxis()->SetLabelFont(42);
   Graph_Graph20->GetXaxis()->SetTitleSize(0.048);
   Graph_Graph20->GetXaxis()->SetTitleOffset(1.15);
   Graph_Graph20->GetXaxis()->SetTitleFont(42);
   Graph_Graph20->GetYaxis()->SetLabelFont(42);
   Graph_Graph20->GetYaxis()->SetTitleSize(0.048);
   Graph_Graph20->GetYaxis()->SetTitleOffset(1.2);
   Graph_Graph20->GetYaxis()->SetTitleFont(42);
   Graph_Graph20->GetZaxis()->SetLabelFont(42);
   Graph_Graph20->GetZaxis()->SetTitleSize(0.048);
   Graph_Graph20->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph20);
   
   graph->Draw("c");
   
   Double_t Graph2_fx21[101] = {
   0,
   0.2,
   0.4,
   0.6,
   0.8,
   1,
   1.2,
   1.4,
   1.6,
   1.8,
   2,
   2.2,
   2.4,
   2.6,
   2.8,
   3,
   3.2,
   3.4,
   3.6,
   3.8,
   4,
   4.2,
   4.4,
   4.6,
   4.8,
   5,
   5.2,
   5.4,
   5.6,
   5.8,
   6,
   6.2,
   6.4,
   6.6,
   6.8,
   7,
   7.2,
   7.4,
   7.6,
   7.8,
   8,
   8.2,
   8.4,
   8.6,
   8.8,
   9,
   9.2,
   9.4,
   9.6,
   9.8,
   10,
   10.2,
   10.4,
   10.6,
   10.8,
   11,
   11.2,
   11.4,
   11.6,
   11.8,
   12,
   12.2,
   12.4,
   12.6,
   12.8,
   13,
   13.2,
   13.4,
   13.6,
   13.8,
   14,
   14.2,
   14.4,
   14.6,
   14.8,
   15,
   15.2,
   15.4,
   15.6,
   15.8,
   16,
   16.2,
   16.4,
   16.6,
   16.8,
   17,
   17.2,
   17.4,
   17.6,
   17.8,
   18,
   18.2,
   18.4,
   18.6,
   18.8,
   19,
   19.2,
   19.4,
   19.6,
   19.8,
   20};
   Double_t Graph2_fy21[101] = {
   0.7232547,
   0.7253095,
   0.7310664,
   0.7407956,
   0.7537228,
   0.7699812,
   0.7885787,
   0.809078,
   0.8310423,
   0.8532729,
   0.8755481,
   0.8971312,
   0.917281,
   0.9356231,
   0.9521021,
   0.9666836,
   0.9792781,
   0.9908252,
   1.001152,
   1.010107,
   1.01786,
   1.024525,
   1.030057,
   1.034468,
   1.038207,
   1.041006,
   1.043403,
   1.044877,
   1.045823,
   1.046288,
   1.046172,
   1.045828,
   1.045229,
   1.044562,
   1.0433,
   1.042288,
   1.040921,
   1.039377,
   1.037694,
   1.036058,
   1.034583,
   1.033004,
   1.031425,
   1.029833,
   1.02837,
   1.026693,
   1.025378,
   1.023688,
   1.022327,
   1.020883,
   1.019543,
   1.018688,
   1.017416,
   1.019471,
   1.018355,
   1.015427,
   1.014266,
   1.011384,
   1.010278,
   1.009289,
   1.00833,
   1.007393,
   1.006438,
   1.00556,
   1.004742,
   1.003888,
   1.003123,
   1.002392,
   1.001674,
   1.000843,
   1.000243,
   0.9978028,
   0.9971189,
   0.9944708,
   0.9939071,
   0.9932256,
   0.9926801,
   0.9922249,
   0.9916484,
   0.9946064,
   0.9940813,
   0.9938143,
   0.9933418,
   0.9927511,
   0.9923394,
   0.9918003,
   0.9914598,
   0.9910855,
   0.9905996,
   0.9902928,
   0.9897906,
   0.9895018,
   0.989151,
   0.9905252,
   0.9902166,
   0.9898343,
   0.9894025,
   0.9891242,
   0.9886794,
   0.9884034,
   0.98814};
   graph = new TGraph(101,Graph2_fx21,Graph2_fy21);
   graph->SetName("Graph2");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);
   graph->SetLineColor(2);
   graph->SetMarkerStyle(20);
   graph->SetMarkerSize(0.8);
   
   TH1F *Graph_Graph21 = new TH1F("Graph_Graph21","Graph",101,0,22);
   Graph_Graph21->SetMinimum(0.6909513);
   Graph_Graph21->SetMaximum(1.078592);
   Graph_Graph21->SetDirectory(0);
   Graph_Graph21->SetStats(0);
   Graph_Graph21->SetMarkerStyle(20);
   Graph_Graph21->SetMarkerSize(0.8);
   Graph_Graph21->GetXaxis()->SetLabelFont(42);
   Graph_Graph21->GetXaxis()->SetTitleSize(0.048);
   Graph_Graph21->GetXaxis()->SetTitleOffset(1.15);
   Graph_Graph21->GetXaxis()->SetTitleFont(42);
   Graph_Graph21->GetYaxis()->SetLabelFont(42);
   Graph_Graph21->GetYaxis()->SetTitleSize(0.048);
   Graph_Graph21->GetYaxis()->SetTitleOffset(1.2);
   Graph_Graph21->GetYaxis()->SetTitleFont(42);
   Graph_Graph21->GetZaxis()->SetLabelFont(42);
   Graph_Graph21->GetZaxis()->SetTitleSize(0.048);
   Graph_Graph21->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph21);
   
   graph->Draw("c");
   
   TLegend *leg = new TLegend(0.15,0.2,0.5,0.35,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextSize(0.045);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(10);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("Graph0","E. loss  ","f");
   entry->SetFillColor(2);
   entry->SetFillStyle(3004);
   entry->SetLineColor(2);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","E. loss + EPS09","f");
   entry->SetFillColor(4);
   entry->SetFillStyle(3004);
   entry->SetLineColor(4);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   
   Double_t Graph3_fx22[202] = {
   0,
   0.2,
   0.4,
   0.6,
   0.8,
   1,
   1.2,
   1.4,
   1.6,
   1.8,
   2,
   2.2,
   2.4,
   2.6,
   2.8,
   3,
   3.2,
   3.4,
   3.6,
   3.8,
   4,
   4.2,
   4.4,
   4.6,
   4.8,
   5,
   5.2,
   5.4,
   5.6,
   5.8,
   6,
   6.2,
   6.4,
   6.6,
   6.8,
   7,
   7.2,
   7.4,
   7.6,
   7.8,
   8,
   8.2,
   8.4,
   8.6,
   8.8,
   9,
   9.2,
   9.4,
   9.6,
   9.8,
   10,
   10.2,
   10.4,
   10.6,
   10.8,
   11,
   11.2,
   11.4,
   11.6,
   11.8,
   12,
   12.2,
   12.4,
   12.6,
   12.8,
   13,
   13.2,
   13.4,
   13.6,
   13.8,
   14,
   14.2,
   14.4,
   14.6,
   14.8,
   15,
   15.2,
   15.4,
   15.6,
   15.8,
   16,
   16.2,
   16.4,
   16.6,
   16.8,
   17,
   17.2,
   17.4,
   17.6,
   17.8,
   18,
   18.2,
   18.4,
   18.6,
   18.8,
   19,
   19.2,
   19.4,
   19.6,
   19.8,
   20,
   20,
   19.8,
   19.6,
   19.4,
   19.2,
   19,
   18.8,
   18.6,
   18.4,
   18.2,
   18,
   17.8,
   17.6,
   17.4,
   17.2,
   17,
   16.8,
   16.6,
   16.4,
   16.2,
   16,
   15.8,
   15.6,
   15.4,
   15.2,
   15,
   14.8,
   14.6,
   14.4,
   14.2,
   14,
   13.8,
   13.6,
   13.4,
   13.2,
   13,
   12.8,
   12.6,
   12.4,
   12.2,
   12,
   11.8,
   11.6,
   11.4,
   11.2,
   11,
   10.8,
   10.6,
   10.4,
   10.2,
   10,
   9.8,
   9.6,
   9.4,
   9.2,
   9,
   8.8,
   8.6,
   8.4,
   8.2,
   8,
   7.8,
   7.6,
   7.4,
   7.2,
   7,
   6.8,
   6.6,
   6.4,
   6.2,
   6,
   5.8,
   5.6,
   5.4,
   5.2,
   5,
   4.8,
   4.6,
   4.4,
   4.2,
   4,
   3.8,
   3.6,
   3.4,
   3.2,
   3,
   2.8,
   2.6,
   2.4,
   2.2,
   2,
   1.8,
   1.6,
   1.4,
   1.2,
   1,
   0.8,
   0.6,
   0.4,
   0.2,
   0};
   Double_t Graph3_fy22[202] = {
   0.8421638,
   0.8431233,
   0.8460817,
   0.8508918,
   0.8567363,
   0.8642813,
   0.8727044,
   0.88212,
   0.8917083,
   0.90233,
   0.9121478,
   0.9211408,
   0.9305888,
   0.9399922,
   0.9509647,
   0.9631977,
   0.9745371,
   0.9845598,
   0.9934767,
   1.00195,
   1.009754,
   1.016507,
   1.021171,
   1.025258,
   1.027879,
   1.028894,
   1.028982,
   1.028892,
   1.028775,
   1.028533,
   1.027579,
   1.026055,
   1.024055,
   1.022329,
   1.020145,
   1.017949,
   1.01571,
   1.013986,
   1.01212,
   1.010422,
   1.008313,
   1.006298,
   1.00444,
   1.00234,
   1.002169,
   1.000202,
   0.9923634,
   0.9930264,
   0.9917278,
   0.9910876,
   0.9989107,
   0.9948872,
   0.9912498,
   0.9886628,
   0.9852329,
   0.9838679,
   0.9824845,
   0.9815419,
   0.980339,
   0.9792295,
   0.9783283,
   0.9752649,
   0.9744775,
   0.9737028,
   0.9797888,
   0.976565,
   0.9777379,
   0.9744934,
   0.9737419,
   0.9649296,
   0.9663267,
   0.9657292,
   0.9669283,
   0.9663636,
   0.9675556,
   0.96777,
   0.9671347,
   0.9670887,
   0.9667007,
   0.9663822,
   0.9656093,
   0.9652302,
   0.9666274,
   0.9660479,
   0.9612273,
   0.9623443,
   0.9631036,
   0.9617128,
   0.9607207,
   0.961213,
   0.9646119,
   0.9631523,
   0.9618471,
   0.9601414,
   0.9596994,
   0.9588979,
   0.9577885,
   0.957409,
   0.9570048,
   0.9565268,
   0.9561286,
   0.8530899,
   0.8536798,
   0.8543082,
   0.8548519,
   0.8553599,
   0.8558056,
   0.8580468,
   0.8590287,
   0.8598163,
   0.8610229,
   0.8624452,
   0.86076,
   0.8622399,
   0.8626477,
   0.8651288,
   0.866286,
   0.8667428,
   0.871632,
   0.8735303,
   0.8742273,
   0.8746181,
   0.8754262,
   0.8761281,
   0.8768638,
   0.8779737,
   0.8793966,
   0.8806079,
   0.881914,
   0.8807982,
   0.88207,
   0.8833459,
   0.8840238,
   0.8894522,
   0.8932277,
   0.8945342,
   0.8939412,
   0.8959787,
   0.8898514,
   0.8912293,
   0.8937911,
   0.8971338,
   0.8987771,
   0.9025391,
   0.9056385,
   0.9070807,
   0.9091738,
   0.9107313,
   0.9121422,
   0.9156347,
   0.9172455,
   0.9188703,
   0.9150057,
   0.9162245,
   0.9197111,
   0.9227688,
   0.9320829,
   0.9353889,
   0.9355368,
   0.9377265,
   0.9375745,
   0.9384882,
   0.9406582,
   0.9424508,
   0.9444664,
   0.9464242,
   0.9486788,
   0.9508605,
   0.9531745,
   0.9550048,
   0.9576565,
   0.9601155,
   0.9620813,
   0.963554,
   0.9648322,
   0.9660598,
   0.9674128,
   0.9682482,
   0.9685571,
   0.9682887,
   0.9673863,
   0.9649037,
   0.9618543,
   0.9582831,
   0.9553384,
   0.9510883,
   0.9442505,
   0.9342997,
   0.9212491,
   0.9055475,
   0.8876717,
   0.8689059,
   0.8495485,
   0.8304236,
   0.8124401,
   0.7953092,
   0.7796732,
   0.766247,
   0.75568,
   0.7475433,
   0.7428535,
   0.7412694};
   graph = new TGraph(202,Graph3_fx22,Graph3_fy22);
   graph->SetName("Graph3");
   graph->SetTitle("Graph");
   graph->SetFillColor(4);
   graph->SetFillStyle(3004);
   graph->SetLineColor(4);
   graph->SetMarkerStyle(20);
   graph->SetMarkerSize(0.8);
   
   TH1F *Graph_Graph22 = new TH1F("Graph_Graph22","Graph",202,0,22);
   Graph_Graph22->SetMinimum(0.7124982);
   Graph_Graph22->SetMaximum(1.057753);
   Graph_Graph22->SetDirectory(0);
   Graph_Graph22->SetStats(0);
   Graph_Graph22->SetMarkerStyle(20);
   Graph_Graph22->SetMarkerSize(0.8);
   Graph_Graph22->GetXaxis()->SetLabelFont(42);
   Graph_Graph22->GetXaxis()->SetTitleSize(0.048);
   Graph_Graph22->GetXaxis()->SetTitleOffset(1.15);
   Graph_Graph22->GetXaxis()->SetTitleFont(42);
   Graph_Graph22->GetYaxis()->SetLabelFont(42);
   Graph_Graph22->GetYaxis()->SetTitleSize(0.048);
   Graph_Graph22->GetYaxis()->SetTitleOffset(1.2);
   Graph_Graph22->GetYaxis()->SetTitleFont(42);
   Graph_Graph22->GetZaxis()->SetLabelFont(42);
   Graph_Graph22->GetZaxis()->SetTitleSize(0.048);
   Graph_Graph22->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph22);
   
   graph->Draw("f");
   
   Double_t Graph4_fx23[101] = {
   0,
   0.2,
   0.4,
   0.6,
   0.8,
   1,
   1.2,
   1.4,
   1.6,
   1.8,
   2,
   2.2,
   2.4,
   2.6,
   2.8,
   3,
   3.2,
   3.4,
   3.6,
   3.8,
   4,
   4.2,
   4.4,
   4.6,
   4.8,
   5,
   5.2,
   5.4,
   5.6,
   5.8,
   6,
   6.2,
   6.4,
   6.6,
   6.8,
   7,
   7.2,
   7.4,
   7.6,
   7.8,
   8,
   8.2,
   8.4,
   8.6,
   8.8,
   9,
   9.2,
   9.4,
   9.6,
   9.8,
   10,
   10.2,
   10.4,
   10.6,
   10.8,
   11,
   11.2,
   11.4,
   11.6,
   11.8,
   12,
   12.2,
   12.4,
   12.6,
   12.8,
   13,
   13.2,
   13.4,
   13.6,
   13.8,
   14,
   14.2,
   14.4,
   14.6,
   14.8,
   15,
   15.2,
   15.4,
   15.6,
   15.8,
   16,
   16.2,
   16.4,
   16.6,
   16.8,
   17,
   17.2,
   17.4,
   17.6,
   17.8,
   18,
   18.2,
   18.4,
   18.6,
   18.8,
   19,
   19.2,
   19.4,
   19.6,
   19.8,
   20};
   Double_t Graph4_fy23[101] = {
   0.8421638,
   0.8431233,
   0.8460817,
   0.8508918,
   0.8567363,
   0.8642813,
   0.8727044,
   0.88212,
   0.8917083,
   0.90233,
   0.9121478,
   0.9211408,
   0.9305888,
   0.9399922,
   0.9509647,
   0.9631977,
   0.9745371,
   0.9845598,
   0.9934767,
   1.00195,
   1.009754,
   1.016507,
   1.021171,
   1.025258,
   1.027879,
   1.028894,
   1.028982,
   1.028892,
   1.028775,
   1.028533,
   1.027579,
   1.026055,
   1.024055,
   1.022329,
   1.020145,
   1.017949,
   1.01571,
   1.013986,
   1.01212,
   1.010422,
   1.008313,
   1.006298,
   1.00444,
   1.00234,
   1.002169,
   1.000202,
   0.9923634,
   0.9930264,
   0.9917278,
   0.9910876,
   0.9989107,
   0.9948872,
   0.9912498,
   0.9886628,
   0.9852329,
   0.9838679,
   0.9824845,
   0.9815419,
   0.980339,
   0.9792295,
   0.9783283,
   0.9752649,
   0.9744775,
   0.9737028,
   0.9797888,
   0.976565,
   0.9777379,
   0.9744934,
   0.9737419,
   0.9649296,
   0.9663267,
   0.9657292,
   0.9669283,
   0.9663636,
   0.9675556,
   0.96777,
   0.9671347,
   0.9670887,
   0.9667007,
   0.9663822,
   0.9656093,
   0.9652302,
   0.9666274,
   0.9660479,
   0.9612273,
   0.9623443,
   0.9631036,
   0.9617128,
   0.9607207,
   0.961213,
   0.9646119,
   0.9631523,
   0.9618471,
   0.9601414,
   0.9596994,
   0.9588979,
   0.9577885,
   0.957409,
   0.9570048,
   0.9565268,
   0.9561286};
   graph = new TGraph(101,Graph4_fx23,Graph4_fy23);
   graph->SetName("Graph4");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);
   graph->SetLineColor(4);
   graph->SetMarkerStyle(20);
   graph->SetMarkerSize(0.8);
   
   TH1F *Graph_Graph23 = new TH1F("Graph_Graph23","Graph",101,0,22);
   Graph_Graph23->SetMinimum(0.823482);
   Graph_Graph23->SetMaximum(1.047664);
   Graph_Graph23->SetDirectory(0);
   Graph_Graph23->SetStats(0);
   Graph_Graph23->SetMarkerStyle(20);
   Graph_Graph23->SetMarkerSize(0.8);
   Graph_Graph23->GetXaxis()->SetLabelFont(42);
   Graph_Graph23->GetXaxis()->SetTitleSize(0.048);
   Graph_Graph23->GetXaxis()->SetTitleOffset(1.15);
   Graph_Graph23->GetXaxis()->SetTitleFont(42);
   Graph_Graph23->GetYaxis()->SetLabelFont(42);
   Graph_Graph23->GetYaxis()->SetTitleSize(0.048);
   Graph_Graph23->GetYaxis()->SetTitleOffset(1.2);
   Graph_Graph23->GetYaxis()->SetTitleFont(42);
   Graph_Graph23->GetZaxis()->SetLabelFont(42);
   Graph_Graph23->GetZaxis()->SetTitleSize(0.048);
   Graph_Graph23->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph23);
   
   graph->Draw("c");
   
   Double_t Graph5_fx24[101] = {
   0,
   0.2,
   0.4,
   0.6,
   0.8,
   1,
   1.2,
   1.4,
   1.6,
   1.8,
   2,
   2.2,
   2.4,
   2.6,
   2.8,
   3,
   3.2,
   3.4,
   3.6,
   3.8,
   4,
   4.2,
   4.4,
   4.6,
   4.8,
   5,
   5.2,
   5.4,
   5.6,
   5.8,
   6,
   6.2,
   6.4,
   6.6,
   6.8,
   7,
   7.2,
   7.4,
   7.6,
   7.8,
   8,
   8.2,
   8.4,
   8.6,
   8.8,
   9,
   9.2,
   9.4,
   9.6,
   9.8,
   10,
   10.2,
   10.4,
   10.6,
   10.8,
   11,
   11.2,
   11.4,
   11.6,
   11.8,
   12,
   12.2,
   12.4,
   12.6,
   12.8,
   13,
   13.2,
   13.4,
   13.6,
   13.8,
   14,
   14.2,
   14.4,
   14.6,
   14.8,
   15,
   15.2,
   15.4,
   15.6,
   15.8,
   16,
   16.2,
   16.4,
   16.6,
   16.8,
   17,
   17.2,
   17.4,
   17.6,
   17.8,
   18,
   18.2,
   18.4,
   18.6,
   18.8,
   19,
   19.2,
   19.4,
   19.6,
   19.8,
   20};
   Double_t Graph5_fy24[101] = {
   0.7412694,
   0.7428535,
   0.7475433,
   0.75568,
   0.766247,
   0.7796732,
   0.7953092,
   0.8124401,
   0.8304236,
   0.8495485,
   0.8689059,
   0.8876717,
   0.9055475,
   0.9212491,
   0.9342997,
   0.9442505,
   0.9510883,
   0.9553384,
   0.9582831,
   0.9618543,
   0.9649037,
   0.9673863,
   0.9682887,
   0.9685571,
   0.9682482,
   0.9674128,
   0.9660598,
   0.9648322,
   0.963554,
   0.9620813,
   0.9601155,
   0.9576565,
   0.9550048,
   0.9531745,
   0.9508605,
   0.9486788,
   0.9464242,
   0.9444664,
   0.9424508,
   0.9406582,
   0.9384882,
   0.9375745,
   0.9377265,
   0.9355368,
   0.9353889,
   0.9320829,
   0.9227688,
   0.9197111,
   0.9162245,
   0.9150057,
   0.9188703,
   0.9172455,
   0.9156347,
   0.9121422,
   0.9107313,
   0.9091738,
   0.9070807,
   0.9056385,
   0.9025391,
   0.8987771,
   0.8971338,
   0.8937911,
   0.8912293,
   0.8898514,
   0.8959787,
   0.8939412,
   0.8945342,
   0.8932277,
   0.8894522,
   0.8840238,
   0.8833459,
   0.88207,
   0.8807982,
   0.881914,
   0.8806079,
   0.8793966,
   0.8779737,
   0.8768638,
   0.8761281,
   0.8754262,
   0.8746181,
   0.8742273,
   0.8735303,
   0.871632,
   0.8667428,
   0.866286,
   0.8651288,
   0.8626477,
   0.8622399,
   0.86076,
   0.8624452,
   0.8610229,
   0.8598163,
   0.8590287,
   0.8580468,
   0.8558056,
   0.8553599,
   0.8548519,
   0.8543082,
   0.8536798,
   0.8530899};
   graph = new TGraph(101,Graph5_fx24,Graph5_fy24);
   graph->SetName("Graph5");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);
   graph->SetLineColor(4);
   graph->SetMarkerStyle(20);
   graph->SetMarkerSize(0.8);
   
   TH1F *Graph_Graph24 = new TH1F("Graph_Graph24","Graph",101,0,22);
   Graph_Graph24->SetMinimum(0.7185407);
   Graph_Graph24->SetMaximum(0.9912858);
   Graph_Graph24->SetDirectory(0);
   Graph_Graph24->SetStats(0);
   Graph_Graph24->SetMarkerStyle(20);
   Graph_Graph24->SetMarkerSize(0.8);
   Graph_Graph24->GetXaxis()->SetLabelFont(42);
   Graph_Graph24->GetXaxis()->SetTitleSize(0.048);
   Graph_Graph24->GetXaxis()->SetTitleOffset(1.15);
   Graph_Graph24->GetXaxis()->SetTitleFont(42);
   Graph_Graph24->GetYaxis()->SetLabelFont(42);
   Graph_Graph24->GetYaxis()->SetTitleSize(0.048);
   Graph_Graph24->GetYaxis()->SetTitleOffset(1.2);
   Graph_Graph24->GetYaxis()->SetTitleFont(42);
   Graph_Graph24->GetZaxis()->SetLabelFont(42);
   Graph_Graph24->GetZaxis()->SetTitleSize(0.048);
   Graph_Graph24->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph24);
   
   graph->Draw("c");
   
   leg = new TLegend(0.15,0.2,0.5,0.35,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextSize(0.045);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(10);
   leg->SetFillStyle(1001);
   entry=leg->AddEntry("Graph0","E. loss  ","f");
   entry->SetFillColor(2);
   entry->SetFillStyle(3004);
   entry->SetLineColor(2);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph3","E. loss + EPS09","f");
   entry->SetFillColor(4);
   entry->SetFillStyle(3004);
   entry->SetLineColor(4);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   
   leg = new TLegend(0.5,0.15,0.92,0.4,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextSize(0.057);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(10);
   leg->SetFillStyle(1001);
   entry=leg->AddEntry("Graph4","J/#psi  p-Pb ","");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph4","#sqrt{s} = 5 TeV ","");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph4","|y|=1.2","");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   w6->Modified();
   w6->cd();
   w6->SetSelected(w6);
}
Esempio n. 17
0
void drawContour(TString bino="bino", TString jet="nojet", bool print=false) {

  bool useCustomGetContour = false;

  //  TString data_dir = "table_20120131/multiChannel"; // answering preapproval questions
  TString data_dir = "table_20120209/multiChannel"; // last success after answering preapproval questions
  //TString data_dir = ".";

  gStyle->SetOptStat(0);

  TString label = bino + "_mN375_met100_" + jet;
  if(bino.Contains("mNScan")) label = bino + "_met100_" + jet;

  gStyle->SetPalette(1);
  gStyle->SetPadLeftMargin(0.15);

  //  TString option2D = "CONT4 Z";
  TString option2D = "COL Z";

  // for bino & wino
  const int nG = 21;
  const int nS = 21;
  float mGVals[nG+1] = {400, 480, 560, 640, 720, 800, 880, 960, 1040, 1120, 1200, 1280, 1360, 1440, 1520, 1600, 1680, 1760, 1840, 1920, 2000, 2100};
  float mSVals[nS+1] = {400, 480, 560, 640, 720, 800, 880, 960, 1040, 1120, 1200, 1280, 1360, 1440, 1520, 1600, 1680, 1760, 1840, 1920, 2000, 2100};

  // to make valuse on the center of each bin
  float* mGBins = new float[nG+1];
  float* mSBins = new float[nS+1];
  for(int i=0; i<nG+1; i++) mGBins[i] = mGVals[i]-40;
  for(int i=0; i<nS+1; i++) mSBins[i] = mSVals[i]-40;


  // for mNScan
  const int nX = 10;
  const int nY = 23;
  float xVals[nX+1] = {150, 250, 350, 450, 550, 650, 750, 850, 950, 1050, 1150};
  float yVals[nY+1] = {240, 320, 400, 480, 560, 640, 720, 800, 880, 960, 1040, 1120, 1200, 1280, 1360, 1440, 1520, 1600, 1680, 1760, 1840, 1920, 2000, 2100};

  float* xBins = new float[nX+1];
  float* yBins = new float[nY+1];

  for(int i=0; i<nX+1; i++) xBins[i] = xVals[i]-50;
  for(int i=0; i<nY+1; i++) yBins[i] = yVals[i]-40;


  TFile* fout = new TFile("hist_exclusion_"+label+".root","RECREATE");

  const int nxs = 6;
  TString xsname[nxs] = {"xsec","xsec_1L","xsec_1H","xsec_2L","xsec_2H","acc"};
  TH2D* h_xs[nxs];
  for(int i=0; i<nxs; i++) {
    if(bino.Contains("mNScan")) h_xs[i] = new TH2D(xsname[i],xsname[i],nX,xBins,nY,yBins);
    else h_xs[i] = new TH2D(xsname[i],xsname[i],nS,mSBins,nG,mGBins);
  }

  const int nlimit = 6;
  TString limitname[nlimit] = {"limit", "exp", "exp_1L","exp_1H","exp_2L","exp_2H"};
  TH2D* h_limit[nlimit];
  for(int i=0; i<nlimit; i++) {
    if(bino.Contains("mNScan")) h_limit[i] = new TH2D(limitname[i],limitname[i],nX,xBins,nY,yBins);
    else h_limit[i] = new TH2D(limitname[i],limitname[i],nS,mSBins,nG,mGBins);
  }

  TString datafile = data_dir + "/" + bino + "_" + jet + ".table";

  std::ifstream fin;
  fin.open(datafile.Data());
  while(1){
    // #echo "mS mG mN acc xsec xsecPDFError xsecRSErrorNeg xsecRSErrorPos obsLimit expLimit exp_m1s exp_m2s exp_p1s exp_p2s"
    int mS, mG, mN;
    double acc, xsec, xsecPDFError, xsecRSErrorNeg, xsecRSErrorPos, obsLimit, expLimit, exp_m1s, exp_m2s, exp_p1s, exp_p2s;
    fin >> mS >> mG >> mN >> acc >> xsec >> xsecPDFError >> xsecRSErrorNeg >> xsecRSErrorPos >> obsLimit >> expLimit >> exp_m1s >> exp_m2s >> exp_p1s >> exp_p2s;
    if(!fin.good()) break;

//     std::cout << mS << ", " << mG << ", " << mN << ", " << acc << ", " << xsec << ", " << xsecPDFError << ", "
// 	      << xsecRSErrorNeg << ", " << xsecRSErrorPos << ", " << obsLimit << ", " << expLimit << ", "
// 	      << exp_m1s << ", " << exp_m2s << ", " << exp_p1s << ", " << exp_p2s << std::endl;

    double oneSigma_L = std::sqrt(xsecRSErrorNeg * xsecRSErrorNeg + xsecPDFError * xsecPDFError);
    double oneSigma_H = std::sqrt(xsecRSErrorPos * xsecRSErrorPos + xsecPDFError * xsecPDFError);

    if(bino.Contains("mNScan")) {
      if(mS != 2500) continue;
      h_xs[5]->Fill(mN,mG,acc);
      h_xs[0]->Fill(mN,mG,xsec);
      h_xs[1]->Fill(mN,mG,xsec - xsec*oneSigma_L);
      h_xs[2]->Fill(mN,mG,xsec + xsec*oneSigma_H);
      h_xs[3]->Fill(mN,mG,xsec - xsec*2*oneSigma_L);
      h_xs[4]->Fill(mN,mG,xsec + xsec*2*oneSigma_H);

      h_limit[0]->Fill(mN,mG,obsLimit*xsec);
      h_limit[1]->Fill(mN,mG,expLimit*xsec);
      h_limit[2]->Fill(mN,mG,exp_m1s*xsec);
      h_limit[3]->Fill(mN,mG,exp_p1s*xsec);
      h_limit[4]->Fill(mN,mG,exp_m2s*xsec);
      h_limit[5]->Fill(mN,mG,exp_p2s*xsec);
    }
    else {
      if(mN != 375) continue;
      h_xs[5]->Fill(mS,mG,acc);
      h_xs[0]->Fill(mS,mG,xsec);
      h_xs[1]->Fill(mS,mG,xsec - xsec*oneSigma_L);
      h_xs[2]->Fill(mS,mG,xsec + xsec*oneSigma_H);
      h_xs[3]->Fill(mS,mG,xsec - xsec*2*oneSigma_L);
      h_xs[4]->Fill(mS,mG,xsec + xsec*2*oneSigma_H);

      h_limit[0]->Fill(mS,mG,obsLimit*xsec);
      h_limit[1]->Fill(mS,mG,expLimit*xsec);
      h_limit[2]->Fill(mS,mG,exp_m1s*xsec);
      h_limit[3]->Fill(mS,mG,exp_p1s*xsec);
      h_limit[4]->Fill(mS,mG,exp_m2s*xsec);
      h_limit[5]->Fill(mS,mG,exp_p2s*xsec);
    }// if - else

  }// while
  fin.close();

  for(int i=0; i<nxs; i++) fillPotHoles(h_xs[i]);
  for(int i=0; i<nlimit; i++) fillPotHoles(h_limit[i]);


  TGraph* noRegion2 = new TGraph(3);
  noRegion2->SetPoint(0,200,200);
  noRegion2->SetPoint(1,1100,200);
  noRegion2->SetPoint(2,1100,1100);
  noRegion2->SetFillColor(16);

  TLatex* lat44 = new TLatex(0.7,0.25,"#tilde{g} NLSP");
  lat44->SetNDC(true);
  lat44->SetTextSize(0.04);


  TString title;

  TCanvas* can_acc = new TCanvas("can_acc_"+label,"can_acc_"+label,1000,800);
  can_acc->SetRightMargin(0.19);
  h_xs[5]->GetXaxis()->SetNdivisions(505);
  h_xs[5]->GetYaxis()->SetNdivisions(505);
  h_xs[5]->GetYaxis()->SetTitleOffset(1.2);
  h_xs[5]->GetZaxis()->SetTitleOffset(1.2);
  title = ";m_{#tilde{q}} (GeV/c^{2});m_{#tilde{g}} (GeV/c^{2});Acceptance";
  if(bino.Contains("mNScan")) title = ";m_{#chi^{0}} (GeV/c^{2});m_{#tilde{g}} (GeV/c^{2});Acceptance";
  h_xs[5]->SetTitle(title);
  h_xs[5]->Draw(option2D);
  if(bino.Contains("mNScan")){
    noRegion2->Draw("same f");
    lat44->Draw("same");
  }
  if(print) {
    can_acc->Print("",".gif");
    can_acc->Print("",".pdf");
  }



  TCanvas* can_xs = new TCanvas("can_xsec_"+label,"can_xsec_"+label,1000,800);
  can_xs->SetRightMargin(0.17);
  can_xs->SetLogz();
  h_xs[0]->GetXaxis()->SetNdivisions(505);
  h_xs[0]->GetYaxis()->SetNdivisions(505);
  h_xs[0]->GetYaxis()->SetTitleOffset(1.2);
  h_xs[0]->GetZaxis()->SetTitleOffset(1.0);
  title = ";m_{#tilde{q}} (GeV/c^{2});m_{#tilde{g}} (GeV/c^{2});Cross Section (pb)";
  if(bino.Contains("mNScan")) title = ";m_{#chi^{0}} (GeV/c^{2});m_{#tilde{g}} (GeV/c^{2});Cross Section (pb)";
  h_xs[0]->SetTitle(title);
  h_xs[0]->Draw(option2D);
  if(bino.Contains("mNScan")){
    noRegion2->Draw("same f");
    lat44->Draw("same");
  }
  if(print) {
    can_xs->Print("",".gif");
    can_xs->Print("",".pdf");
  }

  TCanvas* can_limit = new TCanvas("can_limit_"+label,"can_limit_"+label,1000,800);
  can_limit->SetRightMargin(0.2);
  h_limit[0]->GetXaxis()->SetNdivisions(505);
  h_limit[0]->GetYaxis()->SetNdivisions(505);
  h_limit[0]->GetYaxis()->SetTitleOffset(1.2);
  h_limit[0]->GetZaxis()->SetTitleOffset(1.3);
  if(bino.Contains("wino")){
    can_limit->SetRightMargin(0.17);
    h_limit[0]->GetZaxis()->SetTitleOffset(1.0);
  }

  title = ";m_{#tilde{q}} (GeV/c^{2});m_{#tilde{g}} (GeV/c^{2});95% CL Upper Limit (pb)";
  if(bino.Contains("mNScan")) title = ";m_{#chi^{0}} (GeV/c^{2});m_{#tilde{g}} (GeV/c^{2});95% CL Upper Limit (pb)";
  h_limit[0]->SetTitle(title);
  h_limit[0]->Draw(option2D);
  if(bino.Contains("mNScan")){
    noRegion2->Draw("same f");
    lat44->Draw("same");
  }
  if(print) {
    can_limit->Print("",".gif");
    can_limit->Print("",".pdf");
  }

  // now find exclusion curves
  TCanvas* can_diff = new TCanvas("can_diff_"+label,"can_diff_"+label,1200,800);
  //  can_diff->Divide(nlimit,nxs);
  TH2D* h_excl[nlimit][nxs-1];
  for(int i=0; i<nlimit; i++) {
    for(int j=0; j<nxs-1; j++) {

      h_excl[i][j] = (TH2D*) h_limit[i]->Clone("exclusion_"+limitname[i]+"_"+xsname[j]);
      int nbinsx = h_excl[i][j]->GetXaxis()->GetNbins();
      int nbinsy = h_excl[i][j]->GetYaxis()->GetNbins();

      for( int ibx=1; ibx<=nbinsx; ++ibx){
	for( int iby=1; iby<=nbinsy; ++iby){
	  double x1 = h_limit[i]->GetBinContent(ibx,iby);
	  double x2 = h_xs[j]->GetBinContent(ibx,iby);
	  h_excl[i][j]->SetBinContent(ibx,iby,x2-x1);
	  x1 = h_limit[i]->GetBinError(ibx,iby);
	  x2 = h_xs[j]->GetBinError(ibx,iby);
	  h_excl[i][j]->SetBinError(ibx,iby,std::sqrt(x1*x1+x2*x2));
	}// for iby
      }// for ibx
      fixBadCells(h_excl[i][j]);
      if(i==0 && j==0) h_excl[i][j]->Draw("TEXT");
    }// for j
  }// for i


  float xmin = 400;
  float ymin = 400;
  float xmax = 2000;
  float ymax = 2000;
  if(bino.Contains("mNScan")){
    xmin = 200;
    xmax = 1500;
    ymin = 300;
    ymax = 2000;
  }


  TGraph* curv[nlimit][nxs-1];
  TGraphSmooth* gsmooth = new TGraphSmooth("normal");

  TH2D* h_back;
  if(bino.Contains("mNScan")) h_back = new TH2D("h_back",";m_{#tilde{#chi^{0}}} (GeV/c^{2});m_{#tilde{g}} (GeV/c^{2})",100,xmin,xmax,100,ymin,ymax);
  else h_back = new TH2D("h_back",";m_{#tilde{q}} (GeV/c^{2});m_{#tilde{g}} (GeV/c^{2})",100,xmin,xmax,100,ymin,ymax);

  h_back->GetXaxis()->SetNdivisions(505);
  h_back->GetYaxis()->SetNdivisions(505);
  h_back->GetYaxis()->SetTitleOffset(1.2);


  double contours[2]={ 0.0, 1.0 };
  TCanvas *can_excl01 = new TCanvas("can_excl01_"+label, "can_excl01_"+label,1200,800);
  can_excl01->Divide(nlimit,nxs-1);
  for(int i=0; i<nlimit; i++) {
    for(int j=0; j<nxs-1; j++) {

      can_excl01->cd(j*nlimit + i + 1);
      h_back->Draw();

      if(useCustomGetContour) {
        curv[i][j] = getContour(h_excl[i][j],"excl_curv_"+limitname[i]+"_"+xsname[j]);
        curv[i][j]->Draw("SAME L");
      }
      else {
	h_excl[i][j]->SetContour(2,contours);
	h_excl[i][j]->Draw("SAME CONT LIST");
	gPad->Update();

	TObjArray *contsM = (TObjArray*) gROOT->GetListOfSpecials()->FindObject("contours");
	TList* contLevel = (TList*)contsM->At(0);
	curv[i][j] = (TGraph*)contLevel->First()->Clone("excl_curv_"+limitname[i]+"_"+xsname[j]);
      }
      //      PrintPoints(curv[i][j]);
      //      RemovePoints(curv[i][j]);

    }// for j
  }// for i

  if(bino.Contains("mNScan")) {
    for(int i=0; i<nlimit; i++) {
      for(int j=0; j<nxs-1; j++) {
	RemovePoints(curv[i][j]);
      }
    }

    for(int i=0; i<nlimit; i++) {
      for(int j=0; j<nxs-1; j++) {
	double x,y;
	int whichone = curv[i][j]->GetN()-1;
	curv[i][j]->GetPoint(whichone-1,x,y);
	curv[i][j]->SetPoint(whichone,y,y);
      }
    }
  }

  TGraphSmooth* gs[nlimit][nxs-1];
  TGraph* curvS[nlimit][nxs-1];
  for(int i=0; i<nlimit; i++) {
    for(int j=0; j<nxs-1; j++) {
      //      gs[i][j] = new TGraphSmooth("normal");
      //      curvS[i][j] = gs[i][j]->SmoothSuper(curv[i][j]);
      curvS[i][j] = (TGraph*) curv[i][j]->Clone();
      curvS[i][j]->SetName("excl_curvS_"+limitname[i]+"_"+xsname[j]);
    }
  }

  std::cout << "curv[3][0]----------------- N : " << curv[3][0]->GetN() << std::endl;
  PrintPoints(curv[3][0]);
  std::cout << "curvS[3][0]----------------- N : " << curvS[3][0]->GetN() << std::endl;
  PrintPoints(curvS[3][0]);
  std::cout << "---------------------------------" << std::endl;


  // make excluded region
  TGraph* excludedRegion = new TGraph(curvS[0][0]->GetN()+3);
  int nbins = curvS[0][0]->GetN();
  for(int i=0; i<nbins; i++){
    double x,y;
    curvS[0][0]->GetPoint(i,x,y);
    excludedRegion->SetPoint(i,x,y);
  }

  excludedRegion->SetPoint(nbins,xmax,ymin);
  excludedRegion->SetPoint(nbins+1,xmin,ymin);
  excludedRegion->SetPoint(nbins+2,xmin,ymax);

  // make band graph
  TGraph* exp1sigma_aroundExp = makeBandGraph(curvS[2][0],curvS[3][0]);


  TCanvas* can_excl02 = new TCanvas("can_excl02_"+label, "can_excl02_"+label,1000,800);
  h_back->Draw();
  //  can_excl02->SetGrid(1,1);

  // ecluded region
  excludedRegion->SetFillColor(kBlue-10);
  excludedRegion->SetFillStyle(1001);
  excludedRegion->Draw("SAME F");

  // experimental 1 sigma band around expected limit
  exp1sigma_aroundExp->SetFillColor(kOrange-3);
  exp1sigma_aroundExp->SetFillStyle(1001);
  exp1sigma_aroundExp->Draw("SAME F");

  // expected limit
  curvS[1][0]->SetLineStyle(9);
  curvS[1][0]->SetLineWidth(2);
  curvS[1][0]->SetLineColor(kOrange+9);
  curvS[1][0]->Draw("SAME L");

  // theory 1 sigma around expected limit
  curvS[1][1]->SetLineStyle(3);
  curvS[1][1]->SetLineWidth(1);
  curvS[1][1]->SetLineColor(kOrange+9);
  curvS[1][1]->Draw("SAME L");

  curvS[1][2]->SetLineStyle(3);
  curvS[1][2]->SetLineWidth(1);
  curvS[1][2]->SetLineColor(kOrange+9);
  curvS[1][2]->Draw("SAME L");

  // observed limit
  curvS[0][0]->SetLineWidth(3);
  curvS[0][0]->SetLineColor(4);
  curvS[0][0]->Draw("SAME L");

  // theory 1 sigma around observed limit
  curvS[0][1]->SetLineStyle(3);
  curvS[0][1]->SetLineWidth(2);
  curvS[0][1]->SetLineColor(kBlue);
  curvS[0][1]->Draw("SAME L");

  curvS[0][2]->SetLineStyle(3);
  curvS[0][2]->SetLineWidth(2);
  curvS[0][2]->SetLineColor(kBlue);
  curvS[0][2]->Draw("SAME L");


  PrintPoints(curvS[0][0]);


  float leg_xmin = 0.65;
  float leg_xmax = 0.9;
  float leg_ymin = 0.5;
  float leg_ymax = 0.8;
  if(bino.Contains("mNScan")){
    leg_xmin -= 0.45;
    leg_xmax -= 0.45;
  }


  TLegend* leg;
  if(bino.Contains("mNScan")) leg = new TLegend(leg_xmin,leg_ymin,leg_xmax,leg_ymax,"","brNDC");
  else leg = new TLegend(leg_xmin,leg_ymin,leg_xmax,leg_ymax,"GGM "+bino+"-like #tilde{#chi}^{0}","brNDC");
  leg->SetFillColor(0);
  leg->SetLineColor(0);
  leg->SetBorderSize(0);
  leg->SetTextFont(62);
  leg->SetTextSize(0.03);
  if(bino.Contains("mNScan")) leg->AddEntry("NULL","m_{#tilde{q}} = 2500 (GeV/c^{2})","h");
  else leg->AddEntry("NULL","m_{#tilde{#chi}^{0}} = 375 (GeV/c^{2})","h");
  TString jetRequirement = "Without jet requirement";
  if(jet.Contains("1jet")) jetRequirement = "At least 1 jet requirement";
  leg->AddEntry("NULL",jetRequirement,"h");
  leg->AddEntry("NULL","NLO Limits","h");
  leg->AddEntry(curvS[0][0],"Observed","L");
  leg->AddEntry(curvS[0][1],"#pm1#sigma (theory)","L");
  leg->AddEntry(curvS[1][0],"Expected","L");
  leg->AddEntry(curvS[1][1],"#pm1#sigma (theory)","L");
  leg->AddEntry(exp1sigma_aroundExp,"#pm1#sigma (experimental)","F");
  leg->Draw("same");

  TLatex* lat = new TLatex(leg_xmin+0.02,0.87,"CMS Preliminary");
  lat->SetNDC(true);
  lat->SetTextFont(43);
  lat->SetTextSize(30);
  lat->Draw("same");

  TLatex* lat2 = new TLatex(leg_xmin,0.83,"#int #font[12]{L}dt = 4.7fb^{-1}, #sqrt{s} = 7 TeV");
  lat2->SetNDC(true);
  lat2->SetTextFont(43);
  lat2->SetTextSize(24);
  lat2->Draw("same");

  float xv = 0.25;
  float yv = 0.25;
  if(bino.Contains("wino")){
    xv = 0.23;
    yv = 0.23;
  }
  if(bino.Contains("mNScan")){
    xv = 0.2;
    yv = 0.3;
  }
  TLatex* lat3 = new TLatex(xv,yv,"Excluded");
  lat3->SetNDC(true);
  lat3->SetTextFont(52);
  lat3->SetTextSize(0.06);
  lat3->Draw("same");

  TGraph* noRegion = new TGraph(3);
  noRegion->SetPoint(0,TMath::Min(xmin,ymin),TMath::Min(xmin,ymin));
  noRegion->SetPoint(1,xmax,ymin);
  noRegion->SetPoint(2,TMath::Min(xmax,ymax),TMath::Min(xmax,ymax));
  noRegion->SetFillColor(16);

  TLatex* lat4 = new TLatex(0.7,0.25,"#tilde{g} NLSP");
  lat4->SetNDC(true);
  lat4->SetTextSize(0.04);

  if(bino.Contains("mNScan")){
    noRegion->Draw("same f");
    lat4->Draw("same");
  }

  can_excl02->RedrawAxis();


  if(print) {
    can_excl02->Print("",".gif");
    can_excl02->Print("",".pdf");
  }

  fout->cd();
  fout->Write();

  can_acc->Write();
  can_xs->Write();
  can_limit->Write();
  can_excl01->Write();
  can_excl02->Write();

  for(int i=0; i<nlimit; i++){
    for(int j=0; j<nxs-1; j++){
      curv[i][j]->Write();
      curvS[i][j]->Write();
    }
  }


}
Esempio n. 18
0
int main (int argc, char * argv[])
{
	// set style for plots
	SetAtlasStyle();

	// input observed limits
	Float_t obs_x_points[NLIMPT];
	Float_t obs_y_points[NLIMPT];

	FILE * obs_file = fopen("xdxhDh_observed.dat", "r");
	for (int j = 0; j < NLIMPT; j++)
	{
		fscanf(obs_file, "%f %f", &obs_x_points[j], &obs_y_points[j]);
	}
	fclose(obs_file);

	// input expected limits and errors
	Float_t x_points[NLIMPT];
	Float_t y_points[NLIMPT];
	Float_t y_errors_1sig_lo[NLIMPT];
	Float_t y_errors_1sig_hi[NLIMPT];
	Float_t y_errors_2sig_lo[NLIMPT];
	Float_t y_errors_2sig_hi[NLIMPT];

	FILE * exp_file = fopen("xdxhDh_expected.dat", "r");
	for (int j = 0; j < NLIMPT; j++)
	{
		fscanf(exp_file, "%f %f %f %f %f %f", &x_points[j], &y_points[j], &y_errors_1sig_lo[j], &y_errors_2sig_lo[j], &y_errors_1sig_hi[j], &y_errors_2sig_hi[j]);
	}
	fclose(exp_file);

	// xdxhDh model info
	Float_t xdxhDh_Lambda0 = 100;
	Float_t xdxhDh_xsec0[NLIMPT];
	xdxhDh_xsec0[0] = 108;
	xdxhDh_xsec0[1] = 15.5;
	xdxhDh_xsec0[2] = 9.33;
	xdxhDh_xsec0[3] = 0.171;
	xdxhDh_xsec0[4] = 0.00286;
	double power = -0.125;

	// convert xsec limits to parameter limits
	for (int i = 0; i < NLIMPT; i++)
	{
		obs_x_points[i] = obs_x_points[i];
		obs_y_points[i] = xdxhDh_Lambda0 * pow((obs_y_points[i] /xdxhDh_xsec0[i]), power);

		x_points[i] = x_points[i];
		y_points[i] = xdxhDh_Lambda0 * pow((y_points[i] /xdxhDh_xsec0[i]), power);
		y_errors_1sig_lo[i] = xdxhDh_Lambda0 * pow((y_errors_1sig_lo[i] /xdxhDh_xsec0[i]), power);
		y_errors_1sig_hi[i] = xdxhDh_Lambda0 * pow((y_errors_1sig_hi[i] /xdxhDh_xsec0[i]), power);
		y_errors_2sig_lo[i] = xdxhDh_Lambda0 * pow((y_errors_2sig_lo[i] /xdxhDh_xsec0[i]), power);
		y_errors_2sig_hi[i] = xdxhDh_Lambda0 * pow((y_errors_2sig_hi[i] /xdxhDh_xsec0[i]), power);

		y_errors_1sig_lo[i] = y_points[i] - y_errors_1sig_lo[i];
		y_errors_2sig_lo[i] = y_points[i] - y_errors_2sig_lo[i];
		y_errors_1sig_hi[i] = y_errors_1sig_hi[i] - y_points[i];
		y_errors_2sig_hi[i] = y_errors_2sig_hi[i] - y_points[i];
	}

	// observed limits
	TGraph * observed = new TGraph(NLIMPT, obs_x_points, obs_y_points);
	observed->SetLineWidth(2);
	observed->SetLineColor(kBlack);
	observed->SetLineStyle(1);		// solid

	// expected limits
	TGraph * expected = new TGraph(NLIMPT, x_points, y_points);
	expected->SetLineWidth(2);
	expected->SetLineColor(kBlack);
	expected->SetLineStyle(2);		// dashed

	// expected one sigma errors
	TGraphAsymmErrors * one_sigma = new TGraphAsymmErrors(NLIMPT, x_points, y_points, 0, 0, y_errors_1sig_lo, y_errors_1sig_hi);
	one_sigma->SetFillColor(kGreen);
	one_sigma->SetFillStyle(1001);

	// expected two sigma errors
	TGraphAsymmErrors * two_sigma = new TGraphAsymmErrors(NLIMPT, x_points, y_points, 0, 0, y_errors_2sig_lo, y_errors_2sig_hi);
	two_sigma->SetFillColor(kYellow);
	two_sigma->SetFillStyle(1001);

	// lux limits
	TGraph * lux = new TGraph("xdxhDh_lux.dat", "%lg %lg", " \t,;");
	lux->SetLineWidth(2);
	lux->SetLineColor(kMagenta);
	lux->SetLineStyle(1);		// solid

	// inv limits
	TGraph * inv = new TGraph("xdxhDh_inv.dat", "%lg %lg", " \t,;");
	inv->SetLineWidth(2);
	inv->SetLineColor(kRed);
	inv->SetLineStyle(1);		// solid

	// trunc limits
	TGraph * max_trunc = new TGraph("xdxhDh_max_trunc.dat", "%lg %lg", " \t,;");
	max_trunc->SetLineWidth(2);
	max_trunc->SetLineColor(kBlack);
	max_trunc->SetLineStyle(3);		// dotted
	max_trunc->SetMarkerStyle(25);		// open square

	// perturbative limits
	TGraph * pert;
	double pert_x[2] = {0, 1000};
	double pert_y[2] = {30, 30};
	pert = new TGraph(2, pert_x, pert_y);
	pert->SetLineWidth(2);
	pert->SetLineColor(kBlue);
	pert->SetLineStyle(2);		// dashed

	// aa limits
	TGraph * aa = new TGraph("xdxhDh_aa_observed.dat", "%lg %lg", " \t,;");;
//	aa->SetLineWidth(2);
//	aa->SetLineColor(kGreen + 3);
//	aa->SetLineStyle(1);		// solid
	aa->SetLineWidth(-502);
	aa->SetLineColor(kGreen + 3);
	aa->SetFillColor(kGreen + 3);
	aa->SetFillStyle(3005);

	// setup legend
	TLegend * legend;
	legend = new TLegend(0.6, 0.4, 0.9, 0.74, "");
	legend->SetFillStyle(0);
	legend->SetBorderSize(0);
	legend->SetTextSize(0.04);
	legend->SetTextFont(42);
	legend->AddEntry(observed, "h#rightarrowb#bar{b} observed", "L");
	legend->AddEntry(expected, "h#rightarrowb#bar{b} expected", "L");
	legend->AddEntry(one_sigma, "#pm1#sigma uncertainty", "F");
	legend->AddEntry(two_sigma, "#pm2#sigma uncertainty", "F");
	legend->AddEntry(pert, "perturbative limit", "L");
	legend->AddEntry(max_trunc, "g=4#pi trunc.", "LP");
	legend->AddEntry(inv, "BR(Z#rightarrowinv)", "L");
	legend->AddEntry(lux, "LUX", "L");
	legend->AddEntry(aa, "h#rightarrow#gamma#gamma observed", "LF");

	// setup canvas
	TCanvas * c_graph = new TCanvas("c_graph", "c_graph", 600, 600);
	c_graph->SetLogx();
	c_graph->SetLogy();

	// draw expected limits and errors
	two_sigma->GetXaxis()->SetLimits(1, 1000);
	two_sigma->GetHistogram()->SetMaximum(30000);	// set axis limits on first graph drawn
	two_sigma->GetHistogram()->SetMinimum(10);	// set axis limits on first graph drawn
	two_sigma->GetXaxis()->SetTitle("m_{#chi} [GeV]");
	two_sigma->GetYaxis()->SetTitle("95% CL #Lambda lower limit [GeV]");
	two_sigma->Draw("A3");				// set axis on first graph drawn
	one_sigma->Draw("3");
	expected->Draw("L");

	// draw observed limits
	observed->Draw("L");

	// draw aa limits
	aa->Draw("L");

	// draw truncation limits
	max_trunc->Draw("LP");

	// total hack
	TBox * white_box = new TBox(0, 0, 46, 1000);
	white_box->SetFillColor(0);
	white_box->Draw();

	// draw lux limits
	lux->Draw("L");

	// draw inv limits
	inv->Draw("L");

	// draw perturbativity limit
	pert->Draw("L");

	gPad->RedrawAxis();	// hack

	// draw the legend
	legend->Draw();

	// draw text
	ATLASLabel(0.2, 0.89, "", kBlack);

	TLatex n1;
	n1.SetNDC();
	char atlas_text_2[256];
	char atlas_text_3[256];
	sprintf(atlas_text_2, "#sqrt{s} = 8 TeV, 20.3 fb^{-1}");
	n1.SetTextSize(0.04);
	n1.DrawLatex(0.2, 0.84, atlas_text_2);
	sprintf(atlas_text_2, "#font[152]{c}#partial^{#font[152]{m}}#font[152]{c}#font[12]{HD}_{#font[152]{m}}#font[12]{H}");
	n1.SetTextSize(0.04);
	n1.DrawLatex(0.2, 0.79, atlas_text_2);
	sprintf(atlas_text_2, "Scalar DM");
	n1.SetTextSize(0.04);
	n1.DrawLatex(0.2, 0.74, atlas_text_2);

	// output file
	char eps_name[256];
	sprintf(eps_name, "xdxhDh_param_limits.pdf");
	c_graph->SaveAs(eps_name);

	return 0;
}
void makePlots()
{
 // **********************************************
 // *            Input parameters                *
 // **********************************************
 // switch to include/exclude sytematics uncertainties 
 bool systematics = true;

 // array of signal efficiencies
 Double_t S_eff[5] = {0.36, 0.43, 0.54, 0.59, 0.66};
//  Double_t S_eff[1] = {0.66}; // for testing of individual mass points  <----------------------------------------------
 // array of relative uncertainties on the signal efficiencies
 Double_t Sigma_S_eff[5] = {0.18, 0.15, 0.12, 0.12, 0.10};
 
 // array of N_background for 100 pb^-1
 Double_t N_bkg_100[5] = {10.35, 6.37, 2.83, 1.27, 1.27};
//  Double_t N_bkg_100[1] = {1.27}; // for testing of individual mass points   <----------------------------------------------
 // array of relative uncertainties on N_background (0.1 = 10%)
 Double_t Sigma_N_bkg[5] = {0.19, 0.23, 0.33, 0.33, 0.33};
//  Double_t Sigma_N_bkg[1] = {0.46}; // for testing of individual mass points   <----------------------------------------------
 
 // arrays of leptoquark masses
 string mass[5] = {"m250", "m300", "m400", "m500", "m600"};
 Double_t m[5] = {250, 300, 400, 500, 600};
 
 // relative uncertainty on the integrated luminosity (0.1 = 10% uncertainty)
 Double_t Sigma_L = 0.1;
 
 // array of theoretical cross-sections for different leptoquark mass
 Double_t xsTh[5] = {9.64045, 3.6081, 0.691125, 0.176217, 0.0538333};
 
 // arrays of beta^2 ranges that contain 95% CL exclusion of different leptoquark mass hypotheses
 Double_t rangeMin[5] = {0.018, 0.03, 0.09, 0.3,  0.9};
 Double_t rangeMax[5] = { 0.03, 0.08,  0.2, 0.55, 1.5};
 Double_t rangeMin_sys[5] = {0.02, 0.04,  0.1, 0.35, 1.0};
 Double_t rangeMax_sys[5] = {0.05, 0.09, 0.25, 0.6 , 1.6};
//  Double_t rangeMin[1] = {0.8}; // for testing of individual mass points   <----------------------------------------------
//  Double_t rangeMax[1] = {1.4}; // for testing of individual mass points   <----------------------------------------------
//  Double_t rangeMin_sys[1] = {0.9}; // for testing of individual mass points   <----------------------------------------------
//  Double_t rangeMax_sys[1] = {1.5}; // for testing of individual mass points   <----------------------------------------------
 
 // number of points used for interpolation
 Int_t NPts = 5;
  
 // filename for the final plot (NB: changing the name extension changes the file format)
 string fileName = "beta2_vs_m_excl.eps";
  
 // axes labels for the final plot 
 string title = ";m (GeV/c^{2});#beta^{2}";

 TH2F *bg = new TH2F("bg",title.c_str(), 100, 200., 650., 100, 0., 1.);
 bg->SetStats(kFALSE);
 bg->SetTitleOffset(1.,"X");
 bg->SetTitleOffset(1.5,"Y");

 TF1 *fit1 = new TF1("fit1","[0]*exp([1]*x)",200,600);
 fit1->SetLineWidth(2);
 fit1->SetLineStyle(7);
 fit1->SetLineColor(kBlue);

 TF1 *fit2 = new TF1("fit2","[0]*exp([1]*x)",200,600);
 fit2->SetLineWidth(2);
 fit2->SetLineColor(kRed);
 
 // region excluded by Tevatron limits
 Double_t x_shaded[14] = {200,205,210,215,220,225,230,235,240,245,250,255,256,200};
 Double_t y_shaded[14] = {0.0267547,0.0380903,0.0531225,0.0736446,0.10221,0.142373,0.194058,0.265091,0.385415,0.520114,0.721552,0.945015,1,1};

 // **********************************************
 // *  Don't change anything below this point!   *
 // **********************************************
 
  // turn on/off batch mode
 gROOT->SetBatch(kTRUE);
 // set ROOT style
 style();
 
 TCanvas *c = new TCanvas("c","",800,800);
 c->cd();

 bg->Draw();
 
 TGraph *grexcl = new TGraph(14,x_shaded,y_shaded);
 grexcl->SetFillColor(kGray+1);
 grexcl->Draw("f");

 Int_t size = sizeof(S_eff)/sizeof(*S_eff);

 // array of minimum beta^2 values for 95% CL exclusion
//  Double_t beta2[size];
 Double_t beta2[5] = {0.0246067, 0.0460278, 0.146584, 0.429775, 1.24257};
//  Double_t beta2_sys[size]; // with systematics included
 Double_t beta2_sys[5] = {0.031345, 0.0550194, 0.16532, 0.467803, 1.33682}; // with systematics included
 
//  for(Int_t i = 0; i < size; i++){
//   
//   beta2[i] = beta2_for_exclusion(NPts, xsTh[i], rangeMin[i], rangeMax[i], 0, S_eff[i], 0, N_bkg_100[i], 0, mass[i]);
//   if(systematics) beta2_sys[i] = beta2_for_exclusion(NPts, xsTh[i], rangeMin_sys[i], rangeMax_sys[i], Sigma_L, S_eff[i], Sigma_S_eff[i], N_bkg_100[i], Sigma_N_bkg[i], mass[i]);
//  }

 TGraph *beta2_vs_m = new TGraph(size, m, beta2);
 beta2_vs_m->SetLineWidth(2);
 beta2_vs_m->SetLineStyle(7);
 beta2_vs_m->SetLineColor(kBlue);
 beta2_vs_m->SetMarkerSize(.9);
 beta2_vs_m->SetMarkerStyle(22);
 beta2_vs_m->SetMarkerColor(kBlue); 
 beta2_vs_m->Fit("fit1");
 fit1->SetRange(200,600);

 TGraph *beta2_vs_m_sys = new TGraph(size, m, beta2_sys);
 beta2_vs_m_sys->SetLineWidth(2);
 beta2_vs_m_sys->SetLineColor(kRed);
 beta2_vs_m_sys->SetMarkerSize(.9);
 beta2_vs_m_sys->SetMarkerStyle(21);
 beta2_vs_m_sys->SetMarkerColor(kRed); 
 if(systematics) beta2_vs_m_sys->Fit("fit2");
 if(systematics) fit2->SetRange(200,600);
  
 const Int_t n = 21;
 Double_t x[n], ymin[n], ymin_sys[n], ymax[n];
 for(Int_t i=0;i<n;i++) {
   x[i] = 200+20*i;
   ymin[i] = fit1->Eval(x[i]);
   if(systematics) ymin_sys[i] = fit2->Eval(x[i]); else ymin_sys[i] = fit1->Eval(x[i]);
   ymax[i] = 1;
 }
 TGraph *grshade = new TGraph(2*n);
 TGraph *grshade_sys = new TGraph(2*n);
 for(Int_t i=0;i<n;i++) {
    grshade->SetPoint(i,x[i],ymax[i]);
    grshade->SetPoint(n+i,x[n-i-1],ymin[n-i-1]);
    grshade_sys->SetPoint(i,x[i],ymax[i]);
    grshade_sys->SetPoint(n+i,x[n-i-1],ymin_sys[n-i-1]);
 }
 grshade->SetFillStyle(3005);
 grshade->SetFillColor(kBlue);
 grshade->Draw("f");
 grshade_sys->SetFillStyle(3004);
 grshade_sys->SetFillColor(kRed);
 grshade_sys->Draw("f");
 
 gPad->RedrawAxis();
 
 beta2_vs_m->Draw("P");
 fit1->Draw("same");
 if(systematics) beta2_vs_m_sys->Draw("P");
 if(systematics) fit2->Draw("same");
 
 TLegend *legend = new TLegend(.25,.68,.7,.85);
 legend->SetBorderSize(1);
 legend->SetFillColor(0);
 //legend->SetFillStyle(0);
 legend->SetMargin(0.2);
 legend->SetHeader("LQ #rightarrow eq");
 legend->AddEntry(beta2_vs_m_sys,"95% C.L. (with sys. unc.)","lp");
 legend->AddEntry(beta2_vs_m,"95% C.L. (no sys. unc.)","lp");
 if(systematics) legend->Draw();

 TLatex l1;
 l1.SetTextAlign(12);
 l1.SetTextSize(0.04);
 l1.SetTextFont(62);
 l1.SetNDC();
 l1.DrawLatex(0.6,0.24,"CMS Preliminary");

 TLatex l2;
 l2.SetTextAlign(12);
 l2.SetTextSize(0.04);
 l2.SetTextFont(62);
 l2.SetNDC();
 l2.DrawLatex(0.6,0.15,"#intLdt=100 pb^{-1}");

 c->SetGridx();
 c->SetGridy();
 c->SaveAs(fileName.c_str());

//  string name, extension;
//  size_t pos = fileName.find(".");
// 
//  name = fileName.substr(0,pos);
//  extension = fileName.substr(pos);
// 
//  c->SetLogy();
//  c->SaveAs((name + "_log" + extension).c_str());
 
 delete fit1;
 delete fit2;
 delete grexcl;
 delete grshade;
 delete grshade_sys;
 delete legend;
 delete beta2_vs_m;
 delete beta2_vs_m_sys;
 delete bg;
 delete c;
}
void makeMuVMassPlot(bool iUseWWType = false) { 
  SetStyle();
  TCanvas *lCan = new TCanvas("A","A",600,600);
  // lCan->SetGridx(1);
  //lCan->SetGridy(1);
  lCan->SetRightMargin(0.14);

  double *lTX1 = new double[2];
  double *lTX2 = new double[2];
  double lMinNLL = 1000;
  double lVMin = 0;
  double *lMin = new double[36];     
  if(!iUseWWType) for(int i0 = 0; i0 < 36; i0++) { lMin[i0] = getMinNLL(110+i0*1.); if(lMin[i0] < lVMin) {lVMin = lMin[i0]; lTX1[0] = 110+i0*1.;}}
  //lMin[17] = (lMin[16]+lMin[18])/2.;
  //lMin[21] = (lMin[20]+lMin[22])/2.;
  //lMin[29] = (lMin[28]+lMin[30])/2.;
  //lMin[34] = (lMin[33]+lMin[35])/2.;

  TFile *lFile = new TFile("/afs/cern.ch/user/p/pharris/public/massscan/cmb+.root");
  TTree *lTree = lFile->FindObjectAny("limit");
  TH2F *lH = new TH2F("2D","2D",36,109.5,145.5,50,-2.,3.);
  float  lNLL  = 0; lTree->SetBranchAddress("nll"     ,&lNLL);
  float  lMNLL = 0; lTree->SetBranchAddress("deltaNLL",&lMNLL);
  double lMH   = 0; lTree->SetBranchAddress("mh"      ,&lMH);
  float  lR    = 0; lTree->SetBranchAddress("r"       ,&lR);
  
  if(iUseWWType) { 
    for(int i0 = 0; i0 < lTree->GetEntries(); i0++) { 
      lTree->GetEntry(i0);
      if(lR < 0.1 && lR > 0)  lMin[int(lMH-110)] = -lMNLL;
    }
    lVMin = 10000;
    for(int i0 = 0; i0 < lTree->GetEntries(); i0++) { 
      lTree->GetEntry(i0);
      double pMin =  lMin[int(lMH-110)] + lMNLL;
      if(pMin < lVMin) lVMin = pMin;
    }
  }
  for(int i0 = 0; i0 < lTree->GetEntries(); i0++) { 
    lTree->GetEntry(i0);
    //if(lMH == 125) continue;
    lNLL = 0.; //lMin  = 0.;
    lH->SetBinContent(lH->GetXaxis()->FindBin(lMH),lH->GetYaxis()->FindBin(lR),(lMNLL+lMin[lH->GetXaxis()->FindBin(lMH)-1]-lVMin)); 
    if(lMH == lTX1[0] && lMNLL < lMinNLL) {lMinNLL = lMNLL; lTX2[0] = lR;}
  }
  TH2F* lHC = lH->Clone("2D_v2");
  double lCont[3];
  lCont[0] = 1.17; 
  lCont[1] = 3.0;
  lCont[2] = 9.0;
  lHC->SetContour(2,lCont);
  //lCan->SetLogz();
  lHC->Draw("cont z list");
  lCan->Update();
  lHC->Draw("colz");

  TObjArray *lContours = (TObjArray*)gROOT->GetListOfSpecials()->FindObject("contours");
  int lTotalConts = lContours->GetSize();
  double *lTX = new double[2]; lTX[0] = 110;  lTX[1] = 145; 
  double *lTY = new double[2]; lTY[0] = -0.5; lTY[1] = 2.5;
  TGraph *lFirst = new TGraph(2,lTX,lTY); lFirst->SetLineColor(kWhite);
  lFirst->GetXaxis()->SetRangeUser(110,148);
  lFirst->Draw("al"); lFirst->SetTitle("");
  lH->GetYaxis()->SetRangeUser(-0.5,2.5);
  lFirst->GetXaxis()->SetTitle("m_{H}[GeV]");
  lFirst->GetXaxis()->SetTitleOffset(1.0);
  lFirst->GetYaxis()->SetTitle("#mu_{best-fit}");
  lFirst->GetYaxis()->SetTitleOffset(1.2);

  lH->GetXaxis()->SetTitle("m_{H}[GeV]");
  lH->GetXaxis()->SetTitleOffset(1.0);
  lH->GetYaxis()->SetTitle("#mu_{best-fit}");
  lH->GetYaxis()->SetTitleOffset(1.2);

  lTX1[1] = lTX1[0]; lTX2[1] = lTX2[1]+0.001;
  TGraph *lSecond = new TGraph(1,lTX1,lTX2); lSecond->SetMarkerStyle(34); lSecond->SetMarkerSize(3.5);
  //lSecond->Draw("p");
  
  TLegend *lL = new TLegend(0.65,0.15,0.85,0.35); lL->SetBorderSize(0); lL->SetFillColor(0); lL->SetFillStyle(0); 
  for(i0 = 0; i0 < lTotalConts; i0++){
    pContLevel = (TList*)lContours->At(lTotalConts-1.-i0);
    // Get first graph from list on curves on this level
    std::vector<double> lX; 
    std::vector<double> lY; 
    pCurv = (TGraph*)pContLevel->First();
    for(int i1 = 0; i1 < pContLevel->GetSize(); i1++){
      for(int i2  = 0; i2 < pCurv->GetN(); i2++) {lX.push_back(pCurv->GetX()[i2]); lY.push_back(pCurv->GetY()[i2]);}
      //pCurv->GetPoint(0, x0, y0);
      pCurv->SetLineColor(kBlack);//kGreen+i0);
      pCCurv = (TGraph*)pCurv->Clone();
      if(i0 == 0) pCCurv->SetFillColor(0);
      if(i0 == 1) pCCurv->SetFillColor(0);
      //if(i0 == 1) pCCurv->SetLineStyle(kDashed);
      pCCurv->SetLineWidth(3);
      pCCurv->GetXaxis()->SetRangeUser(0,3.0);
      //if(i0 == 0) pCCurv->Draw("AL");
      //if(i0 != -10) pCCurv->Draw("LC");
      //l.DrawLatex(x0,y0,val);
      pCurv = (TGraph*)pContLevel->After(pCurv); // Get Next graph
    }
    TGraph *lTotal = new TGraph(lX.size(),&lX[0],&lY[0]);
    lTotal->SetLineWidth(3);
    lTotal->SetFillColor(kGreen+i0*2);
    lTotal->SetFillStyle(3001);
    //lTotal->Draw("lf");
    
    //if(i0 == 0) lTotal->Draw("alf");
    //if(i0 == 0) lTotal->Draw("alf");
    //for(int iX = 0; iX < lTotal->GetN(); iX++) cout << "===> " << lTotal->GetX()[iX] << " -- " << lTotal->GetY()[iX] << endl;
    //if(i0 != -10) lTotal->Draw("lfC");
    bool pSwitch = false;
    int  pSign   = -1.;   if(lTotal->GetX()[0] > lTotal->GetX()[1]) pSign = 1;
    double pXOld = lTotal->GetX()[lTotal->GetN()-1];
    std::vector<double> pXLeft;
    std::vector<double> pXRight;
    std::vector<double> pYLeft;
    std::vector<double> pYRight;
    for(int iX = 0; iX < lTotal->GetN(); iX++) { 
      double pX = lTotal->GetX()[iX];
      if(pSign*pX > pSign*pXOld ) {pSwitch = !pSwitch; pSign *= -1;}
      if(!pSwitch) {pXLeft.push_back(lTotal->GetX()[iX]); pYLeft.push_back(lTotal->GetY()[iX]); }
      if(pSwitch) {pXRight.push_back(lTotal->GetX()[iX]); pYRight.push_back(lTotal->GetY()[iX]); }
      pXOld = pX;
    }
    TGraph *lLeftTotal  = new TGraph(pXLeft.size() ,&pXLeft[0],&pYLeft[0]);
    TGraph *lRightTotal = new TGraph(pXRight.size(),&pXRight[0],&pYRight[0]);
    lLeftTotal->SetLineColor(kRed);
    lRightTotal->SetLineColor(kBlue);
    lLeftTotal->SetLineStyle(kDashed);
    lRightTotal->SetLineStyle(kDashed);
    //lLeftTotal->Draw("l");
    //lRightTotal->Draw("l");
    
    TGraphSmooth *lGS0 = new TGraphSmooth("normal");
    TGraphSmooth *lGS1 = new TGraphSmooth("normal");
    TGraph *lSmooth0 = lGS0->SmoothSuper(lRightTotal,"",0.,0.);
    TGraph *lSmooth1 = lGS1->SmoothSuper(lLeftTotal,"",0.,0.) ;
    lSmooth0->Draw("l");
    lSmooth1->Draw("l");
    std::vector<double> pXSmooth;
    std::vector<double> pYSmooth;
    std::vector<double> pXSmooth1;
    std::vector<double> pYSmooth1;
    cout << "==" << lSmooth0->GetN() << " -- " <<lSmooth1->GetN() << endl;
    for(int iX = 0; iX < lSmooth0->GetN(); iX++) {pXSmooth.push_back(lSmooth0->GetX()[iX]);                    pYSmooth.push_back(lSmooth0->GetY()[iX]);}
    for(int iX = 0; iX < lSmooth1->GetN(); iX++) {pXSmooth.push_back(lSmooth1->GetX()[lSmooth1->GetN()-iX-1]); pYSmooth.push_back(lSmooth1->GetY()[lSmooth1->GetN()-iX-1]);}

    for(int iX = 0; iX < lSmooth0->GetN(); iX++) {pXSmooth1.push_back(lSmooth0->GetX()[iX]);                    pYSmooth1.push_back(lSmooth0->GetY()[iX]);}
    for(int iX = 0; iX < lSmooth1->GetN(); iX++) {pXSmooth1.push_back(lSmooth1->GetX()[lSmooth1->GetN()-iX-1]); pYSmooth1.push_back(lSmooth1->GetY()[lSmooth1->GetN()-iX-1]);}
    //if(i0 == 1) {pXSmooth1.push_back(lSmooth1->GetX()[0]); pYSmooth1.push_back(lSmooth1->GetY()[0]);}
    TGraph *pSmoothShape  = new TGraph(pXSmooth.size() ,&pXSmooth [0],&pYSmooth [0]);
    TGraph *pSmoothShape1 = new TGraph(pXSmooth1.size(),&pXSmooth1[0],&pYSmooth1[0]);
    if(i0 == 1) {TLine  *lLine = new TLine(pXSmooth1[0],pYSmooth1[0],pXSmooth1[pXSmooth1.size()-1],pYSmooth1[pYSmooth1.size()-1]); lLine->Draw();}
    pSmoothShape1->SetLineColor(kBlack);
    pSmoothShape1->SetLineWidth(2);
    pSmoothShape->SetFillColor(kGreen+i0*2);
    pSmoothShape->SetFillStyle(3001);
    pSmoothShape->Draw("lf");
    pSmoothShape1->Draw("l");
    if(i0 == 0) lL->AddEntry(lTotal,"95% CL","lf");
    if(i0 == 1) lL->AddEntry(lTotal,"68% CL","lf");
  }
  lL->AddEntry(lSecond,"BestFit","p");
  lSecond->Draw("lp");
  lL->Draw();
  
  std::string masslabel = "m_{H}"; double mass = 125;
  TString label = TString::Format("%s = 135 GeV", masslabel.c_str());//, 125.);
  TPaveText* textlabel = new TPaveText(0.18, 0.81, 0.50, 0.90, "NDC");
  textlabel->SetBorderSize(   0 );
  textlabel->SetFillStyle (   0 );
  textlabel->SetTextAlign (  12 );
  textlabel->SetTextSize  (0.04 );
  textlabel->SetTextColor (   1 );
  textlabel->SetTextFont  (  62 );
  textlabel->AddText(label);
  //textlabel->Draw();
  CMSPrelim("Preliminary, H#rightarrow#tau#tau,L = 24.3 fb^{-1}", "", 0.145, 0.835);
  gPad->RedrawAxis();
  lCan->Update();

  lCan->SaveAs("cmb+_muvmass.png");
  lCan->SaveAs("cmb+_muvmass.pdf");
  lCan->SaveAs("cmb+_muvmass.eps");
}
Esempio n. 21
0
///
/// Make a plot out of a 1D histogram holding a 1-CL curve.
/// The strategy is to always convert the 1-CL histogram (hCL) into
/// a TGraph. This way we can add known points (solutions, points
/// at end of scan range) and also have a filled area without line
/// smoothing. This is not possible with histograms due to a Root bug.
///
/// The function draws the TGraphs, and returns a pointer to the
/// TGraph object that can be used in the TLegend.
///
/// Markers are plotted if the method name of the scanner is "Plugin" or "BergerBoos" or "DatasetsPlugin".
/// One can plot a line instead of points even for the Plugin method by
/// using setPluginMarkers().
///
/// For the angle variables, a new axis is painted that is in Deg.
///
/// \param s The scanner to plot.
/// \param first
/// \param last
/// \param filled
///
TGraph* OneMinusClPlot::scan1dPlot(MethodAbsScan* s, bool first, bool last, bool filled, int CLsType)
{
	if ( arg->debug ){
		cout << "OneMinusClPlot::scan1dPlot() : plotting ";
		cout << s->getName() << " (" << s->getMethodName() << ")" << endl;
	}
	if ( m_mainCanvas==0 ){
		m_mainCanvas = newNoWarnTCanvas(name+getUniqueRootName(), title, 800, 600);
	}
	m_mainCanvas->cd();
	bool plotPoints = ( s->getMethodName()=="Plugin" || s->getMethodName()=="BergerBoos" || s->getMethodName()=="DatasetsPlugin" ) && plotPluginMarkers;
	TH1F *hCL = (TH1F*)s->getHCL()->Clone(getUniqueRootName());
	if (CLsType==1) hCL = (TH1F*)s->getHCLs()->Clone(getUniqueRootName());
  else if (CLsType==2) hCL = (TH1F*)s->getHCLsFreq()->Clone(getUniqueRootName());
	// fix inf and nan entries
	for ( int i=1; i<=s->getHCL()->GetNbinsX(); i++ ){
		if ( s->getHCL()->GetBinContent(i)!=s->getHCL()->GetBinContent(i)
				|| std::isinf(s->getHCL()->GetBinContent(i)) ) s->getHCL()->SetBinContent(i, 0.0);
	}

	// remove errors the hard way, else root ALWAYS plots them
	if ( !plotPoints ) hCL = histHardCopy(hCL, true, true);

	// disable any statistics box
	hCL->SetStats(0);

	// Convert the histogram into a TGraph so we can add the solution.
	// Also, the lf2 drawing option is broken in latest root versions.
	TGraph *g;
	if ( plotPoints ) g = new TGraphErrors(hCL->GetNbinsX());
	else              g = new TGraph(hCL->GetNbinsX());
	g->SetName(getUniqueRootName());
	for ( int i=0; i<hCL->GetNbinsX(); i++ ){
		g->SetPoint(i, hCL->GetBinCenter(i+1), hCL->GetBinContent(i+1));
		if ( plotPoints ) ((TGraphErrors*)g)->SetPointError(i, 0.0, hCL->GetBinError(i+1));
	}

	// add solution
	if ( ! s->getSolutions().empty() ){
		TGraphTools t;
		TGraph *gNew = t.addPointToGraphAtFirstMatchingX(g, s->getScanVar1Solution(0), 1.0);
		delete g;
		g = gNew;
	}

	// // set last point to the same p-value as first point by hand
	// // some angle plots sometimes don't manage to do it by themselves...
	// if ( arg->isQuickhack(XX) )
	// {
	//   Double_t pointx0, pointy0, err0;
	//   Double_t pointx1, pointy1, err1;
	//   g->GetPoint(0, pointx0, pointy0);
	//   g->GetPoint(g->GetN()-1, pointx1, pointy1);
	//   g->SetPoint(g->GetN()-1, pointx1, pointy0);
	//   if ( plotPoints ) err0 = ((TGraphErrors*)g)->GetErrorY(0);
	//   if ( plotPoints ) ((TGraphErrors*)g)->SetPointError(g->GetN()-1, 0.0, err0);
	// }

	// add end points of scan range
	if ( !plotPoints )
	{
		Double_t pointx0, pointy0;
		TGraph *gNew = new TGraph(g->GetN()+4);
		gNew->SetName(getUniqueRootName());
		for ( int i=0; i<g->GetN(); i++)
		{
			g->GetPoint(i, pointx0, pointy0);
			gNew->SetPoint(i+2, pointx0, pointy0);
		}

		// add origin
		gNew->SetPoint(0, hCL->GetXaxis()->GetXmin(), 0);

		// add a point at first y height but at x=origin.
		g->GetPoint(0, pointx0, pointy0);
		gNew->SetPoint(1, hCL->GetXaxis()->GetXmin(), pointy0);

		// add a point at last y height but at x=xmax.
		g->GetPoint(g->GetN()-1, pointx0, pointy0);
		gNew->SetPoint(gNew->GetN()-2, hCL->GetXaxis()->GetXmax(), pointy0);

		// add a point at xmax, 0
		gNew->SetPoint(gNew->GetN()-1, hCL->GetXaxis()->GetXmax(), 0);
		g = gNew;
	}

	int color = s->getLineColor();
	if(CLsType>0 && s->getMethodName().Contains("Plugin") && !arg->plotpluginonly) {
    if (CLsType==1) color = kBlue-7;
    else if (CLsType==2) color = kBlue+2;
  }
	else if(CLsType>0) {
    if (CLsType==1) color = s->getLineColor() - 5;
    if (CLsType==2) color = s->getLineColor() - 4;
  }
	g->SetLineColor(color);

	if ( filled ){
		g->SetLineWidth(2);
    double alpha = arg->isQuickhack(12) ? 0.4 : 1.;
    if ( arg->isQuickhack(24) ) alpha = 0.;
		g->SetFillColorAlpha(color,alpha);
		g->SetLineStyle(1);
    g->SetFillStyle( s->getFillStyle() );
	}
	else{
		g->SetLineWidth(2);
		g->SetLineStyle(s->getLineStyle());
    if ( last && arg->isQuickhack(25) ) g->SetLineWidth(3);
	}

	if ( plotPoints ){
		g->SetLineWidth(1);
		g->SetMarkerColor(color);
		g->SetMarkerStyle(8);
		g->SetMarkerSize(0.6);
		if(CLsType==1) {
			g->SetMarkerStyle(33);
			g->SetMarkerSize(1);
		}
		if(CLsType==2) {
			g->SetMarkerStyle(21);
		}
	}

	// build a histogram which holds the axes
	float min = arg->scanrangeMin == arg->scanrangeMax ? hCL->GetXaxis()->GetXmin() : arg->scanrangeMin;
	float max = arg->scanrangeMin == arg->scanrangeMax ? hCL->GetXaxis()->GetXmax() : arg->scanrangeMax;
	TH1F *haxes = new TH1F("haxes"+getUniqueRootName(), "", 100, min, max);
	haxes->SetStats(0);
	haxes->GetXaxis()->SetTitle(s->getScanVar1()->GetTitle());
	haxes->GetYaxis()->SetTitle("1-CL");
	haxes->GetXaxis()->SetLabelFont(font);
	haxes->GetYaxis()->SetLabelFont(font);
	haxes->GetXaxis()->SetTitleFont(font);
	haxes->GetYaxis()->SetTitleFont(font);
	haxes->GetXaxis()->SetTitleOffset(0.9);
	haxes->GetYaxis()->SetTitleOffset(0.85);
	haxes->GetXaxis()->SetLabelSize(labelsize);
	haxes->GetYaxis()->SetLabelSize(labelsize);
	haxes->GetXaxis()->SetTitleSize(titlesize);
	haxes->GetYaxis()->SetTitleSize(titlesize);
	int xndiv = arg->ndiv==-1 ? 407 : abs(arg->ndiv);
	bool optimizeNdiv = arg->ndiv<0 ? true : false;
	haxes->GetXaxis()->SetNdivisions(xndiv, optimizeNdiv);
	haxes->GetYaxis()->SetNdivisions(407, true);

  // plot y range
  float plotYMax;
  float plotYMin;
  if ( plotLegend && !arg->isQuickhack(22) ) {
    if ( arg->plotlog ) { plotYMin = 1.e-3; plotYMax = 10.; }
    else                { plotYMin = 0.0  ; plotYMax = 1.3; }
  }
  else {
    if ( arg->plotlog ) { plotYMin = 1.e-3; plotYMax = 1.0; }
    else                { plotYMin = 0.0  ; plotYMax = 1.0; }
  }
  // change if passed as option
	plotYMin = arg->plotymin > 0. ? arg->plotymin : plotYMin;
  plotYMax = arg->plotymax > 0. ? arg->plotymax : plotYMax;

  haxes->GetYaxis()->SetRangeUser( plotYMin, plotYMax );
	haxes->Draw("axissame");
	g->SetHistogram(haxes);

	TString drawOption = "";
	if ( plotPoints )   drawOption += " pe";
	else if ( filled )  drawOption += " F";
	else                drawOption += " L";
	if ( first )        drawOption += " A";
	g->Draw(drawOption);
  //if ( drawOption.Contains("F") ) ((TGraph*)g->Clone())->Draw("L");

	gPad->Update();
	float ymin = gPad->GetUymin();
	float ymax = gPad->GetUymax();
	float xmin = gPad->GetUxmin();
	float xmax = gPad->GetUxmax();

	// for the angles, draw a new axis in units of degrees
	if ( isAngle(s->getScanVar1()) ){
		haxes->GetXaxis()->SetTitle(s->getScanVar1()->GetTitle() + TString(" [#circ]"));
		haxes->GetXaxis()->SetNdivisions(0);  // disable old axis
		if ( last ){
			// new top axis
			TString chopt = "-U"; // - = downward ticks, U = unlabeled, http://root.cern.ch/root/html534/TGaxis.html
			if ( !optimizeNdiv ) chopt += "N"; // n = no bin optimization
			TGaxis *axist = new TGaxis(xmin, 1, xmax, 1, RadToDeg(xmin), RadToDeg(xmax), xndiv, chopt);
			axist->SetName("axist");
			axist->Draw();

			// new bottom axis
			float axisbMin = RadToDeg(xmin);
			float axisbMax = RadToDeg(xmax);
			if ( arg->isQuickhack(3) ){ ///< see documentation of --qh option in OptParser.cpp
				axisbMin += 180.;
				axisbMax += 180.;
			}
			chopt = ""; // - = downward ticks, U = unlabeled, http://root.cern.ch/root/html534/TGaxis.html
			if ( !optimizeNdiv ) chopt += "N"; // n = no bin optimization
			TGaxis *axisb = new TGaxis(xmin, ymin, xmax, ymin, axisbMin, axisbMax, xndiv, chopt);
			axisb->SetName("axisb");
			axisb->SetLabelFont(font);
			axisb->SetLabelSize(labelsize);
			axisb->Draw();
		}
	}
	else
	{
		if ( last ){
			// add top axis
			TString chopt = "-U"; // - = downward ticks, U = unlabeled, http://root.cern.ch/root/html534/TGaxis.html
			if ( !optimizeNdiv ) chopt += "N"; // n = no bin optimization
			TGaxis *axist = new TGaxis(xmin, 1.0, xmax, 1.0, xmin, xmax, xndiv, chopt);
			axist->SetName("axist");
			axist->SetLineWidth(1);
			axist->Draw();
		}
	}

	if ( last )
	{
		// add right axis
		TGaxis *axisr = 0;
		if ( arg->plotlog ){
			float f3min = 1e-3;
			float f3max = (plotLegend && !arg->isQuickhack(22)) ? 10. : 1.;
			TF1 *f3 = new TF1("f3","log10(x)",f3min,f3max);
			axisr = new TGaxis(xmax, f3min, xmax, f3max, "f3", 510, "G+");
		}
		else{
			axisr = new TGaxis(xmax, ymin, xmax, ymax, 0, (plotLegend && !arg->isQuickhack(22)) ? 1.3 : 1.0, 407, "+");
		}
		axisr->SetLabelSize(0);
		axisr->SetLineWidth(1);
		axisr->SetName("axisr");
		axisr->SetLabelColor(kWhite);
		axisr->SetTitleColor(kWhite);
		axisr->Draw();

		// redraw right axis as well because the 1-CL graph can cover the old one
		haxes->Draw("axissame");
	}

	return g;
}
Esempio n. 22
0
// Function for the computation of channeling efficiency at various incoming angle
Int_t AnalyseChannelingEfficiency(TTree *fTree,Float_t fChannelingMinimum = 35., Float_t fChannelingMaximum = 70.){
    //**//Channeling Gaussian Fit Function
    TF1 *vChanneling = new TF1("vChanneling","gaus",fChannelingMinimum,fChannelingMaximum);
    vChanneling->SetParNames("Const","Mean","Sigma");
    vChanneling->SetLineColor(4);
    vChanneling->SetLineStyle(2);

    TH2D *hChannelingPlot = new TH2D("hChannelingPlot","Deflection Angle vs. Incoming Angle;Horizontal Incoming Angle [#murad];Horizontal Deflection Angle [#murad]",21,-10.5,10.5,256,-127.5,128.5);
    
    TH1F *hChannelingEfficiency = new TH1F("hChannelingEfficiency","G4Channeling;Horizontal Incoming Angle [#murad];Efficiency [%]",21,-10.5,10.5);

    fTree->Draw("-(angXout-angXin):-angXin>>hChannelingPlot");
    
    Double_t vNormalizationToAmorphous = 0.965; // Normalization for channeling efficiency, see PRSTAB 11, 063501 (2008)
    
    for(int i=2;i<=21;i++){
        TH1D* h1 = hChannelingPlot->ProjectionY("h1",i,i);
        h1->Fit(vChanneling,"QR");
        Double_t *vChannelingParameters;
        vChannelingParameters = vChanneling->GetParameters();
        hChannelingEfficiency->SetBinContent(i,ComputeEfficiency(h1,vChannelingParameters)/vNormalizationToAmorphous);
        h1->Delete();
    }
    hChannelingEfficiency->SetLineColor(3);
    hChannelingEfficiency->SetLineStyle(4);
    hChannelingEfficiency->SetMarkerColor(3);
    hChannelingEfficiency->SetFillStyle(0);
    hChannelingEfficiency->SetMarkerStyle(20);
    hChannelingEfficiency->Draw("PL");

    TGraph* gRoughExperimentalData = new TGraph(11);
    gRoughExperimentalData->SetPoint(	0	,	-10	,	20	);
    gRoughExperimentalData->SetPoint(	1	,	-8	,	38	);
    gRoughExperimentalData->SetPoint(	2	,	-6	,	56	);
    gRoughExperimentalData->SetPoint(	3	,	-4	,	72	);
    gRoughExperimentalData->SetPoint(	4	,	-2	,	80	);
    gRoughExperimentalData->SetPoint(	5	,	0	,	84	);
    gRoughExperimentalData->SetPoint(	6	,	2	,	82	);
    gRoughExperimentalData->SetPoint(	7	,	4	,	78	);
    gRoughExperimentalData->SetPoint(	8	,	6	,	66	);
    gRoughExperimentalData->SetPoint(	9	,	8	,	52	);
    gRoughExperimentalData->SetPoint(	10	,	10	,	37	);

    gRoughExperimentalData->SetLineColor(4);
    gRoughExperimentalData->SetLineStyle(3);
    gRoughExperimentalData->SetFillStyle(0);
    gRoughExperimentalData->SetFillColor(0);
    gRoughExperimentalData->SetMarkerColor(4);
    gRoughExperimentalData->SetMarkerStyle(21);
    gRoughExperimentalData->SetTitle("Phys. Lett. B 680, 129");

    gRoughExperimentalData->Draw("sameCP");

    TLegend *aLegend = new TLegend(0.30,0.15,0.55,0.3);
    aLegend->AddEntry(hChannelingEfficiency);
    aLegend->AddEntry(gRoughExperimentalData);
    aLegend->SetFillStyle(0);
    aLegend->SetLineColor(0);
    aLegend->Draw();

    return 0;
}
Esempio n. 23
0
//Draw an error envelop from a TGraphAsymmErrors
void drawGraphEnv(TGraphAsymmErrors* g, float scale = 1, bool doAxis = false,
                  int linestyle = 1, int linewidth = 2, int linecolor = 4,
                  bool fill = false,
                  TH1** ppGl = 0, TH1** ppGh = 0){
  //                  const char* opth = "", const char* optl = ""){
  char buffer[256];
  int n = g->GetN();
  double* x = new double[n+2];
  double* yh = new double[n+2];
  double* yl = new double[n+2];

  for(int i = 0; i < n; ++i){
    x[i+1]  = g->GetX()[i];
    yh[i+1] = g->GetY()[i] + g->GetEYhigh()[i] * scale;
    yl[i+1] = g->GetY()[i] - g->GetEYlow()[i] * scale;
  }

  x[0] = g->GetX()[0] - g->GetEXlow()[0];
  yl[0] = yl[1] - (yl[2]-yl[1])/(x[2]-x[1])*g->GetEXlow()[0];
  yh[0] = yh[1] - (yh[2]-yh[1])/(x[2]-x[1])*g->GetEXlow()[0];

  x[n+1] = g->GetX()[n-1] + g->GetEXhigh()[n-1];
  yl[n+1] = yl[n] + (yl[n]-yl[n-1])/(x[n]-x[n-1])*g->GetEXhigh()[n-1];
  yh[n+1] = yh[n] + (yh[n]-yh[n-1])/(x[n]-x[n-1])*g->GetEXhigh()[n-1];

  TGraph* gl = new TGraph(n+2, x, yl);
  gl->SetTitle(g->GetTitle());
  TGraph* gh = new TGraph(n+2, x, yh);
  gh->SetTitle(g->GetTitle());
  const char* opt = "l,same";
  
  sprintf(buffer, "%s_eh", g->GetName());
  gh->SetName(buffer);
  
  sprintf(buffer, "%s_el", g->GetName());
  gl->SetName(buffer);

  if(doAxis){
    g->Draw("AP");
    TH1* h = g->GetHistogram();
    gPad->Clear();
    h->Draw();
  }

  if(fill){
    gl->SetFillStyle(linestyle);
    gl->SetFillColor(linecolor);
    gl->SetLineColor(linecolor);
  
    gh->SetFillStyle(linestyle);
    gh->SetFillColor(linecolor);
    gh->SetLineColor(linecolor);
  } else{
    gl->SetLineStyle(linestyle);
    gl->SetLineWidth(linewidth);
    gl->SetLineColor(linecolor);
    
    gh->SetLineStyle(linestyle);
    gh->SetLineWidth(linewidth);
    gh->SetLineColor(linecolor);
  }
  
  gh->Draw(opt);
  gl->Draw(opt);

  if(ppGh) *ppGh = gh;
  if(ppGl) *ppGl = gl;
}