36 {
37
38 msg() <<
"LutCamLoader started loading data via ID. ID = " << lTarget.id() << std::endl;
39 try {
41 msg() <<
"Loading LutCam " << lTarget.id() << std::endl;
42
43 coral::ITable&
table =
m_session.nominalSchema().tableHandle(
"L1_CTP_FILES");
45 query->setRowCacheSize( 5 );
46
47 std::string
condition=
"L1CF_ID = :l1cfid";
48
49 coral::AttributeList boundvars;
50 boundvars.extend<int>("l1cfid");
51 boundvars[0].data<int>() = lTarget.id();
52
53 query->setCondition( condition, boundvars );
54
55 query->addToOutputList(
"L1CF_NAME" );
56 query->addToOutputList(
"L1CF_VERSION" );
57 query->addToOutputList(
"L1CF_LUT" );
58 query->addToOutputList(
"L1CF_CAM" );
59
61
63 msg() <<
"LutCamLoader >> No such L1_CTP_Files exists " << lTarget.id() << std::endl;
66 throw std::runtime_error( "LutCamLoader >> LutCam not available" );
67 }
68
69 const coral::AttributeList&
row =
cursor.currentRow();
70
71 std::string
name =
"";
72 name =
row[
"L1CF_NAME"].data<std::string>();
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>();
79
81 msg() <<
"LutCamLoader >> More than one LutCam exists " << lTarget.id() << std::endl;
84 throw std::runtime_error( "LutCamLoader >> LutCam not available" );
85 }
86
87
88
90 u_int significantBits = 8;
91 u_int preFix = 2;
92 u_int postFix = 1;
93 u_int wordsize = (preFix + significantBits + postFix);
95
96 u_int tmp_data;
97
98
99
100
101
102
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." );
108 }
109 lut_int[
i] = tmp_data;
110 }
113
114 u_int tmp_data;
115
116
117
119 msg() <<
"LutCamLoader>> Conversion of CAM no" <<
i <<
" failed!" << std::endl;
121 throw std::runtime_error( "LutCamLoader >> CAM conversion failed." );
122 }
124 }
125
126
127 lTarget.setName( name );
128 lTarget.setVersion( version );
131
134 return true;
135 }
136 catch( const coral::SchemaException& e )
137 {
138 msg() <<
"LutCamLoader >> SchemaException: "
139 <<
e.what() << std::endl;
141 return false;
142 }
143 catch( const std::exception& e )
144 {
145 msg() <<
"LutCamLoader >> Standard C++ exception: " <<
e.what() << std::endl;
147 return false;
148 }
149 catch( ... )
150 {
151 msg() <<
"LutCamLoader >> unknown C++ exception" << std::endl;
153 return false;
154 }
155}
void commitSession()
commit session if not already done
void startSession()
start session if not already active
bool convert_hex_string(T &t, const std::string &s)
static const u_int ALL_CAM_SIZE
static const u_int ALL_LUT_SIZE
MsgStreamTC & msg() const
The standard message stream.
row
Appending html table to final .html summary file.