25using std::stringstream;
36 gStyle->SetFrameBorderMode(0);
47 const string& drawOpt,
75 gPad->SetLeftMargin(0.17);
76 gPad->SetBottomMargin(0.15);
80 hist->
Draw(drawOpt.c_str());
81 gPad->SetGrid(
true,
true);
110 gPad->SetLeftMargin(0.17);
111 gPad->SetRightMargin(0.30);
112 gPad->SetBottomMargin(0.15);
113 gPad->SetTicks(1, 1);
114 hist->
Draw(drawOpt.c_str());
115 gPad->SetGrid(
true,
true);
121 const vector<string>& histLabels,
129 const string& drawOpt,
132 assert(histos.size() != 0 && histLabels.size() == histos.size());
133 Double_t max = std::numeric_limits<Double_t>::min();
134 Int_t nofHistos = histos.size();
137 for (
Int_t iHist = 0; iHist < nofHistos; iHist++) {
138 TH1* hist = histos[iHist];
139 string opt = (iHist == 0) ? drawOpt : (iHist == nofHistos - 1) ?
"SAME" + drawOpt :
"SAME" + drawOpt;
144 Int_t nonZeroBins = 0;
156 if (outputMeanValue01)
157 legText =
TString::Format(
"%s | mean = %3.1f | mean01 = %3.1f", histLabels[iHist].c_str(), effAll, eff01)
161 legend->
AddEntry(hist, legText,
"lp");
163 FILE* f = fopen(
"test.dat",
"a+");
165 fprintf(f,
"%s %s %f %f\n", hist->
GetName(), histLabels[iHist].c_str(), effAll, eff01);
168 histos[0]->SetMaximum(
max * 1.10);
238 Int_t nonZeroBins = 0;
252 const string& drawOpt,
266 if (drawOpt.find(
"A") != string::npos) {
281 gPad->SetLeftMargin(0.17);
282 gPad->SetBottomMargin(0.15);
283 graph->
Draw(drawOpt.c_str());
284 gPad->SetGrid(
true,
true);
289 const vector<string>& graphLabels,
298 assert(graphs.size() != 0 && graphs.size() == graphLabels.size());
300 Double_t max = std::numeric_limits<Double_t>::min();
301 Double_t min = std::numeric_limits<Double_t>::max();
304 Int_t nofGraphs = graphs.size();
305 for (
Int_t iGraph = 0; iGraph < nofGraphs; iGraph++) {
306 TGraph* graph = graphs[iGraph];
307 string opt = (iGraph == 0) ?
"ACP" :
"CP";
313 legend->
AddEntry(graph, graphLabels[iGraph].c_str(),
"lp");
315 graphs[0]->SetMaximum(
max);
316 graphs[0]->SetMinimum(
min);
347 gPad->SetLeftMargin(0.17);
348 gPad->SetRightMargin(0.30);
349 gPad->SetBottomMargin(0.15);
350 gPad->SetTicks(1, 1);
351 graph->
Draw(drawOpt.c_str());
352 gPad->SetGrid(
true,
true);
void DrawH1(TH1 *hist, HistScale logx, HistScale logy, const string &drawOpt, Int_t lineColor, Int_t lineWidth, Int_t lineStyle, Float_t markerSize, Int_t markerStyle, Int_t fillColor)
void SetDefaultDrawStyle()
void DrawH2(TH2 *hist, HistScale logx, HistScale logy, HistScale logz, const string &drawOpt)
void DrawMeanLine(TH1 *hist)
void DrawGraph2D(TGraph2D *graph, HistScale logx, HistScale logy, HistScale logz, const string &drawOpt)
void DrawGraph(TGraph *graph, HistScale logx, HistScale logy, const string &drawOpt, Int_t color, Int_t lineWidth, Int_t lineStyle, Int_t markerSize, Int_t markerStyle)
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Helper functions for drawing 1D and 2D histograms and graphs.
R__EXTERN TStyle * gStyle
static Int_t LineStyle(Int_t lineStyleIndex)
static Double_t TextSize()
static Int_t Color(Int_t colorIndex)
static Int_t MarkerStyle(Int_t markerIndex)
static Float_t MarkerSize()
virtual void SetTitleOffset(Float_t offset=1)
virtual void SetLabelSize(Float_t size=0.04)
virtual void SetTitleSize(Float_t size=0.04)
virtual void SetNdivisions(Int_t n1, Int_t n2, Int_t n3, Bool_t optim=kTRUE)
virtual void SetFillColor(Color_t fcolor)
virtual Color_t GetLineColor() const
virtual void SetLineStyle(Style_t lstyle)
virtual void SetLineWidth(Width_t lwidth)
virtual void SetLineColor(Color_t lcolor)
virtual void SetMarkerColor(Color_t mcolor=1)
virtual void SetMarkerStyle(Style_t mstyle=1)
virtual void SetMarkerSize(Size_t msize=1)
void Draw(Option_t *option="P0") override
void Draw(Option_t *chopt="") override
virtual Double_t GetBinCenter(Int_t bin) const
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
virtual Int_t GetNbinsX() const
void Draw(Option_t *option="") override
virtual Double_t Integral(Int_t binx1, Int_t binx2, Option_t *option="") const
virtual Double_t GetBinContent(Int_t bin) const
virtual void SetStats(Bool_t stats=kTRUE)
void Draw(Option_t *option="") override
TLegendEntry * AddEntry(const char *name, const char *label="", Option_t *option="lpf")
const char * GetName() const override
virtual void Draw(Option_t *option="")
const char * Data() const
static TString Format(const char *fmt,...)
HistScale
Define linear or logarithmic scale for drawing.