CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 "boost/cstdint.hpp"
6 #include <string>
7 #include <vector>
8 #include <map>
9 
10 class TH1;
11 
20 
21  public:
22 
23  // ---------- General ----------
24 
26  virtual ~SummaryGenerator() {;}
27 
28  // Some useful typedefs
29  typedef std::pair<float,float> Data;
30  typedef std::vector<Data> BinData;
31  typedef std::map<std::string,BinData> HistoData;
32 
34  static SummaryGenerator* instance( const sistrip::View& );
35 
36  // ---------- Contruct name and TObject ----------
37 
39  static std::string name( const sistrip::RunType&,
40  const sistrip::Monitorable&,
41  const sistrip::Presentation&,
42  const sistrip::View&,
43  const std::string& directory );
44 
46  static TH1* histogram( const sistrip::Presentation&,
47  const uint32_t& xbins );
48 
49  // ---------- Methods to fill and update histograms ----------
50 
52  void fillMap( const std::string& top_level_dir,
53  const sistrip::Granularity&,
54  const uint32_t& key,
55  const float& value,
56  const float& error = 0. );
57 
59  void clearMap();
60 
62  void printMap();
63 
65  void histo1D( TH1& );
66 
70  void histo2DSum( TH1& );
71 
75  void histo2DScatter( TH1& );
76 
80  void profile1D( TH1& );
81 
82  // ---------- Histogram formatting ----------
83 
85  void format( const sistrip::RunType&,
86  const sistrip::Monitorable&,
87  const sistrip::Presentation&,
88  const sistrip::View&,
89  const std::string& directory,
90  const sistrip::Granularity&,
91  TH1& );
92 
94  inline void axisLabel( const std::string& );
95 
97  inline uint32_t nBins() const;
98  inline uint32_t size() const { return nBins(); } //@@ TEMPORARY!!!
99 
100  // ---------- Utility methods ----------
101 
103  inline const std::string& myName() const;
104 
105  protected:
106 
107  // ---------- Protected methods ----------
108 
110  virtual void fill( const std::string& top_level_dir,
111  const sistrip::Granularity&,
112  const uint32_t& key,
113  const float& value,
114  const float& error );
115 
116  protected:
117 
118  // ---------- Protected member data ----------
119 
123 
124  float entries_;
125 
126  float max_;
127 
128  float min_;
129 
131 
132  private:
133 
134  // ---------- Private member data ----------
135 
137 
138 };
139 
140 const std::string& SummaryGenerator::myName() const { return myName_; }
141 uint32_t SummaryGenerator::nBins() const { return map_.size(); }
143 
144 #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::vector< Data > BinData
static SummaryGenerator * instance(const sistrip::View &)
: Fills summary histograms.
SummaryGenerator(std::string name)
std::pair< float, float > Data
void histo2DScatter(TH1 &)
uint32_t nBins() const
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)
std::map< std::string, BinData > HistoData
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
virtual ~SummaryGenerator()
static TH1 * histogram(const sistrip::Presentation &, const uint32_t &xbins)
void axisLabel(const std::string &)