CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SummaryGenerator.h
Go to the documentation of this file.
1 #ifndef DQM_SiStripCommon_SummaryGenerator_H
2 #define DQM_SiStripCommon_SummaryGenerator_H
3 
5 #include <string>
6 #include <vector>
7 #include <map>
8 #include <cstdint>
9 
10 class TH1;
11 
20 public:
21  // ---------- General ----------
22 
24  virtual ~SummaryGenerator() { ; }
25 
26  // Some useful typedefs
27  typedef std::pair<float, float> Data;
28  typedef std::vector<Data> BinData;
29  typedef std::map<std::string, BinData> HistoData;
30 
32  static SummaryGenerator* instance(const sistrip::View&);
33 
34  // ---------- Contruct name and TObject ----------
35 
37  static std::string name(const sistrip::RunType&,
38  const sistrip::Monitorable&,
39  const sistrip::Presentation&,
40  const sistrip::View&,
41  const std::string& directory);
42 
44  static TH1* histogram(const sistrip::Presentation&, const uint32_t& xbins);
45 
46  // ---------- Methods to fill and update histograms ----------
47 
49  void fillMap(const std::string& top_level_dir,
50  const sistrip::Granularity&,
51  const uint32_t& key,
52  const float& value,
53  const float& error = 0.);
54 
56  void clearMap();
57 
59  void printMap();
60 
62  void histo1D(TH1&);
63 
67  void histo2DSum(TH1&);
68 
72  void histo2DScatter(TH1&);
73 
77  void profile1D(TH1&);
78 
79  // ---------- Histogram formatting ----------
80 
82  void format(const sistrip::RunType&,
83  const sistrip::Monitorable&,
84  const sistrip::Presentation&,
85  const sistrip::View&,
86  const std::string& directory,
87  const sistrip::Granularity&,
88  TH1&);
89 
91  inline void axisLabel(const std::string&);
92 
94  inline uint32_t nBins() const;
95  inline uint32_t size() const { return nBins(); } //@@ TEMPORARY!!!
96 
97  // ---------- Utility methods ----------
98 
100  inline const std::string& myName() const;
101 
102 protected:
103  // ---------- Protected methods ----------
104 
106  virtual void fill(const std::string& top_level_dir,
107  const sistrip::Granularity&,
108  const uint32_t& key,
109  const float& value,
110  const float& error);
111 
112 protected:
113  // ---------- Protected member data ----------
114 
118 
119  float entries_;
120 
121  float max_;
122 
123  float min_;
124 
126 
127 private:
128  // ---------- Private member data ----------
129 
131 };
132 
133 const std::string& SummaryGenerator::myName() const { return myName_; }
134 uint32_t SummaryGenerator::nBins() const { return map_.size(); }
136 
137 #endif // DQM_SiStripCommon_SummaryGenerator_H
static std::string name(const sistrip::RunType &, const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory)
void histo2DSum(TH1 &)
const double xbins[]
std::map< std::string, BinData > HistoData
std::vector< Data > BinData
static SummaryGenerator * instance(const sistrip::View &)
: Fills summary histograms.
SummaryGenerator(std::string name)
void histo2DScatter(TH1 &)
uint32_t nBins() const
char const * label
void fillMap(const std::string &top_level_dir, const sistrip::Granularity &, const uint32_t &key, const float &value, const float &error=0.)
virtual void fill(const std::string &top_level_dir, const sistrip::Granularity &, const uint32_t &key, const float &value, const float &error)
tuple key
prepare the HTCondor submission files and eventually submit them
uint32_t size() const
void format(const sistrip::RunType &, const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory, const sistrip::Granularity &, TH1 &)
const std::string & myName() const
std::pair< float, float > Data
virtual ~SummaryGenerator()
static TH1 * histogram(const sistrip::Presentation &, const uint32_t &xbins)
void axisLabel(const std::string &)