CMS 3D CMS Logo

HDQMSummary.h
Go to the documentation of this file.
1 #ifndef HDQMSummary_h
2 #define HDQMSummary_h
3 
5 
6 #include <vector>
7 #include <map>
8 #include <iostream>
10 #include <cstdint>
11 
18 /*
19 namespace hdqmsummary {
20  enum CMSRegion { TRACKER = 0,
21  TIB = 1,
22  TIB_1 = 11, TIB_2 = 12, TIB_3 = 13, TIB_4 = 14,
23  TOB = 2,
24  TOB_1 = 21, TOB_2 = 22, TOB_3 = 23, TOB_4 = 24, TOB_5 = 25, TOB_6 = 26,
25  TID = 3,
26  TIDM = 31,
27  TIDP = 32,
28  TIDM_1 = 311, TIDM_2 = 312, TIDM_3 = 313,
29  TIDP_1 = 321, TIDP_2 = 322, TIDP_3 = 323,
30  TEC = 4,
31  TECM = 41,
32  TECP = 42,
33  TECM_1 = 411, TECM_2 = 412, TECM_3 = 413, TECM_4 = 414, TECM_5 = 415, TECM_6 = 416, TECM_7 = 417, TECM_8 = 418, TECM_9 = 419,
34  TECP_1 = 421, TECP_2 = 422, TECP_3 = 423, TECP_4 = 424, TECP_5 = 425, TECP_6 = 426, TECP_7 = 427, TECP_8 = 428, TECP_9 = 429
35  };
36 }
37 */
38 
39 class HDQMSummary {
40 public:
41  struct DetRegistry {
42  uint32_t detid;
43  uint32_t ibegin;
44 
46  };
47 
49  public:
50  bool operator()(const DetRegistry& p, const uint32_t& i) const { return p.detid < i; }
51  };
52 
53  // SOME DEFINITIONS
54  //
55  typedef std::vector<float>::const_iterator ContainerIterator;
56  typedef std::pair<ContainerIterator, ContainerIterator> Range;
57  typedef std::vector<DetRegistry> Registry;
58  typedef Registry::const_iterator RegistryIterator;
59  typedef std::vector<float> InputVector;
60 
61  HDQMSummary(std::vector<std::string>& userDBContent);
65 
66  ContainerIterator getDataVectorBegin() const { return v_sum_.begin(); }
67  ContainerIterator getDataVectorEnd() const { return v_sum_.end(); }
68  RegistryIterator getRegistryVectorBegin() const { return indexes_.begin(); }
70 
71  // RETURNS POSITION OF DETID IN v_sum_
72  //
73  const Range getRange(const uint32_t& detID) const;
74 
75  // RETURNS LIST OF DETIDS
76  //
77  std::vector<uint32_t> getDetIds() const;
78 
79  // INSERT SUMMARY OBJECTS...
80  //
81  bool put(const uint32_t& detID, InputVector& input, std::vector<std::string>& userContent);
82  void setObj(const uint32_t& detID, std::string elementName, float value);
83 
84  // RETRIEVE SUMMARY OBJECTS...
85  //
86 
87  // returns a vector of selected infos related to a given detId
88  std::vector<float> getSummaryObj(uint32_t& detID, const std::vector<std::string>& list) const;
89 
90  // returns a vector filled with "info elementName" for each detId
91  // The order is SORTED according to the one used in getDetIds() !
92  std::vector<float> getSummaryObj(std::string elementName) const;
93 
94  // returns the entire SummaryObj related to one detId
95  std::vector<float> getSummaryObj(uint32_t& detID) const;
96 
97  // returns everything, all SummaryObjects for all detIds (unsorted !)
98  std::vector<float> getSummaryObj() const;
99 
100  // INLINE METHODS ABOUT RUN, TIME VALUE...
101  //
102  inline void setUserDBContent(const std::vector<std::string>& userDBContent) { userDBContent_ = userDBContent; }
103  inline void setRunNr(int inputRunNr) { runNr_ = inputRunNr; }
104  inline void setTimeValue(unsigned long long inputTimeValue) { timeValue_ = inputTimeValue; }
105 
106  inline unsigned long long getTimeValue() const { return timeValue_; }
107  inline std::vector<std::string> getUserDBContent() const { return userDBContent_; }
108  inline int getRunNr() const { return runNr_; }
109 
110  // PRINT METHOD...
111  //
112  void print();
113 
114  // HDQMSummary MEMBERS...
115  //
116  std::vector<std::string> userDBContent_;
117  std::vector<float> v_sum_;
118  std::vector<DetRegistry> indexes_;
119 
120  int runNr_;
121  unsigned long long timeValue_;
122 
123 protected:
124  // RETURNS POSITION OF ELEMENTNAME IN userDBContent_
125  const short getPosition(std::string elementName) const;
126 
128 };
129 
130 #endif
std::pair< ContainerIterator, ContainerIterator > Range
Definition: HDQMSummary.h:56
void setRunNr(int inputRunNr)
Definition: HDQMSummary.h:103
RegistryIterator getRegistryVectorEnd() const
Definition: HDQMSummary.h:69
RegistryIterator getRegistryVectorBegin() const
Definition: HDQMSummary.h:68
bool put(const uint32_t &detID, InputVector &input, std::vector< std::string > &userContent)
Definition: HDQMSummary.cc:22
const Range getRange(const uint32_t &detID) const
Definition: HDQMSummary.cc:53
std::vector< float > v_sum_
Definition: HDQMSummary.h:117
void setTimeValue(unsigned long long inputTimeValue)
Definition: HDQMSummary.h:104
void setObj(const uint32_t &detID, std::string elementName, float value)
Definition: HDQMSummary.cc:86
std::vector< float > getSummaryObj() const
Definition: HDQMSummary.cc:139
static std::string const input
Definition: EdmProvDump.cc:50
unsigned long long getTimeValue() const
Definition: HDQMSummary.h:106
unsigned long long timeValue_
Definition: HDQMSummary.h:121
void setUserDBContent(const std::vector< std::string > &userDBContent)
Definition: HDQMSummary.h:102
std::vector< DetRegistry > Registry
Definition: HDQMSummary.h:57
std::vector< float > InputVector
Definition: HDQMSummary.h:59
std::vector< uint32_t > getDetIds() const
Definition: HDQMSummary.cc:62
void print()
Definition: HDQMSummary.cc:160
Registry::const_iterator RegistryIterator
Definition: HDQMSummary.h:58
std::vector< DetRegistry > indexes_
Definition: HDQMSummary.h:118
Definition: value.py:1
std::vector< std::string > getUserDBContent() const
Definition: HDQMSummary.h:107
std::vector< std::string > userDBContent_
Definition: HDQMSummary.h:116
bool operator()(const DetRegistry &p, const uint32_t &i) const
Definition: HDQMSummary.h:50
int getRunNr() const
Definition: HDQMSummary.h:108
#define COND_SERIALIZABLE
Definition: Serializable.h:39
ContainerIterator getDataVectorEnd() const
Definition: HDQMSummary.h:67
std::vector< float >::const_iterator ContainerIterator
Definition: HDQMSummary.h:55
ContainerIterator getDataVectorBegin() const
Definition: HDQMSummary.h:66
const short getPosition(std::string elementName) const
Definition: HDQMSummary.cc:73