187 {
188 MsgStream log(messageService(), name());
189 SmartDataPtr<Event::EventHeader> eventHeader(m_eventSvc,"/Event/EventHeader");
190 int run = eventHeader->runNumber();
191
192
193 char stmt1[400];
194 StatusCode st1;
195
196 int runfrm1;
197 int runto1;
198 std::string cType;
199
200 if(run<0) {
201
202 run = -run;
203 }
204
205 if(m_bossRelease=="default") m_bossRelease = getenv("BES_RELEASE");
206
207 cType="EmcShEnCalib";
208
209 st1=
getSftParVer(m_bossVer,m_calPar,runfrm1,runto1,run,m_bossRelease,cType);
210
211 sprintf(stmt1,
"select RunFrom,RunTo,singleGammaCalib,pi0Calib from EmcShEnCalibConst where SftVer = '%s' and RunFrom <= %d and RunTo >= %d ", m_bossVer.c_str(), run, run);
212
215
216 if( row_no > 0 ) {
218 m_SingleGammaCalibFile = dbrec.
GetString(
"singleGammaCalib");
219 m_Pi0CalibFile = dbrec.
GetString(
"pi0Calib");
220 m_RunFrom = dbrec.
GetInt(
"RunFrom");
221 m_RunTo = dbrec.
GetInt(
"RunTo");
222
223
224
225
226
227
228
229
230
231
232 return true;
233 } else if( row_no<=0 ) {
234 cout << " EmcShEnCalibSvc:: can not found EmcShEnCalibSvc information of run:"
235 << run << ", boss version " << m_bossRelease << endl;
236 exit(1);
237 return false;
238 }
239 return true;
240}
sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=2", j, j)
int GetInt(std::string key)
std::string GetString(std::string key)
StatusCode getSftParVer(std::string &SftVer, std::string &CalParVer, int &runfrm, int &runto, int RunNo, std::string BossRelease, std::string DataType)
virtual int query(const std::string &dbName, const std::string &sql, DatabaseRecordVector &res)=0