132 {
133 MsgStream log(
msgSvc(), name() );
134 if ( !m_dbsvc )
135 {
136 log << MSG::FATAL << " m_dbsvc=0" << endmsg;
137 return StatusCode::FAILURE;
138 }
139
140 SmartDataPtr<Event::EventHeader> eventHeader( m_eventSvc, "/Event/EventHeader" );
141 int run = eventHeader->runNumber();
142
143 log << MSG::INFO << "run=" << run << endmsg;
144
145 char stmt1[200];
146 sprintf( stmt1,
"select efconfig_id from RunParams where run_number = %d",
abs( run ) );
147
148 DatabaseRecordVector res;
149 int row_no = m_dbsvc->query( "RunInfo", stmt1, res );
150 if ( !row_no )
151 {
152 log << MSG::ERROR << "search errror" << endmsg;
153 return StatusCode::FAILURE;
154 }
155 long int efId = atoi( ( *res[0] )["efconfig_id"] );
156
157 char stmt2[200];
159 "select Seqlist_dtd,Siglist_dtd,Seqlist_xml,Siglist_xml from EFConfInfo where "
160 "EFConfId = %ld",
161 efId );
162
164 row_no = m_dbsvc->query( "configdb", stmt2, res );
165 if ( !row_no )
166 {
167 log << MSG::ERROR << "search errror" << endmsg;
168 return StatusCode::FAILURE;
169 }
170
171 long int seq_dtd, sig_dtd, seq_xml, sig_xml;
172 seq_dtd = atoi( ( *res[0] )["Seqlist_dtd"] );
173 seq_dtd = 18;
174 sig_dtd = atoi( ( *res[0] )["Siglist_dtd"] );
175 sig_dtd = 15;
176 seq_xml = atoi( ( *res[0] )["Seqlist_xml"] );
177 sig_xml = atoi( ( *res[0] )["Siglist_xml"] );
178
180
181 char stmt3[200];
182 sprintf( stmt3,
"select FileName,FileText from EFfile where EFfileId = %ld", seq_dtd );
184 row_no = m_dbsvc->query( "configdb", stmt3, res );
185 if ( !row_no )
186 {
187 log << MSG::ERROR << "search errror" << endmsg;
188 return StatusCode::FAILURE;
189 }
190 outfile.open( ( *res[0] )["FileName"], ios_base::out );
191 outfile << ( *res[0] )["FileText"];
192 outfile.close();
193
194 char stmt4[200];
195 sprintf( stmt4,
"select FileName,FileText from EFfile where EFfileId = %ld", sig_dtd );
197 row_no = m_dbsvc->query( "configdb", stmt4, res );
198 if ( !row_no )
199 {
200 log << MSG::ERROR << "search errror" << endmsg;
201 return StatusCode::FAILURE;
202 }
203 outfile.open( ( *res[0] )["FileName"], ios_base::out );
204 outfile << ( *res[0] )["FileText"];
205 outfile.close();
206
207 char stmt5[200];
208 sprintf( stmt5,
"select FileName,FileText from EFfile where EFfileId = %ld", seq_xml );
210 row_no = m_dbsvc->query( "configdb", stmt5, res );
211 if ( !row_no )
212 {
213 log << MSG::ERROR << "search errror" << endmsg;
214 return StatusCode::FAILURE;
215 }
216 outfile.open( ( *res[0] )["FileName"], ios_base::out );
217 outfile << ( *res[0] )["FileText"];
218 outfile.close();
219 m_seqListFile = string( ( *res[0] )["FileName"] );
220
221 char stmt6[200];
222 sprintf( stmt6,
"select FileName,FileText from EFfile where EFfileId = %ld", sig_xml );
224 row_no = m_dbsvc->query( "configdb", stmt6, res );
225 if ( !row_no )
226 {
227 log << MSG::ERROR << "search errror" << endmsg;
228 return StatusCode::FAILURE;
229 }
230 outfile.open( ( *res[0] )["FileName"], ios_base::out );
231 outfile << ( *res[0] )["FileText"];
232 outfile.close();
233 m_sigListFile = string( ( *res[0] )["FileName"] );
234
235 return StatusCode::SUCCESS;
236}
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)