65 unique_ptr<coral::IQuery>
query(
m_session.nominalSchema().tableHandle(
"L1_MASTER_TABLE").newQuery() );
66 query->setRowCacheSize( 5 );
69 coral::AttributeList emptyBindVariableList0;
70 std::string condition =
"L1MT_ID = :mtId";
71 emptyBindVariableList0.extend<
int>(
"mtId");
72 emptyBindVariableList0[0].data<
int>() = mid;
73 query->setCondition( condition, emptyBindVariableList0 );
75 coral::AttributeList attList;
76 attList.extend<
int>(
"L1MT_TRIGGER_MENU_ID" );
79 coral::ICursor& cursor =
query->execute();
80 if ( ! cursor.next() ) {
83 throw std::runtime_error(
"CTPFilesLoader" );
85 const coral::AttributeList& row = cursor.currentRow();
86 int menuid = row[
"L1MT_TRIGGER_MENU_ID"].data<
int>();
87 if ( cursor.next() ) {
90 throw std::runtime_error(
"CTPFilesLoader >> Master_Table not available" );
98 coral::ITable& table =
m_session.nominalSchema().tableHandle(
"L1_TRIGGER_MENU");
99 coral::IQuery*
query = table.newQuery();
100 query->setRowCacheSize( 5 );
103 coral::AttributeList emptyBindVariableList0;
104 std::string condition =
"L1TM_ID = :tmId";
105 emptyBindVariableList0.extend<
int>(
"tmId");
106 emptyBindVariableList0[0].data<
int>() = mid;
107 query->setCondition( condition, emptyBindVariableList0 );
109 coral::AttributeList attList;
110 attList.extend<
int>(
"L1TM_CTP_FILES_ID" );
111 query->defineOutput(attList);
112 query->addToOutputList(
"L1TM_CTP_FILES_ID" );
114 coral::ICursor& cursor =
query->execute();
115 if ( ! cursor.next() ) {
119 throw std::runtime_error(
"CTPFilesLoader" );
121 const coral::AttributeList& row = cursor.currentRow();
122 return static_cast<long>(row[
"L1TM_CTP_FILES_ID"].data<
int>());
128 coral::ITable& table =
m_session.nominalSchema().tableHandle(
"L1_TRIGGER_MENU");
129 coral::IQuery*
query = table.newQuery();
130 query->setRowCacheSize( 5 );
133 coral::AttributeList emptyBindVariableList0;
134 std::string condition =
"L1TM_ID = :tmId";
135 emptyBindVariableList0.extend<
int>(
"tmId");
136 emptyBindVariableList0[0].data<
int>() = mid;
137 query->setCondition( condition, emptyBindVariableList0 );
139 coral::AttributeList attList;
140 attList.extend<
int>(
"L1TM_CTP_SMX_ID" );
141 query->defineOutput(attList);
142 query->addToOutputList(
"L1TM_CTP_SMX_ID" );
144 coral::ICursor& cursor =
query->execute();
145 if ( ! cursor.next() ) {
149 throw std::runtime_error(
"CTPFilesLoader" );
151 const coral::AttributeList& row = cursor.currentRow();
152 return static_cast<long>(row[
"L1TM_CTP_SMX_ID"].data<
int>());
165 if(ctpFiles.
id() <= 0) {
169 ctpFiles.
setId(filesid);
172 unique_ptr<coral::IQuery>
query(
m_session.nominalSchema().tableHandle(
"L1_CTP_FILES").newQuery() );
173 query->setRowCacheSize( 10 );
176 coral::AttributeList emptyBindVariableList0;
177 emptyBindVariableList0.extend<
long>(
"fId");
178 emptyBindVariableList0[0].data<
long>() = ctpFiles.
id();
179 query->setCondition(
"L1CF_ID = :fId", emptyBindVariableList0 );
181 coral::AttributeList attList;
182 attList.extend<std::string>(
"L1CF_NAME" );
183 attList.extend<
int>(
"L1CF_VERSION" );
184 attList.extend<std::string>(
"L1CF_LUT" );
185 attList.extend<std::string>(
"L1CF_CAM" );
188 coral::ICursor& cursor =
query->execute();
190 if ( ! cursor.next() ) {
193 throw std::runtime_error(
"CTPFilesLoader >> CTPFiles not available" );
196 const coral::AttributeList& row = cursor.currentRow();
197 std::string
name = row[
"L1CF_NAME"].data<std::string>();
198 int version = row[
"L1CF_VERSION"].data<
int>();
199 std::string ctpcoreLUT_str = row[
"L1CF_LUT"].data<std::string>();
200 std::string ctpcoreCAM_str = row[
"L1CF_CAM"].data<std::string>();
202 if ( cursor.next() ) {
205 throw std::runtime_error(
"CTPFilesLoader >> CTPFiles not available" );
208 std::vector<u_int> lutVec(CTPFiles::ALL_CTPCORELUT_SIZE);
212 std::vector<u_int> camVec(CTPFiles::ALL_CTPCORECAM_SIZE);
223 }
catch(
const coral::Exception& e ) {
237 if(ctpFiles.
id() <= 0 || ctpFiles.
smxId() <= 0) {
240 if(ctpFiles.
id() <= 0) {
242 ctpFiles.
setId(filesid);
244 if(ctpFiles.
smxId() <= 0) {
251 unique_ptr<coral::IQuery>
query(
m_session.nominalSchema().tableHandle(
"L1_CTP_FILES").newQuery() );
252 query->setRowCacheSize( 13 );
255 coral::AttributeList emptyBindVariableList0;
256 std::string condition =
"L1CF_ID = :fId";
257 emptyBindVariableList0.extend<
long>(
"fId");
258 emptyBindVariableList0[0].data<
long>() = ctpFiles.
id();
259 query->setCondition( condition, emptyBindVariableList0 );
261 coral::AttributeList attList;
262 attList.extend<std::string>(
"L1CF_NAME" );
263 attList.extend<
int>(
"L1CF_VERSION" );
264 attList.extend<std::string>(
"L1CF_MON_SEL_SLOT7" );
265 attList.extend<std::string>(
"L1CF_MON_SEL_SLOT8" );
266 attList.extend<std::string>(
"L1CF_MON_SEL_SLOT9" );
267 attList.extend<std::string>(
"L1CF_MON_DEC_SLOT7" );
268 attList.extend<std::string>(
"L1CF_MON_DEC_SLOT8" );
269 attList.extend<std::string>(
"L1CF_MON_DEC_SLOT9" );
272 coral::ICursor& cursor =
query->execute();
273 if ( ! cursor.next() ) {
276 throw std::runtime_error(
"CTPFilesLoader >> CTPFiles not available" );
279 const coral::AttributeList& row = cursor.currentRow();
280 std::string
name = row[
"L1CF_NAME"].data<std::string>();
281 int version = row[
"L1CF_VERSION"].data<
int>();
282 std::string strMonSel7 = row[
"L1CF_MON_SEL_SLOT7"].data<std::string>();
283 std::string strMonSel8 = row[
"L1CF_MON_SEL_SLOT8"].data<std::string>();
284 std::string strMonSel9 = row[
"L1CF_MON_SEL_SLOT9"].data<std::string>();
285 std::string strMonDec7 = row[
"L1CF_MON_DEC_SLOT7"].data<std::string>();
286 std::string strMonDec8 = row[
"L1CF_MON_DEC_SLOT8"].data<std::string>();
287 std::string strMonDec9 = row[
"L1CF_MON_DEC_SLOT9"].data<std::string>();
289 if ( cursor.next() ) {
292 throw std::runtime_error(
"CTPFilesLoader >> CTPFiles not available" );
295 std::vector<u_int> monDecSlot7(CTPFiles::ALL_CTPINMONDEC_SIZE);
296 TRG_MSG_INFO(
"Loading MON Slot7 of size " << monDecSlot7.size());
298 std::vector<u_int> monDecSlot8(CTPFiles::ALL_CTPINMONDEC_SIZE);
299 TRG_MSG_INFO(
"Loading MON Slot8 of size " << monDecSlot8.size());
301 std::vector<u_int> monDecSlot9(CTPFiles::ALL_CTPINMONDEC_SIZE);
302 TRG_MSG_INFO(
"Loading MON Slot9 of size " << monDecSlot9.size());
305 std::vector<u_int> monSelSlot7(CTPFiles::ALL_CTPINMONSEL_SIZE);
306 TRG_MSG_INFO(
"Loading MON SEL Slot7 of size " << monSelSlot7.size());
308 std::vector<u_int> monSelSlot8(CTPFiles::ALL_CTPINMONSEL_SIZE);
309 TRG_MSG_INFO(
"Loading MON SEL Slot8 of size " << monSelSlot8.size());
311 std::vector<u_int> monSelSlot9(CTPFiles::ALL_CTPINMONSEL_SIZE);
312 TRG_MSG_INFO(
"Loading MON SEL Slot9 of size " << monSelSlot9.size());
327 unique_ptr<coral::IQuery>
query(
m_session.nominalSchema().tableHandle(
"L1_CTP_SMX").newQuery() );
328 query->setRowCacheSize( 13 );
331 coral::AttributeList emptyBindVariableList0;
332 std::string condition =
"L1SMX_ID = :sId";
333 emptyBindVariableList0.extend<
long>(
"sId");
334 emptyBindVariableList0[0].data<
long>() = ctpFiles.
smxId();
335 query->setCondition( condition, emptyBindVariableList0 );
337 coral::AttributeList attList;
338 attList.extend<std::string>(
"L1SMX_NAME" );
339 attList.extend<std::string>(
"L1SMX_OUTPUT" );
340 attList.extend<std::string>(
"L1SMX_VHDL_SLOT7" );
341 attList.extend<std::string>(
"L1SMX_VHDL_SLOT8" );
342 attList.extend<std::string>(
"L1SMX_VHDL_SLOT9" );
343 attList.extend<std::string>(
"L1SMX_SVFI_SLOT7" );
344 attList.extend<std::string>(
"L1SMX_SVFI_SLOT8" );
345 attList.extend<std::string>(
"L1SMX_SVFI_SLOT9" );
348 coral::ICursor& cursor =
query->execute();
349 if ( ! cursor.next() ) {
352 throw std::runtime_error(
"CTPFilesLoader >> CTPFiles not available" );
355 const coral::AttributeList& row = cursor.currentRow();
369 catch(
const coral::Exception& e ) {
385 if(ctpFiles.
id() <= 0) {
389 ctpFiles.
setId(filesid);
392 unique_ptr<coral::IQuery>
query(
m_session.nominalSchema().tableHandle(
"L1_CTP_FILES").newQuery() );
393 query->setRowCacheSize( 13 );
396 coral::AttributeList emptyBindVariableList0;
397 std::string condition =
"L1CF_ID = :fId";
398 emptyBindVariableList0.extend<
long>(
"fId");
399 emptyBindVariableList0[0].data<
long>() = ctpFiles.
id();
400 query->setCondition( condition, emptyBindVariableList0 );
402 coral::AttributeList attList;
403 attList.extend<std::string>(
"L1CF_NAME" );
404 attList.extend<
int>(
"L1CF_VERSION" );
405 attList.extend<std::string>(
"L1CF_MON_SEL_CTPMON" );
406 attList.extend<std::string>(
"L1CF_MON_DEC_CTPMON" );
410 coral::ICursor& cursor =
query->execute();
411 if ( ! cursor.next() ) {
414 throw std::runtime_error(
"CTPFilesLoader >> CTPFiles not available" );
417 const coral::AttributeList& row = cursor.currentRow();
419 std::string
name = row[
"L1CF_NAME"].data<std::string>();
420 int version = row[
"L1CF_VERSION"].data<
int>();
421 std::string ctpmonSelector_str = row[
"L1CF_MON_SEL_CTPMON"].data<std::string>();
422 std::string ctpmonDecoder_str = row[
"L1CF_MON_DEC_CTPMON"].data<std::string>();
424 if ( cursor.next() ) {
427 throw std::runtime_error(
"CTPFilesLoader >> CTPFiles not available" );
430 std::vector<u_int> monDecVec(CTPFiles::ALL_CTPMONDECODER_SIZE);
431 TRG_MSG_INFO(
"Loading MON DEC vec of size " << monDecVec.size());
436 std::vector<u_int> monSelVec(CTPFiles::ALL_CTPMONSELECTOR_SIZE);
437 std::stringstream stream(ctpmonSelector_str);
441 while(stream >> val) {
443 std::string::size_type loc = val.find(
"0x");
444 if(loc != std::string::npos) val.replace(loc,2,
"");
448 throw std::runtime_error(
"CTPFilesLoader >> CTPMONSELECTOR conversion failed." );
450 if(
index >= CTPFiles::ALL_CTPMONSELECTOR_SIZE) {
453 throw std::runtime_error(
"CTPFilesLoader >> CTPMONSELECTOR conversion failed." );
467 catch(
const coral::Exception& e ) {