20using std::stringstream;
48 const string& drawOpt,
77 gPad->SetTopMargin(0.20);
78 gPad->SetLeftMargin(0.17);
79 gPad->SetBottomMargin(0.15);
90 hist->
Draw(drawOpt.c_str());
91 gPad->SetGrid(
true,
true);
101 const string& drawOpt)
126 gPad->SetTopMargin(0.20);
127 gPad->SetLeftMargin(0.17);
128 gPad->SetRightMargin(0.30);
129 gPad->SetBottomMargin(0.15);
130 gPad->SetTicks(1, 1);
138 hist->
Draw(drawOpt.c_str());
139 gPad->SetGrid(
true,
true);
145 const vector<TH1*>& histos,
146 const vector<string>& histLabels,
154 const string& drawOpt,
157 assert(histos.size() != 0 && histLabels.size() == histos.size());
158 Double_t max = std::numeric_limits<Double_t>::min();
159 Int_t nofHistos = histos.size();
162 for (
Int_t iHist = 0; iHist < nofHistos; iHist++) {
163 TH1* hist = histos[iHist];
164 string opt = (iHist == 0) ? drawOpt : (iHist == nofHistos - 1) ?
"SAME" + drawOpt :
"SAME" + drawOpt;
169 Int_t nonZeroBins = 0;
181 if (outputMeanValue01)
182 legText =
TString::Format(
"%s | mean = %3.1f | mean01 = %3.1f", histLabels[iHist].c_str(), effAll, eff01)
186 legend->
AddEntry(hist, legText,
"lp");
188 FILE* f = fopen(
"test.dat",
"a+");
190 fprintf(f,
"%s %s %f %f\n", hist->
GetName(), histLabels[iHist].c_str(), effAll, eff01);
194 histos[0]->SetMaximum(
max * 1.10);
204 gPad->SetTopMargin(0.20);
205 gPad->SetLeftMargin(0.17);
206 gPad->SetBottomMargin(0.15);
207 gPad->SetTicks(1, 1);
216 gPad->SetGrid(
true,
true);
222 const Char_t* httpStr =
Form(
"http:%d;cors;noglobal", port);
242 TCanvas* mainCanvas =
new TCanvas(nameOfCanv,
"title", 1280, height);
244 mainCanvas->
Divide(1, numOfCanvases, 0.01, 0.002);
245 TPad* newpad[numOfCanvases];
248 for (
Int_t i = 0;
i < numOfCanvases; ++
i) {
249 mainCanvas->
cd(
i + 1);
252 TString newpadName =
"newpad" + std::to_string(
i);
253 newpad[
i] =
new TPad(newpadName,
"a transparent pad", 0.0, 0.93, 1.0, 1.0);
270 TString namesOfCanv[] = {
"inner",
"TOF",
"CSC",
"DCH",
"pid",
"He3",
"pi+",
"e-",
"proton",
"K+",
"D",
"T",
"He4"};
271 Int_t size =
sizeof(namesOfCanv) /
sizeof(namesOfCanv[0]);
276 fServer->Register(
"/Objects", canv);
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Helper functions for drawing 1D and 2D histograms and graphs.
char * Form(const char *fmt,...)
void DrawH2(TCanvas *canvas, TH2 *hist, HistScale logx=kLinear, HistScale logy=kLinear, HistScale logz=kLinear, const string &drawOpt="COLZ")
void DrawMainCanvas(TString)
BmnDrawOnline(TString param, TString storageName="canvStorage")
Constructor.
vector< TCanvas * > canvVect
void DrawH1(TCanvas *canvas, TH1 *hist, HistScale logx=kLinear, HistScale logy=kLinear, const string &drawOpt="", Int_t color=BmnDrawingOptions::Color(0), Int_t lineWidth=BmnDrawingOptions::LineWidth(), Int_t lineStyle=BmnDrawingOptions::LineStyle(0), Float_t markerSize=BmnDrawingOptions::MarkerSize(), Int_t markerStyle=BmnDrawingOptions::MarkerStyle(0), Int_t fillColor=-1)
void RegisterCanvases(TFile *)
virtual ~BmnDrawOnline()
Destructor.
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 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)
virtual void SetTextFont(Font_t tfont=62)
TVirtualPad * cd(Int_t subpadnumber=0) override
UInt_t GetWh() const override
T * Get(const char *namecycle)
void Draw(Option_t *opt="") 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 Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0) override
void SetFillStyle(Style_t fstyle) override
TVirtualPad * cd(Int_t subpadnumber=0) override
void Draw(Option_t *option="") override
const char * GetName() const override
void Draw(Option_t *option="") override
const char * Data() const
static TString Format(const char *fmt,...)
HistScale
Define linear or logarithmic scale for drawing.