BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnDrawOnline.h
Go to the documentation of this file.
1#ifndef BMNDRAWONLINE_H_
2#define BMNDRAWONLINE_H_
3
4#include "BmnDrawHist.h"
5#include "TEfficiency.h"
6#include "TH1.h"
7#include "TH1D.h"
8#include "TH2.h"
9#include "TLegend.h"
10#include "TPad.h"
11#include "TSystem.h"
12
13#include <TCanvas.h>
14#include <TFile.h>
15#include <THttpServer.h>
16#include <string>
17#include <vector>
18
19using std::string;
20using std::vector;
21
22class BmnDrawOnline
23{
24 public:
25 /**
26 * \brief Constructor.
27 */
28 BmnDrawOnline(TString param, TString storageName = "canvStorage");
29
30 /**
31 * \brief Constructor.
32 */
33 BmnDrawOnline(TFile*, Int_t port = 8080);
34
35 /**
36 * \brief Destructor.
37 */
38 virtual ~BmnDrawOnline();
39
40 /**
41 * \fn DrawH1
42 * \brief Draw 1D histogram.
43 * \param[in] canvas Pointer to canvas
44 * \param[in] hist Pointer to histogram.
45 * \param[in] logx Specify logarithmic or linear scale for X axis.
46 * \param[in] logy Specify logarithmic or linear scale for Y axis.
47 * \param[in] drawOpt Other drawing options (see ROOT documentation for details).
48 * \param[in] color Color.
49 * \param[in] lineWidth Line width.
50 * \param[in] lineStyle Line style (see ROOT documentation for details).
51 * \param[in] markerSize Marker size.
52 * \param[in] markerStyle Marker style (see ROOT documentation for details).
53 */
54 void DrawH1(TCanvas* canvas,
55 TH1* hist,
56 HistScale logx = kLinear,
57 HistScale logy = kLinear,
58 const string& drawOpt = "",
64 Int_t fillColor = -1);
65
66 void DrawH1(TCanvas* canvas, TEfficiency* hist);
67
68 /**
69 * \fn DrawH2
70 * \brief Draw 2D histogram.
71 * \param[in] canvas Pointer to canvas
72 * \param[in] hist Pointer to histogram.
73 * \param[in] logx Specify logarithmic or linear scale for X axis.
74 * \param[in] logy Specify logarithmic or linear scale for Y axis.
75 * \param[in] logz Specify logarithmic or linear scale for Z axis.
76 * \param[in] drawOpt Other drawing options (see ROOT documentation for details).
77 */
78 void DrawH2(TCanvas* canvas,
79 TH2* hist,
80 HistScale logx = kLinear,
81 HistScale logy = kLinear,
82 HistScale logz = kLinear,
83 const string& drawOpt = "COLZ");
84
85 /**
86 * \fn DrawH1
87 * \brief Draw several TH1 histograms.
88 * \param[in] canvas Pointer to canvas
89 * \param[in] histos Array of histograms.
90 * \param[in] histLabels Array of histogram labels.
91 * \param[in] logx Specify logarithmic or linear scale for X axis.
92 * \param[in] logy Specify logarithmic or linear scale for Y axis.
93 * \param[in] drawLegend If true than legend will be drawn.
94 * \param[in] x1 X coordinate of legend in current pad.
95 * \param[in] y1 Y coordinate of legend in current pad.
96 * \param[in] x2 X coordinate of legend in current pad.
97 * \param[in] y2 Y coordinate of legend in current pad.
98 * \param[in] drawOpt Draw options for TH1->Draw method.
99 */
100 void DrawH1(TCanvas* canvas,
101 const vector<TH1*>& histos,
102 const vector<string>& histLabels,
103 HistScale logx = kLinear,
104 HistScale logy = kLinear,
105 Bool_t drawLegend = true,
106 Double_t x1 = 0.25,
107 Double_t y1 = 0.99,
108 Double_t x2 = 0.55,
109 Double_t y2 = 0.75,
110 const string& drawOpt = "",
111 Bool_t outputMeanValue01 = kFALSE);
112
113 /**
114 * \fn InitServer
115 * \brief Create server on localhost
116 */
118
119 /**
120 * \fn DrawMainCanvas
121 * \brief Draw All hists on Canvas
122
123 */
124
126
127 /**
128 * \fn RegisterCanvas
129 * \brief ...
130 * \param[in] file Pointer to canvasStorage root-file
131
132 */
134
135 private:
139 vector<TCanvas*> canvVect;
140 vector<TString> detVect;
142
144};
145
146#endif
Helper functions for drawing 1D and 2D histograms and graphs.
bool Bool_t
int Int_t
float Float_t
constexpr Bool_t kFALSE
double Double_t
#define ClassDef(name, id)
void InitServer(Int_t)
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.
void DrawH1(TCanvas *canvas, TEfficiency *hist)
vector< TCanvas * > canvVect
virtual ~BmnDrawOnline()
Destructor.
void DrawH1(TCanvas *canvas, const vector< TH1 * > &histos, const vector< string > &histLabels, HistScale logx=kLinear, HistScale logy=kLinear, Bool_t drawLegend=true, Double_t x1=0.25, Double_t y1=0.99, Double_t x2=0.55, Double_t y2=0.75, const string &drawOpt="", Bool_t outputMeanValue01=kFALSE)
TFile * canvStorage
vector< TString > detVect
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)
BmnDrawOnline(TFile *, Int_t port=8080)
Constructor.
void RegisterCanvases(TFile *)
THttpServer * fServer
static Int_t LineStyle(Int_t lineStyleIndex)
Definition BmnDrawHist.h:43
static Int_t Color(Int_t colorIndex)
Definition BmnDrawHist.h:34
static Int_t LineWidth()
Definition BmnDrawHist.h:41
static Int_t MarkerStyle(Int_t markerIndex)
Definition BmnDrawHist.h:47
static Float_t MarkerSize()
Definition BmnDrawHist.h:45
HistScale
Define linear or logarithmic scale for drawing.
Definition BmnDrawHist.h:64
@ kLinear
Definition BmnDrawHist.h:66