Beispiel #1
0
  /** 
   * Create ratios to other data 
   * 
   * @param ib      Bin number  
   * @param res     Result
   * @param alice   ALICE result if any
   * @param cms     CMS result if any
   * @param all     Stack to add ratio to 
   */
  void Ratio2Stack(Int_t ib, TH1* res, TGraph* alice, TGraph* cms, THStack* all)
  {
    if (!all || !res || !(alice || cms)) return;

    Int_t        off  = 5*ib;
    TGraph*      gs[] = { (alice ? alice : cms), (alice ? cms : 0), 0 };
    TGraph**     pg   = gs;
    while (*pg) { 
      TGraph*     g = *pg;
      const char* n = (g == alice ? "ALICE" : "CMS");

      TH1*    r = static_cast<TH1*>(res->Clone(Form("ratio%s", n)));
      TString tit(r->GetTitle());
      tit.ReplaceAll("Corrected", Form("Ratio to %s", n));
      r->SetTitle(tit);
      r->SetMarkerColor(g->GetMarkerColor());
      r->SetLineColor(g->GetLineColor());

      TObject* tst = r->FindObject("legend");
      if (tst) r->GetListOfFunctions()->Remove(tst);

      for (Int_t i = 1; i <= r->GetNbinsX(); i++) {
	Double_t c = r->GetBinContent(i);
	Double_t e = r->GetBinError(i);
	Double_t o = g->Eval(r->GetBinCenter(i));
	if (o < 1e-12) { 
	  r->SetBinContent(i, 0);
	  r->SetBinError(i, 0);
	  continue;
	}
	r->SetBinContent(i, (c - o) / o + off);
	r->SetBinError(i, e / o);
      }
      all->Add(r);
      pg++;
    }
    TLegend* leg = StackLegend(all);
    if (!leg) return;
      
    TString   txt      = res->GetTitle();
    txt.ReplaceAll("Corrected P(#it{N}_{ch}) in ", "");
    if      (ib == 0) txt.Append(" "); // (#times1)");
    // else if (ib == 1) txt.Append(" (#times10)");
    else              txt.Append(Form(" (+%d)", off));

    TObject* dummy = 0;
    TLegendEntry* e = leg->AddEntry(dummy, txt, "p");
    e->SetMarkerStyle(res->GetMarkerStyle());
    e->SetMarkerSize(res->GetMarkerSize());
    e->SetMarkerColor(kBlack);
    e->SetFillColor(0);
    e->SetFillStyle(0);
    e->SetLineColor(kBlack);
  }
Beispiel #2
0
/** 
 * Draw final plot for QM2011
 * 
 * @param max 
 * 
 * @ingroup pwglf_forward_scripts
 */
