87 |
/** |
/** |
88 |
* Initialize CaloLevel0 object |
* Initialize CaloLevel0 object |
89 |
**/ |
**/ |
90 |
void CaloLevel0::ProcessingInit(TSQLServer *dbc, UInt_t hs, Int_t &sgnl, TTree *l0tree, Bool_t isdeb, Bool_t isverb){ |
void CaloLevel0::ProcessingInit(GL_TABLES *glt, UInt_t hs, Int_t &sgnl, TTree *l0tree, Bool_t isdeb, Bool_t isverb){ |
91 |
|
// |
92 |
|
const TString host = glt->CGetHost(); |
93 |
|
const TString user = glt->CGetUser(); |
94 |
|
const TString psw = glt->CGetPsw(); |
95 |
|
TSQLServer *dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
96 |
|
if ( !dbc->IsConnected() ) throw -116; |
97 |
|
stringstream myquery; |
98 |
|
myquery.str(""); |
99 |
|
myquery << "SET time_zone='+0:00'"; |
100 |
|
dbc->Query(myquery.str().c_str()); |
101 |
// |
// |
102 |
debug = isdeb; |
debug = isdeb; |
103 |
verbose = isverb; |
verbose = isverb; |
174 |
// |
// |
175 |
delete glcalo; |
delete glcalo; |
176 |
delete glroot; |
delete glroot; |
177 |
|
dbc->Close(); |
178 |
|
delete dbc; |
179 |
// |
// |
180 |
return; |
return; |
181 |
// |
// |
182 |
} |
} |
183 |
|
|
184 |
Int_t CaloLevel0::ChkCalib(TSQLServer *dbc, UInt_t atime){ |
Int_t CaloLevel0::ChkCalib(GL_TABLES *glt, UInt_t atime){ |
185 |
Int_t sgnl = 0; |
Int_t sgnl = 0; |
186 |
for ( Int_t s = 0; s < 4; s++){ |
for ( Int_t s = 0; s < 4; s++){ |
187 |
if ( atime > totime[s] ){ |
if ( atime > totime[s] ){ |
188 |
if ( !dbc->IsConnected() ) throw -116; |
sgnl = Update(glt,atime,s); |
|
sgnl = Update(dbc,atime,s); |
|
189 |
if ( sgnl < 0 ) return(sgnl); |
if ( sgnl < 0 ) return(sgnl); |
190 |
}; |
}; |
191 |
}; |
}; |
192 |
return(sgnl); |
return(sgnl); |
193 |
} |
} |
194 |
|
|
195 |
Int_t CaloLevel0::ChkParam(TSQLServer *dbc, UInt_t runheader, Bool_t mechal){ |
Int_t CaloLevel0::ChkParam(GL_TABLES *glt, UInt_t runheader, Bool_t mechal){ |
196 |
|
const TString host = glt->CGetHost(); |
197 |
|
const TString user = glt->CGetUser(); |
198 |
|
const TString psw = glt->CGetPsw(); |
199 |
|
TSQLServer *dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
200 |
|
if ( !dbc->IsConnected() ) throw -116; |
201 |
|
stringstream myquery; |
202 |
|
myquery.str(""); |
203 |
|
myquery << "SET time_zone='+0:00'"; |
204 |
|
dbc->Query(myquery.str().c_str()); |
205 |
|
// |
206 |
stringstream calfile; |
stringstream calfile; |
207 |
stringstream bmfile; |
stringstream bmfile; |
208 |
stringstream aligfile; |
stringstream aligfile; |
358 |
}; |
}; |
359 |
// |
// |
360 |
delete glparam; |
delete glparam; |
361 |
|
dbc->Close(); |
362 |
|
delete dbc; |
363 |
// |
// |
364 |
return(0); |
return(0); |
365 |
} |
} |
1019 |
return; |
return; |
1020 |
} |
} |
1021 |
|
|
1022 |
Int_t CaloLevel0::Update(TSQLServer *dbc, UInt_t atime, Int_t s){ |
Int_t CaloLevel0::Update(GL_TABLES *glt, UInt_t atime, Int_t s){ |
1023 |
// |
// |
1024 |
|
const TString host = glt->CGetHost(); |
1025 |
|
const TString user = glt->CGetUser(); |
1026 |
|
const TString psw = glt->CGetPsw(); |
1027 |
|
TSQLServer *dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
1028 |
|
if ( !dbc->IsConnected() ) throw -116; |
1029 |
|
stringstream myquery; |
1030 |
|
myquery.str(""); |
1031 |
|
myquery << "SET time_zone='+0:00'"; |
1032 |
|
dbc->Query(myquery.str().c_str()); |
1033 |
Int_t sgnl = 0; |
Int_t sgnl = 0; |
1034 |
// |
// |
1035 |
GL_CALO_CALIB *glcalo = new GL_CALO_CALIB(); |
GL_CALO_CALIB *glcalo = new GL_CALO_CALIB(); |