StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEmcDbHandler.h
1 //******************************************************************************
2 
9 //******************************************************************************
10 
11 #ifndef StEmcDbHandler_HH
12 #define StEmcDbHandler_HH
13 
14 #include <iostream>
15 using namespace std;
16 
17 
18 //#include <strstream>
19 //#include <Stsstream.h>
20 
21 #include "TObject.h"
22 
23 #include "StDbLib/StDbManager.hh"
24 #include "StDbLib/StDbConfigNode.hh"
25 #include "StDbLib/StDbTable.h"
26 #include "StDbLib/StDataBaseI.hh"
27 
28 #include <string>
29 #include <vector>
30 
31 class StEmcDbHandler : public TObject
32 {
33 public:
34  StEmcDbHandler();
35  virtual ~StEmcDbHandler();
36 
37  StDbTable* getDbTable();
38  std::vector<std::string> getTimeStampList(const char * beginTime, const char * endTime);
39 
40  void setTableNode(const char* node = "Calibrations_emc") { mTableNode = node; }
41  void setTableName(const char* name) { mTableName = name; }
42  void setTimeStamp(const char* stamp = "2030-01-01 00:00:00") { mTimeStamp = stamp; }
43  void setMaxEntryTime(const char* stamp = "2030-01-01 00:00:00") { mMaxTime = stamp; }
44  void setFlavor(const char* flavor = "ofl") { mFlavor = flavor; }
45 
46  void writeToDb(char* data);
47 
48  static std::string timeToSqlTime(const char* apiTime);
49 
50 protected:
51  std::string mFlavor;
52  std::string mTableNode;
53  std::string mTableName;
54  std::string mTimeStamp;
55  std::string mMaxTime;
56  std::vector<std::string> mTimeStampList;
57 
58  ClassDef(StEmcDbHandler,1)
59 };
60 #endif
std::string mMaxTime
EMC database max entry time.
std::string mFlavor
flavor for BEMC tables
std::string mTableName
EMC database table name, according to input.
std::string mTimeStamp
EMC database table time stamp.
std::string mTableNode
Database node for EMC tables.
std::vector< std::string > mTimeStampList
Time stamp list of specified EMC database table.