test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MonPulseShapeDat.h
Go to the documentation of this file.
1 #ifndef MONPULSESHAPEDAT_H
2 #define MONPULSESHAPEDAT_H
3 
4 #include <vector>
5 #include <map>
6 #include <stdexcept>
7 
12 
13 class MonPulseShapeDat : public IDataItem {
14  public:
15  friend class EcalCondDBInterface;
18 
19  // User data methods
20  inline std::string getTable() { return "MON_PULSE_SHAPE_DAT"; }
21 
22  inline void setSamples( std::vector<float> &samples, int gain )
23  throw(std::runtime_error)
24  {
25  if (samples.size() != 10) {
26  throw(std::runtime_error("MonPulseShapeDat::setSamples: There should be 10 samples."));
27  }
28 
29  if (gain == 1) {
30  m_samplesG1 = samples;
31  } else if (gain == 6) {
32  m_samplesG6 = samples;
33  } else if (gain == 12) {
34  m_samplesG12 = samples;
35  } else {
36  throw(std::runtime_error("MonPulseShapeDat::setSamples: Gain should be 1, 6 or 12"));
37  }
38  }
39 
40  inline std::vector<float> getSamples(int gain) const
41  throw(std::runtime_error)
42  {
43  if (gain == 1) {
44  return m_samplesG1;
45  } else if (gain == 6) {
46  return m_samplesG6;
47  } else if (gain == 12) {
48  return m_samplesG12;
49  } else {
50  throw(std::runtime_error("MonPulseShapeDat::getSamples: Gain should be 1, 6 or 12"));
51  }
52  }
53 
54  private:
55  void prepareWrite()
56  throw(std::runtime_error);
57 
59  throw(std::runtime_error);
60 
61  void fetchData(std::map< EcalLogicID, MonPulseShapeDat >* fillVec, MonRunIOV* iov)
62  throw(std::runtime_error);
63 
64  // User data
65  std::vector<float> m_samplesG1;
66  std::vector<float> m_samplesG6;
67  std::vector<float> m_samplesG12;
68 };
69 
70 #endif
std::vector< float > m_samplesG1
std::vector< float > getSamples(int gain) const
std::vector< float > m_samplesG6
void setSamples(std::vector< float > &samples, int gain)
std::vector< float > m_samplesG12
tuple iov
Definition: o2o.py:307
std::string getTable()
string const
Definition: compareJSON.py:14
void fetchData(std::map< EcalLogicID, MonPulseShapeDat > *fillVec, MonRunIOV *iov)
void writeDB(const EcalLogicID *ecid, const MonPulseShapeDat *item, MonRunIOV *iov)