File indexing completed on 2024-04-06 12:08:37
0001 #ifndef DQM_SiStripCommon_SummaryGenerator_H
0002 #define DQM_SiStripCommon_SummaryGenerator_H
0003
0004 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
0005 #include <string>
0006 #include <vector>
0007 #include <map>
0008 #include <cstdint>
0009
0010 class TH1;
0011
0012
0013
0014
0015
0016
0017
0018
0019 class SummaryGenerator {
0020 public:
0021
0022
0023 SummaryGenerator(std::string name);
0024 virtual ~SummaryGenerator() { ; }
0025
0026
0027 typedef std::pair<float, float> Data;
0028 typedef std::vector<Data> BinData;
0029 typedef std::map<std::string, BinData> HistoData;
0030
0031
0032 static SummaryGenerator* instance(const sistrip::View&);
0033
0034
0035
0036
0037 static std::string name(const sistrip::RunType&,
0038 const sistrip::Monitorable&,
0039 const sistrip::Presentation&,
0040 const sistrip::View&,
0041 const std::string& directory);
0042
0043
0044 static TH1* histogram(const sistrip::Presentation&, const uint32_t& xbins);
0045
0046
0047
0048
0049 void fillMap(const std::string& top_level_dir,
0050 const sistrip::Granularity&,
0051 const uint32_t& key,
0052 const float& value,
0053 const float& error = 0.);
0054
0055
0056 void clearMap();
0057
0058
0059 void printMap();
0060
0061
0062 void histo1D(TH1&);
0063
0064
0065
0066
0067 void histo2DSum(TH1&);
0068
0069
0070
0071
0072 void histo2DScatter(TH1&);
0073
0074
0075
0076
0077 void profile1D(TH1&);
0078
0079
0080
0081
0082 void format(const sistrip::RunType&,
0083 const sistrip::Monitorable&,
0084 const sistrip::Presentation&,
0085 const sistrip::View&,
0086 const std::string& directory,
0087 const sistrip::Granularity&,
0088 TH1&);
0089
0090
0091 inline void axisLabel(const std::string&);
0092
0093
0094 inline uint32_t nBins() const;
0095 inline uint32_t size() const { return nBins(); }
0096
0097
0098
0099
0100 inline const std::string& myName() const;
0101
0102 protected:
0103
0104
0105
0106 virtual void fill(const std::string& top_level_dir,
0107 const sistrip::Granularity&,
0108 const uint32_t& key,
0109 const float& value,
0110 const float& error);
0111
0112 protected:
0113
0114
0115
0116
0117 HistoData map_;
0118
0119 float entries_;
0120
0121 float max_;
0122
0123 float min_;
0124
0125 std::string label_;
0126
0127 private:
0128
0129
0130 std::string myName_;
0131 };
0132
0133 const std::string& SummaryGenerator::myName() const { return myName_; }
0134 uint32_t SummaryGenerator::nBins() const { return map_.size(); }
0135 void SummaryGenerator::axisLabel(const std::string& label) { label_ = label; }
0136
0137 #endif