void
dndeta_final(Double_t max=6)
{
  gStyle->SetOptTitle(0);
  gStyle->SetOptFit(0);
  gStyle->SetTitleFont(132, "xyz");
  gStyle->SetTitleSize(0.1, "xyz");
  gStyle->SetTitleOffset(0.4, "y");
  gStyle->SetTitleOffset(0.8, "x");
  gStyle->SetLabelFont(132, "xyz");
  gStyle->SetLabelSize(0.08, "xyz");
  gStyle->SetNdivisions(212, "x");
  gStyle->SetNdivisions(208, "y");
  gStyle->SetTextFont(132);
  gStyle->SetPadColor(0);
  gStyle->SetPadBorderMode(0);
  // gStyle->SetFillColor(0);
  // gStyle->SetFillStyle(0);
  
  TCanvas* c = new TCanvas("c", "c", 900, 900);
  c->SetFillColor(0);
  c->SetFillStyle(0);
  c->SetBorderSize(0);
  c->SetBorderMode(0);
  c->SetRightMargin(0.02);
  c->SetTopMargin(0.02);
  c->SetBottomMargin(0.15);
  c->Divide(1,3,0,0);
  
  // --- INEL --------------------------------------------------------
  TVirtualPad* p = c->cd(1);
  p->SetGridx();
  p->SetRightMargin(.01);
  THStack* inel     = new THStack("inel", "INEL");
  TLatex*  inelT    = new TLatex(1-p->GetRightMargin()-.01, 
				 1-p->GetTopMargin()-.01, 
				 "INEL");
  inelT->SetNDC();
  inelT->SetTextAlign(33);
  inelT->SetTextSize(0.12);
  TLegend* inelL    = new TLegend(.3, .02, .8, .4);
  inelL->SetBorderSize(0);
  inelL->SetNColumns(2);
  inelL->SetFillColor(0);
  inelL->SetFillStyle(0);
  TLegendEntry* e = inelL->AddEntry("d1", "Forward", "lp");
  e->SetMarkerColor(kRed+2);
  e->SetMarkerStyle(29);
  e = inelL->AddEntry("d2", "Central", "lp");
  e->SetMarkerColor(kMagenta+2);    
  e->SetMarkerStyle(29);
  e = inelL->AddEntry("d3", "Data", "lp");
  e->SetMarkerStyle(29);
  e = inelL->AddEntry("d4", "Mirrored data", "lp");
  e->SetMarkerStyle(30);
  e = inelL->AddEntry("d5", "Systematic error", "f");
  e->SetFillColor(kGray); 
  e->SetLineColor(kGray);
  e->SetLineWidth(0);
  e->SetFillStyle(3001);
  
  gROOT->LoadMacro("export_pp_0900GeV_INEL_m10p10cm_000100000ev.C");
  export_pp_0900GeV_INEL_m10p10cm_000100000ev(inel, inelL, 20);
  export_pp_0900GeV_INEL_m10p10cm_000100000ev(inel, inelL, 21);
  export_pp_0900GeV_INEL_m10p10cm_000100000ev(inel, inelL, 22);
  inel->Draw("nostack e1");
  inel->GetHistogram()->SetYTitle("#frac{1}{N}#frac{dN_{ch}}{d#eta}");
  inel->GetHistogram()->SetXTitle("#eta");
  inel->GetHistogram()->GetYaxis()->SetDecimals();
  inelL->Draw();
  inelT->Draw();

  // --- INEL>0 ------------------------------------------------------
  p = c->cd(2);
  p->SetGridx();
  p->SetRightMargin(.01);
  THStack* inelgt0     = new THStack("inelgt0", "INEL>0");
  TLatex*  inelgt0T    = new TLatex(1-p->GetRightMargin()-.01, 
				    1-p->GetTopMargin()-.01, 
				    "INEL>0");
  inelgt0T->SetNDC();
  inelgt0T->SetTextAlign(33);
  inelgt0T->SetTextSize(0.12);
  gROOT->LoadMacro("export_pp_0900GeV_INEL_m10p10cm_000100000ev.C");
  export_pp_0900GeV_INEL_m10p10cm_000100000ev(inelgt0, 0, 20);
  export_pp_0900GeV_INEL_m10p10cm_000100000ev(inelgt0, 0, 21);
  export_pp_0900GeV_INEL_m10p10cm_000100000ev(inelgt0, 0, 22);
  inelgt0->Draw("nostack e1");
  inelgt0->GetHistogram()->SetXTitle("#eta");
  inelgt0->GetHistogram()->GetYaxis()->SetDecimals();
  inelgt0T->Draw();

  // --- NSD ---------------------------------------------------------
  p = c->cd(3);
  p->SetGridx();
  p->SetRightMargin(.01);
  THStack* nsd     = new THStack("nsd", "NSD");
  TLatex*  nsdT    = new TLatex(1-p->GetRightMargin()-.01, 
				1-p->GetTopMargin()-.01, 
				"NSD");
  nsdT->SetNDC();
  nsdT->SetTextAlign(33);
  nsdT->SetTextSize(0.12);
  gROOT->LoadMacro("export_pp_0900GeV_NSD_m10p10cm_000100000ev.C");
  export_pp_0900GeV_NSD_m10p10cm_000100000ev(nsd, 0, 20);
  export_pp_0900GeV_NSD_m10p10cm_000100000ev(nsd, 0, 21);
  export_pp_0900GeV_NSD_m10p10cm_000100000ev(nsd, 0, 22);
  nsd->Draw("nostack e1");
  nsd->GetHistogram()->SetXTitle("#eta");
  nsd->GetHistogram()->GetYaxis()->SetDecimals();
  nsdT->Draw();

  c->cd();
  c->SaveAs("dndeta_final.png");
}
Beispiel #3
0
TH1* GetCentK(TDirectory* top, Double_t c1, Double_t c2, Int_t s,
	      TLegend* l)
{
  TString dname; dname.Form("cent%06.2f_%06.2f", c1, c2);
  dname.ReplaceAll(".", "d");
  TDirectory* d = top->GetDirectory(dname);
  if (!d) {
    Warning("GetCetnK", "Directory %s not found in %s",
	    dname.Data(), top->GetName());
    return;
  }

  TDirectory* det = d->GetDirectory("details");
  if (!det) {
    Warning("GetCetnK", "Directory details not found in %s",
	    d->GetName());
    d->ls();
    return;
  }

  TObject* o = det->Get("scalar");
  if (!o) {
    Warning("GetCetnK", "Object scalar not found in %s",
	    det->GetName());
    return;
  }

  if (!o->IsA()->InheritsFrom(TH1::Class())) {
    Warning("GetCetnK", "Object %s is not a TH1, but a %s",
	    o->GetName(), o->ClassName());
    return;
  }
  TH1* h = static_cast<TH1*>(o->Clone());
  Color_t col = cc[(s-1)%10];
  h->SetLineColor(col);
  h->SetMarkerColor(col);
  h->SetFillColor(col);
  h->SetFillStyle(1001);
  // h->SetTitle(Form("%5.2f-%5.2f%% #times %d", c1, c2, s));
  h->SetTitle(Form("%2.0f-%2.0f%% + %d", c1, c2, s-1));
  TF1* f = new TF1("", "[0]",-2.2,2.2);
  f->SetParameter(0,s-1);
  f->SetLineColor(col);
  f->SetLineStyle(7);
  f->SetLineWidth(1);
  // h->Scale(s);
  h->Add(f);
  h->GetListOfFunctions()->Add(f);
  f->SetParameter(0,s);
  for (Int_t i = 1; i <= h->GetNbinsX(); i++) {
    if (TMath::Abs(h->GetBinCenter(i)) > 2) {
      h->SetBinContent(i,0);
      h->SetBinError(i,0);
    }
  }
  
  TLegendEntry* e = l->AddEntry(h, h->GetTitle(), "f");
  e->SetFillColor(col);
  e->SetFillStyle(1001);
  e->SetLineColor(col);

  return h;
}
Beispiel #4
0
  /** 
   * Add the bin histograms to our summary stacks 
   * 
   * @param bin       Bin stack
   * @param i         Current off-set in the stacks 
   * @param measured  All measured @f$ P(N_{ch})@f$ 
   * @param truth     All MC truth @f$ P(N_{ch})@f$ 
   * @param accepted  All MC accepted @f$ P(N_{ch})@f$ 
   * @param unfolded  All unfolded @f$ P(N_{ch})@f$ 
   * @param corrected All corrected @f$ P(N_{ch})@f$ 
   * @param result    The result in this bin
   */
  void Bin2Stack(const THStack* bin, Int_t i, 
		 THStack* measured, 
		 THStack* truth, 
		 THStack* accepted, 
		 THStack* unfolded,
		 THStack* corrected,
		 TH1*&    result)
  {
    Int_t open, closed;
    Double_t factor; 
    Float_t  size;
    BinAttributes(i, open, closed, size, factor);

    TIter next(bin->GetHists());
    TH1*  h = 0;
    while ((h = static_cast<TH1*>(next()))) {
      THStack* tmp = 0;
      Int_t    col = h->GetMarkerColor();
      Int_t    sty = 0;
      switch (col) { 
      case kColorMeasured:  tmp = measured;   sty = closed;  break;
      case kColorTruth:     tmp = truth;      sty = open;    break;
      case kColorAccepted:  tmp = accepted;   sty = open;    break;
      case kColorUnfolded:  tmp = unfolded;   sty = closed;  break;
      case kColorCorrected: tmp = corrected;  sty = closed;  break;
      default: continue; 
      }
      // Now clone, and add to the appropriate stack 
      TH1* cln = static_cast<TH1*>(h->Clone(h->GetName()));
      cln->SetDirectory(0);
      cln->SetMarkerStyle(sty);
      cln->SetMarkerSize(size);
      cln->Scale(factor); // Scale by 10^i
      if (col == kColorCorrected) result = cln;

      // Make sure we do not get the old legend 
      TObject* tst = cln->FindObject("legend");
      if (tst) cln->GetListOfFunctions()->Remove(tst);

      tmp->Add(cln, next.GetOption());
    }
    
    // Add entries to our stacks 
    TString   txt      = bin->GetTitle();
    if      (i == 0) txt.Append(" (#times1)");
    else if (i == 1) txt.Append(" (#times10)");
    else             txt.Append(Form(" (#times10^{%d})", i));
    THStack*  stacks[] = { measured, truth, accepted, unfolded, corrected, 0 };
    THStack** pstack   = stacks;
    while (*pstack) { 
      TLegend* leg = StackLegend(*pstack);
      pstack++;
      if (!leg) continue;
      
      TObject* dummy = 0;
      TLegendEntry* e = leg->AddEntry(dummy, txt, "p");
      e->SetMarkerStyle(closed);
      e->SetMarkerSize(1.2*size);
      e->SetMarkerColor(kBlack);
      e->SetFillColor(0);
      e->SetFillStyle(0);
      e->SetLineColor(kBlack);
    }
  }
