CMS 3D CMS Logo

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