CbmRoot
Loading...
Searching...
No Matches
CbmSimulationReport.h
Go to the documentation of this file.
1/* Copyright (C) 2011-2020 GSI/JINR-LIT, Darmstadt/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Semen Lebedev, Andrey Lebedev [committer], Florian Uhlig */
4
11#ifndef CBMSIMULATIONREPORT_H_
12#define CBMSIMULATIONREPORT_H_
13
14#include "CbmDrawHist.h" // for kLinear, HistScale
15#include "CbmHistManager.h" // for CbmHistManager
16#include "CbmReport.h" // for CbmReport
17
18#include <Rtypes.h> // for THashConsistencyHolder, ClassDef
19
20#include <string> // for string
21
22class TH1;
23class TH2;
24class TH3;
25
33public:
38
42 virtual ~CbmSimulationReport();
43
55 void Create(CbmHistManager* histManager, const std::string& outputDir);
56
65 void Create(const std::string& fileName, const std::string& outputDir);
66
70 virtual void Create() = 0;
71
77 TH1* H1(const std::string& name) const { return HM()->H1(name); }
78
84 TH2* H2(const std::string& name) const { return HM()->H2(name); }
85
91 TH3* H3(const std::string& name) const { return HM()->H3(name); }
92
96 CbmHistManager* HM() const { return fHM; }
97
102 void DrawH1ByPattern(const std::string& histNamePattern);
103
108 void DrawH1ByPattern(const std::string& histNamePattern,
109 std::string (*labelFormatter)(const std::string&, const CbmHistManager*));
110
119 void DrawH2ByPattern(const std::string& histNamePattern, HistScale logx = kLinear, HistScale logy = kLinear,
120 HistScale logz = kLinear, const std::string& drawOpt = "");
121
122private:
123 CbmHistManager* fHM; // Histogram manager
124
127
128 ClassDef(CbmSimulationReport, 1)
129};
130
131#endif /* CBMSIMULATIONREPORT_H_ */
Helper functions for drawing 1D and 2D histograms and graphs.
HistScale
Define linear or logarithmic scale for drawing.
Definition CbmDrawHist.h:67
@ kLinear
Definition CbmDrawHist.h:69
Histogram manager.
Histogram manager.
TH2 * H2(const std::string &name) const
Return pointer to TH2 histogram.
TH3 * H3(const std::string &name) const
Return pointer to TH3 histogram.
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
Base class for reports.
Definition CbmReport.h:45
Base class for simulation reports.
TH2 * H2(const std::string &name) const
Return pointer to TH2 histogram.
void Create(CbmHistManager *histManager, const std::string &outputDir)
Main function which creates report data.
void DrawH1ByPattern(const std::string &histNamePattern, std::string(*labelFormatter)(const std::string &, const CbmHistManager *))
Select by pattern TH1 histograms and draw all histograms on the same canvas.
CbmSimulationReport()
Constructor.
void Create(const std::string &fileName, const std::string &outputDir)
Main function which creates report data.
virtual void Create()=0
Inherited from CbmReport. Pure abstract function which is called from public Create() function.
CbmSimulationReport(const CbmSimulationReport &)
CbmSimulationReport & operator=(const CbmSimulationReport &)
virtual ~CbmSimulationReport()
Destructor.
void DrawH1ByPattern(const std::string &histNamePattern)
Select by pattern TH1 histograms and draw each histogram on separate canvas.
TH3 * H3(const std::string &name) const
Return pointer to TH3 histogram.
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
CbmHistManager * HM() const
Return pointer to Histogram manager.
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.