19 , fMonitorMode(kFALSE)
20 , fInitCanvasesDone(kFALSE)
21 , fReportName(
"qa_report")
22 , fReportTitle(
"QA report")
30 for (
auto h : fCanvases) {
36void BmnReport::CreateReportElement()
43 fOut =
new ofstream(TString(
GetOutputDir() + fReportName +
".html").Data());
46void BmnReport::DeleteReportElement()
61 CreateReportElement();
63 DeleteReportElement();
77 TCanvas* canvas =
nullptr;
79 auto it = fCanvasMap.find(sname);
80 if (it == fCanvasMap.end()) {
81 canvas =
new TCanvas(name, title, ww, wh);
82 fCanvases.push_back(canvas);
83 fCanvasMap.insert(make_pair(sname, canvas));
93 Int_t nofCanvases = fCanvases.size();
94 cout <<
"nofCanvases = " << nofCanvases << endl;
95 gErrorIgnoreLevel = kWarning;
96 for (Int_t
i = 0;
i < nofCanvases;
i++) {
97 TCanvas* canvas = fCanvases[
i];
98 canvas->SaveAs(TString(
GetOutputDir() +
string(canvas->GetTitle()) +
".png").Data());
100 gErrorIgnoreLevel = kPrint;
107 Int_t nofCanvases = fCanvases.size();
108 for (Int_t
i = 0;
i < nofCanvases;
i++) {
109 fCanvases[
i]->Write();
115 Int_t nofCanvases = fCanvases.size();
116 for (Int_t
i = 0;
i < nofCanvases;
i++) {
117 TCanvas* canvas = fCanvases[
i];
118 Out() <<
R()->
Image(canvas->GetName(), canvas->GetName());
124 for (
auto can : fCanvases) {
Implementation of BmnReportElement for HTML output.
Implementation of BmnReportElement for text output.
virtual string Image(const string &title, const string &file) const =0
Return string with image tags.
const string & GetOutputDir() const
virtual void Draw()=0
Pure abstract function which is called from public Create() function. This function has to draw all n...
void PrintCanvases() const
Print images created from canvases in the report.
const BmnReportElement * R() const
Accessor to BmnReportElement object. User has to write the report using available tags from BmnReport...
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 CreateReports()
Create all available report types.
ostream & Out() const
All text output goes to this stream.
void WriteCanvases() const
Write canvases to file.
void Register(string path)
virtual void Create()=0
Pure abstract function which is called from public Create() function. This function has to write repo...
void SaveCanvasesAsImages() const
Save all canvases to images.
virtual ~BmnReport()
Destructor.