|
ATLAS Offline Software
|
Go to the documentation of this file.
21 #include <CoralBase/Attribute.h>
22 #include <CoralBase/AttributeList.h>
24 #include "RelationalAccess/SchemaException.h"
25 #include "RelationalAccess/ITransaction.h"
26 #include "RelationalAccess/ITable.h"
27 #include "RelationalAccess/ISchema.h"
28 #include "RelationalAccess/ICursor.h"
29 #include "RelationalAccess/IQuery.h"
41 msg() <<
"DeadTimeLoader: Start loading data via ID. ID=" << dtTarget.
id() << std::endl;
46 coral::ITable&
table =
m_session.nominalSchema().tableHandle(
"L1_DEAD_TIME");
48 query->setRowCacheSize( 5 );
52 bindList.extend<
long>(
"dtId");
53 std::string cond =
"L1DT_ID = :dtId";
54 bindList[0].data<
long>() = dtTarget.
id();
55 query->setCondition( cond, bindList );
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);
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" );
82 msg() <<
"DeadTimeLoader >> No such deadtime exists " << dtTarget.
id() << std::endl;
85 throw std::runtime_error(
"DeadTimeLoader >> DeadTime not available" );
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>();
98 msg() <<
"DeadTimeLoader >> More than one DeadTime exists "
99 << dtTarget.
id() << std::endl;
101 throw std::runtime_error(
"DeadTimeLoader >> DeadTime not available" );
116 }
catch(
const coral::SchemaException&
e ) {
117 msg() <<
"DeadTimeLoader >> SchemaException: "
118 <<
e.what() << std::endl;
122 msg() <<
"DeadTimeLoader >> Standard C++ exception: " <<
e.what() << std::endl;
126 msg() <<
"DeadTimeLoader >> Unknown C++ exception" << std::endl;
void setName(const std::string &name)
virtual int verbose() const override
void setComplex2Rate(int i)
void setComplex1Rate(int i)
void setComplex2Level(int i)
coral::ISessionProxy & m_session
CORAL interface to database session.
void setComplex1Level(int i)
virtual bool load(DeadTime &data) override
MsgStreamTC & msg() const
The standard message stream.
void commitSession()
commit session if not already done
void setVersion(unsigned int version)
void startSession()
start session if not already active