189 {
190 MsgStream log(messageService(), name());
191 SmartDataPtr<Event::EventHeader> eventHeader(m_eventSvc,"/Event/EventHeader");
192 int run = eventHeader->runNumber();
193
194
195 char stmt1[400];
196 StatusCode st1;
197
198 int runfrm1;
199 int runto1;
200 std::string cType;
201
202 if(run<0) {
203
204 run = -run;
205 }
206
207 if(m_bossRelease=="default") m_bossRelease = getenv("BES_RELEASE");
208
209 cType="EmcShEnCalib";
210
211 st1=
getSftParVer(m_bossVer,m_calPar,runfrm1,runto1,run,m_bossRelease,cType);
212
213 sprintf(stmt1,
"select RunFrom,RunTo,singleGammaCalib,pi0Calib from EmcShEnCalibConst where SftVer = '%s' and RunFrom <= %d and RunTo >= %d ", m_bossVer.c_str(), run, run);
214
217
218 if( row_no > 0 ) {
220 m_SingleGammaCalibFile = dbrec.
GetString(
"singleGammaCalib");
221 m_Pi0CalibFile = dbrec.
GetString(
"pi0Calib");
222 m_RunFrom = dbrec.
GetInt(
"RunFrom");
223 m_RunTo = dbrec.
GetInt(
"RunTo");
224
225
226
227
228
229
230
231
232
233
234 return true;
235 } else if( row_no<=0 ) {
236 cout << " EmcShEnCalibSvc:: can not found EmcShEnCalibSvc information of run:"
237 << run << ", boss version " << m_bossRelease << endl;
238 exit(1);
239 return false;
240 }
241 return true;
242}
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