41 msg() <<
"MuctpiLoader: Loading MuCTPi with ID = " << mTarget.id() <<
" and Lvl1 masterId = " << mTarget.lvl1MasterTableId() << std::endl;
44 if ( mTarget.lvl1MasterTableId() ) {
48 std::unique_ptr<coral::IQuery> query0(
m_session.nominalSchema().tableHandle(
"L1_MASTER_TABLE").newQuery());
49 query0->setRowCacheSize( 5 );
53 bindList.extend<
long>(
"mtId");
54 std::string cond =
"L1MT_ID = :mtId";
55 bindList[0].data<
long>() = mTarget.lvl1MasterTableId();
56 query0->setCondition( cond, bindList );
60 attList.extend<
long>(
"L1MT_MUCTPI_INFO_ID" );
61 query0->defineOutput(attList);
62 query0->addToOutputList(
"L1MT_MUCTPI_INFO_ID" );
64 coral::ICursor& cursor0 = query0->execute();
66 if ( ! cursor0.next() ) {
67 msg() <<
"MuctpiLoader >> No such Master_Table exists " << mTarget.lvl1MasterTableId() << std::endl;
69 throw std::runtime_error(
"MuctpiLoader >> Muctpi_Info not available" );
73 muctpi_id = row0[
"L1MT_MUCTPI_INFO_ID"].data<
long>();
75 if ( cursor0.next() ) {
76 msg() <<
"MuctpiLoader >> More than one Muctpi_Info exists for this master_table id"
77 << mTarget.lvl1MasterTableId() << std::endl;
79 throw std::runtime_error(
"MuctpiLoader >> Muctpi_Info not available" );
81 mTarget.setId(muctpi_id);
84 std::unique_ptr<coral::IQuery>
query(
m_session.nominalSchema().tableHandle(
"L1_MUCTPI_INFO").newQuery());
85 query->setRowCacheSize( 5 );
89 bindList2.extend<
long>(
"miId");
90 std::string cond2 =
"L1MI_ID = :miId";
91 bindList2[0].data<
long>() = mTarget.id();
92 query->setCondition( cond2, bindList2 );
96 attList.extend<
int>(
"L1MI_VERSION" );
97 attList.extend<std::string>(
"L1MI_NAME" );
98 attList.extend<
int>(
"L1MI_LOW_PT" );
99 attList.extend<
int>(
"L1MI_HIGH_PT" );
100 attList.extend<
int>(
"L1MI_MAX_CAND" );
101 attList.extend<
long>(
"L1MI_ID" );
102 query->defineOutput(attList);
104 query->addToOutputList(
"L1MI_VERSION" );
105 query->addToOutputList(
"L1MI_NAME" );
106 query->addToOutputList(
"L1MI_LOW_PT" );
107 query->addToOutputList(
"L1MI_HIGH_PT" );
108 query->addToOutputList(
"L1MI_MAX_CAND" );
109 query->addToOutputList(
"L1MI_ID" );
110 query->addToOrderList(
"L1MI_ID" );
114 msg() <<
"MuctpiLoader >> No such Muctpi_info exists " << mTarget.id() << std::endl;
116 throw std::runtime_error(
"MuctpiLoader >> Muctpi not available" );
120 std::string
name =
row[
"L1MI_NAME"].data<std::string>();
121 int version =
row[
"L1MI_VERSION"].data<
int>();
122 int low_pt =
row[
"L1MI_LOW_PT"].data<
int>();
123 int high_pt =
row[
"L1MI_HIGH_PT"].data<
int>();
124 int max_cand =
row[
"L1MI_MAX_CAND"].data<
int>();
127 msg() <<
"MuctpiLoader >> More than one Muctpi exists " << mTarget.id() << std::endl;
129 throw std::runtime_error(
"MuctpiLoader >> Muctpi not available" );
134 mTarget.setName(
name );
136 mTarget.setLowptThreshold( low_pt );
137 mTarget.setHighptThreshold( high_pt );
138 mTarget.setMaxCand( max_cand );
141 }
catch(
const coral::SchemaException&
e ) {
142 msg() <<
"MuctpiLoader >> SchemaException: " <<
e.what() << std::endl;
146 msg() <<
"MuctpiLoader >> Standard C++ exception: " <<
e.what() << std::endl;
151 msg() <<
"MuctpiLoader >> unknown C++ exception" << std::endl;