CMS 3D CMS Logo

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
sistrip::Granularity
Granularity
Definition: ConstantsForGranularity.h:60
SummaryGenerator::fillMap
void fillMap(const std::string &top_level_dir, const sistrip::Granularity &, const uint32_t &key, const float &value, const float &error=0.)
Definition: SummaryGenerator.cc:222
fw3dlego::xbins
const double xbins[]
Definition: fw3dlego_xbins.cc:16
sistrip::View
View
Definition: ConstantsForView.h:26
SummaryGenerator::~SummaryGenerator
virtual ~SummaryGenerator()
Definition: SummaryGenerator.h:24
SummaryGenerator::myName_
std::string myName_
Definition: SummaryGenerator.h:130
SummaryGenerator::entries_
float entries_
Definition: SummaryGenerator.h:119
SummaryGenerator::fill
virtual void fill(const std::string &top_level_dir, const sistrip::Granularity &, const uint32_t &key, const float &value, const float &error)
Definition: SummaryGenerator.cc:250
SummaryGenerator::printMap
void printMap()
Definition: SummaryGenerator.cc:197
SummaryGenerator::histogram
static TH1 * histogram(const sistrip::Presentation &, const uint32_t &xbins)
Definition: SummaryGenerator.cc:74
sistrip::RunType
RunType
Definition: ConstantsForRunType.h:70
SummaryGenerator::name
static std::string name(const sistrip::RunType &, const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory)
Definition: SummaryGenerator.cc:48
relativeConstraints.error
error
Definition: relativeConstraints.py:53
SummaryGenerator::profile1D
void profile1D(TH1 &)
Definition: SummaryGenerator.cc:385
SummaryGenerator::clearMap
void clearMap()
Definition: SummaryGenerator.cc:184
SummaryGenerator::min_
float min_
Definition: SummaryGenerator.h:123
sistrip::Monitorable
Monitorable
Definition: ConstantsForMonitorable.h:200
SummaryGenerator::Data
std::pair< float, float > Data
Definition: SummaryGenerator.h:27
sistrip::Presentation
Presentation
Definition: ConstantsForPresentation.h:28
SummaryGenerator::myName
const std::string & myName() const
Definition: SummaryGenerator.h:133
SummaryGenerator::BinData
std::vector< Data > BinData
Definition: SummaryGenerator.h:28
SiStripConstants.h
HistoData
Definition: HistoData.h:9
value
Definition: value.py:1
SummaryGenerator::axisLabel
void axisLabel(const std::string &)
Definition: SummaryGenerator.h:135
SummaryGenerator::histo2DSum
void histo2DSum(TH1 &)
Definition: SummaryGenerator.cc:309
SummaryGenerator::instance
static SummaryGenerator * instance(const sistrip::View &)
Definition: SummaryGenerator.cc:23
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SummaryGenerator::size
uint32_t size() const
Definition: SummaryGenerator.h:95
SummaryGenerator::SummaryGenerator
SummaryGenerator(std::string name)
Definition: SummaryGenerator.cc:16
SummaryGenerator::max_
float max_
Definition: SummaryGenerator.h:121
SummaryGenerator
: Fills summary histograms.
Definition: SummaryGenerator.h:19
SummaryGenerator::label_
std::string label_
Definition: SummaryGenerator.h:125
SummaryGenerator::histo1D
void histo1D(TH1 &)
Definition: SummaryGenerator.cc:261
createBeamHaloJobs.directory
string directory
Definition: createBeamHaloJobs.py:211
SummaryGenerator::nBins
uint32_t nBins() const
Definition: SummaryGenerator.h:134
SummaryGenerator::HistoData
std::map< std::string, BinData > HistoData
Definition: SummaryGenerator.h:29
SummaryGenerator::histo2DScatter
void histo2DScatter(TH1 &)
Definition: SummaryGenerator.cc:347
crabWrapper.key
key
Definition: crabWrapper.py:19
label
const char * label
Definition: PFTauDecayModeTools.cc:11
SummaryGenerator::format
void format(const sistrip::RunType &, const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory, const sistrip::Granularity &, TH1 &)
Definition: SummaryGenerator.cc:107
SummaryGenerator::map_
HistoData map_
Definition: SummaryGenerator.h:117