CbmRoot
Loading...
Searching...
No Matches
CbmLitClusteringQaStudyReport.cxx
Go to the documentation of this file.
1/* Copyright (C) 2011-2014 GSI/JINR-LIT, Darmstadt/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Andrey Lebedev [committer] */
4
11
12#include "CbmHistManager.h"
13#include "CbmReportElement.h"
14#include "CbmUtils.h"
15#include "TH1.h"
16
17#include <boost/assign/list_of.hpp>
18
19#include <vector>
20using boost::assign::list_of;
22using Cbm::Split;
23using std::endl;
24using std::vector;
25
27
29
31{
32 Out().precision(3);
33 Out() << R()->DocumentBegin();
34 Out() << R()->Title(0, GetTitle());
35
37
38 // Out() << PrintImages(".*clustering_qa_.*png");
39
40 Out() << R()->DocumentEnd();
41}
42
44{
45 Int_t nofStudies = HM().size();
46 vector<vector<TH1*>> histos(nofStudies);
47 for (Int_t i = 0; i < nofStudies; i++) {
48 histos[i] = HM(i)->H1Vector("hno_NofObjects_.+_Event");
49 }
50 string str = R()->TableBegin("Number of objects", list_of(string("")).range(GetStudyNames()));
51 for (UInt_t iHist = 0; iHist < histos[0].size(); iHist++) {
52 string cellName = Split(histos[0][iHist]->GetName(), '_')[2];
53 vector<string> cells(nofStudies);
54 for (Int_t i = 0; i < nofStudies; i++) {
55 cells[i] = NumberToString<Double_t>(histos[i][iHist]->GetMean());
56 }
57 str += R()->TableRow(list_of(cellName).range(cells));
58 }
59 str += R()->TableEnd();
60 return str;
61}
62
64
ClassImp(CbmConverterManager)
Histogram manager.
Study summary report for clustering QA.
Abstract class for basic report elements (headers, tables, images etc.).
Study summary report for clustering QA.
string PrintNofObjects() const
Print number of objects table.
void Create()
Inherited from CbmStudyReport.
void Draw()
Inherited from CbmStudyReport.
virtual std::string TableRow(const std::vector< std::string > &row) const =0
Return string with table row tags.
virtual std::string Title(int size, const std::string &title) const =0
Return string with title.
virtual std::string TableBegin(const std::string &caption, const std::vector< std::string > &colNames) const =0
Return string with table open tag.
virtual std::string DocumentBegin() const =0
Return string with open tags for document.
virtual std::string TableEnd() const =0
Return string with table close tag.
virtual std::string DocumentEnd() const =0
Return string with close tags of the document.
std::ostream & Out() const
All text output goes to this stream.
Definition CbmReport.h:66
void SetReportName(const std::string &name)
Definition CbmReport.h:69
const CbmReportElement * R() const
Accessor to CbmReportElement object. User has to write the report using available tags from CbmReport...
Definition CbmReport.h:61
Base class for study reports.
const std::vector< std::string > & GetStudyNames() const
const std::vector< CbmHistManager * > & HM() const
vector< string > Split(const string &name, char delimiter)
Definition CbmUtils.cxx:67
std::string NumberToString(const T &value, int precision=1)
Definition CbmUtils.h:34