void plotSteps() { //checkInputs(); return; TFile fin("/mnt/sdc/andriusj/DY13TeV/DYanalysis-20160817/ElectronNtupler/test/Analysis_Codes/AccEff/dyee_preFSR_forAccEff_v1steps.root"); TH1D *h1effPass_new= loadHisto(fin,"h1_eff_sumPass","h1effPass_new",1,h1dummy); TH1D *h1effPass_noPU= loadHisto(fin,"h1_eff_sumPass_noPU","h1effPass_noPU",1,h1dummy); TH1D *h1effPass_noTrigObjMatching= loadHisto(fin,"h1_eff_sumPass_noTrigObjMatching","h1effPass_noTrigObjMatching",1,h1dummy); TH1D *h1effPass_matchDR3= loadHisto(fin,"h1_eff_sumPass_matchDR3","h1effPass_matchDR3",1,h1dummy); TH1D *h1effPass_noTrig= loadHisto(fin,"h1_eff_sumPass_noTrig","h1effPass_noTrig",1,h1dummy); TH1D *h1effPass_noTrigNoPU= loadHisto(fin,"h1_eff_sumPass_noTrigNoPU","h1effPass_noTrigNoPU",1,h1dummy); //TH1D *h1effTot_new= loadHisto(fin, "h1_eff_sumTot", "h1effTot_new",1,h1dummy); fin.Close(); if (!h1effPass_new || !h1effPass_noPU || !h1effPass_noTrigObjMatching || !h1effPass_matchDR3 || !h1effPass_noTrig || !h1effPass_noTrigNoPU) { std::cout << "null ptr\n"; return; } std::vector<TH1D*> h1InfoV; std::vector<TString> infoLabelV; histoStyle(h1effPass_noPU,kRed,5,1); histoStyle(h1effPass_noTrig,kBlue,7,2); histoStyle(h1effPass_matchDR3,kGreen+1,5,1); histoStyle(h1effPass_noTrigObjMatching,kOrange,20,2); std::cout << "\nwPU effect on new effPass distribution\n"; plotHisto(h1effPass_new,"cPUnew",1,0,"LPE1","new wPU"); plotHistoSame(h1effPass_noPU,"cPUnew","LPE1","new noPU"); printRatio(h1effPass_new,h1effPass_noPU); addRatio(h1effPass_noPU,h1effPass_new,"no PU rew.",h1InfoV,infoLabelV); std::cout << "\nwPU effect on old effPass distribution\n"; plotHisto(h1effPass_noTrig,"cPUold",1,0,"LPE1","old wPU"); plotHistoSame(h1effPass_noTrigNoPU,"cPUold","LPE1","old noPU"); printRatio(h1effPass_noTrig,h1effPass_noTrigNoPU); std::cout << "\ntriggering\n"; plotHisto(h1effPass_new,"cTrig",1,0,"LPE1","new wPU"); plotHistoSame(h1effPass_noTrig,"cTrig","LPE1","no event trigger"); printRatio(h1effPass_new,h1effPass_noTrig); addRatio(h1effPass_noTrig,h1effPass_new,"no trigger",h1InfoV,infoLabelV); std::cout << "\ntrigger object matching\n"; plotHisto(h1effPass_new,"cTrigObjMatch",1,0,"LPE1","new wPU"); plotHistoSame(h1effPass_noTrigObjMatching,"cTrigObjMatch","LPE1","new, noTrigObjMatch"); printRatio(h1effPass_new,h1effPass_noTrigObjMatching); addRatio(h1effPass_noTrigObjMatching,h1effPass_new,"no trig.obj.match.",h1InfoV,infoLabelV); std::cout << "\nDR effect on new effPass distribution\n"; plotHisto(h1effPass_new,"cDR",1,0,"LPE1","new wPU, match DR1"); plotHistoSame(h1effPass_matchDR3,"cDR","LPE1","new wPU, match DR3"); printRatio(h1effPass_new,h1effPass_matchDR3); addRatio(h1effPass_matchDR3,h1effPass_new,"#DeltaR<0.3",h1InfoV,infoLabelV); //printLatex("effPassSteps.tex",h1InfoV,infoLabelV,1); plotRatios(h1InfoV,infoLabelV); }
TCanvas* plotRatios_wFit(TH1D* numeratorHist1, TH1D* numeratorHist2, TH1D* denominatorHist, TString title="", TString xTitle="", TString yTitle="") { std::vector<TH1D*> numeratorHistograms; numeratorHistograms.push_back( numeratorHist1 ); numeratorHistograms.push_back( numeratorHist2 ); TCanvas* c1 = plotRatios(numeratorHistograms, denominatorHist, title, xTitle, yTitle); return c1; }