StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fms_db_recpar.C
1 #include <iostream.h>
2 #include <fstream.h>
3 
4 //read and write Calibration/fms/fmsRec
5 
6 Int_t fms_db_recpar(char* opt = "readtext run15sim", char* dataspec = "fmsrecpar_lowthre.txt"){
7  TString option(opt);
8  TString data(dataspec);
9  TString storeTime; //that's begin time for validity range for WRITING TO DB
10  int readDate, readTime=0;
11  if(option.Contains("run15") && option.Contains("sim")){
12  storeTime = "2014-12-10 00:00:02";
13  readDate = 20141215;
14  }else if(option.Contains("run15") && option.Contains("ofl")){
15  storeTime = "2014-12-20 00:00:01";
16  readDate = 20141225;
17  }
18 
19  std::cout << "Opt =" << opt << "\n";
20  std::cout << "readtext = " << option.Contains("readtext") << "\n";
21  std::cout << "readdb = " << option.Contains("readdb") << "\n";
22  std::cout << "writedb = " << option.Contains("writedb") << "\n";
23  std::cout << "writetext = " << option.Contains("writetext") << "\n";
24 
25  gROOT->Macro("/star/u/yuxip/FMS/myreviewFmsPointMaker/load.C");
26  gSystem->Load("St_base.so");
27  gSystem->Load("libStDb_Tables.so");
28  gSystem->Load("StDbLib.so");
29  gSystem->Load("StChain");
30  gSystem->Load("StBFChain");
31  gSystem->Load("StUtilities");
32  gSystem->Load("StIOMaker");
33  gSystem->Load("StarClassLibrary");
34  gSystem->Load("St_Tables");
35  gSystem->Load("StDbLib");
36  gSystem->Load("StDbBroker");
37  gSystem->Load("St_db_Maker");
38 
39  // St_db_Maker* dbMk = new St_db_Maker("db","MySQL:StarDb","$STAR/StarDb");
40  // dbMk->SetDEBUG(0);
41  // dbMk->SetDateTime(readDate, readTime);
42  StFmsDbMaker* fmsdb = new StFmsDbMaker("fmsDb");
43  fmsdb->setDebug(0);
44  StFmsDbConfig& recDbConfig = fmsdb->getRecConfig();
45  //max index dimensions
46  const Int_t MAX = 80;
47 
48  //structure to fill up
49  fmsRec_st recpar;
50  const char* filename = "fmsrecpar.txt";
51  // recDbConfig.fillMap(filename);
52  // recDbConfig.writeMap("tmp1.txt");
53  // std::string a1 = recDbConfig.getParameter("CORNER_LOW_COL");
54  // std::cout << "outside a1 = " << a1 << std::endl;
55 
56  if(option.Contains("readtext")){
57  const char* filename = dataspec;
58  std::cout << "filename: " << filename << endl;
59  recDbConfig.fillMap(filename);
60  //print the internal map. std::cout generated by awk on fmsRec.idl
61  std::cout << "ROW_LOW_LIMIT = " << recDbConfig.getParameter("ROW_LOW_LIMIT") << std::endl;
62  std::cout << "COL_LOW_LIMIT = " << recDbConfig.getParameter("COL_LOW_LIMIT") << std::endl;
63  std::cout << "CEN_ROW_LRG = " << recDbConfig.getParameter("CEN_ROW_LRG") << std::endl;
64  std::cout << "CEN_ROW_WIDTH_LRG = " << recDbConfig.getParameter("CEN_ROW_WIDTH_LRG") << std::endl;
65  std::cout << "CEN_UPPER_COL_LRG = " << recDbConfig.getParameter("CEN_UPPER_COL_LRG") << std::endl;
66  std::cout << "CEN_ROW_SML = " << recDbConfig.getParameter("CEN_ROW_SML") << std::endl;
67  std::cout << "CEN_ROW_WIDTH_SML = " << recDbConfig.getParameter("CEN_ROW_WIDTH_SML") << std::endl;
68  std::cout << "CEN_UPPER_COL_SML = " << recDbConfig.getParameter("CEN_UPPER_COL_SML") << std::endl;
69  std::cout << "CORNER_ROW = " << recDbConfig.getParameter("CORNER_ROW") << std::endl;
70  std::cout << "CORNER_LOW_COL = " << recDbConfig.getParameter("CORNER_LOW_COL") << std::endl;
71  std::cout << "CLUSTER_BASE = " << recDbConfig.getParameter("CLUSTER_BASE") << std::endl;
72  std::cout << "CLUSTER_ID_FACTOR_DET = " << recDbConfig.getParameter("CLUSTER_ID_FACTOR_DET") << std::endl;
73  std::cout << "TOTAL_TOWERS = " << recDbConfig.getParameter("TOTAL_TOWERS") << std::endl;
74  std::cout << "PEAK_TOWER_FACTOR = " << recDbConfig.getParameter("PEAK_TOWER_FACTOR") << std::endl;
75  std::cout << "TOWER_E_THRESHOLD = " << recDbConfig.getParameter("TOWER_E_THRESHOLD") << std::endl;
76  std::cout << "BAD_2PH_CHI2 = " << recDbConfig.getParameter("BAD_2PH_CHI2") << std::endl;
77  std::cout << "BAD_MIN_E_LRG = " << recDbConfig.getParameter("BAD_MIN_E_LRG") << std::endl;
78  std::cout << "BAD_MAX_TOW_LRG = " << recDbConfig.getParameter("BAD_MAX_TOW_LRG") << std::endl;
79  std::cout << "BAD_MIN_E_SML = " << recDbConfig.getParameter("BAD_MIN_E_SML") << std::endl;
80  std::cout << "BAD_MAX_TOW_SML = " << recDbConfig.getParameter("BAD_MAX_TOW_SML") << std::endl;
81  std::cout << "VALID_FT = " << recDbConfig.getParameter("VALID_FT") << std::endl;
82  std::cout << "VALID_2ND_FT = " << recDbConfig.getParameter("VALID_2ND_FT") << std::endl;
83  std::cout << "VALID_E_OWN = " << recDbConfig.getParameter("VALID_E_OWN") << std::endl;
84  std::cout << "SS_C = " << recDbConfig.getParameter("SS_C") << std::endl;
85  std::cout << "SS_A1 = " << recDbConfig.getParameter("SS_A1") << std::endl;
86  std::cout << "SS_A2 = " << recDbConfig.getParameter("SS_A2") << std::endl;
87  std::cout << "SS_A3 = " << recDbConfig.getParameter("SS_A3") << std::endl;
88  std::cout << "SS_B1 = " << recDbConfig.getParameter("SS_B1") << std::endl;
89  std::cout << "SS_B2 = " << recDbConfig.getParameter("SS_B2") << std::endl;
90  std::cout << "SS_B3 = " << recDbConfig.getParameter("SS_B3") << std::endl;
91  std::cout << "CAT_NTOWERS_PH1 = " << recDbConfig.getParameter("CAT_NTOWERS_PH1") << std::endl;
92  std::cout << "CAT_EP1_PH2 = " << recDbConfig.getParameter("CAT_EP1_PH2") << std::endl;
93  std::cout << "CAT_EP0_PH2 = " << recDbConfig.getParameter("CAT_EP0_PH2") << std::endl;
94  std::cout << "CAT_SIGMAMAX_MIN_PH2 = " << recDbConfig.getParameter("CAT_SIGMAMAX_MIN_PH2") << std::endl;
95  std::cout << "CAT_EP1_PH1 = " << recDbConfig.getParameter("CAT_EP1_PH1") << std::endl;
96  std::cout << "CAT_EP0_PH1 = " << recDbConfig.getParameter("CAT_EP0_PH1") << std::endl;
97  std::cout << "CAT_SIGMAMAX_MAX_PH1 = " << recDbConfig.getParameter("CAT_SIGMAMAX_MAX_PH1") << std::endl;
98  std::cout << "PH1_START_NPH = " << recDbConfig.getParameter("PH1_START_NPH") << std::endl;
99  std::cout << "PH1_DELTA_N = " << recDbConfig.getParameter("PH1_DELTA_N") << std::endl;
100  std::cout << "PH1_DELTA_X = " << recDbConfig.getParameter("PH1_DELTA_X") << std::endl;
101  std::cout << "PH1_DELTA_Y = " << recDbConfig.getParameter("PH1_DELTA_Y") << std::endl;
102  std::cout << "PH1_DELTA_E = " << recDbConfig.getParameter("PH1_DELTA_E") << std::endl;
103  std::cout << "PH2_START_NPH = " << recDbConfig.getParameter("PH2_START_NPH") << std::endl;
104  std::cout << "PH2_START_FSIGMAMAX = " << recDbConfig.getParameter("PH2_START_FSIGMAMAX") << std::endl;
105  std::cout << "PH2_RAN_LOW = " << recDbConfig.getParameter("PH2_RAN_LOW") << std::endl;
106  std::cout << "PH2_RAN_HIGH = " << recDbConfig.getParameter("PH2_RAN_HIGH") << std::endl;
107  std::cout << "PH2_STEP_0 = " << recDbConfig.getParameter("PH2_STEP_0") << std::endl;
108  std::cout << "PH2_STEP_1 = " << recDbConfig.getParameter("PH2_STEP_1") << std::endl;
109  std::cout << "PH2_STEP_2 = " << recDbConfig.getParameter("PH2_STEP_2") << std::endl;
110  std::cout << "PH2_STEP_3 = " << recDbConfig.getParameter("PH2_STEP_3") << std::endl;
111  std::cout << "PH2_STEP_4 = " << recDbConfig.getParameter("PH2_STEP_4") << std::endl;
112  std::cout << "PH2_STEP_5 = " << recDbConfig.getParameter("PH2_STEP_5") << std::endl;
113  std::cout << "PH2_STEP_6 = " << recDbConfig.getParameter("PH2_STEP_6") << std::endl;
114  std::cout << "PH2_MAXTHETA_F = " << recDbConfig.getParameter("PH2_MAXTHETA_F") << std::endl;
115  std::cout << "PH2_LOWER_NPH = " << recDbConfig.getParameter("PH2_LOWER_NPH") << std::endl;
116  std::cout << "PH2_LOWER_XF = " << recDbConfig.getParameter("PH2_LOWER_XF") << std::endl;
117  std::cout << "PH2_LOWER_YF = " << recDbConfig.getParameter("PH2_LOWER_YF") << std::endl;
118  std::cout << "PH2_LOWER_XMAX_F = " << recDbConfig.getParameter("PH2_LOWER_XMAX_F") << std::endl;
119  std::cout << "PH2_LOWER_XMAX_POW = " << recDbConfig.getParameter("PH2_LOWER_XMAX_POW") << std::endl;
120  std::cout << "PH2_LOWER_XMAX_LIMIT = " << recDbConfig.getParameter("PH2_LOWER_XMAX_LIMIT") << std::endl;
121  std::cout << "PH2_LOWER_5_F = " << recDbConfig.getParameter("PH2_LOWER_5_F") << std::endl;
122  std::cout << "PH2_LOWER_6_F = " << recDbConfig.getParameter("PH2_LOWER_6_F") << std::endl;
123  std::cout << "PH2_UPPER_NPH = " << recDbConfig.getParameter("PH2_UPPER_NPH") << std::endl;
124  std::cout << "PH2_UPPER_XF = " << recDbConfig.getParameter("PH2_UPPER_XF") << std::endl;
125  std::cout << "PH2_UPPER_YF = " << recDbConfig.getParameter("PH2_UPPER_YF") << std::endl;
126  std::cout << "PH2_UPPER_XMIN_F = " << recDbConfig.getParameter("PH2_UPPER_XMIN_F") << std::endl;
127  std::cout << "PH2_UPPER_XMIN_P0 = " << recDbConfig.getParameter("PH2_UPPER_XMIN_P0") << std::endl;
128  std::cout << "PH2_UPPER_XMIN_LIMIT = " << recDbConfig.getParameter("PH2_UPPER_XMIN_LIMIT") << std::endl;
129  std::cout << "PH2_UPPER_5_F = " << recDbConfig.getParameter("PH2_UPPER_5_F") << std::endl;
130  std::cout << "PH2_UPPER_6_F = " << recDbConfig.getParameter("PH2_UPPER_6_F") << std::endl;
131  std::cout << "PH2_3_LIMIT_LOWER = " << recDbConfig.getParameter("PH2_3_LIMIT_LOWER") << std::endl;
132  std::cout << "PH2_3_LIMIT_UPPER = " << recDbConfig.getParameter("PH2_3_LIMIT_UPPER") << std::endl;
133  std::cout << "GL_LOWER_1 = " << recDbConfig.getParameter("GL_LOWER_1") << std::endl;
134  std::cout << "GL_UPPER_DELTA_MAXN = " << recDbConfig.getParameter("GL_UPPER_DELTA_MAXN") << std::endl;
135  std::cout << "GL_0_DLOWER = " << recDbConfig.getParameter("GL_0_DLOWER") << std::endl;
136  std::cout << "GL_0_DUPPER = " << recDbConfig.getParameter("GL_0_DUPPER") << std::endl;
137  std::cout << "GL_1_DLOWER = " << recDbConfig.getParameter("GL_1_DLOWER") << std::endl;
138  std::cout << "GL_1_DUPPER = " << recDbConfig.getParameter("GL_1_DUPPER") << std::endl;
139  std::cout << "GL_2_DLOWER = " << recDbConfig.getParameter("GL_2_DLOWER") << std::endl;
140  std::cout << "GL_2_DUPPER = " << recDbConfig.getParameter("GL_2_DUPPER") << std::endl;
141  }
142 
143  if(option.Contains("readdb")){
144 
145  gSystem->Load("StChain");
146  gSystem->Load("StBFChain");
147  gSystem->Load("StUtilities");
148  gSystem->Load("StIOMaker");
149  gSystem->Load("StarClassLibrary");
150  gSystem->Load("St_Tables");
151  gSystem->Load("StDbLib");
152  gSystem->Load("StDbBroker");
153  gSystem->Load("St_db_Maker");
154 
155  St_db_Maker *dbMk=new St_db_Maker("db", "MySQL:StarDb", "$STAR/StarDb");
156  dbMk->SetDebug();
157  dbMk->SetDateTime(readDate,readTime);
158  dbMk->SetFlavor("ofl");
159  dbMk->Init();
160  dbMk->Make();
161 
162  TDataSet *DB = 0;
163  DB = dbMk->GetInputDB("Calibrations/fms");
164  if (!DB) { std::cout << "ERROR: no db maker?" << std::endl; }
165 
166  St_fmsRec *dbrecpar = 0;
167  dbrecpar = (St_fmsRec*) DB->Find("fmsRec");
168  int ifield = 0;
169  if(dbrecpar){
170  std::cout << "Reading fmsRec table" << endl;
171  fmsRec_st *rectable = dbrecpar->GetTable();
172  recDbConfig.readMap(*rectable);
173 
174  //print the internal map
175  std::cout << "ROW_LOW_LIMIT = " << recDbConfig.getParameter("ROW_LOW_LIMIT") << std::endl;
176  std::cout << "COL_LOW_LIMIT = " << recDbConfig.getParameter("COL_LOW_LIMIT") << std::endl;
177  std::cout << "CEN_ROW_LRG = " << recDbConfig.getParameter("CEN_ROW_LRG") << std::endl;
178  std::cout << "CEN_ROW_WIDTH_LRG = " << recDbConfig.getParameter("CEN_ROW_WIDTH_LRG") << std::endl;
179  std::cout << "CEN_UPPER_COL_LRG = " << recDbConfig.getParameter("CEN_UPPER_COL_LRG") << std::endl;
180  std::cout << "CEN_ROW_SML = " << recDbConfig.getParameter("CEN_ROW_SML") << std::endl;
181  std::cout << "CEN_ROW_WIDTH_SML = " << recDbConfig.getParameter("CEN_ROW_WIDTH_SML") << std::endl;
182  std::cout << "CEN_UPPER_COL_SML = " << recDbConfig.getParameter("CEN_UPPER_COL_SML") << std::endl;
183  std::cout << "CORNER_ROW = " << recDbConfig.getParameter("CORNER_ROW") << std::endl;
184  std::cout << "CORNER_LOW_COL = " << recDbConfig.getParameter("CORNER_LOW_COL") << std::endl;
185  std::cout << "CLUSTER_BASE = " << recDbConfig.getParameter("CLUSTER_BASE") << std::endl;
186  std::cout << "CLUSTER_ID_FACTOR_DET = " << recDbConfig.getParameter("CLUSTER_ID_FACTOR_DET") << std::endl;
187  std::cout << "TOTAL_TOWERS = " << recDbConfig.getParameter("TOTAL_TOWERS") << std::endl;
188  std::cout << "PEAK_TOWER_FACTOR = " << recDbConfig.getParameter("PEAK_TOWER_FACTOR") << std::endl;
189  std::cout << "TOWER_E_THRESHOLD = " << recDbConfig.getParameter("TOWER_E_THRESHOLD") << std::endl;
190  std::cout << "BAD_2PH_CHI2 = " << recDbConfig.getParameter("BAD_2PH_CHI2") << std::endl;
191  std::cout << "BAD_MIN_E_LRG = " << recDbConfig.getParameter("BAD_MIN_E_LRG") << std::endl;
192  std::cout << "BAD_MAX_TOW_LRG = " << recDbConfig.getParameter("BAD_MAX_TOW_LRG") << std::endl;
193  std::cout << "BAD_MIN_E_SML = " << recDbConfig.getParameter("BAD_MIN_E_SML") << std::endl;
194  std::cout << "BAD_MAX_TOW_SML = " << recDbConfig.getParameter("BAD_MAX_TOW_SML") << std::endl;
195  std::cout << "VALID_FT = " << recDbConfig.getParameter("VALID_FT") << std::endl;
196  std::cout << "VALID_2ND_FT = " << recDbConfig.getParameter("VALID_2ND_FT") << std::endl;
197  std::cout << "VALID_E_OWN = " << recDbConfig.getParameter("VALID_E_OWN") << std::endl;
198  std::cout << "SS_C = " << recDbConfig.getParameter("SS_C") << std::endl;
199  std::cout << "SS_A1 = " << recDbConfig.getParameter("SS_A1") << std::endl;
200  std::cout << "SS_A2 = " << recDbConfig.getParameter("SS_A2") << std::endl;
201  std::cout << "SS_A3 = " << recDbConfig.getParameter("SS_A3") << std::endl;
202  std::cout << "SS_B1 = " << recDbConfig.getParameter("SS_B1") << std::endl;
203  std::cout << "SS_B2 = " << recDbConfig.getParameter("SS_B2") << std::endl;
204  std::cout << "SS_B3 = " << recDbConfig.getParameter("SS_B3") << std::endl;
205  std::cout << "CAT_NTOWERS_PH1 = " << recDbConfig.getParameter("CAT_NTOWERS_PH1") << std::endl;
206  std::cout << "CAT_EP1_PH2 = " << recDbConfig.getParameter("CAT_EP1_PH2") << std::endl;
207  std::cout << "CAT_EP0_PH2 = " << recDbConfig.getParameter("CAT_EP0_PH2") << std::endl;
208  std::cout << "CAT_SIGMAMAX_MIN_PH2 = " << recDbConfig.getParameter("CAT_SIGMAMAX_MIN_PH2") << std::endl;
209  std::cout << "CAT_EP1_PH1 = " << recDbConfig.getParameter("CAT_EP1_PH1") << std::endl;
210  std::cout << "CAT_EP0_PH1 = " << recDbConfig.getParameter("CAT_EP0_PH1") << std::endl;
211  std::cout << "CAT_SIGMAMAX_MAX_PH1 = " << recDbConfig.getParameter("CAT_SIGMAMAX_MAX_PH1") << std::endl;
212  std::cout << "PH1_START_NPH = " << recDbConfig.getParameter("PH1_START_NPH") << std::endl;
213  std::cout << "PH1_DELTA_N = " << recDbConfig.getParameter("PH1_DELTA_N") << std::endl;
214  std::cout << "PH1_DELTA_X = " << recDbConfig.getParameter("PH1_DELTA_X") << std::endl;
215  std::cout << "PH1_DELTA_Y = " << recDbConfig.getParameter("PH1_DELTA_Y") << std::endl;
216  std::cout << "PH1_DELTA_E = " << recDbConfig.getParameter("PH1_DELTA_E") << std::endl;
217  std::cout << "PH2_START_NPH = " << recDbConfig.getParameter("PH2_START_NPH") << std::endl;
218  std::cout << "PH2_START_FSIGMAMAX = " << recDbConfig.getParameter("PH2_START_FSIGMAMAX") << std::endl;
219  std::cout << "PH2_RAN_LOW = " << recDbConfig.getParameter("PH2_RAN_LOW") << std::endl;
220  std::cout << "PH2_RAN_HIGH = " << recDbConfig.getParameter("PH2_RAN_HIGH") << std::endl;
221  std::cout << "PH2_STEP_0 = " << recDbConfig.getParameter("PH2_STEP_0") << std::endl;
222  std::cout << "PH2_STEP_1 = " << recDbConfig.getParameter("PH2_STEP_1") << std::endl;
223  std::cout << "PH2_STEP_2 = " << recDbConfig.getParameter("PH2_STEP_2") << std::endl;
224  std::cout << "PH2_STEP_3 = " << recDbConfig.getParameter("PH2_STEP_3") << std::endl;
225  std::cout << "PH2_STEP_4 = " << recDbConfig.getParameter("PH2_STEP_4") << std::endl;
226  std::cout << "PH2_STEP_5 = " << recDbConfig.getParameter("PH2_STEP_5") << std::endl;
227  std::cout << "PH2_STEP_6 = " << recDbConfig.getParameter("PH2_STEP_6") << std::endl;
228  std::cout << "PH2_MAXTHETA_F = " << recDbConfig.getParameter("PH2_MAXTHETA_F") << std::endl;
229  std::cout << "PH2_LOWER_NPH = " << recDbConfig.getParameter("PH2_LOWER_NPH") << std::endl;
230  std::cout << "PH2_LOWER_XF = " << recDbConfig.getParameter("PH2_LOWER_XF") << std::endl;
231  std::cout << "PH2_LOWER_YF = " << recDbConfig.getParameter("PH2_LOWER_YF") << std::endl;
232  std::cout << "PH2_LOWER_XMAX_F = " << recDbConfig.getParameter("PH2_LOWER_XMAX_F") << std::endl;
233  std::cout << "PH2_LOWER_XMAX_POW = " << recDbConfig.getParameter("PH2_LOWER_XMAX_POW") << std::endl;
234  std::cout << "PH2_LOWER_XMAX_LIMIT = " << recDbConfig.getParameter("PH2_LOWER_XMAX_LIMIT") << std::endl;
235  std::cout << "PH2_LOWER_5_F = " << recDbConfig.getParameter("PH2_LOWER_5_F") << std::endl;
236  std::cout << "PH2_LOWER_6_F = " << recDbConfig.getParameter("PH2_LOWER_6_F") << std::endl;
237  std::cout << "PH2_UPPER_NPH = " << recDbConfig.getParameter("PH2_UPPER_NPH") << std::endl;
238  std::cout << "PH2_UPPER_XF = " << recDbConfig.getParameter("PH2_UPPER_XF") << std::endl;
239  std::cout << "PH2_UPPER_YF = " << recDbConfig.getParameter("PH2_UPPER_YF") << std::endl;
240  std::cout << "PH2_UPPER_XMIN_F = " << recDbConfig.getParameter("PH2_UPPER_XMIN_F") << std::endl;
241  std::cout << "PH2_UPPER_XMIN_P0 = " << recDbConfig.getParameter("PH2_UPPER_XMIN_P0") << std::endl;
242  std::cout << "PH2_UPPER_XMIN_LIMIT = " << recDbConfig.getParameter("PH2_UPPER_XMIN_LIMIT") << std::endl;
243  std::cout << "PH2_UPPER_5_F = " << recDbConfig.getParameter("PH2_UPPER_5_F") << std::endl;
244  std::cout << "PH2_UPPER_6_F = " << recDbConfig.getParameter("PH2_UPPER_6_F") << std::endl;
245  std::cout << "PH2_3_LIMIT_LOWER = " << recDbConfig.getParameter("PH2_3_LIMIT_LOWER") << std::endl;
246  std::cout << "PH2_3_LIMIT_UPPER = " << recDbConfig.getParameter("PH2_3_LIMIT_UPPER") << std::endl;
247  std::cout << "GL_LOWER_1 = " << recDbConfig.getParameter("GL_LOWER_1") << std::endl;
248  std::cout << "GL_UPPER_DELTA_MAXN = " << recDbConfig.getParameter("GL_UPPER_DELTA_MAXN") << std::endl;
249  std::cout << "GL_0_DLOWER = " << recDbConfig.getParameter("GL_0_DLOWER") << std::endl;
250  std::cout << "GL_0_DUPPER = " << recDbConfig.getParameter("GL_0_DUPPER") << std::endl;
251  std::cout << "GL_1_DLOWER = " << recDbConfig.getParameter("GL_1_DLOWER") << std::endl;
252  std::cout << "GL_1_DUPPER = " << recDbConfig.getParameter("GL_1_DUPPER") << std::endl;
253  std::cout << "GL_2_DLOWER = " << recDbConfig.getParameter("GL_2_DLOWER") << std::endl;
254  std::cout << "GL_2_DUPPER = " << recDbConfig.getParameter("GL_2_DUPPER") << std::endl;
255  }
256 
257  else {
258  std::cout << "WARNING: No data in fmsRec table (wrong timestamp?). Nothing to return" << endl;
259  }
260  }
261 
262  if(option.Contains("writetext")){
263  const char* filename = data.Data();
264  recDbConfig.writeMap(filename);
265  }
266 
267  if(option.Contains("writedb")){
268  if(recDbConfig.isMapEmpty()){
269  std::cout << "internal map empty, please load map first" << std::endl;
270  return 0;
271  }
272  gSystem->Setenv("DB_ACCESS_MODE","write");
274  StDbConfigNode* node = mgr->initConfig("Calibrations_fms");
275  StDbTable* table = node->addDbTable("fmsRec");
276  mgr->setStoreTime(storeTime.Data());
277 
278  recDbConfig.fillFmsRec(recpar);
279  table->SetTable((char*)&recpar,1);
280 
281  mgr->storeDbTable(table);
282 
283  gSystem->Unsetenv("DB_ACCESS_MODE");
284  std::cout << "Done with database upload" << endl;
285  }
286 
287  return 1;
288 }
289 
290 
291 
292 
293 
void setDebug(Int_t debug)
debug mode, 0 for minimal message, &gt;0 for more debug messages
virtual Int_t Make()
virtual void SetTable(char *data, int nrows, int *idList=0)
calloc&#39;d version of data for StRoot
Definition: StDbTable.cc:550
static StDbManager * Instance()
strdup(..) is not ANSI
Definition: StDbManager.cc:155
virtual TDataSet * Find(const char *path) const
Definition: TDataSet.cxx:362