File indexing completed on 2024-09-11 04:32:40
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef DQM_SiStripMonitorHardware_HistogramBase_HH
0017 #define DQM_SiStripMonitorHardware_HistogramBase_HH
0018
0019 #include <sstream>
0020
0021 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0022
0023 #include "DQM/SiStripCommon/interface/TkHistoMap.h"
0024
0025 #include "DQMServices/Core/interface/DQMStore.h"
0026
0027 class HistogramBase {
0028 public:
0029 typedef dqm::legacy::DQMStore DQMStore;
0030 typedef dqm::legacy::MonitorElement MonitorElement;
0031
0032 struct HistogramConfig {
0033 HistogramConfig() : globalswitchon(true) {}
0034 MonitorElement* monitorEle;
0035 bool enabled;
0036 unsigned int nBins;
0037 double min;
0038 double max;
0039 bool globalswitchon;
0040 };
0041
0042 virtual ~HistogramBase() {}
0043
0044
0045
0046 virtual void initialise(const edm::ParameterSet& iConfig, std::ostringstream* pDebugStream) = 0;
0047
0048
0049 static void fillHistogram(HistogramConfig& histogram, double value, double weight = 1.);
0050
0051
0052 static void fillHistogram(MonitorElement* histogram, double value, double weight = 1.);
0053
0054 static void fillHistogram2D(HistogramConfig& histogram, double value, double trendVar, double weight = 1.);
0055
0056 static void fillTkHistoMap(TkHistoMap* aMap, uint32_t& detid, float value);
0057
0058
0059 virtual bool tkHistoMapEnabled(unsigned int aIndex = 0) = 0;
0060
0061 virtual TkHistoMap* tkHistoMapPointer(unsigned int aIndex = 0) = 0;
0062
0063
0064 void getConfigForHistogram(HistogramConfig& aConfig,
0065 const std::string& configName,
0066 const edm::ParameterSet& psetContainingConfigPSet,
0067 std::ostringstream* pDebugStream);
0068
0069
0070 void bookHistogram(DQMStore::IBooker&,
0071 HistogramConfig& aConfig,
0072 const std::string& name,
0073 const std::string& title,
0074 const unsigned int nBins,
0075 const double min,
0076 const double max,
0077 const std::string& xAxisTitle);
0078
0079
0080 void bookHistogram(DQMStore::IBooker&,
0081 HistogramConfig& aConfig,
0082 MonitorElement*& aHist,
0083 const std::string& name,
0084 const std::string& title,
0085 const unsigned int nBins,
0086 const double min,
0087 const double max,
0088 const std::string& xAxisTitle);
0089
0090
0091 void book2DHistogram(DQMStore::IBooker&,
0092 HistogramConfig& aConfig,
0093 const std::string& name,
0094 const std::string& title,
0095 const unsigned int nBins,
0096 const double min,
0097 const double max,
0098 const unsigned int nBinsY,
0099 const double minY,
0100 const double maxY,
0101 const std::string& xAxisTitle,
0102 const std::string& yAxisTitle);
0103
0104
0105 void book2DHistogram(DQMStore::IBooker&,
0106 HistogramConfig& aConfig,
0107 MonitorElement*& aHist,
0108 const std::string& name,
0109 const std::string& title,
0110 const unsigned int nBins,
0111 const double min,
0112 const double max,
0113 const unsigned int nBinsY,
0114 const double minY,
0115 const double maxY,
0116 const std::string& xAxisTitle,
0117 const std::string& yAxisTitle);
0118
0119
0120 void bookHistogram(DQMStore::IBooker&,
0121 HistogramConfig& aConfig,
0122 const std::string& name,
0123 const std::string& title,
0124 const std::string& xAxisTitle);
0125
0126 void bookProfile(DQMStore::IBooker&,
0127 HistogramConfig& aConfig,
0128 const std::string& name,
0129 const std::string& title,
0130 const unsigned int nBins,
0131 const double min,
0132 const double max,
0133 const double minY,
0134 const double maxY,
0135 const std::string& xAxisTitle,
0136 const std::string& yAxisTitle);
0137
0138 void bookProfile(DQMStore::IBooker&,
0139 HistogramConfig& aConfig,
0140 const std::string& name,
0141 const std::string& title,
0142 const double minY,
0143 const double maxY,
0144 const std::string& xAxisTitle,
0145 const std::string& yAxisTitle);
0146 void bookProfile2D(DQMStore::IBooker&,
0147 HistogramConfig& aConfig,
0148 const std::string& name,
0149 const std::string& title,
0150 const unsigned int nBinsx,
0151 const double xmin,
0152 const double xmax,
0153 const unsigned int nBinsy,
0154 const double ymin,
0155 const double ymax,
0156 const std::string& xAxisTitle,
0157 const std::string& yAxisTitle);
0158
0159 void bookProfile2D(DQMStore::IBooker&,
0160 HistogramConfig& aConfig,
0161 const std::string& name,
0162 const std::string& title,
0163 const unsigned int nBinsy,
0164 const double ymin,
0165 const double ymax,
0166 const std::string& xAxisTitle,
0167 const std::string& yAxisTitle);
0168
0169 protected:
0170 private:
0171 };
0172
0173 #endif