BCMTFComparisonTool.h
1 #ifndef __BCMTFCOMPARISONTOOL__H
2 #define __BCMTFCOMPARISONTOOL__H
3 
14 /*
15  * Copyright (C) 2007-2018, the BAT core developer team
16  * All rights reserved.
17  *
18  * For the licensing terms see doc/COPYING.
19  * For documentation see http://mpp.mpg.de/bat
20  */
21 
22 // ---------------------------------------------------------
23 #include "../../BAT/BCAux.h"
24 
25 #include <TH1D.h>
26 
27 #include <string>
28 #include <vector>
29 
30 // ---------------------------------------------------------
32 {
33 
34 public:
35 
42  BCMTFComparisonTool(const std::string& name);
43 
47 
54  const std::string& GetName()
55  { return fName; };
56 
59  const std::string& GetSafeName()
60  { return fSafeName; };
61 
65  { return (int) fHistogramContainer.size(); };
66 
72  void SetName(const std::string& name)
73  { fName = name; fSafeName = BCAux::SafeName(name); }
74 
83  void AddContribution(const std::string& name, TH1D hist);
84 
90  void AddContribution(const std::string& name, double centralvalue, double uncertainty);
91 
94  void DrawOverview();
95 
103  void PrintHistograms(const std::string& filename);
104 
108  void PrintOverview(const std::string& filename);
109 
112 private:
113 
116  std::string fName;
117 
120  std::string fSafeName;
121 
124  std::vector<std::string> fNameContainer;
125 
128  std::vector<TH1D*> fHistogramContainer;
129 
132  std::vector<double> fCentralValueContainer;
133 
136  std::vector<double> fUncertaintyContainer;
137 
140  mutable BCAux::BCTrash<TObject> fTrash;
141 };
142 // ---------------------------------------------------------
143 
144 #endif
const std::string & GetSafeName()
void PrintHistograms(const std::string &filename)
Print all histograms to a file.
BCMTFComparisonTool(const std::string &name)
The default constructor.
A helper class for BCMTFAnalysisFacility storing information.
void PrintOverview(const std::string &filename)
Print an overview to a file.
~BCMTFComparisonTool()
The defaul destructor.
std::string SafeName(const std::string &name)
Convert a name into a safe name for use in ROOT object naming.
Definition: BCAux.cxx:111
void AddContribution(const std::string &name, TH1D hist)
Add a constribution.
void DrawOverview()
Draw an overview.
void SetName(const std::string &name)
Set name.
const std::string & GetName()