38 msg() <<
"LutCamLoader started loading data via ID. ID = " << lTarget.
id() << std::endl;
41 msg() <<
"Loading LutCam " << lTarget.
id() << std::endl;
43 coral::ITable& table =
m_session.nominalSchema().tableHandle(
"L1_CTP_FILES");
44 coral::IQuery*
query = table.newQuery();
45 query->setRowCacheSize( 5 );
47 std::string condition=
"L1CF_ID = :l1cfid";
49 coral::AttributeList boundvars;
50 boundvars.extend<
int>(
"l1cfid");
51 boundvars[0].data<
int>() = lTarget.
id();
53 query->setCondition( condition, boundvars );
55 query->addToOutputList(
"L1CF_NAME" );
56 query->addToOutputList(
"L1CF_VERSION" );
57 query->addToOutputList(
"L1CF_LUT" );
58 query->addToOutputList(
"L1CF_CAM" );
60 coral::ICursor& cursor =
query->execute();
62 if ( ! cursor.next() ) {
63 msg() <<
"LutCamLoader >> No such L1_CTP_Files exists " << lTarget.
id() << std::endl;
66 throw std::runtime_error(
"LutCamLoader >> LutCam not available" );
69 const coral::AttributeList& row = cursor.currentRow();
71 std::string
name =
"";
72 name = row[
"L1CF_NAME"].data<std::string>();
74 version = row[
"L1CF_VERSION"].data<
int>();
75 std::string lut_str =
"";
76 lut_str = row[
"L1CF_LUT"].data<std::string>();
77 std::string cam_str =
"";
78 cam_str = row[
"L1CF_CAM"].data<std::string>();
80 if ( cursor.next() ) {
81 msg() <<
"LutCamLoader >> More than one LutCam exists " << lTarget.
id() << std::endl;
84 throw std::runtime_error(
"LutCamLoader >> LutCam not available" );
90 u_int significantBits = 8;
93 u_int wordsize = (preFix + significantBits + postFix);
104 msg() <<
"LutCamLoader>> Conversion of LUT no" << i <<
" failed! Read string " << lut_str.substr(i*wordsize+preFix,significantBits) << std::endl;
105 msg() <<
"TEST: substr(0,24): " << lut_str.substr(0,24) <<
" - substr(14,8): " << lut_str.substr(14,8) <<
" cc : " << (i*wordsize+preFix) << std::endl;
107 throw std::runtime_error(
"LutCamLoader >> LUT conversion failed." );
109 lut_int[i] = tmp_data;
119 msg() <<
"LutCamLoader>> Conversion of CAM no" << i <<
" failed!" << std::endl;
121 throw std::runtime_error(
"LutCamLoader >> CAM conversion failed." );
136 catch(
const coral::SchemaException& e )
138 msg() <<
"LutCamLoader >> SchemaException: "
139 << e.what() << std::endl;
143 catch(
const std::exception& e )
145 msg() <<
"LutCamLoader >> Standard C++ exception: " << e.what() << std::endl;
151 msg() <<
"LutCamLoader >> unknown C++ exception" << std::endl;