CMS 3D CMS Logo

RPCFw.cc
Go to the documentation of this file.
1 
2 /*
3  * See header file for a description of this class.
4  *
5  * \author D. Pagano - Dip. Fis. Nucl. e Teo. & INFN Pavia
6  */
7 
9 #include "RelationalAccess/ISession.h"
10 #include "RelationalAccess/ITransaction.h"
11 #include "RelationalAccess/ISchema.h"
12 #include "RelationalAccess/ITable.h"
13 #include "RelationalAccess/ITableDataEditor.h"
14 #include "RelationalAccess/TableDescription.h"
15 #include "RelationalAccess/IQuery.h"
16 #include "RelationalAccess/ICursor.h"
17 
18 #include "CoralBase/AttributeList.h"
19 #include "CoralBase/Attribute.h"
20 #include "CoralBase/AttributeSpecification.h"
21 #include <iostream>
22 #include <stdexcept>
23 #include <vector>
24 #include <cmath>
25 #include <iostream>
26 #include <sstream>
27 #include <ctime>
29 
31  : RPCDBCom(), m_connectionString(connectionString), m_userName(userName), m_password(password) {}
32 
34 
35 void RPCFw::run() {}
36 
37 //----------------------------- I M O N ------------------------------------------------------------------------
38 std::vector<RPCObImon::I_Item> RPCFw::createIMON(long long since, long long till) {
39  tMIN = UTtoT(since);
40  std::cout << ">> Processing since: " << tMIN.day() << "/" << tMIN.month() << "/" << tMIN.year() << " " << tMIN.hour()
41  << ":" << tMIN.minute() << "." << tMIN.second() << std::endl;
42 
43  coral::ISession* session = this->connect(m_connectionString, m_userName, m_password);
44  session->transaction().start(true);
45  coral::ISchema& schema = session->nominalSchema();
46  coral::IQuery* queryI = schema.newQuery();
47  queryI->addToTableList("FWCAENCHANNEL");
48  queryI->addToOutputList("FWCAENCHANNEL.DPID", "DPID");
49  queryI->addToOutputList("FWCAENCHANNEL.CHANGE_DATE", "TSTAMP");
50  queryI->addToOutputList("FWCAENCHANNEL.ACTUAL_IMON", "IMON");
51 
52  RPCObImon::I_Item Itemp;
53  std::vector<RPCObImon::I_Item> imonarray;
54  coral::TimeStamp tlast = tMIN;
55  if (till > since) {
56  tMAX = UTtoT(till);
57  std::cout << ">> Processing till: " << tMAX.day() << "/" << tMAX.month() << "/" << tMAX.year() << " " << tMAX.hour()
58  << ":" << tMAX.minute() << "." << tMAX.second() << std::endl;
59  std::cout << ">> creating IMON object..." << std::endl;
60  coral::AttributeList conditionData;
61  conditionData.extend<coral::TimeStamp>("tmin");
62  conditionData.extend<coral::TimeStamp>("tmax");
63  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
64  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
65  std::string condition = "FWCAENCHANNEL.ACTUAL_IMON IS NOT NULL AND CHANGE_DATE >:tmin AND CHANGE_DATE <:tmax";
66  queryI->setCondition(condition, conditionData);
67  coral::ICursor& cursorI = queryI->execute();
68  while (cursorI.next()) {
69  const coral::AttributeList& row = cursorI.currentRow();
70  float idoub = row["DPID"].data<float>();
71  int id = static_cast<int>(idoub);
72  float val = row["IMON"].data<float>();
73  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
74  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
75  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
76  Itemp.dpid = id;
77  Itemp.value = val;
78  Itemp.day = ndate;
79  Itemp.time = ntime;
80  imonarray.push_back(Itemp);
81  }
82  } else {
83  std::cout << ">> creating IMON object..." << std::endl;
84  coral::AttributeList conditionData;
85  conditionData.extend<coral::TimeStamp>("tmin");
86  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
87  std::string condition = "FWCAENCHANNEL.ACTUAL_IMON IS NOT NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin";
88  queryI->setCondition(condition, conditionData);
89  coral::ICursor& cursorI = queryI->execute();
90  while (cursorI.next()) {
91  const coral::AttributeList& row = cursorI.currentRow();
92  float idoub = row["DPID"].data<float>();
93  int id = static_cast<int>(idoub);
94  float val = row["IMON"].data<float>();
95  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
96  if (isMajor(ts, tlast))
97  tlast = ts;
98  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
99  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
100  Itemp.dpid = id;
101  Itemp.value = val;
102  Itemp.day = ndate;
103  Itemp.time = ntime;
104  imonarray.push_back(Itemp);
105  }
106  }
107  N_IOV = TtoUT(tlast);
108  if (till > since)
109  N_IOV = till;
110  std::cout << ">> Imon array --> size: " << imonarray.size() << " >> done." << std::endl;
111  delete queryI;
112  session->transaction().commit();
113  delete session;
114  return imonarray;
115 }
116 
117 //------------------------------------------------------- V M O N ---------------------------------------------------
118 std::vector<RPCObVmon::V_Item> RPCFw::createVMON(long long since, long long till) {
119  tMIN = UTtoT(since);
120  std::cout << ">> Processing since: " << tMIN.day() << "/" << tMIN.month() << "/" << tMIN.year() << " " << tMIN.hour()
121  << ":" << tMIN.minute() << "." << tMIN.second() << std::endl;
122 
123  coral::ISession* session = this->connect(m_connectionString, m_userName, m_password);
124  session->transaction().start(true);
125  coral::ISchema& schema = session->nominalSchema();
126  coral::IQuery* queryV = schema.newQuery();
127  queryV->addToTableList("FWCAENCHANNEL");
128  queryV->addToOutputList("FWCAENCHANNEL.DPID", "DPID");
129  queryV->addToOutputList("FWCAENCHANNEL.CHANGE_DATE", "TSTAMP");
130  queryV->addToOutputList("FWCAENCHANNEL.ACTUAL_VMON", "VMON");
131  RPCObVmon::V_Item Vtemp;
132  std::vector<RPCObVmon::V_Item> vmonarray;
133  coral::TimeStamp tlast = tMIN;
134  if (till > since) {
135  tMAX = UTtoT(till);
136  std::cout << ">> Processing till: " << tMAX.day() << "/" << tMAX.month() << "/" << tMAX.year() << " " << tMAX.hour()
137  << ":" << tMAX.minute() << "." << tMAX.second() << std::endl;
138  std::cout << ">> creating VMON object..." << std::endl;
139  coral::AttributeList conditionData;
140  conditionData.extend<coral::TimeStamp>("tmin");
141  conditionData.extend<coral::TimeStamp>("tmax");
142  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
143  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
144  std::string condition =
145  " NOT FWCAENCHANNEL.ACTUAL_VMON IS NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin AND FWCAENCHANNEL.CHANGE_DATE "
146  "<:tmax";
147  queryV->setCondition(condition, conditionData);
148  coral::ICursor& cursorV = queryV->execute();
149  while (cursorV.next()) {
150  const coral::AttributeList& row = cursorV.currentRow();
151  float idoub = row["DPID"].data<float>();
152  int id = static_cast<int>(idoub);
153  float val = row["VMON"].data<float>();
154  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
155  if (isMajor(ts, tlast))
156  tlast = ts;
157  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
158  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
159  Vtemp.dpid = id;
160  Vtemp.value = val;
161  Vtemp.day = ndate;
162  Vtemp.time = ntime;
163  vmonarray.push_back(Vtemp);
164  }
165  } else {
166  std::cout << ">> creating VMON object..." << std::endl;
167  coral::AttributeList conditionData;
168  conditionData.extend<coral::TimeStamp>("tmin");
169  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
170  std::string condition = " NOT FWCAENCHANNEL.ACTUAL_VMON IS NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin";
171  queryV->setCondition(condition, conditionData);
172  coral::ICursor& cursorV = queryV->execute();
173  while (cursorV.next()) {
174  const coral::AttributeList& row = cursorV.currentRow();
175  float idoub = row["DPID"].data<float>();
176  int id = static_cast<int>(idoub);
177  float val = row["VMON"].data<float>();
178  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
179  if (isMajor(ts, tlast))
180  tlast = ts;
181  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
182  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
183  Vtemp.dpid = id;
184  Vtemp.value = val;
185  Vtemp.day = ndate;
186  Vtemp.time = ntime;
187  vmonarray.push_back(Vtemp);
188  }
189  }
190 
191  std::cout << ">> Vmon array --> size: " << vmonarray.size() << " >> done." << std::endl;
192  delete queryV;
193  session->transaction().commit();
194  delete session;
195  return vmonarray;
196 }
197 
198 //------------------------------ S T A T U S ---------------------------------------------------------------------
199 std::vector<RPCObStatus::S_Item> RPCFw::createSTATUS(long long since, long long till) {
200  tMIN = UTtoT(since);
201  std::cout << ">> Processing since: " << tMIN.day() << "/" << tMIN.month() << "/" << tMIN.year() << " " << tMIN.hour()
202  << ":" << tMIN.minute() << "." << tMIN.second() << std::endl;
203 
204  coral::ISession* session = this->connect(m_connectionString, m_userName, m_password);
205  session->transaction().start(true);
206  coral::ISchema& schema = session->nominalSchema();
207  std::cout << ">> creating STATUS object..." << std::endl;
208  coral::IQuery* queryS = schema.newQuery();
209  queryS->addToTableList("FWCAENCHANNEL");
210  queryS->addToOutputList("FWCAENCHANNEL.DPID", "DPID");
211  queryS->addToOutputList("FWCAENCHANNEL.CHANGE_DATE", "TSTAMP");
212  queryS->addToOutputList("FWCAENCHANNEL.ACTUAL_STATUS", "STATUS");
213  RPCObStatus::S_Item Stemp;
214  std::vector<RPCObStatus::S_Item> statusarray;
215  coral::TimeStamp tlast = tMIN;
216  if (till > since) {
217  tMAX = UTtoT(till);
218  std::cout << ">> Processing till: " << tMAX.day() << "/" << tMAX.month() << "/" << tMAX.year() << " " << tMAX.hour()
219  << ":" << tMAX.minute() << "." << tMAX.second() << std::endl;
220  std::cout << ">> creating STATUS object..." << std::endl;
221  coral::AttributeList conditionData;
222  conditionData.extend<coral::TimeStamp>("tmin");
223  conditionData.extend<coral::TimeStamp>("tmax");
224  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
225  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
226  std::string condition =
227  " NOT FWCAENCHANNEL.ACTUAL_STATUS IS NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin AND FWCAENCHANNEL.CHANGE_DATE "
228  "<:tmax";
229  queryS->setCondition(condition, conditionData);
230  coral::ICursor& cursorS = queryS->execute();
231  while (cursorS.next()) {
232  const coral::AttributeList& row = cursorS.currentRow();
233  float idoub = row["DPID"].data<float>();
234  int id = static_cast<int>(idoub);
235  float val = row["STATUS"].data<float>();
236  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
237  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
238  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
239  Stemp.dpid = id;
240  Stemp.value = val;
241  Stemp.day = ndate;
242  Stemp.time = ntime;
243  statusarray.push_back(Stemp);
244  }
245  } else {
246  std::cout << ">> creating STATUS object..." << std::endl;
247  coral::AttributeList conditionData;
248  conditionData.extend<coral::TimeStamp>("tmin");
249  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
250  std::string condition = " NOT FWCAENCHANNEL.ACTUAL_STATUS IS NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin";
251  queryS->setCondition(condition, conditionData);
252  coral::ICursor& cursorS = queryS->execute();
253  while (cursorS.next()) {
254  const coral::AttributeList& row = cursorS.currentRow();
255  float idoub = row["DPID"].data<float>();
256  int id = static_cast<int>(idoub);
257  float val = row["STATUS"].data<float>();
258  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
259  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
260  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
261  Stemp.dpid = id;
262  Stemp.value = val;
263  Stemp.day = ndate;
264  Stemp.time = ntime;
265  statusarray.push_back(Stemp);
266  }
267  }
268  std::cout << ">> Staus array --> size: " << statusarray.size() << " >> done." << std::endl << std::endl << std::endl;
269 
270  delete queryS;
271  session->transaction().commit();
272  delete session;
273 
274  return statusarray;
275 }
276 
277 //------------------------------ G A S ---------------------------------------------------------------------
278 std::vector<RPCObGas::Item> RPCFw::createGAS(long long since, long long till) {
279  tMIN = UTtoT(since);
280  std::cout << ">> Processing since: " << tMIN.day() << "/" << tMIN.month() << "/" << tMIN.year() << " " << tMIN.hour()
281  << ":" << tMIN.minute() << "." << tMIN.second() << std::endl;
282 
283  coral::ISession* session = this->connect(m_connectionString, m_userName, m_password);
284  session->transaction().start(true);
285  coral::ISchema& schema = session->nominalSchema();
286 
287  coral::TimeStamp tlast = tMIN;
288 
289  // FLOWIN
290  coral::IQuery* querySIN = schema.newQuery();
291  querySIN->addToTableList("RPCGASCHANNEL");
292  querySIN->addToOutputList("RPCGASCHANNEL.DPID", "DPID");
293  querySIN->addToOutputList("RPCGASCHANNEL.CHANGE_DATE", "TSTAMP");
294  querySIN->addToOutputList("RPCGASCHANNEL.FLOWIN", "FLOWIN");
295 
296  // FLOWOUT
297  coral::IQuery* querySOUT = schema.newQuery();
298  querySOUT->addToTableList("RPCGASCHANNEL");
299  querySOUT->addToOutputList("RPCGASCHANNEL.DPID", "DPID");
300  querySOUT->addToOutputList("RPCGASCHANNEL.CHANGE_DATE", "TSTAMP");
301  querySOUT->addToOutputList("RPCGASCHANNEL.FLOWOUT", "FLOWOUT");
302 
303  RPCObGas::Item gastemp;
304  std::vector<RPCObGas::Item> gasarray;
305 
306  if (till > since) {
307  tMAX = UTtoT(till);
308  std::cout << ">> Processing till: " << tMAX.day() << "/" << tMAX.month() << "/" << tMAX.year() << " " << tMAX.hour()
309  << ":" << tMAX.minute() << "." << tMAX.second() << std::endl;
310  std::cout << ">> creating GAS object..." << std::endl;
311  std::cout << ">> processing FLOWIN..." << std::endl;
312  coral::AttributeList conditionData;
313  conditionData.extend<coral::TimeStamp>("tmin");
314  conditionData.extend<coral::TimeStamp>("tmax");
315  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
316  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
317  std::string conditionIN = "RPCGASCHANNEL.FLOWIN IS NOT NULL AND CHANGE_DATE >:tmin AND CHANGE_DATE <:tmax";
318 
319  querySIN->setCondition(conditionIN, conditionData);
320  coral::ICursor& cursorSIN = querySIN->execute();
321  while (cursorSIN.next()) {
322  gastemp.dpid = 0;
323  gastemp.flowin = 0;
324  gastemp.flowout = 0;
325  gastemp.day = 0;
326  gastemp.time = 0;
327  const coral::AttributeList& row = cursorSIN.currentRow();
328  float idoub = row["DPID"].data<float>();
329  int id = static_cast<int>(idoub);
330  float val = row["FLOWIN"].data<float>();
331  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
332  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
333  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
334  gastemp.dpid = id;
335  gastemp.flowin = val;
336  gastemp.day = ndate;
337  gastemp.time = ntime;
338  gasarray.push_back(gastemp);
339  }
340  } else {
341  std::cout << ">> creating GAS object..." << std::endl;
342  std::cout << ">> processing FLOWIN..." << std::endl;
343  coral::AttributeList conditionData;
344  conditionData.extend<coral::TimeStamp>("tmin");
345  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
346  std::string conditionIN = "RPCGASCHANNEL.FLOWIN IS NOT NULL AND CHANGE_DATE >:tmin";
347  std::cout << "processing FLOWIN..." << std::endl;
348  querySIN->setCondition(conditionIN, conditionData);
349  coral::ICursor& cursorSIN = querySIN->execute();
350  while (cursorSIN.next()) {
351  gastemp.dpid = 0;
352  gastemp.flowin = 0;
353  gastemp.flowout = 0;
354  gastemp.day = 0;
355  gastemp.time = 0;
356  const coral::AttributeList& row = cursorSIN.currentRow();
357  float idoub = row["DPID"].data<float>();
358  int id = static_cast<int>(idoub);
359  float val = row["FLOWIN"].data<float>();
360  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
361  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
362  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
363  gastemp.dpid = id;
364  gastemp.flowin = val;
365  gastemp.day = ndate;
366  gastemp.time = ntime;
367  gasarray.push_back(gastemp);
368  }
369  }
370 
371  if (till > since) {
372  tMAX = UTtoT(till);
373  // std::cout <<">> Processing till: "<<tMAX.day()<<"/"<<tMAX.month()<<"/"<<tMAX.year()<<" "<<tMAX.hour()<<":"<<tMAX.minute()<<"."<<tMAX.second()<< std::endl;
374  std::cout << ">> processing FLOWOUT..." << std::endl;
375  coral::AttributeList conditionData;
376  conditionData.extend<coral::TimeStamp>("tmin");
377  conditionData.extend<coral::TimeStamp>("tmax");
378  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
379  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
380  std::string conditionOUT = "RPCGASCHANNEL.FLOWOUT IS NOT NULL AND CHANGE_DATE >:tmin AND CHANGE_DATE <:tmax";
381 
382  querySOUT->setCondition(conditionOUT, conditionData);
383  coral::ICursor& cursorSOUT = querySOUT->execute();
384  while (cursorSOUT.next()) {
385  gastemp.dpid = 0;
386  gastemp.flowin = 0;
387  gastemp.flowout = 0;
388  gastemp.day = 0;
389  gastemp.time = 0;
390  const coral::AttributeList& row = cursorSOUT.currentRow();
391  float idoub = row["DPID"].data<float>();
392  int id = static_cast<int>(idoub);
393  float val = row["FLOWOUT"].data<float>();
394  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
395  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
396  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
397  gastemp.dpid = id;
398  gastemp.flowout = val;
399  gastemp.day = ndate;
400  gastemp.time = ntime;
401  gasarray.push_back(gastemp);
402  }
403  } else {
404  std::cout << ">> processing FLOWOUT..." << std::endl;
405  coral::AttributeList conditionData;
406  conditionData.extend<coral::TimeStamp>("tmin");
407  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
408  std::string conditionOUT = "RPCGASCHANNEL.FLOWOUT IS NOT NULL AND CHANGE_DATE >:tmin";
409  querySOUT->setCondition(conditionOUT, conditionData);
410  coral::ICursor& cursorSOUT = querySOUT->execute();
411  while (cursorSOUT.next()) {
412  gastemp.dpid = 0;
413  gastemp.flowin = 0;
414  gastemp.flowout = 0;
415  gastemp.day = 0;
416  gastemp.time = 0;
417  const coral::AttributeList& row = cursorSOUT.currentRow();
418  float idoub = row["DPID"].data<float>();
419  int id = static_cast<int>(idoub);
420  float val = row["FLOWOUT"].data<float>();
421  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
422  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
423  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
424  gastemp.dpid = id;
425  gastemp.flowout = val;
426  gastemp.day = ndate;
427  gastemp.time = ntime;
428  gasarray.push_back(gastemp);
429  }
430  }
431 
432  N_IOV = TtoUT(tlast);
433  if (till > since)
434  N_IOV = till;
435  std::cout << ">> Gas array --> size: " << gasarray.size() << " >> done." << std::endl << std::endl << std::endl;
436 
437  delete querySIN;
438  delete querySOUT;
439  session->transaction().commit();
440  delete session;
441 
442  return gasarray;
443 }
444 
445 //------------------------------ T E M P E R A T U R E ---------------------------------------------------------------------
446 std::vector<RPCObTemp::T_Item> RPCFw::createT(long long since, long long till) {
447  tMIN = UTtoT(since);
448  std::cout << ">> Processing since: " << tMIN.day() << "/" << tMIN.month() << "/" << tMIN.year() << " " << tMIN.hour()
449  << ":" << tMIN.minute() << "." << tMIN.second() << std::endl;
450 
451  coral::ISession* session = this->connect(m_connectionString, m_userName, m_password);
452  session->transaction().start(true);
453  coral::ISchema& schema = session->nominalSchema();
454  coral::IQuery* queryS = schema.newQuery();
455  queryS->addToTableList("FWCAENCHANNELADC");
456  queryS->addToOutputList("FWCAENCHANNELADC.DPID", "DPID");
457  queryS->addToOutputList("FWCAENCHANNELADC.CHANGE_DATE", "TSTAMP");
458  queryS->addToOutputList("FWCAENCHANNELADC.ACTUAL_TEMPERATURE", "TEMPERATURE");
459  RPCObTemp::T_Item Ttemp;
460  std::vector<RPCObTemp::T_Item> temparray;
461  coral::TimeStamp tlast = tMIN;
462  if (till > since) {
463  tMAX = UTtoT(till);
464  std::cout << ">> Processing till: " << tMAX.day() << "/" << tMAX.month() << "/" << tMAX.year() << " " << tMAX.hour()
465  << ":" << tMAX.minute() << "." << tMAX.second() << std::endl;
466  std::cout << ">> creating TEMPERATURE object..." << std::endl;
467  coral::AttributeList conditionData;
468  conditionData.extend<coral::TimeStamp>("tmin");
469  conditionData.extend<coral::TimeStamp>("tmax");
470  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
471  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
472  std::string condition =
473  "FWCAENCHANNELADC.ACTUAL_TEMPERATURE IS NOT NULL AND CHANGE_DATE >:tmin AND CHANGE_DATE <:tmax";
474  queryS->setCondition(condition, conditionData);
475  coral::ICursor& cursorS = queryS->execute();
476  while (cursorS.next()) {
477  const coral::AttributeList& row = cursorS.currentRow();
478  float idoub = row["DPID"].data<float>();
479  int id = static_cast<int>(idoub);
480  float val = row["TEMPERATURE"].data<float>();
481  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
482  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
483  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
484 
485  Ttemp.dpid = id;
486  Ttemp.value = val;
487  Ttemp.day = ndate;
488  Ttemp.time = ntime;
489  temparray.push_back(Ttemp);
490  }
491  } else {
492  std::cout << ">> creating TEMPERATURE object..." << std::endl;
493  coral::AttributeList conditionData;
494  conditionData.extend<coral::TimeStamp>("tmin");
495  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
496  std::string condition = "FWCAENCHANNELADC.ACTUAL_TEMPERATURE IS NOT NULL AND CHANGE_DATE >:tmin";
497  queryS->setCondition(condition, conditionData);
498  coral::ICursor& cursorS = queryS->execute();
499  while (cursorS.next()) {
500  const coral::AttributeList& row = cursorS.currentRow();
501  float idoub = row["DPID"].data<float>();
502  int id = static_cast<int>(idoub);
503  float val = row["TEMPERATURE"].data<float>();
504  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
505  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
506  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
507 
508  Ttemp.dpid = id;
509  Ttemp.value = val;
510  Ttemp.day = ndate;
511  Ttemp.time = ntime;
512  temparray.push_back(Ttemp);
513  }
514  }
515  N_IOV = TtoUT(tlast);
516  if (till > since)
517  N_IOV = till;
518  std::cout << ">> Temperature array --> size: " << temparray.size() << " >> done." << std::endl
519  << std::endl
520  << std::endl;
521 
522  delete queryS;
523  session->transaction().commit();
524  delete session;
525 
526  return temparray;
527 }
528 
529 //----------------------------- I D M A P ------------------------------------------------------------------------
530 std::vector<RPCObPVSSmap::Item> RPCFw::createIDMAP() {
531  // float tMINi = 0;
532  std::cout << ">> Processing data..." << std::endl;
533 
534  coral::ISession* session = this->connect(m_connectionString, m_userName, m_password);
535  session->transaction().start(true);
536  coral::ISchema& schema = session->nominalSchema();
537  std::cout << ">> creating IDMAP object..." << std::endl;
538  coral::IQuery* queryM = schema.newQuery();
539  queryM->addToTableList("RPCPVSSDETID");
540  queryM->addToOutputList("RPCPVSSDETID.SINCE", "SINCE");
541  queryM->addToOutputList("RPCPVSSDETID.PVSS_ID", "PVSS_ID");
542  queryM->addToOutputList("RPCPVSSDETID.REGION", "REGION");
543  queryM->addToOutputList("RPCPVSSDETID.RING", "RING");
544  queryM->addToOutputList("RPCPVSSDETID.STATION", "STATION");
545  queryM->addToOutputList("RPCPVSSDETID.SECTOR", "SECTOR");
546  queryM->addToOutputList("RPCPVSSDETID.LAYER", "LAYER");
547  queryM->addToOutputList("RPCPVSSDETID.SUBSECTOR", "SUBSECTOR");
548  queryM->addToOutputList("RPCPVSSDETID.SUPPLYTYPE", "SUPPLYTYPE");
549 
550  std::string condM = "RPCPVSSDETID.PVSS_ID is not NULL";
551 
552  // queryM->setCondition(condM);
553  coral::ICursor& cursorM = queryM->execute();
554 
555  RPCObPVSSmap::Item Itemp;
556  std::vector<RPCObPVSSmap::Item> idmaparray;
557  while (cursorM.next()) {
558  const coral::AttributeList& row = cursorM.currentRow();
559  int id = row["PVSS_ID"].data<int>();
560  std::string reg_s = row["REGION"].data<std::string>();
561  std::string rin_s = row["RING"].data<std::string>();
562  std::string sta_s = row["STATION"].data<std::string>();
563  std::string sec_s = row["SECTOR"].data<std::string>();
564  std::string lay_s = row["LAYER"].data<std::string>();
565  std::string sub_s = row["SUBSECTOR"].data<std::string>();
566  std::string sup_s = row["SUPPLYTYPE"].data<std::string>();
567 
568  int reg = atoi(reg_s.c_str());
569  int rin = atoi(rin_s.c_str());
570  int sta = atoi(sta_s.c_str());
571  int sec = atoi(sec_s.c_str());
572  int lay = atoi(lay_s.c_str());
573  int sub = atoi(sub_s.c_str());
574  int sup = 5;
575 
576  if (sup_s == "HV")
577  sup = 0;
578  if (sup_s == "LVA")
579  sup = 1;
580  if (sup_s == "LVD")
581  sup = 2;
582  if (sup_s == "LB")
583  sup = 3;
584  if (sup_s == "T")
585  sup = 4;
586 
587  coral::TimeStamp ts = row["SINCE"].data<coral::TimeStamp>();
588 
589  std::ostringstream dday;
590  std::ostringstream dmon;
591  std::ostringstream dyea;
592  dday << ts.day();
593  dmon << ts.month();
594  dyea << ts.year();
595  std::string date = dday.str() + "-" + dmon.str() + "-" + dyea.str();
596 
597  Itemp.since = atoi(date.c_str());
598  Itemp.dpid = id;
599  Itemp.region = reg;
600  Itemp.ring = rin;
601  Itemp.station = sta;
602  Itemp.sector = sec;
603  Itemp.layer = lay;
604  Itemp.subsector = sub;
605  Itemp.suptype = sup;
606 
607  idmaparray.push_back(Itemp);
608  }
609 
610  std::cout << ">> IDMAP array --> size: " << idmaparray.size() << " >> done." << std::endl;
611  delete queryM;
612  session->transaction().commit();
613  delete session;
614  return idmaparray;
615 }
616 
617 //----------------------------- F E B ------------------------------------------------------------------------
618 std::vector<RPCObFebmap::Feb_Item> RPCFw::createFEB(long long since, long long till) {
619  tMIN = UTtoT(since);
620  std::cout << ">> Processing since: " << tMIN.day() << "/" << tMIN.month() << "/" << tMIN.year() << " " << tMIN.hour()
621  << ":" << tMIN.minute() << "." << tMIN.second() << std::endl;
622 
623  coral::ISession* session = this->connect(m_connectionString, m_userName, m_password);
624  session->transaction().start(true);
625  coral::ISchema& schema = session->nominalSchema();
626  std::cout << ">> creating FEB object..." << std::endl;
627 
628  // VTH1
629  coral::IQuery* queryFVTH1 = schema.newQuery();
630  queryFVTH1->addToTableList("RPCFEB");
631  queryFVTH1->addToOutputList("RPCFEB.DPID", "DPID");
632  queryFVTH1->addToOutputList("RPCFEB.CHANGE_DATE", "TSTAMP");
633  queryFVTH1->addToOutputList("RPCFEB.VTH1", "VTH1");
634 
635  // VTH2
636  coral::IQuery* queryFVTH2 = schema.newQuery();
637  queryFVTH2->addToTableList("RPCFEB");
638  queryFVTH2->addToOutputList("RPCFEB.DPID", "DPID");
639  queryFVTH2->addToOutputList("RPCFEB.CHANGE_DATE", "TSTAMP");
640  queryFVTH2->addToOutputList("RPCFEB.VTH2", "VTH2");
641 
642  // VTH3
643  coral::IQuery* queryFVTH3 = schema.newQuery();
644  queryFVTH3->addToTableList("RPCFEB");
645  queryFVTH3->addToOutputList("RPCFEB.DPID", "DPID");
646  queryFVTH3->addToOutputList("RPCFEB.CHANGE_DATE", "TSTAMP");
647  queryFVTH3->addToOutputList("RPCFEB.VTH3", "VTH3");
648 
649  // VTH4
650  coral::IQuery* queryFVTH4 = schema.newQuery();
651  queryFVTH4->addToTableList("RPCFEB");
652  queryFVTH4->addToOutputList("RPCFEB.DPID", "DPID");
653  queryFVTH4->addToOutputList("RPCFEB.CHANGE_DATE", "TSTAMP");
654  queryFVTH4->addToOutputList("RPCFEB.VTH4", "VTH4");
655 
656  // VMON1
657  coral::IQuery* queryFVMON1 = schema.newQuery();
658  queryFVMON1->addToTableList("RPCFEB");
659  queryFVMON1->addToOutputList("RPCFEB.DPID", "DPID");
660  queryFVMON1->addToOutputList("RPCFEB.CHANGE_DATE", "TSTAMP");
661  queryFVMON1->addToOutputList("RPCFEB.VMON1", "VMON1");
662 
663  // VMON2
664  coral::IQuery* queryFVMON2 = schema.newQuery();
665  queryFVMON2->addToTableList("RPCFEB");
666  queryFVMON2->addToOutputList("RPCFEB.DPID", "DPID");
667  queryFVMON2->addToOutputList("RPCFEB.CHANGE_DATE", "TSTAMP");
668  queryFVMON2->addToOutputList("RPCFEB.VMON2", "VMON2");
669 
670  // VMON3
671  coral::IQuery* queryFVMON3 = schema.newQuery();
672  queryFVMON3->addToTableList("RPCFEB");
673  queryFVMON3->addToOutputList("RPCFEB.DPID", "DPID");
674  queryFVMON3->addToOutputList("RPCFEB.CHANGE_DATE", "TSTAMP");
675  queryFVMON3->addToOutputList("RPCFEB.VMON3", "VMON3");
676 
677  // VMON4
678  coral::IQuery* queryFVMON4 = schema.newQuery();
679  queryFVMON4->addToTableList("RPCFEB");
680  queryFVMON4->addToOutputList("RPCFEB.DPID", "DPID");
681  queryFVMON4->addToOutputList("RPCFEB.CHANGE_DATE", "TSTAMP");
682  queryFVMON4->addToOutputList("RPCFEB.VMON4", "VMON4");
683 
684  // TEMP1
685  coral::IQuery* queryFTEMP1 = schema.newQuery();
686  queryFTEMP1->addToTableList("RPCFEB");
687  queryFTEMP1->addToOutputList("RPCFEB.DPID", "DPID");
688  queryFTEMP1->addToOutputList("RPCFEB.CHANGE_DATE", "TSTAMP");
689  queryFTEMP1->addToOutputList("RPCFEB.TEMPERATURE1", "TEMP1");
690 
691  // TEMP2
692  coral::IQuery* queryFTEMP2 = schema.newQuery();
693  queryFTEMP2->addToTableList("RPCFEB");
694  queryFTEMP2->addToOutputList("RPCFEB.DPID", "DPID");
695  queryFTEMP2->addToOutputList("RPCFEB.CHANGE_DATE", "TSTAMP");
696  queryFTEMP2->addToOutputList("RPCFEB.TEMPERATURE2", "TEMP2");
697 
698  RPCObFebmap::Feb_Item Itemp;
699  std::vector<RPCObFebmap::Feb_Item> febarray;
700  coral::TimeStamp tlast = tMIN;
701  if (till > since) {
702  tMAX = UTtoT(till);
703  std::cout << ">> Processing till: " << tMAX.day() << "/" << tMAX.month() << "/" << tMAX.year() << " " << tMAX.hour()
704  << ":" << tMAX.minute() << "." << tMAX.second() << std::endl;
705  std::cout << "Processing VTH1..." << std::endl;
706  coral::AttributeList conditionData;
707  conditionData.extend<coral::TimeStamp>("tmin");
708  conditionData.extend<coral::TimeStamp>("tmax");
709  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
710  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
711  std::string conditionVTH1 = "RPCFEB.VTH1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
712  queryFVTH1->setCondition(conditionVTH1, conditionData);
713  coral::ICursor& cursorFVTH1 = queryFVTH1->execute();
714  while (cursorFVTH1.next()) {
715  Itemp.thr1 = 0;
716  Itemp.thr2 = 0;
717  Itemp.thr3 = 0;
718  Itemp.thr4 = 0;
719  Itemp.vmon1 = 0;
720  Itemp.vmon2 = 0;
721  Itemp.vmon3 = 0;
722  Itemp.vmon4 = 0;
723  Itemp.temp1 = 0;
724  Itemp.temp2 = 0;
725  Itemp.noise1 = 0;
726  Itemp.noise2 = 0;
727  Itemp.noise3 = 0;
728  Itemp.noise4 = 0;
729  const coral::AttributeList& row = cursorFVTH1.currentRow();
730  float idoub = row["DPID"].data<float>();
731  int id = static_cast<int>(idoub);
732  float vth1 = row["VTH1"].data<float>();
733  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
734  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
735  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
736  Itemp.dpid = id;
737  Itemp.thr1 = vth1;
738  Itemp.day = ndate;
739  Itemp.time = ntime;
740  febarray.push_back(Itemp);
741  }
742  } else {
743  std::cout << ">> Processing VTH1..." << std::endl;
744  coral::AttributeList conditionData;
745  conditionData.extend<coral::TimeStamp>("tmin");
746  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
747  std::string conditionVTH1 = "RPCFEB.VTH1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
748  queryFVTH1->setCondition(conditionVTH1, conditionData);
749  coral::ICursor& cursorFVTH1 = queryFVTH1->execute();
750  while (cursorFVTH1.next()) {
751  Itemp.thr1 = 0;
752  Itemp.thr2 = 0;
753  Itemp.thr3 = 0;
754  Itemp.thr4 = 0;
755  Itemp.vmon1 = 0;
756  Itemp.vmon2 = 0;
757  Itemp.vmon3 = 0;
758  Itemp.vmon4 = 0;
759  Itemp.temp1 = 0;
760  Itemp.temp2 = 0;
761  Itemp.noise1 = 0;
762  Itemp.noise2 = 0;
763  Itemp.noise3 = 0;
764  Itemp.noise4 = 0;
765  const coral::AttributeList& row = cursorFVTH1.currentRow();
766  float idoub = row["DPID"].data<float>();
767  int id = static_cast<int>(idoub);
768  float vth1 = row["VTH1"].data<float>();
769  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
770  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
771  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
772  Itemp.dpid = id;
773  Itemp.thr1 = vth1;
774  Itemp.day = ndate;
775  Itemp.time = ntime;
776  febarray.push_back(Itemp);
777  }
778  }
779 
780  if (till > since) {
781  tMAX = UTtoT(till);
782  std::cout << "Processing VTH2..." << std::endl;
783  coral::AttributeList conditionData;
784  conditionData.extend<coral::TimeStamp>("tmin");
785  conditionData.extend<coral::TimeStamp>("tmax");
786  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
787  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
788  std::string conditionVTH2 = "RPCFEB.VTH2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
789  queryFVTH2->setCondition(conditionVTH2, conditionData);
790  coral::ICursor& cursorFVTH2 = queryFVTH2->execute();
791  while (cursorFVTH2.next()) {
792  Itemp.thr1 = 0;
793  Itemp.thr2 = 0;
794  Itemp.thr3 = 0;
795  Itemp.thr4 = 0;
796  Itemp.vmon1 = 0;
797  Itemp.vmon2 = 0;
798  Itemp.vmon3 = 0;
799  Itemp.vmon4 = 0;
800  Itemp.temp1 = 0;
801  Itemp.temp2 = 0;
802  Itemp.noise1 = 0;
803  Itemp.noise2 = 0;
804  Itemp.noise3 = 0;
805  Itemp.noise4 = 0;
806  const coral::AttributeList& row = cursorFVTH2.currentRow();
807  float idoub = row["DPID"].data<float>();
808  int id = static_cast<int>(idoub);
809  float vth2 = row["VTH2"].data<float>();
810  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
811  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
812  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
813  Itemp.dpid = id;
814  Itemp.thr2 = vth2;
815  Itemp.day = ndate;
816  Itemp.time = ntime;
817  febarray.push_back(Itemp);
818  }
819  } else {
820  std::cout << ">> Processing VTH2..." << std::endl;
821  coral::AttributeList conditionData;
822  conditionData.extend<coral::TimeStamp>("tmin");
823  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
824  std::string conditionVTH2 = "RPCFEB.VTH2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
825  queryFVTH2->setCondition(conditionVTH2, conditionData);
826  coral::ICursor& cursorFVTH2 = queryFVTH2->execute();
827  while (cursorFVTH2.next()) {
828  Itemp.thr1 = 0;
829  Itemp.thr2 = 0;
830  Itemp.thr3 = 0;
831  Itemp.thr4 = 0;
832  Itemp.vmon1 = 0;
833  Itemp.vmon2 = 0;
834  Itemp.vmon3 = 0;
835  Itemp.vmon4 = 0;
836  Itemp.temp1 = 0;
837  Itemp.temp2 = 0;
838  Itemp.noise1 = 0;
839  Itemp.noise2 = 0;
840  Itemp.noise3 = 0;
841  Itemp.noise4 = 0;
842  const coral::AttributeList& row = cursorFVTH2.currentRow();
843  float idoub = row["DPID"].data<float>();
844  int id = static_cast<int>(idoub);
845  float vth2 = row["VTH2"].data<float>();
846  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
847  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
848  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
849  Itemp.dpid = id;
850  Itemp.thr2 = vth2;
851  Itemp.day = ndate;
852  Itemp.time = ntime;
853  febarray.push_back(Itemp);
854  }
855  }
856 
857  if (till > since) {
858  tMAX = UTtoT(till);
859  std::cout << "Processing VTH3..." << std::endl;
860  coral::AttributeList conditionData;
861  conditionData.extend<coral::TimeStamp>("tmin");
862  conditionData.extend<coral::TimeStamp>("tmax");
863  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
864  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
865  std::string conditionVTH3 = "RPCFEB.VTH3 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
866  queryFVTH3->setCondition(conditionVTH3, conditionData);
867  coral::ICursor& cursorFVTH3 = queryFVTH3->execute();
868  while (cursorFVTH3.next()) {
869  Itemp.thr1 = 0;
870  Itemp.thr2 = 0;
871  Itemp.thr3 = 0;
872  Itemp.thr4 = 0;
873  Itemp.vmon1 = 0;
874  Itemp.vmon2 = 0;
875  Itemp.vmon3 = 0;
876  Itemp.vmon4 = 0;
877  Itemp.temp1 = 0;
878  Itemp.temp2 = 0;
879  Itemp.noise1 = 0;
880  Itemp.noise2 = 0;
881  Itemp.noise3 = 0;
882  Itemp.noise4 = 0;
883  const coral::AttributeList& row = cursorFVTH3.currentRow();
884  float idoub = row["DPID"].data<float>();
885  int id = static_cast<int>(idoub);
886  float vth3 = row["VTH3"].data<float>();
887  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
888  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
889  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
890  Itemp.dpid = id;
891  Itemp.thr3 = vth3;
892  Itemp.day = ndate;
893  Itemp.time = ntime;
894  febarray.push_back(Itemp);
895  }
896  } else {
897  std::cout << ">> Processing VTH3..." << std::endl;
898  coral::AttributeList conditionData;
899  conditionData.extend<coral::TimeStamp>("tmin");
900  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
901  std::string conditionVTH3 = "RPCFEB.VTH3 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
902  queryFVTH3->setCondition(conditionVTH3, conditionData);
903  coral::ICursor& cursorFVTH3 = queryFVTH3->execute();
904  while (cursorFVTH3.next()) {
905  Itemp.thr1 = 0;
906  Itemp.thr2 = 0;
907  Itemp.thr3 = 0;
908  Itemp.thr4 = 0;
909  Itemp.vmon1 = 0;
910  Itemp.vmon2 = 0;
911  Itemp.vmon3 = 0;
912  Itemp.vmon4 = 0;
913  Itemp.temp1 = 0;
914  Itemp.temp2 = 0;
915  Itemp.noise1 = 0;
916  Itemp.noise2 = 0;
917  Itemp.noise3 = 0;
918  Itemp.noise4 = 0;
919  const coral::AttributeList& row = cursorFVTH3.currentRow();
920  float idoub = row["DPID"].data<float>();
921  int id = static_cast<int>(idoub);
922  float vth3 = row["VTH3"].data<float>();
923  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
924  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
925  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
926  Itemp.dpid = id;
927  Itemp.thr3 = vth3;
928  Itemp.day = ndate;
929  Itemp.time = ntime;
930  febarray.push_back(Itemp);
931  }
932  }
933 
934  if (till > since) {
935  tMAX = UTtoT(till);
936  std::cout << "Processing VTH4..." << std::endl;
937  coral::AttributeList conditionData;
938  conditionData.extend<coral::TimeStamp>("tmin");
939  conditionData.extend<coral::TimeStamp>("tmax");
940  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
941  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
942  std::string conditionVTH4 = "RPCFEB.VTH4 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
943  queryFVTH4->setCondition(conditionVTH4, conditionData);
944  coral::ICursor& cursorFVTH4 = queryFVTH4->execute();
945  while (cursorFVTH4.next()) {
946  Itemp.thr1 = 0;
947  Itemp.thr2 = 0;
948  Itemp.thr3 = 0;
949  Itemp.thr4 = 0;
950  Itemp.vmon1 = 0;
951  Itemp.vmon2 = 0;
952  Itemp.vmon3 = 0;
953  Itemp.vmon4 = 0;
954  Itemp.temp1 = 0;
955  Itemp.temp2 = 0;
956  Itemp.noise1 = 0;
957  Itemp.noise2 = 0;
958  Itemp.noise3 = 0;
959  Itemp.noise4 = 0;
960  const coral::AttributeList& row = cursorFVTH4.currentRow();
961  float idoub = row["DPID"].data<float>();
962  int id = static_cast<int>(idoub);
963  float vth4 = row["VTH4"].data<float>();
964  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
965  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
966  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
967  Itemp.dpid = id;
968  Itemp.thr4 = vth4;
969  Itemp.day = ndate;
970  Itemp.time = ntime;
971  febarray.push_back(Itemp);
972  }
973  } else {
974  std::cout << ">> Processing VTH4..." << std::endl;
975  coral::AttributeList conditionData;
976  conditionData.extend<coral::TimeStamp>("tmin");
977  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
978  std::string conditionVTH4 = "RPCFEB.VTH4 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
979  queryFVTH4->setCondition(conditionVTH4, conditionData);
980  coral::ICursor& cursorFVTH4 = queryFVTH4->execute();
981  while (cursorFVTH4.next()) {
982  Itemp.thr1 = 0;
983  Itemp.thr2 = 0;
984  Itemp.thr3 = 0;
985  Itemp.thr4 = 0;
986  Itemp.vmon1 = 0;
987  Itemp.vmon2 = 0;
988  Itemp.vmon3 = 0;
989  Itemp.vmon4 = 0;
990  Itemp.temp1 = 0;
991  Itemp.temp2 = 0;
992  Itemp.noise1 = 0;
993  Itemp.noise2 = 0;
994  Itemp.noise3 = 0;
995  Itemp.noise4 = 0;
996  const coral::AttributeList& row = cursorFVTH4.currentRow();
997  float idoub = row["DPID"].data<float>();
998  int id = static_cast<int>(idoub);
999  float vth4 = row["VTH4"].data<float>();
1000  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1001  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1002  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1003  Itemp.dpid = id;
1004  Itemp.thr4 = vth4;
1005  Itemp.day = ndate;
1006  Itemp.time = ntime;
1007  febarray.push_back(Itemp);
1008  }
1009  }
1010 
1011  if (till > since) {
1012  tMAX = UTtoT(till);
1013  std::cout << "Processing VMON1..." << std::endl;
1014  coral::AttributeList conditionData;
1015  conditionData.extend<coral::TimeStamp>("tmin");
1016  conditionData.extend<coral::TimeStamp>("tmax");
1017  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1018  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
1019  std::string conditionVMON1 = "RPCFEB.VMON1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1020  queryFVMON1->setCondition(conditionVMON1, conditionData);
1021  coral::ICursor& cursorFVMON1 = queryFVMON1->execute();
1022  while (cursorFVMON1.next()) {
1023  Itemp.thr1 = 0;
1024  Itemp.thr2 = 0;
1025  Itemp.thr3 = 0;
1026  Itemp.thr4 = 0;
1027  Itemp.vmon1 = 0;
1028  Itemp.vmon2 = 0;
1029  Itemp.vmon3 = 0;
1030  Itemp.vmon4 = 0;
1031  Itemp.temp1 = 0;
1032  Itemp.temp2 = 0;
1033  Itemp.noise1 = 0;
1034  Itemp.noise2 = 0;
1035  Itemp.noise3 = 0;
1036  Itemp.noise4 = 0;
1037  const coral::AttributeList& row = cursorFVMON1.currentRow();
1038  float idoub = row["DPID"].data<float>();
1039  int id = static_cast<int>(idoub);
1040  float vmon1 = row["VMON1"].data<float>();
1041  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1042  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1043  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1044  Itemp.dpid = id;
1045  Itemp.vmon1 = vmon1;
1046  Itemp.day = ndate;
1047  Itemp.time = ntime;
1048  febarray.push_back(Itemp);
1049  }
1050  } else {
1051  std::cout << ">> Processing VMON1..." << std::endl;
1052  coral::AttributeList conditionData;
1053  conditionData.extend<coral::TimeStamp>("tmin");
1054  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1055  std::string conditionVMON1 = "RPCFEB.VMON1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1056  queryFVMON1->setCondition(conditionVMON1, conditionData);
1057  coral::ICursor& cursorFVMON1 = queryFVMON1->execute();
1058  while (cursorFVMON1.next()) {
1059  Itemp.thr1 = 0;
1060  Itemp.thr2 = 0;
1061  Itemp.thr3 = 0;
1062  Itemp.thr4 = 0;
1063  Itemp.vmon1 = 0;
1064  Itemp.vmon2 = 0;
1065  Itemp.vmon3 = 0;
1066  Itemp.vmon4 = 0;
1067  Itemp.temp1 = 0;
1068  Itemp.temp2 = 0;
1069  Itemp.noise1 = 0;
1070  Itemp.noise2 = 0;
1071  Itemp.noise3 = 0;
1072  Itemp.noise4 = 0;
1073  const coral::AttributeList& row = cursorFVMON1.currentRow();
1074  float idoub = row["DPID"].data<float>();
1075  int id = static_cast<int>(idoub);
1076  float vmon1 = row["VMON1"].data<float>();
1077  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1078  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1079  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1080  Itemp.dpid = id;
1081  Itemp.vmon1 = vmon1;
1082  Itemp.day = ndate;
1083  Itemp.time = ntime;
1084  febarray.push_back(Itemp);
1085  }
1086  }
1087 
1088  if (till > since) {
1089  tMAX = UTtoT(till);
1090  std::cout << "Processing VMON2..." << std::endl;
1091  coral::AttributeList conditionData;
1092  conditionData.extend<coral::TimeStamp>("tmin");
1093  conditionData.extend<coral::TimeStamp>("tmax");
1094  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1095  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
1096  std::string conditionVMON2 = "RPCFEB.VMON2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1097  queryFVMON2->setCondition(conditionVMON2, conditionData);
1098  coral::ICursor& cursorFVMON2 = queryFVMON2->execute();
1099  while (cursorFVMON2.next()) {
1100  Itemp.thr1 = 0;
1101  Itemp.thr2 = 0;
1102  Itemp.thr3 = 0;
1103  Itemp.thr4 = 0;
1104  Itemp.vmon1 = 0;
1105  Itemp.vmon2 = 0;
1106  Itemp.vmon3 = 0;
1107  Itemp.vmon4 = 0;
1108  Itemp.temp1 = 0;
1109  Itemp.temp2 = 0;
1110  Itemp.noise1 = 0;
1111  Itemp.noise2 = 0;
1112  Itemp.noise3 = 0;
1113  Itemp.noise4 = 0;
1114  const coral::AttributeList& row = cursorFVMON2.currentRow();
1115  float idoub = row["DPID"].data<float>();
1116  int id = static_cast<int>(idoub);
1117  float vmon2 = row["VMON2"].data<float>();
1118  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1119  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1120  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1121  Itemp.dpid = id;
1122  Itemp.vmon2 = vmon2;
1123  Itemp.day = ndate;
1124  Itemp.time = ntime;
1125  febarray.push_back(Itemp);
1126  }
1127  } else {
1128  std::cout << ">> Processing VMON2..." << std::endl;
1129  coral::AttributeList conditionData;
1130  conditionData.extend<coral::TimeStamp>("tmin");
1131  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1132  std::string conditionVMON2 = "RPCFEB.VMON2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1133  queryFVMON2->setCondition(conditionVMON2, conditionData);
1134  coral::ICursor& cursorFVMON2 = queryFVMON2->execute();
1135  while (cursorFVMON2.next()) {
1136  Itemp.thr1 = 0;
1137  Itemp.thr2 = 0;
1138  Itemp.thr3 = 0;
1139  Itemp.thr4 = 0;
1140  Itemp.vmon1 = 0;
1141  Itemp.vmon2 = 0;
1142  Itemp.vmon3 = 0;
1143  Itemp.vmon4 = 0;
1144  Itemp.temp1 = 0;
1145  Itemp.temp2 = 0;
1146  Itemp.noise1 = 0;
1147  Itemp.noise2 = 0;
1148  Itemp.noise3 = 0;
1149  Itemp.noise4 = 0;
1150  const coral::AttributeList& row = cursorFVMON2.currentRow();
1151  float idoub = row["DPID"].data<float>();
1152  int id = static_cast<int>(idoub);
1153  float vmon2 = row["VMON2"].data<float>();
1154  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1155  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1156  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1157  Itemp.dpid = id;
1158  Itemp.vmon2 = vmon2;
1159  Itemp.day = ndate;
1160  Itemp.time = ntime;
1161  febarray.push_back(Itemp);
1162  }
1163  }
1164 
1165  if (till > since) {
1166  tMAX = UTtoT(till);
1167  std::cout << "Processing VMON3..." << std::endl;
1168  coral::AttributeList conditionData;
1169  conditionData.extend<coral::TimeStamp>("tmin");
1170  conditionData.extend<coral::TimeStamp>("tmax");
1171  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1172  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
1173  std::string conditionVMON3 = "RPCFEB.VMON3 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1174  queryFVMON3->setCondition(conditionVMON3, conditionData);
1175  coral::ICursor& cursorFVMON3 = queryFVMON3->execute();
1176  while (cursorFVMON3.next()) {
1177  Itemp.thr1 = 0;
1178  Itemp.thr2 = 0;
1179  Itemp.thr3 = 0;
1180  Itemp.thr4 = 0;
1181  Itemp.vmon1 = 0;
1182  Itemp.vmon2 = 0;
1183  Itemp.vmon3 = 0;
1184  Itemp.vmon4 = 0;
1185  Itemp.temp1 = 0;
1186  Itemp.temp2 = 0;
1187  Itemp.noise1 = 0;
1188  Itemp.noise2 = 0;
1189  Itemp.noise3 = 0;
1190  Itemp.noise4 = 0;
1191  const coral::AttributeList& row = cursorFVMON3.currentRow();
1192  float idoub = row["DPID"].data<float>();
1193  int id = static_cast<int>(idoub);
1194  float vmon3 = row["VMON3"].data<float>();
1195  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1196  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1197  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1198  Itemp.dpid = id;
1199  Itemp.vmon3 = vmon3;
1200  Itemp.day = ndate;
1201  Itemp.time = ntime;
1202  febarray.push_back(Itemp);
1203  }
1204  } else {
1205  std::cout << ">> Processing VMON3..." << std::endl;
1206  coral::AttributeList conditionData;
1207  conditionData.extend<coral::TimeStamp>("tmin");
1208  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1209  std::string conditionVMON3 = "RPCFEB.VMON3 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1210  queryFVMON3->setCondition(conditionVMON3, conditionData);
1211  coral::ICursor& cursorFVMON3 = queryFVMON3->execute();
1212  while (cursorFVMON3.next()) {
1213  Itemp.thr1 = 0;
1214  Itemp.thr2 = 0;
1215  Itemp.thr3 = 0;
1216  Itemp.thr4 = 0;
1217  Itemp.vmon1 = 0;
1218  Itemp.vmon2 = 0;
1219  Itemp.vmon3 = 0;
1220  Itemp.vmon4 = 0;
1221  Itemp.temp1 = 0;
1222  Itemp.temp2 = 0;
1223  Itemp.noise1 = 0;
1224  Itemp.noise2 = 0;
1225  Itemp.noise3 = 0;
1226  Itemp.noise4 = 0;
1227  const coral::AttributeList& row = cursorFVMON3.currentRow();
1228  float idoub = row["DPID"].data<float>();
1229  int id = static_cast<int>(idoub);
1230  float vmon3 = row["VMON3"].data<float>();
1231  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1232  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1233  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1234  Itemp.dpid = id;
1235  Itemp.vmon3 = vmon3;
1236  Itemp.day = ndate;
1237  Itemp.time = ntime;
1238  febarray.push_back(Itemp);
1239  }
1240  }
1241 
1242  if (till > since) {
1243  tMAX = UTtoT(till);
1244  std::cout << "Processing VMON4..." << std::endl;
1245  coral::AttributeList conditionData;
1246  conditionData.extend<coral::TimeStamp>("tmin");
1247  conditionData.extend<coral::TimeStamp>("tmax");
1248  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1249  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
1250  std::string conditionVMON4 = "RPCFEB.VMON4 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1251  queryFVMON4->setCondition(conditionVMON4, conditionData);
1252  coral::ICursor& cursorFVMON4 = queryFVMON4->execute();
1253  while (cursorFVMON4.next()) {
1254  Itemp.thr1 = 0;
1255  Itemp.thr2 = 0;
1256  Itemp.thr3 = 0;
1257  Itemp.thr4 = 0;
1258  Itemp.vmon1 = 0;
1259  Itemp.vmon2 = 0;
1260  Itemp.vmon3 = 0;
1261  Itemp.vmon4 = 0;
1262  Itemp.temp1 = 0;
1263  Itemp.temp2 = 0;
1264  Itemp.noise1 = 0;
1265  Itemp.noise2 = 0;
1266  Itemp.noise3 = 0;
1267  Itemp.noise4 = 0;
1268  const coral::AttributeList& row = cursorFVMON4.currentRow();
1269  float idoub = row["DPID"].data<float>();
1270  int id = static_cast<int>(idoub);
1271  float vmon4 = row["VMON4"].data<float>();
1272  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1273  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1274  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1275  Itemp.dpid = id;
1276  Itemp.vmon4 = vmon4;
1277  Itemp.day = ndate;
1278  Itemp.time = ntime;
1279  febarray.push_back(Itemp);
1280  }
1281  } else {
1282  std::cout << ">> Processing VMON4..." << std::endl;
1283  coral::AttributeList conditionData;
1284  conditionData.extend<coral::TimeStamp>("tmin");
1285  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1286  std::string conditionVMON4 = "RPCFEB.VMON4 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1287  queryFVMON4->setCondition(conditionVMON4, conditionData);
1288  coral::ICursor& cursorFVMON4 = queryFVMON4->execute();
1289  while (cursorFVMON4.next()) {
1290  Itemp.thr1 = 0;
1291  Itemp.thr2 = 0;
1292  Itemp.thr3 = 0;
1293  Itemp.thr4 = 0;
1294  Itemp.vmon1 = 0;
1295  Itemp.vmon2 = 0;
1296  Itemp.vmon3 = 0;
1297  Itemp.vmon4 = 0;
1298  Itemp.temp1 = 0;
1299  Itemp.temp2 = 0;
1300  Itemp.noise1 = 0;
1301  Itemp.noise2 = 0;
1302  Itemp.noise3 = 0;
1303  Itemp.noise4 = 0;
1304  const coral::AttributeList& row = cursorFVMON4.currentRow();
1305  float idoub = row["DPID"].data<float>();
1306  int id = static_cast<int>(idoub);
1307  float vmon4 = row["VMON4"].data<float>();
1308  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1309  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1310  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1311  Itemp.dpid = id;
1312  Itemp.vmon4 = vmon4;
1313  Itemp.day = ndate;
1314  Itemp.time = ntime;
1315  febarray.push_back(Itemp);
1316  }
1317  }
1318 
1319  if (till > since) {
1320  tMAX = UTtoT(till);
1321  std::cout << "Processing TEMP1..." << std::endl;
1322  coral::AttributeList conditionData;
1323  conditionData.extend<coral::TimeStamp>("tmin");
1324  conditionData.extend<coral::TimeStamp>("tmax");
1325  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1326  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
1327  std::string conditionTEMP1 =
1328  "RPCFEB.TEMPERATURE1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1329  queryFTEMP1->setCondition(conditionTEMP1, conditionData);
1330  coral::ICursor& cursorFTEMP1 = queryFTEMP1->execute();
1331  while (cursorFTEMP1.next()) {
1332  Itemp.thr1 = 0;
1333  Itemp.thr2 = 0;
1334  Itemp.thr3 = 0;
1335  Itemp.thr4 = 0;
1336  Itemp.vmon1 = 0;
1337  Itemp.vmon2 = 0;
1338  Itemp.vmon3 = 0;
1339  Itemp.vmon4 = 0;
1340  Itemp.temp1 = 0;
1341  Itemp.temp2 = 0;
1342  Itemp.noise1 = 0;
1343  Itemp.noise2 = 0;
1344  Itemp.noise3 = 0;
1345  Itemp.noise4 = 0;
1346  const coral::AttributeList& row = cursorFTEMP1.currentRow();
1347  float idoub = row["DPID"].data<float>();
1348  int id = static_cast<int>(idoub);
1349  float temp1 = row["TEMP1"].data<float>();
1350  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1351  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1352  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1353  Itemp.dpid = id;
1354  Itemp.temp1 = temp1;
1355  Itemp.day = ndate;
1356  Itemp.time = ntime;
1357  febarray.push_back(Itemp);
1358  }
1359  } else {
1360  std::cout << ">> Processing TEMP1..." << std::endl;
1361  coral::AttributeList conditionData;
1362  conditionData.extend<coral::TimeStamp>("tmin");
1363  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1364  std::string conditionTEMP1 = "RPCFEB.TEMPERATURE1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1365  queryFTEMP1->setCondition(conditionTEMP1, conditionData);
1366  coral::ICursor& cursorFTEMP1 = queryFTEMP1->execute();
1367  while (cursorFTEMP1.next()) {
1368  Itemp.thr1 = 0;
1369  Itemp.thr2 = 0;
1370  Itemp.thr3 = 0;
1371  Itemp.thr4 = 0;
1372  Itemp.vmon1 = 0;
1373  Itemp.vmon2 = 0;
1374  Itemp.vmon3 = 0;
1375  Itemp.vmon4 = 0;
1376  Itemp.temp1 = 0;
1377  Itemp.temp2 = 0;
1378  Itemp.noise1 = 0;
1379  Itemp.noise2 = 0;
1380  Itemp.noise3 = 0;
1381  Itemp.noise4 = 0;
1382  const coral::AttributeList& row = cursorFTEMP1.currentRow();
1383  float idoub = row["DPID"].data<float>();
1384  int id = static_cast<int>(idoub);
1385  float temp1 = row["TEMP1"].data<float>();
1386  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1387  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1388  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1389  Itemp.dpid = id;
1390  Itemp.temp1 = temp1;
1391  Itemp.day = ndate;
1392  Itemp.time = ntime;
1393  febarray.push_back(Itemp);
1394  }
1395  }
1396 
1397  if (till > since) {
1398  tMAX = UTtoT(till);
1399  std::cout << "Processing TEMP2..." << std::endl;
1400  coral::AttributeList conditionData;
1401  conditionData.extend<coral::TimeStamp>("tmin");
1402  conditionData.extend<coral::TimeStamp>("tmax");
1403  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1404  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
1405  std::string conditionTEMP2 =
1406  "RPCFEB.TEMPERATURE2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1407  queryFTEMP2->setCondition(conditionTEMP2, conditionData);
1408  coral::ICursor& cursorFTEMP2 = queryFTEMP2->execute();
1409  while (cursorFTEMP2.next()) {
1410  Itemp.thr1 = 0;
1411  Itemp.thr2 = 0;
1412  Itemp.thr3 = 0;
1413  Itemp.thr4 = 0;
1414  Itemp.vmon1 = 0;
1415  Itemp.vmon2 = 0;
1416  Itemp.vmon3 = 0;
1417  Itemp.vmon4 = 0;
1418  Itemp.temp1 = 0;
1419  Itemp.temp2 = 0;
1420  Itemp.noise1 = 0;
1421  Itemp.noise2 = 0;
1422  Itemp.noise3 = 0;
1423  Itemp.noise4 = 0;
1424  const coral::AttributeList& row = cursorFTEMP2.currentRow();
1425  float idoub = row["DPID"].data<float>();
1426  int id = static_cast<int>(idoub);
1427  float temp2 = row["TEMP2"].data<float>();
1428  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1429  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1430  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1431  Itemp.dpid = id;
1432  Itemp.temp2 = temp2;
1433  Itemp.day = ndate;
1434  Itemp.time = ntime;
1435  febarray.push_back(Itemp);
1436  }
1437  } else {
1438  std::cout << ">> Processing TEMP2..." << std::endl;
1439  coral::AttributeList conditionData;
1440  conditionData.extend<coral::TimeStamp>("tmin");
1441  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1442  std::string conditionTEMP2 = "RPCFEB.TEMPERATURE2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1443  queryFTEMP2->setCondition(conditionTEMP2, conditionData);
1444  coral::ICursor& cursorFTEMP2 = queryFTEMP2->execute();
1445  while (cursorFTEMP2.next()) {
1446  Itemp.thr1 = 0;
1447  Itemp.thr2 = 0;
1448  Itemp.thr3 = 0;
1449  Itemp.thr4 = 0;
1450  Itemp.vmon1 = 0;
1451  Itemp.vmon2 = 0;
1452  Itemp.vmon3 = 0;
1453  Itemp.vmon4 = 0;
1454  Itemp.temp1 = 0;
1455  Itemp.temp2 = 0;
1456  Itemp.noise1 = 0;
1457  Itemp.noise2 = 0;
1458  Itemp.noise3 = 0;
1459  Itemp.noise4 = 0;
1460  const coral::AttributeList& row = cursorFTEMP2.currentRow();
1461  float idoub = row["DPID"].data<float>();
1462  int id = static_cast<int>(idoub);
1463  float temp2 = row["TEMP2"].data<float>();
1464  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1465  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1466  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1467  Itemp.dpid = id;
1468  Itemp.temp2 = temp2;
1469  Itemp.day = ndate;
1470  Itemp.time = ntime;
1471  febarray.push_back(Itemp);
1472  }
1473  }
1474 
1475  std::cout << ">> FEB array --> size: " << febarray.size() << " >> done." << std::endl;
1476  delete queryFVTH1;
1477  delete queryFVTH2;
1478  delete queryFVTH3;
1479  delete queryFVTH4;
1480  delete queryFTEMP1;
1481  session->transaction().commit();
1482  delete session;
1483  return febarray;
1484 }
1485 
1486 //----------------------------- U X C ------------------------------------------------------------------------
1487 std::vector<RPCObUXC::Item> RPCFw::createUXC(long long since, long long till) {
1488  tMIN = UTtoT(since);
1489  std::cout << ">> Processing since: " << tMIN.day() << "/" << tMIN.month() << "/" << tMIN.year() << " " << tMIN.hour()
1490  << ":" << tMIN.minute() << "." << tMIN.second() << std::endl;
1491 
1492  coral::ISession* session = this->connect(m_connectionString, m_userName, m_password);
1493  session->transaction().start(true);
1494  coral::ISchema& schema = session->nominalSchema();
1495  std::cout << ">> creating UXC object..." << std::endl;
1496 
1497  // UXCT
1498  coral::IQuery* queryUXCP = schema.newQuery();
1499  queryUXCP->addToTableList("RPCGASPARAMETERS");
1500  queryUXCP->addToTableList("DP_NAME2ID");
1501  queryUXCP->addToOutputList("DP_NAME2ID.DPNAME", "DPNAME");
1502  queryUXCP->addToOutputList("DP_NAME2ID.ID", "ID");
1503  queryUXCP->addToOutputList("RPCGASPARAMETERS.DPID", "DPID");
1504  queryUXCP->addToOutputList("RPCGASPARAMETERS.CHANGE_DATE", "TSTAMP");
1505  queryUXCP->addToOutputList("RPCGASPARAMETERS.VALUE", "VALUE");
1506  coral::IQuery* queryUXCT = schema.newQuery();
1507  queryUXCT->addToTableList("RPCCOOLING");
1508  queryUXCT->addToTableList("DP_NAME2ID");
1509  queryUXCT->addToOutputList("DP_NAME2ID.DPNAME", "DPNAME");
1510  queryUXCT->addToOutputList("DP_NAME2ID.ID", "ID");
1511  queryUXCT->addToOutputList("RPCCOOLING.DPID", "DPID");
1512  queryUXCT->addToOutputList("RPCCOOLING.CHANGE_DATE", "TSTAMP");
1513  queryUXCT->addToOutputList("RPCCOOLING.VALUE", "VALUE");
1514  coral::IQuery* queryUXCH = schema.newQuery();
1515  queryUXCH->addToTableList("RPCCOOLING");
1516  queryUXCH->addToTableList("DP_NAME2ID");
1517  queryUXCH->addToOutputList("DP_NAME2ID.DPNAME", "DPNAME");
1518  queryUXCH->addToOutputList("DP_NAME2ID.ID", "ID");
1519  queryUXCH->addToOutputList("RPCCOOLING.DPID", "DPID");
1520  queryUXCH->addToOutputList("RPCCOOLING.CHANGE_DATE", "TSTAMP");
1521  queryUXCH->addToOutputList("RPCCOOLING.VALUE", "VALUE");
1522 
1523  RPCObUXC::Item Itemp;
1524  std::vector<RPCObUXC::Item> uxcarray;
1525  coral::TimeStamp tlast = tMIN;
1526  if (till > since) {
1527  tMAX = UTtoT(till);
1528  std::cout << ">> Processing till: " << tMAX.day() << "/" << tMAX.month() << "/" << tMAX.year() << " " << tMAX.hour()
1529  << ":" << tMAX.minute() << "." << tMAX.second() << std::endl;
1530  std::cout << "Processing UXC..." << std::endl;
1531  coral::AttributeList conditionData;
1532  conditionData.extend<coral::TimeStamp>("tmin");
1533  conditionData.extend<coral::TimeStamp>("tmax");
1534  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1535  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
1536  std::string conditionUXCP =
1537  "RPCGASPARAMETERS.DPID = DP_NAME2ID.ID AND RPCGASPARAMETERS.CHANGE_DATE >:tmin AND "
1538  "RPCGASPARAMETERS.CHANGE_DATE <:tmax AND (DP_NAME2ID.DPNAME like '%UXCPressure%')";
1539  queryUXCP->setCondition(conditionUXCP, conditionData);
1540  coral::ICursor& cursorUXCP = queryUXCP->execute();
1541  while (cursorUXCP.next()) {
1542  Itemp.temperature = 0;
1543  Itemp.pressure = 0;
1544  Itemp.dewpoint = 0;
1545  const coral::AttributeList& row = cursorUXCP.currentRow();
1546  float value = row["VALUE"].data<float>();
1547  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1548  unsigned long long ut_time = TtoUT(ts);
1549  Itemp.pressure = value;
1550  Itemp.unixtime = ut_time;
1551  uxcarray.push_back(Itemp);
1552  }
1553  std::string conditionUXCT =
1554  "RPCCOOLING.DPID = DP_NAME2ID.ID AND RPCCOOLING.CHANGE_DATE >:tmin AND RPCCOOLING.CHANGE_DATE <:tmax AND "
1555  "(DP_NAME2ID.DPNAME like '%TempUXC%')";
1556  queryUXCT->setCondition(conditionUXCT, conditionData);
1557  coral::ICursor& cursorUXCT = queryUXCT->execute();
1558  while (cursorUXCT.next()) {
1559  Itemp.temperature = 0;
1560  Itemp.pressure = 0;
1561  Itemp.dewpoint = 0;
1562  const coral::AttributeList& row = cursorUXCT.currentRow();
1563  float value = row["VALUE"].data<float>();
1564  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1565  unsigned long long ut_time = TtoUT(ts);
1566  Itemp.temperature = value;
1567  Itemp.unixtime = ut_time;
1568  uxcarray.push_back(Itemp);
1569  }
1570  std::string conditionUXCH =
1571  "RPCCOOLING.DPID = DP_NAME2ID.ID AND RPCCOOLING.CHANGE_DATE >:tmin AND RPCCOOLING.CHANGE_DATE <:tmax AND "
1572  "(DP_NAME2ID.DPNAME like '%DewpointUXC%')";
1573  queryUXCH->setCondition(conditionUXCH, conditionData);
1574  coral::ICursor& cursorUXCH = queryUXCH->execute();
1575  while (cursorUXCH.next()) {
1576  Itemp.temperature = 0;
1577  Itemp.pressure = 0;
1578  Itemp.dewpoint = 0;
1579  const coral::AttributeList& row = cursorUXCH.currentRow();
1580  float value = row["VALUE"].data<float>();
1581  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1582  unsigned long long ut_time = TtoUT(ts);
1583  Itemp.dewpoint = value;
1584  Itemp.unixtime = ut_time;
1585  uxcarray.push_back(Itemp);
1586  }
1587  } else {
1588  std::cout << "This objects cannot be copied in this mode. Use RANGE mode!" << std::endl;
1589  }
1590 
1591  std::cout << ">> UXC array --> size: " << uxcarray.size() << " >> done." << std::endl;
1592  delete queryUXCT;
1593  delete queryUXCP;
1594  delete queryUXCH;
1595  session->transaction().commit();
1596  delete session;
1597  return uxcarray;
1598 }
1599 
1600 //----------------------------- M I X ------------------------------------------------------------------------
1601 std::vector<RPCObGasMix::Item> RPCFw::createMix(long long since, long long till) {
1602  tMIN = UTtoT(since);
1603  std::cout << ">> Processing since: " << tMIN.day() << "/" << tMIN.month() << "/" << tMIN.year() << " " << tMIN.hour()
1604  << ":" << tMIN.minute() << "." << tMIN.second() << std::endl;
1605 
1606  coral::ISession* session = this->connect(m_connectionString, m_userName, m_password);
1607  session->transaction().start(true);
1608  coral::ISchema& schema = session->nominalSchema();
1609  std::cout << ">> creating UXC object..." << std::endl;
1610 
1611  coral::IQuery* queryMix = schema.newQuery();
1612  queryMix->addToTableList("RPCGASPARAMETERS");
1613  queryMix->addToTableList("DP_NAME2ID");
1614  queryMix->addToOutputList("DP_NAME2ID.DPNAME", "DPNAME");
1615  queryMix->addToOutputList("DP_NAME2ID.ID", "ID");
1616  queryMix->addToOutputList("RPCGASPARAMETERS.DPID", "DPID");
1617  queryMix->addToOutputList("RPCGASPARAMETERS.CHANGE_DATE", "TSTAMP");
1618  queryMix->addToOutputList("RPCGASPARAMETERS.VALUE", "VALUE");
1619 
1620  coral::IQuery* queryMix2 = schema.newQuery();
1621  queryMix2->addToTableList("RPCGASPARAMETERS");
1622  queryMix2->addToTableList("DP_NAME2ID");
1623  queryMix2->addToOutputList("DP_NAME2ID.DPNAME", "DPNAME");
1624  queryMix2->addToOutputList("DP_NAME2ID.ID", "ID");
1625  queryMix2->addToOutputList("RPCGASPARAMETERS.DPID", "DPID");
1626  queryMix2->addToOutputList("RPCGASPARAMETERS.CHANGE_DATE", "TSTAMP");
1627  queryMix2->addToOutputList("RPCGASPARAMETERS.VALUE", "VALUE");
1628 
1629  coral::IQuery* queryMix3 = schema.newQuery();
1630  queryMix3->addToTableList("RPCGASPARAMETERS");
1631  queryMix3->addToTableList("DP_NAME2ID");
1632  queryMix3->addToOutputList("DP_NAME2ID.DPNAME", "DPNAME");
1633  queryMix3->addToOutputList("DP_NAME2ID.ID", "ID");
1634  queryMix3->addToOutputList("RPCGASPARAMETERS.DPID", "DPID");
1635  queryMix3->addToOutputList("RPCGASPARAMETERS.CHANGE_DATE", "TSTAMP");
1636  queryMix3->addToOutputList("RPCGASPARAMETERS.VALUE", "VALUE");
1637 
1638  RPCObGasMix::Item Mtemp;
1639  std::vector<RPCObGasMix::Item> marray;
1640  coral::TimeStamp tlast = tMIN;
1641  if (till > since) {
1642  tMAX = UTtoT(till);
1643  std::cout << ">> Processing till: " << tMAX.day() << "/" << tMAX.month() << "/" << tMAX.year() << " " << tMAX.hour()
1644  << ":" << tMAX.minute() << "." << tMAX.second() << std::endl;
1645  std::cout << "Processing UXC..." << std::endl;
1646  coral::AttributeList conditionData;
1647  conditionData.extend<coral::TimeStamp>("tmin");
1648  conditionData.extend<coral::TimeStamp>("tmax");
1649  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1650  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
1651  std::string conditionM1 =
1652  "RPCGASPARAMETERS.DPID = DP_NAME2ID.ID AND RPCGASPARAMETERS.CHANGE_DATE >:tmin AND "
1653  "RPCGASPARAMETERS.CHANGE_DATE <:tmax AND (DP_NAME2ID.DPNAME like '%IC4H10Ratio%')";
1654  queryMix->setCondition(conditionM1, conditionData);
1655  coral::ICursor& cursorMix = queryMix->execute();
1656  while (cursorMix.next()) {
1657  Mtemp.gas1 = 0;
1658  Mtemp.gas2 = 0;
1659  Mtemp.gas3 = 0;
1660  const coral::AttributeList& row = cursorMix.currentRow();
1661  float value = row["VALUE"].data<float>();
1662  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1663  unsigned long long ut_time = TtoUT(ts);
1664  Mtemp.gas1 = value;
1665  Mtemp.unixtime = ut_time;
1666  marray.push_back(Mtemp);
1667  }
1668  std::string conditionM2 =
1669  "RPCGASPARAMETERS.DPID = DP_NAME2ID.ID AND RPCGASPARAMETERS.CHANGE_DATE >:tmin AND "
1670  "RPCGASPARAMETERS.CHANGE_DATE <:tmax AND (DP_NAME2ID.DPNAME like '%C2H2F4Ratio%')";
1671  queryMix2->setCondition(conditionM2, conditionData);
1672  coral::ICursor& cursorMix2 = queryMix2->execute();
1673  while (cursorMix2.next()) {
1674  Mtemp.gas1 = 0;
1675  Mtemp.gas2 = 0;
1676  Mtemp.gas3 = 0;
1677  const coral::AttributeList& row = cursorMix2.currentRow();
1678  float value = row["VALUE"].data<float>();
1679  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1680  unsigned long long ut_time = TtoUT(ts);
1681  Mtemp.gas2 = value;
1682  Mtemp.unixtime = ut_time;
1683  marray.push_back(Mtemp);
1684  }
1685  std::string conditionM3 =
1686  "RPCGASPARAMETERS.DPID = DP_NAME2ID.ID AND RPCGASPARAMETERS.CHANGE_DATE >:tmin AND "
1687  "RPCGASPARAMETERS.CHANGE_DATE <:tmax AND (DP_NAME2ID.DPNAME like '%SF6Ratio%')";
1688  queryMix3->setCondition(conditionM3, conditionData);
1689  coral::ICursor& cursorMix3 = queryMix3->execute();
1690  while (cursorMix3.next()) {
1691  Mtemp.gas1 = 0;
1692  Mtemp.gas2 = 0;
1693  Mtemp.gas3 = 0;
1694  const coral::AttributeList& row = cursorMix3.currentRow();
1695  float value = row["VALUE"].data<float>();
1696  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1697  unsigned long long ut_time = TtoUT(ts);
1698  Mtemp.gas3 = value;
1699  Mtemp.unixtime = ut_time;
1700  marray.push_back(Mtemp);
1701  }
1702  } else {
1703  std::cout << "This objects cannot be copied in this mode. Use RANGE mode!" << std::endl;
1704  }
1705 
1706  std::cout << ">> GasMix array --> size: " << marray.size() << " >> done." << std::endl;
1707  delete queryMix;
1708  session->transaction().commit();
1709  delete session;
1710  return marray;
1711 }
1712 
1713 //----------------------------------------------------------------------------------------------
1714 coral::TimeStamp RPCFw::UTtoT(long long utime) {
1715  int yea = static_cast<int>(trunc(utime / 31536000) + 1970);
1716  int yes = (yea - 1970) * 31536000;
1717  int cony = ((yea - 1972) % 4) + 1;
1718  if (cony == 0)
1719  yes = yes + (yea - 1972) / 4 * 86400;
1720  else
1721  yes = yes + static_cast<int>(trunc((yea - 1972) / 4)) * 86400;
1722  int day = static_cast<int>(trunc((utime - yes) / 86400));
1723  int rest = static_cast<int>(utime - yes - day * 86400);
1724  int mon = 0;
1725  // BISESTILE YEAR
1726  if (cony == 0) {
1727  day = day + 1;
1728  if (day < 32) {
1729  mon = 1;
1730  day = day - 0;
1731  }
1732  if (day >= 32 && day < 61) {
1733  mon = 2;
1734  day = day - 31;
1735  }
1736  if (day >= 61 && day < 92) {
1737  mon = 3;
1738  day = day - 60;
1739  }
1740  if (day >= 92 && day < 122) {
1741  mon = 4;
1742  day = day - 91;
1743  }
1744  if (day >= 122 && day < 153) {
1745  mon = 5;
1746  day = day - 121;
1747  }
1748  if (day >= 153 && day < 183) {
1749  mon = 6;
1750  day = day - 152;
1751  }
1752  if (day >= 183 && day < 214) {
1753  mon = 7;
1754  day = day - 182;
1755  }
1756  if (day >= 214 && day < 245) {
1757  mon = 8;
1758  day = day - 213;
1759  }
1760  if (day >= 245 && day < 275) {
1761  mon = 9;
1762  day = day - 244;
1763  }
1764  if (day >= 275 && day < 306) {
1765  mon = 10;
1766  day = day - 274;
1767  }
1768  if (day >= 306 && day < 336) {
1769  mon = 11;
1770  day = day - 305;
1771  }
1772  if (day >= 336) {
1773  mon = 12;
1774  day = day - 335;
1775  }
1776  }
1777  // NOT BISESTILE YEAR
1778  else {
1779  if (day < 32) {
1780  mon = 1;
1781  day = day - 0;
1782  }
1783  if (day >= 32 && day < 60) {
1784  mon = 2;
1785  day = day - 31;
1786  }
1787  if (day >= 60 && day < 91) {
1788  mon = 3;
1789  day = day - 59;
1790  }
1791  if (day >= 91 && day < 121) {
1792  mon = 4;
1793  day = day - 90;
1794  }
1795  if (day >= 121 && day < 152) {
1796  mon = 5;
1797  day = day - 120;
1798  }
1799  if (day >= 152 && day < 182) {
1800  mon = 6;
1801  day = day - 151;
1802  }
1803  if (day >= 182 && day < 213) {
1804  mon = 7;
1805  day = day - 181;
1806  }
1807  if (day >= 213 && day < 244) {
1808  mon = 8;
1809  day = day - 212;
1810  }
1811  if (day >= 244 && day < 274) {
1812  mon = 9;
1813  day = day - 243;
1814  }
1815  if (day >= 274 && day < 305) {
1816  mon = 10;
1817  day = day - 273;
1818  }
1819  if (day >= 305 && day < 335) {
1820  mon = 11;
1821  day = day - 304;
1822  }
1823  if (day >= 335) {
1824  mon = 12;
1825  day = day - 334;
1826  }
1827  }
1828 
1829  int hou = static_cast<int>(trunc(rest / 3600));
1830  rest = rest - hou * 3600;
1831  int min = static_cast<int>(trunc(rest / 60));
1832  rest = rest - min * 60;
1833  int sec = rest;
1834  int nan = 0;
1835 
1836  // std::cout <<">> Processing since: "<<day<<"/"<<mon<<"/"<<yea<<" "<<hou<<":"<<min<<"."<<sec<< std::endl;
1837 
1838  coral::TimeStamp Tthr;
1839 
1840  Tthr = coral::TimeStamp(yea, mon, day, hou, min, sec, nan);
1841  return Tthr;
1842 }
1843 
1844 //----------------------------------------------------------------------------------------------
1845 unsigned long long RPCFw::TtoUT(const coral::TimeStamp& time) {
1846  long long utime = (time.year() - 1970) * 31536000 + static_cast<int>(trunc((time.year() - 1972) / 4)) * 86400 +
1847  (((time.month() - 1) * 31) * 86400) + ((time.day() - 1) * 86400) + time.hour() * 3600 +
1848  time.minute() * 60 + time.second();
1849 
1850  if (time.month() == 3)
1851  utime = utime - 3 * 86400;
1852  if (time.month() == 4)
1853  utime = utime - 3 * 86400;
1854  if (time.month() == 5)
1855  utime = utime - 4 * 86400;
1856  if (time.month() == 6)
1857  utime = utime - 4 * 86400;
1858  if (time.month() == 7)
1859  utime = utime - 5 * 86400;
1860  if (time.month() == 8)
1861  utime = utime - 5 * 86400;
1862  if (time.month() == 9)
1863  utime = utime - 5 * 86400;
1864  if (time.month() == 10)
1865  utime = utime - 6 * 86400;
1866  if (time.month() == 11)
1867  utime = utime - 6 * 86400;
1868  if (time.month() == 12)
1869  utime = utime - 7 * 86400;
1870 
1871  return utime;
1872 }
1873 
1874 bool RPCFw::isMajor(const coral::TimeStamp& fir, const coral::TimeStamp& sec) {
1875  double first =
1876  fir.year() * 1e10 + fir.month() + 1e8 + fir.day() * 1e6 + fir.hour() * 1e4 + fir.minute() * 1e2 + fir.second();
1877  double second =
1878  sec.year() * 1e10 + sec.month() + 1e8 + sec.day() * 1e6 + sec.hour() * 1e4 + sec.minute() * 1e2 + sec.second();
1879 
1880  if (first > second)
1881  return true;
1882 
1883  return false;
1884 }
unsigned long long TtoUT(const coral::TimeStamp &time)
Definition: RPCFw.cc:1845
std::string m_userName
Definition: RPCFw.h:55
std::vector< RPCObGasMix::Item > createMix(long long since, long long till)
Definition: RPCFw.cc:1601
bool isMajor(const coral::TimeStamp &fir, const coral::TimeStamp &sec)
Definition: RPCFw.cc:1874
std::vector< RPCObFebmap::Feb_Item > createFEB(long long since, long long till)
Definition: RPCFw.cc:618
~RPCFw() override
Definition: RPCFw.cc:33
void run() override
Definition: RPCFw.cc:35
RPCFw(const std::string &connectionString, const std::string &userName, const std::string &password)
Definition: RPCFw.cc:30
std::vector< RPCObUXC::Item > createUXC(long long since, long long till)
Definition: RPCFw.cc:1487
U second(std::pair< T, U > const &p)
unsigned long long N_IOV
Definition: RPCFw.h:40
std::vector< RPCObPVSSmap::Item > createIDMAP()
Definition: RPCFw.cc:530
std::vector< RPCObGas::Item > createGAS(long long since, long long till)
Definition: RPCFw.cc:278
coral::TimeStamp UTtoT(long long utime)
Definition: RPCFw.cc:1714
std::vector< RPCObVmon::V_Item > createVMON(long long from, long long till)
Definition: RPCFw.cc:118
coral::TimeStamp tMAX
Definition: RPCFw.h:39
Definition: value.py:1
std::vector< RPCObStatus::S_Item > createSTATUS(long long since, long long till)
Definition: RPCFw.cc:199
std::vector< RPCObTemp::T_Item > createT(long long since, long long till)
Definition: RPCFw.cc:446
float flowout
Definition: RPCObGas.h:20
float temperature
Definition: RPCObUXC.h:18
float pressure
Definition: RPCObUXC.h:19
float flowin
Definition: RPCObGas.h:19
std::string m_password
Definition: RPCFw.h:56
coral::ISession * connect(const std::string &connectionString, const std::string &userName, const std::string &password)
Definition: RPCDBCom.cc:22
def day(string)
Definition: getRunInfo.py:11
std::vector< RPCObImon::I_Item > createIMON(long long since, long long till)
Definition: RPCFw.cc:38
std::string m_connectionString
Definition: RPCFw.h:54
float dewpoint
Definition: RPCObUXC.h:20
coral::TimeStamp tMIN
Definition: RPCFw.h:38