void makePlots_Combinations(short makePlots=0) {

	TString dirPlots("/home/rossin/Dropbox/TT/Work/figures_stubCleaning/");

	TFile fIn ("/home/rossin/Dropbox/TT/Work/figures_stubCleaning/stubCleaning_Neutrino_PU140_sf1_nz4_pt3_5oo6_14k.root"); TString sLogic ("5oo6"); TString pName("Neutrino_PU140_sf1_nz4_pt3_5oo6_14k"); TString pTitle(" PU140 SF=1 Nz=4 Pt>3 GeV/c");
	TFile fIn2("/home/rossin/Dropbox/TT/Work/figures_stubCleaning/stubCleaning_Neutrino_PU140_sf1_nz4_pt3_6oo6_14k.root"); TString sLogic2("6oo6"); //TString pName("Neutrino_PU140_sf1_nz4_pt3_6oo6_14k"); TString pTitle(" PU140 SF=1 Nz=4 Pt>3 GeV/c");
	TFile fInOR("/home/rossin/Dropbox/TT/Work/figures_stubCleaning/stubCleaning_Neutrino_PU140_sf1_nz4_pt3_5oo6_14k_OverlapRemoved.root");

//	TFile fIn("/home/rossin/Dropbox/TT/Work/figures_stubCleaning/stubCleaning_Neutrino_PU200_sf1_nz4_pt3_5oo6_4k.root"); TString sLogic("5oo6"); TString pName("Neutrino_PU200_sf1_nz4_pt3_5oo6_4k"); TString pTitle(" PU200 SF=1 Nz=4 Pt>3 GeV/c");
//	TFile fInOR("/home/rossin/Dropbox/TT/Work/figures_stubCleaning/stubCleaning_Neutrino_PU200_sf1_nz4_pt3_5oo6_4k_OverlapRemoved.root");

//	TFile fIn("/home/rossin/Dropbox/TT/Work/figures_stubCleaning/stubCleaning_Neutrino_PU250_sf1_nz4_pt3_5oo6_4k.root"); TString sLogic("5oo6"); TString pName("Neutrino_PU250_sf1_nz4_pt3_5oo6_4k"); TString pTitle(" PU250 SF=1 Nz=4 Pt>3 GeV/c");
//	TFile fInOR("/home/rossin/Dropbox/TT/Work/figures_stubCleaning/stubCleaning_Neutrino_PU250_sf1_nz4_pt3_5oo6_4k_OverlapRemoved.root");


	TH1* h1stubsInLayer  [6][2];
	TH1* h1stubsInLayerOR[6][2];
	TH1* h1RoadPerEvent  [2];
	TH1* h1RoadPerEventOR[2];
	TH1* h1CombPerRoad   [2];
	TH1* h1CombPerRoadOR [2];
	TH1* h1CombPerEvent  [2];
	TH1* h1CombPerEventOR[2];

	TH1* h1RoadPerEvent6oo6  [2];
	TH1* h1CombPerRoad6oo6   [2];
	TH1* h1CombPerEvent6oo6  [2];

    TString sClean[2] = {TString(""), TString("_Cleaned")};

    for (unsigned short iLay=0; iLay<6; ++iLay) {
	    TList* tl = fIn.GetListOfKeys();
	    TIter next(tl);
	    TObject *obj;
	    char cc[20];
	    sprintf(cc,"_%d",iLay);
	    TString hString("h1stubsInLayer__"+sLogic+TString(cc));
	    while ((obj=next())) {
	    	TString hName(obj->GetName());
	    	if (hName==hString) {
	    		for (unsigned short iClean = 0; iClean < 2; ++iClean) {
	    		    char cc2[100];
	    			h1stubsInLayer  [iLay][iClean] = (TH1*) fIn  .Get(hName+sClean[iClean]);
	    			sprintf(cc2,"L%d - ",iLay+5);
	    			h1stubsInLayer  [iLay][iClean]->SetTitle(TString(cc2)+sLogic+pTitle);
	    			h1stubsInLayerOR[iLay][iClean] = (TH1*) fInOR.Get(hName+sClean[iClean]);
	    			if (h1stubsInLayer  [iLay][iClean]==0) {
		    			std::cout << "ERROR. " << hName+sClean[iClean] << " not loaded." << std::endl;
		    			return;
	    			}
	    			if (h1stubsInLayerOR[iLay][iClean]==0) {
		    			std::cout << "ERROR. " << hName+sClean[iClean] << " overlap removed not loaded." << std::endl;
		    			return;
	    			}
	    		}
	    	}
	    }
//	    std::cout << h1stubsInLayer  [iLay][0] << "\t" << h1stubsInLayer  [iLay][1] << "\t" << h1stubsInLayerOR[iLay][0] << "\t" << h1stubsInLayerOR[iLay][1] << std::endl;
	}

    for (unsigned short iClean = 0; iClean < 2; ++iClean) {
    	TString hString("h1RoadPerEvent_"+sLogic);
    	h1RoadPerEvent  [iClean] = (TH1*) fIn  .Get(hString+sClean[iClean]);
    	h1RoadPerEventOR[iClean] = (TH1*) fInOR.Get(hString+sClean[iClean]);
    	hString=TString("h1CombPerRoad_")+sLogic;
    	h1CombPerRoad   [iClean] = (TH1*) fIn  .Get(hString+sClean[iClean]);
    	h1CombPerRoadOR [iClean] = (TH1*) fInOR.Get(hString+sClean[iClean]);
    	hString=TString("h1CombPerEvent_")+sLogic;
    	h1CombPerEvent   [iClean] = (TH1*) fIn  .Get(hString+sClean[iClean]);
    	h1CombPerEventOR [iClean] = (TH1*) fInOR.Get(hString+sClean[iClean]);

    	hString=TString("h1RoadPerEvent_"+sLogic2);
    	h1RoadPerEvent6oo6 [iClean] = (TH1*) fIn2  .Get(hString+sClean[iClean]);
    	hString=TString("h1CombPerRoad_")+sLogic2;
    	h1CombPerRoad6oo6  [iClean] = (TH1*) fIn2  .Get(hString+sClean[iClean]);
    	hString=TString("h1CombPerEvent_")+sLogic2;
    	h1CombPerEvent6oo6 [iClean] = (TH1*) fIn2  .Get(hString+sClean[iClean]);
}

    TString cName("cStubsPerLayer_"+sLogic+pName);
    TString cTitle("StubsPerLayer "+sLogic+pTitle);
    TCanvas* cStubsPerLayer = new TCanvas(cName,cTitle,0,0,1400,900);
    cStubsPerLayer->Divide(3,2);
    for (unsigned short iLay=0; iLay<6; ++iLay) {
    	char cc3[100];
    	cStubsPerLayer->cd(iLay+1);
    	gPad->SetLogy();
    	h1stubsInLayer  [iLay][0]->DrawCopy();
    	TLegend* tl = new TLegend(0.3,0.75,0.9,0.9);
		sprintf(cc3,"Mean # stubs: %3.2lf",h1stubsInLayer  [iLay][0]->GetMean());
		TLegendEntry* tle = tl->AddEntry(h1stubsInLayer  [iLay][0],cc3,"l");
		tle->SetLineColor(h1stubsInLayer  [iLay][0]->GetLineColor());
		tle->SetLineWidth(h1stubsInLayer  [iLay][0]->GetLineWidth());
		tl->Draw("L");
    }
    if (makePlots) {
    	cStubsPerLayer->SaveAs(dirPlots+cName+"__.pdf");
    	cStubsPerLayer->SaveAs(dirPlots+cName+"__.png");
    }
    for (unsigned short iLay=0; iLay<6; ++iLay) {
    	char cc3[100];
    	cStubsPerLayer->cd(iLay+1);
    	gPad->SetLogy();
    	h1stubsInLayerOR[iLay][0]->SetLineColor(2);
    	h1stubsInLayerOR[iLay][0]->DrawCopy("same");
    	TLegend* tl = new TLegend(0.25,0.75,0.9,0.9);
		sprintf(cc3,"Mean # stubs: %3.2lf",h1stubsInLayer  [iLay][0]->GetMean());
		TLegendEntry* tle = tl->AddEntry(h1stubsInLayer  [iLay][0],cc3,"l");
		tle->SetLineColor(h1stubsInLayer  [iLay][0]->GetLineColor());
		tle->SetLineWidth(h1stubsInLayer  [iLay][0]->GetLineWidth());
		sprintf(cc3,"Mean # stubs Overlap Removed: %3.2lf",h1stubsInLayerOR[iLay][0]->GetMean());
		tle = tl->AddEntry(h1stubsInLayerOR[iLay][0],cc3,"l");
		tle->SetLineColor(h1stubsInLayerOR[iLay][0]->GetLineColor());
		tle->SetLineWidth(h1stubsInLayerOR[iLay][0]->GetLineWidth());
		tl->Draw("L");
    }
    if (makePlots) {
    	cStubsPerLayer->SaveAs(dirPlots+cName+"_OR_.pdf");
    	cStubsPerLayer->SaveAs(dirPlots+cName+"_OR_.png");
    }

    cName=TString("cStubsPerLayerDsClean_")+sLogic+pName;
    cTitle=TString("StubsPerLayer Ds clean ")+sLogic+pTitle;
    TCanvas* cStubsPerLayerDsClean = new TCanvas(cName,cTitle,0,0,1400,900);
    cStubsPerLayerDsClean->Divide(3,2);
    for (unsigned short iLay=0; iLay<6; ++iLay) {
    	char cc3[100];
    	cStubsPerLayerDsClean->cd(iLay+1);
    	gPad->SetLogy();
    	h1stubsInLayer  [iLay][0]->DrawCopy();
    	h1stubsInLayer  [iLay][1]->SetLineColor(8);
    	h1stubsInLayer  [iLay][1]->DrawCopy("same");
    	TLegend* tl = new TLegend(0.25,0.75,0.9,0.9);
		sprintf(cc3,"Mean # stubs: %3.2lf",h1stubsInLayer  [iLay][0]->GetMean());
		TLegendEntry* tle = tl->AddEntry(h1stubsInLayer  [iLay][0],cc3,"l");
		tle->SetLineColor(h1stubsInLayer  [iLay][0]->GetLineColor());
		tle->SetLineWidth(h1stubsInLayer  [iLay][0]->GetLineWidth());
		sprintf(cc3,"Mean # stubs #Deltas clean: %3.2lf",h1stubsInLayer  [iLay][1]->GetMean());
		tle = tl->AddEntry(h1stubsInLayer  [iLay][1],cc3,"l");
		tle->SetLineColor(h1stubsInLayer  [iLay][1]->GetLineColor());
		tle->SetLineWidth(h1stubsInLayer  [iLay][1]->GetLineWidth());
		tl->Draw("L");
    }
    if (makePlots) {
    	cStubsPerLayerDsClean->SaveAs(dirPlots+cName+"__.pdf");
    	cStubsPerLayerDsClean->SaveAs(dirPlots+cName+"__.png");
    }

    cName=TString("cStubsPerLayerDsCleanOR_")+sLogic+pName;
    cTitle=TString("StubsPerLayer #Deltas clean Overlap Removed ")+sLogic+pTitle;
    TCanvas* cStubsPerLayerDsCleanOR = new TCanvas(cName,cTitle,0,0,1400,900);
    cStubsPerLayerDsCleanOR->Divide(3,2);
    for (unsigned short iLay=0; iLay<6; ++iLay) {
    	char cc3[100];
    	cStubsPerLayerDsCleanOR->cd(iLay+1);
    	gPad->SetLogy();
    	h1stubsInLayer  [iLay][0]->DrawCopy();
    	h1stubsInLayerOR[iLay][0]->SetLineColor(2);
    	h1stubsInLayerOR[iLay][0]->DrawCopy("same");
    	h1stubsInLayerOR[iLay][1]->SetLineColor(6);
    	h1stubsInLayerOR[iLay][1]->DrawCopy("same");
    	TLegend* tl = new TLegend(0.25,0.70,0.9,0.9);
		sprintf(cc3,"Mean # stubs: %3.2lf",h1stubsInLayer  [iLay][0]->GetMean());
		TLegendEntry* tle = tl->AddEntry(h1stubsInLayer  [iLay][0],cc3,"l");
		tle->SetLineColor(h1stubsInLayer  [iLay][0]->GetLineColor());
		tle->SetLineWidth(h1stubsInLayer  [iLay][0]->GetLineWidth());
		sprintf(cc3,"Mean # stubs Ov. Rem.: %3.2lf",h1stubsInLayerOR[iLay][0]->GetMean());
		tle = tl->AddEntry(h1stubsInLayerOR[iLay][0],cc3,"l");
		tle->SetLineColor (h1stubsInLayerOR[iLay][0]->GetLineColor());
		tle->SetLineWidth (h1stubsInLayerOR[iLay][0]->GetLineWidth());
		sprintf(cc3,"Mean # stubs Ds clean Ov. Rem.: %3.2lf",h1stubsInLayerOR[iLay][1]->GetMean());
		tle = tl->AddEntry(h1stubsInLayerOR[iLay][1],cc3,"l");
		tle->SetLineColor (h1stubsInLayerOR[iLay][1]->GetLineColor());
		tle->SetLineWidth (h1stubsInLayerOR[iLay][1]->GetLineWidth());
		tl->Draw("L");
    }
    if (makePlots) {
    	cStubsPerLayerDsCleanOR->SaveAs(dirPlots+cName+"__.pdf");
    	cStubsPerLayerDsCleanOR->SaveAs(dirPlots+cName+"__.png");
    }

	const short nQuant = 4;
	double  percentiles   [nQuant] = {0.90, 0.95, 0.99, 0.999};
	double xpercentiles[6][nQuant];

    cName=TString("cRoadPerEvent_")+sLogic+pName;
    cTitle=TString("Roads per Tower "+sLogic+pTitle);
    TCanvas* cRoadPerEvent = new TCanvas(cName,cTitle,0,0,1400,900);
    cRoadPerEvent->SetLogy();
    h1RoadPerEvent  [0]->SetTitle(cTitle);
    h1RoadPerEvent  [0]->DrawCopy();
//    h1RoadPerEvent6oo6[0]->SetLineColor(14);
//    h1RoadPerEvent6oo6[0]->DrawCopy("same");
	char cc3[100];
	h1RoadPerEvent  [0]->GetQuantiles(nQuant,xpercentiles[0],percentiles);
	sprintf(cc3,"                 #mu=%3.1lf, #Lambda_{%3.1lf}=%3.1lf",h1RoadPerEvent  [0]->GetMean(),percentiles[3]*100,xpercentiles[0][3]);
	TLegend* tl = new TLegend(0.25,0.84,0.9,0.9);
	TLegendEntry* tle = tl->AddEntry(h1RoadPerEvent  [0],cc3,"l");
	tle->SetLineColor(h1RoadPerEvent  [0]->GetLineColor());
	tle->SetLineWidth(h1RoadPerEvent  [0]->GetLineWidth());
//	h1RoadPerEvent6oo6[0]->GetQuantiles(nQuant,xpercentiles[0],percentiles);
//	sprintf(cc3,"# roads/tower-6/6. #mu=%3.1lf, #Lambda_{%3.1lf}=%3.1lf",h1RoadPerEvent6oo6[0]->GetMean(),percentiles[3]*100,xpercentiles[0][3]);
//	tle = tl->AddEntry(h1RoadPerEvent6oo6[0],cc3,"l");
//	tle->SetLineColor(h1RoadPerEvent6oo6[0]->GetLineColor());
//	tle->SetLineWidth(h1RoadPerEvent6oo6[0]->GetLineWidth());
	tl->Draw("L");
	if (makePlots) {
		cRoadPerEvent->SaveAs(dirPlots+cName+"__.pdf");
		cRoadPerEvent->SaveAs(dirPlots+cName+"__.png");
	}

    cName=TString("cRoadPerEvent_OR_")+sLogic+pName;
    cTitle=TString("Roads per Tower "+sLogic+pTitle);
    TCanvas* cRoadPerEventOR = new TCanvas(cName,cTitle,0,0,1400,900);
    cRoadPerEventOR->SetLogy();
    h1RoadPerEvent  [0]->SetTitle(cTitle);
    h1RoadPerEvent  [0]->DrawCopy();
	h1RoadPerEvent  [0]->GetQuantiles(nQuant,xpercentiles[0],percentiles);
	sprintf(cc3,"                 #mu=%3.1lf, #Lambda_{%3.1lf}=%3.1lf",h1RoadPerEvent  [0]->GetMean(),percentiles[3]*100,xpercentiles[0][3]);
	tl = new TLegend(0.25,0.8,0.9,0.9);
	tle = tl->AddEntry(h1RoadPerEvent  [0],cc3,"l");
	tle->SetLineColor(h1RoadPerEvent  [0]->GetLineColor());
	tle->SetLineWidth(h1RoadPerEvent  [0]->GetLineWidth());
    h1RoadPerEventOR[0]->SetLineColor(2);
    h1RoadPerEventOR[0]->DrawCopy("same");
	h1RoadPerEventOR[0]->GetQuantiles(nQuant,xpercentiles[0],percentiles);
	sprintf(cc3,"Ov. Masked #mu=%3.1lf, #Lambda_{%3.1lf}=%3.1lf",h1RoadPerEventOR[0]->GetMean(),percentiles[3]*100,xpercentiles[0][3]);
	tle = tl->AddEntry(h1RoadPerEventOR[0],cc3,"l");
	tle->SetLineColor(h1RoadPerEventOR[0]->GetLineColor());
	tle->SetLineWidth(h1RoadPerEventOR[0]->GetLineWidth());
	tl->Draw("L");
	if (makePlots) {
		cRoadPerEventOR->SaveAs(dirPlots+cName+"__.pdf");
		cRoadPerEventOR->SaveAs(dirPlots+cName+"__.png");
	}

    cName=TString("cCombPerRoad_")+sLogic+pName;
    cTitle=TString("Combinations per Road "+sLogic+pTitle);
    TCanvas* cCombPerRoad = new TCanvas(cName,cTitle,0,0,1400,900);
    cCombPerRoad->SetLogy();
    h1CombPerRoad  [0]->SetTitle(cTitle);
    h1CombPerRoad  [0]->DrawCopy();
	h1CombPerRoad  [0]->GetQuantiles(nQuant,xpercentiles[0],percentiles);
	sprintf(cc3,"# combinations/road.                               #mu=%3.1lf, #Lambda_{%3.1lf}=%3.1lf",h1CombPerRoad  [0]->GetMean(),percentiles[3]*100,xpercentiles[0][3]);
	tl = new TLegend(0.25,0.75,0.9,0.9);
	tle = tl->AddEntry(h1CombPerRoad  [0],cc3,"l");
	tle->SetLineColor (h1CombPerRoad  [0]->GetLineColor());
	tle->SetLineWidth (h1CombPerRoad  [0]->GetLineWidth());
	tl->Draw("L");
	if (makePlots) {
		cCombPerRoad->SaveAs(dirPlots+cName+"__.pdf");
		cCombPerRoad->SaveAs(dirPlots+cName+"__.png");
	}

    cName=TString("cCombPerRoad_OR_")+sLogic+pName;
    h1CombPerRoadOR[0]->SetLineColor(2);
    h1CombPerRoadOR[0]->DrawCopy("same");
	h1CombPerRoadOR[0]->GetQuantiles(nQuant,xpercentiles[0],percentiles);
	sprintf(cc3,"# combinations/road.               Ov. Masked. #mu=%3.1lf, #Lambda_{%3.1lf}=%3.1lf",h1CombPerRoadOR[0]->GetMean(),percentiles[3]*100,xpercentiles[0][3]);
	tle = tl->AddEntry(h1CombPerRoadOR[0],cc3,"l");
	tle->SetLineColor (h1CombPerRoadOR[0]->GetLineColor());
	tle->SetLineWidth (h1CombPerRoadOR[0]->GetLineWidth());
	tl->Draw("L");
	if (makePlots) {
		cCombPerRoad->SaveAs(dirPlots+cName+"__.pdf");
		cCombPerRoad->SaveAs(dirPlots+cName+"__.png");
	}

    cName=TString("cCombPerRoad_OR_DsClean_")+sLogic+pName;
    h1CombPerRoadOR[1]->SetLineColor(8);
    h1CombPerRoadOR[1]->DrawCopy("same");
	h1CombPerRoadOR[1]->GetQuantiles(nQuant,xpercentiles[0],percentiles);
	sprintf(cc3,"# combinations/road. #Deltas clean Ov. Masked #mu=%3.1lf, #Lambda_{%3.1lf}=%3.1lf",h1CombPerRoadOR[1]->GetMean(),percentiles[3]*100,xpercentiles[0][3]);
	tle = tl->AddEntry(h1CombPerRoadOR[1],cc3,"l");
	tle->SetLineColor (h1CombPerRoadOR[1]->GetLineColor());
	tle->SetLineWidth (h1CombPerRoadOR[1]->GetLineWidth());
	tl->Draw("L");
	if (makePlots) {
		cCombPerRoad->SaveAs(dirPlots+cName+"__.pdf");
		cCombPerRoad->SaveAs(dirPlots+cName+"__.png");
	}

    cName=TString("cCombPerEvent_")+sLogic+pName;
    cTitle=TString("Combinations per Tower "+sLogic+pTitle);
    TCanvas* cCombPerEvent = new TCanvas(cName,cTitle,0,0,1400,900);
    cCombPerEvent->SetLogy();
    h1CombPerEvent  [0]->SetTitle(cTitle);
    h1CombPerEvent  [0]->DrawCopy();
	h1CombPerEvent  [0]->GetQuantiles(nQuant,xpercentiles[0],percentiles);
	sprintf(cc3,"                           #mu=%3.1lf, #Lambda_{%3.1lf}=%3.1lf",45.7,percentiles[3]*100,772.4);
	tl = new TLegend(0.25,0.75,0.9,0.9);
	tle = tl->AddEntry(h1CombPerEvent  [0],cc3,"l");
	tle->SetLineColor (h1CombPerEvent  [0]->GetLineColor());
	tle->SetLineWidth (h1CombPerEvent  [0]->GetLineWidth());
	tl->Draw("L");
	if (makePlots) {
		cCombPerEvent->SaveAs(dirPlots+cName+"__.pdf");
		cCombPerEvent->SaveAs(dirPlots+cName+"__.png");
	}

    cName=TString("cCombPerEvent_OR_")+sLogic+pName;
    h1CombPerEventOR[0]->SetLineColor(2);
    h1CombPerEventOR[0]->DrawCopy("same");
	h1CombPerEventOR[0]->GetQuantiles(nQuant,xpercentiles[0],percentiles);
	sprintf(cc3,"              Ov. Masked #mu=%3.1lf, #Lambda_{%3.1lf}=%3.1lf",h1CombPerEventOR[0]->GetMean(),percentiles[3]*100,467.4);
	tle = tl->AddEntry(h1CombPerEventOR[0],cc3,"l");
	tle->SetLineColor (h1CombPerEventOR[0]->GetLineColor());
	tle->SetLineWidth (h1CombPerEventOR[0]->GetLineWidth());
	tl->Draw("L");
	if (makePlots) {
		cCombPerEvent->SaveAs(dirPlots+cName+"__.pdf");
		cCombPerEvent->SaveAs(dirPlots+cName+"__.png");
	}

    cName=TString("cCombPerEvent_OR_DsClean_")+sLogic+pName;
    h1CombPerEventOR[1]->SetLineColor(8);
//    h1CombPerEventOR[1]->SetTitle(cTitle);
//    h1CombPerEventOR[1]->DrawCopy();
    h1CombPerEvent  [0]->DrawCopy();
    h1CombPerEventOR[0]->DrawCopy("same");
    h1CombPerEventOR[1]->DrawCopy("same");
	h1CombPerEventOR[1]->GetQuantiles(nQuant,xpercentiles[0],percentiles);
	sprintf(cc3,"#Deltas clean Ov. Masked #mu=%3.1lf, #Lambda_{%3.1lf}=%3.1lf",h1CombPerEventOR[1]->GetMean(),percentiles[3]*100,xpercentiles[0][3]);
	tle = tl->AddEntry(h1CombPerEventOR[1],cc3,"l");
	tle->SetLineColor (h1CombPerEventOR[1]->GetLineColor());
	tle->SetLineWidth (h1CombPerEventOR[1]->GetLineWidth());
	tl->Draw("L");
	if (makePlots) {
		cCombPerEvent->SaveAs(dirPlots+cName+"__.pdf");
		cCombPerEvent->SaveAs(dirPlots+cName+"__.png");
	}

	TFile f1("/home/rossin/Dropbox/TT/Work/figures_stubOverlapRemoval/eff_LTF_SingleMuonTest_tt27_PU0_sf1_nz4_pt3_5oo6_95c_100k/efficiency1_10dedup_ppt_sf1_nz4.root");
	TFile f2("/home/rossin/Dropbox/TT/Work/figures_stubOverlapRemoval/eff_LTF_SingleMuonTest_tt27_PU0_sf1_nz4_pt3_5oo6_95c_100k_removeOverlap/efficiency1_10dedup_ppt_sf1_nz4.root");

	TCanvas* c1 = (TCanvas*) f1.Get("c1");
	TList* list1 = c1->GetListOfPrimitives();
	TIter next1(list1);
	TObject* obj1;
	TGraphAsymmErrors* eff_graph;
	while ((obj1 = next1())) {
		std::cout << obj1->GetName() << std::endl;
		if (obj1->GetName()==TString("eff_graph")) eff_graph = (TGraphAsymmErrors*) obj1;
	}

//	eff_graph->GetYaxis()->SetTitle("#varepsilon");
//	eff_graph->SetMinimum(0.8);
	TCanvas* c1OR = (TCanvas*) f2.Get("c1");
	c1OR->SetName("eff_OR");
	c1OR->SetTitle("eff_OR");
	TList* list = c1OR->GetListOfPrimitives();
	TIter next(list);
	TObject* obj;
	TGraphAsymmErrors* eff_graphOR;
	c1->Draw();
	while ((obj = next())) {
		std::cout << obj->GetName() << std::endl;
		if (obj->GetName()==TString("eff_graph")) {
			eff_graphOR = (TGraphAsymmErrors*) obj;
			eff_graphOR->SetLineStyle  (eff_graph->GetLineStyle());
			eff_graphOR->SetLineWidth  (eff_graph->GetLineWidth()/2);
			eff_graphOR->SetMarkerStyle(eff_graph->GetMarkerStyle());
			eff_graphOR->SetMarkerSize (eff_graph->GetMarkerSize());
			eff_graphOR->SetFillColor  (eff_graph->GetFillColor());
			eff_graphOR->SetFillStyle  (eff_graph->GetFillStyle());
			eff_graphOR->SetMarkerColor(4);
			eff_graphOR->SetLineColor(4);
			eff_graphOR->GetYaxis()->SetTitle("#varepsilon");
			eff_graphOR->Draw("same p");
		}
	}
	tl = new TLegend(0.4,.13,0.95,0.35);
	tl->AddEntry(eff_graph  ,"No Overlap Removal","p");
	tl->AddEntry(eff_graphOR,"     Overlap Removal","p");
	tl->Draw();
	if (makePlots) {
		c1->SaveAs(dirPlots+TString("totalRecoEff_OR")+"__.png");
		c1->SaveAs(dirPlots+TString("totalRecoEff_OR")+"__.pdf");
	}

	return;
}