CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LMFCorrCoefDatComponent.cc
Go to the documentation of this file.
2 #include <math.h>
3 
5  init();
6 }
7 
9  init();
10 }
11 
13  oracle::occi::Connection* conn):
14  LMFDat(env, conn) {
15  init();
16 }
17 
19  m_className = "LMFCorrCoefDatComponent";
20  m_keys["P1"] = 0;
21  m_keys["P2"] = 1;
22  m_keys["P3"] = 2;
23  m_keys["P1E"] = 3;
24  m_keys["P2E"] = 4;
25  m_keys["P3E"] = 5;
26  m_keys["FLAG"] = 6;
27  m_keys["SEQ_ID"] = 7;
28  for (unsigned int i = 0; i < m_keys.size(); i++) {
29  m_type.push_back("NUMBER");
30  }
31 }
32 
34  return "lmfLmrSubIOV";
35 }
36 
38  return "LMF_CORR_COEF_DAT";
39 }
40 
42  return "LMR_SUB_IOV_ID";
43 }
44 
46  setInt(foreignKeyName(), iov.getID());
47  attach(foreignKeyName(), (LMFUnique*)&iov);
48  return *this;
49 }
50 
52  float p1, float p2, float p3) {
53  LMFDat::setData(id, "P1", p1);
54  LMFDat::setData(id, "P2", p2);
55  LMFDat::setData(id, "P3", p3);
56  return *this;
57 }
58 
60  float p1, float p2, float p3,
61  float p1e, float p2e, float p3e) {
62  setP123(id, p1, p2, p3);
63  setP123Errors(id, p1e, p2e, p3e);
64  return *this;
65 }
66 
68  float p1e, float p2e, float p3e) {
69  LMFDat::setData(id, "P1E", p1e);
70  LMFDat::setData(id, "P2E", p2e);
71  LMFDat::setData(id, "P3E", p3e);
72  return *this;
73 }
74 
76  LMFDat::setData(id, "FLAG", flag);
77  return *this;
78 }
79 
81  int seq_id) {
82  LMFDat::setData(id, "SEQ_ID", seq_id);
83  return *this;
84 }
85 
87  const LMFSeqDat &seq) {
88  LMFDat::setData(id, "SEQ_ID", seq.getID());
89  return *this;
90 }
91 
95  return iov;
96 }
97 
99  return getInt(foreignKeyName());
100 }
101 
103  std::vector<float> v;
104  v.push_back(getData(id, "P1"));
105  v.push_back(getData(id, "P2"));
106  v.push_back(getData(id, "P3"));
107  return v;
108 }
109 
110 std::vector<float> LMFCorrCoefDatComponent::getParameters(int id) {
111  std::vector<float> v;
112  v.push_back(getData(id, "P1"));
113  v.push_back(getData(id, "P2"));
114  v.push_back(getData(id, "P3"));
115  return v;
116 }
117 
119  std::vector<float> v;
120  v.push_back(getData(id, "P1E"));
121  v.push_back(getData(id, "P2E"));
122  v.push_back(getData(id, "P3E"));
123  return v;
124 }
125 
127  std::vector<float> v;
128  v.push_back(getData(id, "P1E"));
129  v.push_back(getData(id, "P2E"));
130  v.push_back(getData(id, "P3E"));
131  return v;
132 }
133 
135  return getData(id, "FLAG");
136 }
137 
139  return getData(id, "SEQ_ID");
140 }
141 
143  return getData(id, "SEQ_ID");
144 }
145 
147  int seq_id = getData(id, "SEQ_ID");
148  LMFSeqDat seq(m_env, m_conn);
149  seq.setByID(seq_id);
150  return seq;
151 }
152 
154  throw(std::runtime_error) {
155  int ret = 0;
156  try {
157  ret = LMFDat::writeDB();
158  }
159  catch (std::runtime_error &e) {
160  m_conn->rollback();
161  throw(e);
162  }
163  return ret;
164 }
std::string m_className
Definition: LMFUnique.h:99
int i
Definition: DBlmapReader.cc:9
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:33
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
long int flag
Definition: mlp_lapack.h:47
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
int getID() const
Definition: LMFUnique.h:52
int getSeqID(const EcalLogicID &id)
std::string getIovIdFieldName() const
LMFDat & setData(int logic_id, const std::vector< float > &data)
Definition: LMFDat.h:55
std::vector< std::string > m_type
Definition: LMFDat.h:150
LMFCorrCoefDatComponent & setP123Errors(const EcalLogicID &id, float p1e, float p2e, float p3e)
int writeDB()
Definition: LMFDat.cc:398
int getInt(std::string fieldname) const
Definition: LMFUnique.cc:203
void setByID(int id)
Definition: LMFUnique.cc:286
LMFCorrCoefDatComponent & setSequence(const EcalLogicID &id, int seq_id)
LMFLmrSubIOV getLMFLmrSubIOV() const
tuple iov
Definition: o2o.py:307
std::vector< float > getParameters(const EcalLogicID &id)
Definition: LMFDat.h:19
std::string getTableName() const
double p2[4]
Definition: TauolaWrapper.h:90
std::map< int, std::vector< float > > getData()
Definition: LMFDat.cc:636
LMFSeqDat getSequence(const EcalLogicID &id)
LMFCorrCoefDatComponent & setP123(const EcalLogicID &id, float p1, float p2, float p3)
std::string foreignKeyName() const
double p1[4]
Definition: TauolaWrapper.h:89
std::map< std::string, unsigned int > m_keys
Definition: LMFDat.h:155
std::vector< float > getParameterErrors(const EcalLogicID &id)
LMFCorrCoefDatComponent & setFlag(const EcalLogicID &id, int flag)
LMFCorrCoefDatComponent & setLMFLmrSubIOV(const LMFLmrSubIOV &iov)
void attach(std::string name, LMFUnique *u)
Definition: LMFUnique.cc:50
mathSSE::Vec4< T > v
tuple conn
Definition: results_mgr.py:53
int getFlag(const EcalLogicID &id)
double p3[4]
Definition: TauolaWrapper.h:91