37 {
38 msg() <<
"CaloSinCosLoader started loading data via ID. ID = " << cscTarget.id() << std::endl;
39
40 try {
42 msg() <<
"Loading CaloSinCos " << cscTarget.id() << std::endl;
43
44 coral::ITable&
table =
m_session.nominalSchema().tableHandle(
"L1_CALO_SIN_COS");
46 query->setRowCacheSize( 5 );
47
48
49 std::string
condition =
"L1CSC_ID = :l1cscid";
50
51
52 coral::AttributeList boundvars;
53 boundvars.extend<int>("l1cscid");
54 boundvars[0].data<int>() = (int)cscTarget.id();
55
56 query->setCondition( condition, boundvars );
57
58
59 coral::AttributeList attList;
60 attList.extend<int>( "L1CSC_VERSION" );
61 attList.extend<std::string>( "L1CSC_NAME" );
62 attList.extend<int>( "L1CSC_VAL1" );
63 attList.extend<int>( "L1CSC_VAL2" );
64 attList.extend<int>( "L1CSC_VAL3" );
65 attList.extend<int>( "L1CSC_VAL4" );
66 attList.extend<int>( "L1CSC_VAL5" );
67 attList.extend<int>( "L1CSC_VAL6" );
68 attList.extend<int>( "L1CSC_VAL7" );
69 attList.extend<int>( "L1CSC_VAL8" );
70 attList.extend<int>( "L1CSC_ETA_MIN" );
71 attList.extend<int>( "L1CSC_ETA_MAX" );
72 attList.extend<int>( "L1CSC_PHI_MIN" );
73 attList.extend<int>( "L1CSC_PHI_MAX" );
74 query->defineOutput(attList);
75
76 query->addToOutputList(
"L1CSC_VERSION" );
77 query->addToOutputList(
"L1CSC_NAME" );
78 query->addToOutputList(
"L1CSC_VAL1" );
79 query->addToOutputList(
"L1CSC_VAL2" );
80 query->addToOutputList(
"L1CSC_VAL3" );
81 query->addToOutputList(
"L1CSC_VAL4" );
82 query->addToOutputList(
"L1CSC_VAL5" );
83 query->addToOutputList(
"L1CSC_VAL6" );
84 query->addToOutputList(
"L1CSC_VAL7" );
85 query->addToOutputList(
"L1CSC_VAL8" );
86 query->addToOutputList(
"L1CSC_ETA_MIN" );
87 query->addToOutputList(
"L1CSC_ETA_MAX" );
88 query->addToOutputList(
"L1CSC_PHI_MIN" );
89 query->addToOutputList(
"L1CSC_PHI_MAX" );
90
91 query->addToOrderList(
"L1CSC_ID" );
92
94
96 msg() <<
"CaloSinCosLoader >> No such deadtime exists " << cscTarget.id() << std::endl;
99 throw std::runtime_error( "CaloSinCosLoader >> CaloSinCos not available" );
100 }
101
102 const coral::AttributeList&
row =
cursor.currentRow();
103 std::string
name =
row[
"L1CSC_NAME"].data<std::string>();
104 int version =
row[
"L1CSC_VERSION"].data<
int>();
105 int val1 =
row[
"L1CSC_VAL1"].data<
int>();
106 int val2 =
row[
"L1CSC_VAL2"].data<
int>();
107 int val3 =
row[
"L1CSC_VAL3"].data<
int>();
108 int val4 =
row[
"L1CSC_VAL4"].data<
int>();
109 int val5 =
row[
"L1CSC_VAL5"].data<
int>();
110 int val6 =
row[
"L1CSC_VAL6"].data<
int>();
111 int val7 =
row[
"L1CSC_VAL7"].data<
int>();
112 int val8 =
row[
"L1CSC_VAL8"].data<
int>();
113 int eta_min =
row[
"L1CSC_ETA_MIN"].data<
int>();
114 int eta_max =
row[
"L1CSC_ETA_MAX"].data<
int>();
115 int phi_min =
row[
"L1CSC_PHI_MIN"].data<
int>();
116 int phi_max =
row[
"L1CSC_PHI_MAX"].data<
int>();
117
119 msg() <<
"CaloSinCosLoader >> More than one CaloSinCos exists "
120 << cscTarget.id() << std::endl;
123 throw std::runtime_error( "CaloSinCosLoader >> CaloSinCos not available" );
124 }
125
126
127 cscTarget.setName( name );
128 cscTarget.setVersion( version );
129 cscTarget.setVal1( val1 );
130 cscTarget.setVal2( val2 );
131 cscTarget.setVal3( val3 );
132 cscTarget.setVal4( val4 );
133 cscTarget.setVal5( val5 );
134 cscTarget.setVal6( val6 );
135 cscTarget.setVal7( val7 );
136 cscTarget.setVal8( val8 );
137 cscTarget.setEtaMin(eta_min);
138 cscTarget.setEtaMax(eta_max);
139 cscTarget.setPhiMin(phi_min);
140 cscTarget.setPhiMax(phi_max);
141
144 return true;
145 } catch( const coral::SchemaException& e ) {
146 msg() <<
"CaloSinCosLoader >> SchemaException: "
147 <<
e.what() << std::endl;
149 return false;
150 } catch( const std::exception& e ) {
151 msg() <<
"CaloSinCosLoader >> Standard C++ exception: " <<
e.what() << std::endl;
153 return false;
154 } catch(...) {
155 msg() <<
"CaloSinCosLoader >> unknown C++ exception" << std::endl;
157 return false;
158 }
159}
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.