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(); }
96  RegistryIterator getRegistryVectorEnd() const { return indexes_.end(); }
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
ContainerIterator getDataVectorBegin() const
unsigned long long getTimeValue() const
std::vector< DetRegistry > indexes_
void setRunNr(int inputRunNr)
Registry::const_iterator RegistryIterator
std::pair< ContainerIterator, ContainerIterator > Range
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
static std::string const input
Definition: EdmProvDump.cc:48
void put(edm::Event &evt, double value, const char *instanceName)
std::vector< float > v_sum_
RegistryIterator getRegistryVectorBegin() const
unsigned long long timeValue_
std::vector< float > InputVector
Definition: value.py:1
std::vector< std::string > getUserDBContent() const
int getRunNr() const
#define COND_SERIALIZABLE
Definition: Serializable.h:38
RegistryIterator getRegistryVectorEnd() const
bool operator()(const DetRegistry &p, const uint32_t &i) const
std::vector< float >::const_iterator ContainerIterator
std::vector< std::string > userDBContent_
void setUserDBContent(const std::vector< std::string > &userDBContent)
void setTimeValue(unsigned long long inputTimeValue)
std::vector< DetRegistry > Registry
ContainerIterator getDataVectorEnd() const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run