CMS 3D CMS Logo

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;
17  ~MonPulseShapeDat() override;
18 
19  // User data methods
20  inline std::string getTable() override { return "MON_PULSE_SHAPE_DAT"; }
21 
22  inline void setSamples(std::vector<float>& samples, int gain) noexcept(false) {
23  if (samples.size() != 10) {
24  throw(std::runtime_error("MonPulseShapeDat::setSamples: There should be 10 samples."));
25  }
26 
27  if (gain == 1) {
29  } else if (gain == 6) {
31  } else if (gain == 12) {
33  } else {
34  throw(std::runtime_error("MonPulseShapeDat::setSamples: Gain should be 1, 6 or 12"));
35  }
36  }
37 
38  inline std::vector<float> getSamples(int gain) const noexcept(false) {
39  if (gain == 1) {
40  return m_samplesG1;
41  } else if (gain == 6) {
42  return m_samplesG6;
43  } else if (gain == 12) {
44  return m_samplesG12;
45  } else {
46  throw(std::runtime_error("MonPulseShapeDat::getSamples: Gain should be 1, 6 or 12"));
47  }
48  }
49 
50 private:
51  void prepareWrite() noexcept(false) override;
52 
53  void writeDB(const EcalLogicID* ecid, const MonPulseShapeDat* item, MonRunIOV* iov) noexcept(false);
54 
55  void fetchData(std::map<EcalLogicID, MonPulseShapeDat>* fillVec, MonRunIOV* iov) noexcept(false);
56 
57  // User data
61 };
62 
63 #endif
EcalCondDBInterface
Definition: EcalCondDBInterface.h:37
IDataItem.h
MonPulseShapeDat::prepareWrite
void prepareWrite() noexcept(false) override
Definition: MonPulseShapeDat.cc:25
funct::false
false
Definition: Factorize.h:29
MonPulseShapeDat::m_samplesG12
std::vector< float > m_samplesG12
Definition: MonPulseShapeDat.h:60
MonPulseShapeDat::getSamples
std::vector< float > getSamples(int gain) const noexcept(false)
Definition: MonPulseShapeDat.h:38
watchdog.const
const
Definition: watchdog.py:83
EgammaValidation_cff.samples
samples
Definition: EgammaValidation_cff.py:19
IDataItem
Definition: IDataItem.h:16
EcalLogicID
Definition: EcalLogicID.h:7
MonPulseShapeDat::writeDB
void writeDB(const EcalLogicID *ecid, const MonPulseShapeDat *item, MonRunIOV *iov) noexcept(false)
Definition: MonPulseShapeDat.cc:51
MonPulseShapeDat::~MonPulseShapeDat
~MonPulseShapeDat() override
Definition: MonPulseShapeDat.cc:23
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MonRunIOV.h
MonPulseShapeDat::m_samplesG1
std::vector< float > m_samplesG1
Definition: MonPulseShapeDat.h:58
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
MonPulseShapeDat::MonPulseShapeDat
MonPulseShapeDat()
Definition: MonPulseShapeDat.cc:12
MonRunIOV
Definition: MonRunIOV.h:14
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
PedestalClient_cfi.gain
gain
Definition: PedestalClient_cfi.py:37
MonRunTag.h
EcalLogicID.h
MonPulseShapeDat::m_samplesG6
std::vector< float > m_samplesG6
Definition: MonPulseShapeDat.h:59
std
Definition: JetResolutionObject.h:76
MonPulseShapeDat::getTable
std::string getTable() override
Definition: MonPulseShapeDat.h:20
MonPulseShapeDat::setSamples
void setSamples(std::vector< float > &samples, int gain) noexcept(false)
Definition: MonPulseShapeDat.h:22
MonPulseShapeDat::fetchData
void fetchData(std::map< EcalLogicID, MonPulseShapeDat > *fillVec, MonRunIOV *iov) noexcept(false)
Definition: MonPulseShapeDat.cc:86
genParticles_cff.map
map
Definition: genParticles_cff.py:11
MonPulseShapeDat
Definition: MonPulseShapeDat.h:13