StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StBemcTablesWriter.h
1 /***************************************************************************
2  *
3  * $Id: StBemcTablesWriter.h,v 1.2 2007/12/11 19:54:46 kocolosk Exp $
4  * Author: Adam Kocoloski, MIT, kocolosk@mit.edu
5  *
6  ***************************************************************************/
7 
8 #ifndef StBemcTablesWriter_HH
9 #define StBemcTablesWriter_HH
10 
11 #include <map>
12 using std::map;
13 
14 #include <string>
15 using std::string;
16 
17 #include "StEmcDbHandler.h"
18 #include "StBemcTables.h"
19 
21 {
22 public:
24  virtual ~StBemcTablesWriter();
25 
26  void setMaxEntryTime(char * maxEntryTime) { mDbHandler->setMaxEntryTime(maxEntryTime); }
27 
28  void loadTables(const char *sqlTime, const char *flavor="ofl");
29  void loadTableFromFile(TFile *f);
30 
31  void setTable(const char *tableName, void *data);
32 
33  void setCalib(int det, int softId, int power, float val);
34  void setPedestal(int det, int softId, int cap, float val);
35  void setPedestalRMS(int det, int softId, int cap, float val);
36  void setGain(int det, int softId, float val);
37  void setStatus(int det, int softId, unsigned short val);
38 
39  void setCalibStatus(int det, int softId, unsigned short val);
40  void setPedestalStatus(int det, int softId, unsigned short val);
41  void setGainStatus(int det, int softId, unsigned short val);
42 
43  void writeToDb(const char * tableName, const char * timeStamp, const char * flavor = "ofl");
44  void writeToFile(const char * fileName);
45 
46 private:
47  //keep the StDbTables stored here so we can test validity ranges, etc.
48  map<string, StDbTable*> mDbTables;
49 
50  StEmcDbHandler* mDbHandler;
51 
52  ClassDef(StBemcTablesWriter,1)
53 };
54 
55 #endif
56 
57 /***************************************************************************
58  *
59  * $Log: StBemcTablesWriter.h,v $
60  * Revision 1.2 2007/12/11 19:54:46 kocolosk
61  * allow direct setting of void * table
62  *
63  * Revision 1.1 2007/09/08 01:22:37 kocolosk
64  * StBemcTablesWriter provides common interface for inserting DB tables
65  *
66  *
67  **************************************************************************/
void loadTables(const char *sqlTime, const char *flavor="ofl")
load directly from DB, no Maker needed