6 #include "TGraphAsymmErrors.h" 14 TString XLabel, TString, Bool_t logY)
16 TH2D* result_holder =
new TH2D(
"Trigger2DHist",
"Trigger2DHist", NumXBins, XBins, 2, 0, 2);
17 std::vector<TGraphAsymmErrors*> mapped;
19 TString drawing = TString::Format(
"%s:%s>>Trigger2DHist", fTrigger.Data(), fDefaultExpr.Data());
20 Message(eDebug,
"Drawing with: %s", drawing.Data());
22 fChain->Draw(drawing, fDefaultCut);
23 TH1D *allhist = result_holder->ProjectionX(
"all");
24 for (
int iBin = 1; iBin < NumXBins + 1; iBin++) {
25 Message(eDebug,
"Bin: %i, pass: %f, fail: %f", iBin,
26 result_holder->GetBinContent(iBin, 2), result_holder->GetBinContent(iBin, 1));
29 if (!allhist->GetBinContent(iBin))
30 allhist->SetBinContent(iBin, 1000000);
33 TGraphAsymmErrors* plot =
new TGraphAsymmErrors(NumXBins);
34 Message(eDebug,
"Number of graph points: %i", plot->GetN());
35 plot->Divide(result_holder->ProjectionX(
"pass", 2, -1), allhist);
36 Message(eDebug,
"Number of graph points: %i", plot->GetN());
38 plot->GetYaxis()->SetRangeUser(0.0, 1.2);
39 mapped.push_back(plot);
41 AddCutLine(1.0,
false);
43 BaseCanvas(FileBase, mapped, XLabel,
"Efficiency", logY);
55 TString XLabel, TString, Bool_t logY)
57 Double_t XBins[NumXBins+1];
59 MakeCanvas(FileBase, NumXBins, XBins, XLabel,
"", logY);