30 TRG_MSG_INFO(
"loading L1 prescale set with PSK " << prescaleSet.
id());
32 CTPdataformatVersion ctpformat(ctpVersion);
34 prescaleSet.
resize(ctpformat.getMaxTrigItems());
38 unique_ptr< coral::IQuery > q(
m_session.nominalSchema().tableHandle(
"L1_PRESCALE_SET").newQuery() );
39 q->setRowCacheSize( 5 );
42 coral::AttributeList bindList;
43 bindList.extend<
int>(
"psId");
44 std::string cond =
"L1PS_ID = :psId";
45 bindList[0].data<
int>() = prescaleSet.
id();
46 q->setCondition( cond, bindList );
49 coral::AttributeList attList;
50 attList.extend<std::string>(
"L1PS_NAME" );
51 attList.extend<
int>(
"L1PS_VERSION" );
52 attList.extend<std::string>(
"L1PS_COMMENT" );
53 for (
unsigned int ctpid = 0; ctpid < ctpformat.getMaxTrigItems(); ++ctpid) {
54 attList.extend<int64_t>(
"L1PS_VAL" + std::to_string(ctpid+1) );
58 coral::ICursor& cursor = q->execute();
60 if ( ! cursor.next() ) {
62 throw std::runtime_error(
"PrescaleSetLoader >> PrescaleSet not available" );
65 const coral::AttributeList& row = cursor.currentRow();
66 std::string
name = row[
"L1PS_NAME"].data<std::string>();
67 int version = row[
"L1PS_VERSION"].data<
int>();
68 std::string comment = row[
"L1PS_COMMENT"].data<std::string>();
74 for (
unsigned int ctpid=0; ctpid < ctpformat.getMaxTrigItems(); ++ctpid) {
75 int64_t val = row[
"L1PS_VAL" +std::to_string(ctpid+1)].data<int64_t>();
80 prescaleSet.
setCut(ctpid,val);
87 catch(
const coral::Exception& e ) {
92 TRG_MSG_DEBUG(
"loaded L1 prescale set '" << prescaleSet.
name() <<
"' (psk " << prescaleSet.
id() <<
")" );