Go to the documentation of this file.
11 #include <RtypesCore.h>
30 const string& outputDir) {
31 assert(histManager !=
nullptr);
38 const string& outputDir) {
39 assert(
fHM ==
nullptr);
41 TFile* file =
new TFile(fileName.c_str());
50 vector<TH1*> histos =
HM()->
H1Vector(histNamePattern);
51 UInt_t nofHistos = histos.size();
52 if (nofHistos < 1)
return;
53 for (UInt_t iHist = 0; iHist < nofHistos; iHist++) {
54 TH1* hist = histos[iHist];
57 CreateCanvas(canvasName.c_str(), canvasName.c_str(), 800, 500);
63 const string& histNamePattern,
65 vector<TH1*> histos =
HM()->
H1Vector(histNamePattern);
66 UInt_t nofHistos = histos.size();
67 if (nofHistos < 1)
return;
70 CreateCanvas(canvasName.c_str(), canvasName.c_str(), 600, 500);
72 vector<string> labels(nofHistos);
73 for (UInt_t iHist = 0; iHist < nofHistos; iHist++) {
74 string name = histos[iHist]->GetName();
75 labels[iHist] = labelFormatter(name,
HM());
85 const string& drawOpt) {
86 vector<TH2*> histos =
HM()->
H2Vector(histNamePattern);
87 UInt_t nofHistos = histos.size();
88 if (nofHistos < 1)
return;
89 for (UInt_t iHist = 0; iHist < nofHistos; iHist++) {
90 TH2* hist = histos[iHist];
93 CreateCanvas(canvasName.c_str(), canvasName.c_str(), 800, 500);
94 DrawH2(hist, logx, logy, logz, drawOpt);
TCanvas * CreateCanvas(const char *name, const char *title, Int_t ww, Int_t wh)
Create canvas and put it to vector of TCanvases. Canvases created with this function will be automati...
void ReadFromFile(TFile *file)
Read histograms from file.
HistScale
Define linear or logarithmic scale for drawing.
virtual void Create()=0
Inherited from CbmReport. Pure abstract function which is called from public Create() function.
const std::string & GetReportName() const
virtual ~CbmSimulationReport()
Destructor.
Helper functions for drawing 1D and 2D histograms and graphs.
void DrawH1(TH1 *hist, HistScale logx, HistScale logy, const string &drawOpt, Int_t color, Int_t lineWidth, Int_t lineStyle, Int_t markerSize, Int_t markerStyle)
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
void DrawH1ByPattern(const std::string &histNamePattern)
Select by pattern TH1 histograms and draw each histogram on separate canvas.
void DrawH2ByPattern(const std::string &histNamePattern, HistScale logx=kLinear, HistScale logy=kLinear, HistScale logz=kLinear, const std::string &drawOpt="")
Select by pattern TH2 histograms and draw each histogram on separate canvas.
std::vector< TH1 * > H1Vector(const std::string &pattern) const
Return vector of pointers to TH1 histogram.
CbmHistManager * HM() const
Return pointer to Histogram manager.
Base class for simulation reports.
std::vector< TH2 * > H2Vector(const std::string &pattern) const
Return vector of pointers to TH2 histogram.
Base class for simulation reports.
void DrawH2(TH2 *hist, HistScale logx, HistScale logy, HistScale logz, const string &drawOpt)
void CreateReports()
Create all available report types.
CbmSimulationReport()
Constructor.
void SetOutputDir(const std::string &outputDir)