181 {
182 MsgStream log(messageService(), name());
183 SmartDataPtr<Event::EventHeader> eventHeader(m_eventSvc,"/Event/EventHeader");
184 int run = eventHeader->runNumber();
185 log << MSG::DEBUG <<"Run in getEmcSatuDeadEnSvcInfo() is: "<<run<<endreq;
186
187 char stmt1[400];
188 StatusCode st1;
189
190 int runfrm1;
191 int runto1;
192 std::string cType;
193
194 if(run<0) {
195 log << MSG::DEBUG << "This data is the MC sample with the Run Number: " << run << endreq;
196 run = -run;
197 }
198
199
200
201
202
203 if(m_bossRelease=="default")
204 {
205 log << MSG::FATAL << " Boss Release for EmcSatuDeadEnSvc not set!" << endreq;
206 exit(1);
207 }
208 else{
209
210
211 cType="EmcSatuDeadEn";
212
213 st1=
getSftParVer(m_bossVer,m_calPar,runfrm1,runto1,run,m_bossRelease,cType);
214
215 sprintf(stmt1,
"select RunFrom,RunTo,EmcSatuEn,EmcDeadEn from EmcSatuDeadEn where SftVer = '%s' and RunFrom <= %d and RunTo >= %d ", m_bossVer.c_str(), run, run);
216 }
217
218
221
222 if( row_no > 0 ) {
224 m_SatuEnFile = dbrec.
GetString(
"EmcSatuEn");
225 m_DeadEnFile = dbrec.
GetString(
"EmcDeadEn");
226 m_RunFrom = dbrec.
GetInt(
"RunFrom");
227 m_RunTo = dbrec.
GetInt(
"RunTo");
228
229 log << MSG::DEBUG <<"BossReleaseVer="<<m_bossRelease.c_str()<<"\t"<<"EmcSatuDeadEnBossVer="<<m_bossVer.c_str()<<endreq;
230 log << MSG::DEBUG <<"m_SatuEnFile is:"<<m_SatuEnFile<<endreq;
231 log << MSG::DEBUG <<"m_DeadEnFile is:"<<m_DeadEnFile<<endreq;
232 log << MSG::DEBUG <<"m_RunFrom is:"<<m_RunFrom<<endreq;
233 log << MSG::DEBUG <<"m_RunTo is:"<<m_RunTo<<endreq;
234 log << MSG::DEBUG <<"Successfully fetch EmcSatuDeadEnSvc information for run: " << run << endreq;
235
236
237 return true;
238 } else if( row_no<=0 ) {
239 cout << " EmcSatuDeadEnSvc:: can not found EmcSatuDeadEnSvc information of run:"
240 << run << ", boss version " << m_bossRelease << endl;
241 exit(1);
242 return false;
243 }
244 return true;
245}
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