39 {
41 msg() <<
"DeadTimeLoader: Start loading data via ID. ID=" << dtTarget.id() << std::endl;
42
43 try {
45
46 coral::ITable&
table =
m_session.nominalSchema().tableHandle(
"L1_DEAD_TIME");
48 query->setRowCacheSize( 5 );
49
50
51 coral::AttributeList bindList;
52 bindList.extend<long>("dtId");
53 std::string cond = "L1DT_ID = :dtId";
54 bindList[0].data<long>() = dtTarget.id();
55 query->setCondition( cond, bindList );
56
57
58 coral::AttributeList attList;
59 attList.extend<int>( "L1DT_VERSION" );
60 attList.extend<string>( "L1DT_NAME" );
61 attList.extend<int>( "L1DT_SIMPLE" );
62 attList.extend<int>( "L1DT_COMPLEX1_LEVEL" );
63 attList.extend<int>( "L1DT_COMPLEX1_RATE" );
64 attList.extend<int>( "L1DT_COMPLEX2_LEVEL" );
65 attList.extend<int>( "L1DT_COMPLEX2_RATE" );
66 attList.extend<long>( "L1DT_ID" );
67 query->defineOutput(attList);
68
69 query->addToOutputList(
"L1DT_VERSION" );
70 query->addToOutputList(
"L1DT_NAME" );
71 query->addToOutputList(
"L1DT_SIMPLE" );
72 query->addToOutputList(
"L1DT_COMPLEX1_LEVEL" );
73 query->addToOutputList(
"L1DT_COMPLEX1_RATE" );
74 query->addToOutputList(
"L1DT_COMPLEX2_LEVEL" );
75 query->addToOutputList(
"L1DT_COMPLEX2_RATE" );
76 query->addToOutputList(
"L1DT_ID" );
77 query->addToOrderList(
"L1DT_ID" );
78
80
82 msg() <<
"DeadTimeLoader >> No such deadtime exists " << dtTarget.id() << std::endl;
85 throw std::runtime_error( "DeadTimeLoader >> DeadTime not available" );
86 }
87
88 const coral::AttributeList&
row =
cursor.currentRow();
89 std::string
name =
row[
"L1DT_NAME"].data<std::string>();
91 int simple =
row[
"L1DT_SIMPLE"].data<
int>();
92 int complex1_level =
row[
"L1DT_COMPLEX1_LEVEL"].data<
int>();
93 int complex1_rate =
row[
"L1DT_COMPLEX1_RATE"].data<
int>();
94 int complex2_level =
row[
"L1DT_COMPLEX2_LEVEL"].data<
int>();
95 int complex2_rate =
row[
"L1DT_COMPLEX2_RATE"].data<
int>();
96
98 msg() <<
"DeadTimeLoader >> More than one DeadTime exists "
99 << dtTarget.id() << std::endl;
101 throw std::runtime_error( "DeadTimeLoader >> DeadTime not available" );
102 }
103
104
105 dtTarget.setName( name );
106 dtTarget.setVersion( version );
107 dtTarget.setSimple( simple );
108 dtTarget.setComplex1Level( complex1_level );
109 dtTarget.setComplex1Rate( complex1_rate );
110 dtTarget.setComplex2Level( complex2_level );
111 dtTarget.setComplex2Rate( complex2_rate );
112
115 return true;
116 } catch( const coral::SchemaException& e ) {
117 msg() <<
"DeadTimeLoader >> SchemaException: "
118 <<
e.what() << std::endl;
120 return false;
121 } catch( const std::exception& e ) {
122 msg() <<
"DeadTimeLoader >> Standard C++ exception: " <<
e.what() << std::endl;
124 return false;
125 } catch( ... ) {
126 msg() <<
"DeadTimeLoader >> Unknown C++ exception" << std::endl;
128 return false;
129 }
130
131}
virtual int verbose() const override
void commitSession()
commit session if not already done
void startSession()
start session if not already active
MsgStreamTC & msg() const
The standard message stream.
row
Appending html table to final .html summary file.