CbmRoot
CbmLitClusteringQaStudyReport.cxx
Go to the documentation of this file.
1 
7 #include "CbmHistManager.h"
8 #include "CbmReportElement.h"
9 #include "CbmUtils.h"
10 #include "TH1.h"
11 #include <boost/assign/list_of.hpp>
12 #include <vector>
13 using boost::assign::list_of;
15 using Cbm::Split;
16 using std::endl;
17 using std::vector;
18 
20  : CbmStudyReport() {
21  SetReportName("clustering_qa");
22 }
23 
25 
27  Out().precision(3);
28  Out() << R()->DocumentBegin();
29  Out() << R()->Title(0, GetTitle());
30 
32 
33  // Out() << PrintImages(".*clustering_qa_.*png");
34 
35  Out() << R()->DocumentEnd();
36 }
37 
39  Int_t nofStudies = HM().size();
40  vector<vector<TH1*>> histos(nofStudies);
41  for (Int_t i = 0; i < nofStudies; i++) {
42  histos[i] = HM(i)->H1Vector("hno_NofObjects_.+_Event");
43  }
44  string str = R()->TableBegin("Number of objects",
45  list_of(string("")).range(GetStudyNames()));
46  for (Int_t iHist = 0; iHist < histos[0].size(); iHist++) {
47  string cellName = Split(histos[0][iHist]->GetName(), '_')[2];
48  vector<string> cells(nofStudies);
49  for (Int_t i = 0; i < nofStudies; i++) {
50  cells[i] = NumberToString<Double_t>(histos[i][iHist]->GetMean());
51  }
52  str += R()->TableRow(list_of(cellName).range(cells));
53  }
54  str += R()->TableEnd();
55  return str;
56 }
57 
59 
CbmReportElement::TableBegin
virtual std::string TableBegin(const std::string &caption, const std::vector< std::string > &colNames) const =0
Return string with table open tag.
CbmLitClusteringQaStudyReport
Study summary report for clustering QA.
Definition: CbmLitClusteringQaStudyReport.h:21
CbmLitClusteringQaStudyReport::Create
void Create()
Inherited from CbmStudyReport.
Definition: CbmLitClusteringQaStudyReport.cxx:26
CbmStudyReport
Base class for study reports.
Definition: CbmStudyReport.h:26
CbmReportElement::DocumentBegin
virtual std::string DocumentBegin() const =0
Return string with open tags for document.
CbmReportElement::TableRow
virtual std::string TableRow(const std::vector< std::string > &row) const =0
Return string with table row tags.
CbmReportElement::DocumentEnd
virtual std::string DocumentEnd() const =0
Return string with close tags of the document.
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmReport::R
const CbmReportElement * R() const
Accessor to CbmReportElement object. User has to write the report using available tags from CbmReport...
Definition: CbmReport.h:51
CbmReportElement.h
Abstract class for basic report elements (headers, tables, images etc.).
CbmHistManager.h
Histogram manager.
CbmReport::SetReportName
void SetReportName(const std::string &name)
Definition: CbmReport.h:59
CbmReportElement::TableEnd
virtual std::string TableEnd() const =0
Return string with table close tag.
CbmStudyReport::HM
const std::vector< CbmHistManager * > & HM() const
Definition: CbmStudyReport.h:74
CbmLitClusteringQaStudyReport::CbmLitClusteringQaStudyReport
CbmLitClusteringQaStudyReport()
Constructor.
Definition: CbmLitClusteringQaStudyReport.cxx:19
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmUtils.h
CbmLitClusteringQaStudyReport::Draw
void Draw()
Inherited from CbmStudyReport.
Definition: CbmLitClusteringQaStudyReport.cxx:58
CbmLitClusteringQaStudyReport::~CbmLitClusteringQaStudyReport
virtual ~CbmLitClusteringQaStudyReport()
Destructor.
Definition: CbmLitClusteringQaStudyReport.cxx:24
CbmLitClusteringQaStudyReport.h
Study summary report for clustering QA.
CbmStudyReport::GetStudyNames
const std::vector< std::string > & GetStudyNames() const
Definition: CbmStudyReport.h:76
CbmReport::Out
std::ostream & Out() const
All text output goes to this stream.
Definition: CbmReport.h:56
CbmReportElement::Title
virtual std::string Title(int size, const std::string &title) const =0
Return string with title.
Cbm::NumberToString
std::string NumberToString(const T &value, int precision=1)
Definition: CbmUtils.h:23
Cbm::Split
vector< string > Split(const string &name, char delimiter)
Definition: CbmUtils.cxx:54
CbmLitClusteringQaStudyReport::PrintNofObjects
string PrintNofObjects() const
Print number of objects table.
Definition: CbmLitClusteringQaStudyReport.cxx:38