File indexing completed on 2024-09-08 23:51:31
0001 #ifndef HDQMSummary_h
0002 #define HDQMSummary_h
0003
0004 #include "CondFormats/Serialization/interface/Serializable.h"
0005
0006 #include <vector>
0007 #include <map>
0008 #include <iostream>
0009 #include "FWCore/Utilities/interface/Exception.h"
0010 #include <cstdint>
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039 class HDQMSummary {
0040 public:
0041 struct DetRegistry {
0042 uint32_t detid;
0043 uint32_t ibegin;
0044
0045 COND_SERIALIZABLE;
0046 };
0047
0048 class StrictWeakOrdering {
0049 public:
0050 bool operator()(const DetRegistry& p, const uint32_t& i) const { return p.detid < i; }
0051 };
0052
0053
0054
0055 typedef std::vector<float>::const_iterator ContainerIterator;
0056 typedef std::pair<ContainerIterator, ContainerIterator> Range;
0057 typedef std::vector<DetRegistry> Registry;
0058 typedef Registry::const_iterator RegistryIterator;
0059 typedef std::vector<float> InputVector;
0060
0061 HDQMSummary(std::vector<std::string>& userDBContent);
0062 HDQMSummary(const HDQMSummary& input);
0063 HDQMSummary() {}
0064 ~HDQMSummary() {}
0065
0066 ContainerIterator getDataVectorBegin() const { return v_sum_.begin(); }
0067 ContainerIterator getDataVectorEnd() const { return v_sum_.end(); }
0068 RegistryIterator getRegistryVectorBegin() const { return indexes_.begin(); }
0069 RegistryIterator getRegistryVectorEnd() const { return indexes_.end(); }
0070
0071
0072
0073 const Range getRange(const uint32_t& detID) const;
0074
0075
0076
0077 std::vector<uint32_t> getDetIds() const;
0078
0079
0080
0081 bool put(const uint32_t& detID, InputVector& input, std::vector<std::string>& userContent);
0082 void setObj(const uint32_t& detID, std::string elementName, float value);
0083
0084
0085
0086
0087
0088 std::vector<float> getSummaryObj(uint32_t& detID, const std::vector<std::string>& list) const;
0089
0090
0091
0092 std::vector<float> getSummaryObj(std::string elementName) const;
0093
0094
0095 std::vector<float> getSummaryObj(uint32_t& detID) const;
0096
0097
0098 std::vector<float> getSummaryObj() const;
0099
0100
0101
0102 inline void setUserDBContent(const std::vector<std::string>& userDBContent) { userDBContent_ = userDBContent; }
0103 inline void setRunNr(int inputRunNr) { runNr_ = inputRunNr; }
0104 inline void setTimeValue(unsigned long long inputTimeValue) { timeValue_ = inputTimeValue; }
0105
0106 inline unsigned long long getTimeValue() const { return timeValue_; }
0107 inline std::vector<std::string> getUserDBContent() const { return userDBContent_; }
0108 inline int getRunNr() const { return runNr_; }
0109
0110
0111
0112 void print();
0113
0114
0115
0116 std::vector<std::string> userDBContent_;
0117 std::vector<float> v_sum_;
0118 std::vector<DetRegistry> indexes_;
0119
0120 int runNr_;
0121 unsigned long long timeValue_;
0122
0123 protected:
0124
0125 const short getPosition(std::string elementName) const;
0126
0127 COND_SERIALIZABLE;
0128 };
0129
0130 #endif