92 coral::AttributeList conditionData;
94 <<
"L1RPCHwConfigSourceHandler: start to build L1RPC Hw Config..." << std::flush << std::endl
98 coral::IQuery* query1 = schema.newQuery();
99 query1->addToTableList(
"CRATEDISABLED");
100 query1->addToTableList(
"CRATE");
101 query1->addToTableList(
"BOARD");
102 query1->addToTableList(
"TRIGGERBOARD");
103 query1->addToOutputList(
"TRIGGERBOARD.TOWERTO",
"TOWERTO");
104 query1->addToOutputList(
"TRIGGERBOARD.TOWERFROM",
"TOWERFROM");
105 query1->addToOutputList(
"TRIGGERBOARD.SECTOR",
"SECTOR");
106 query1->addToOrderList(
"TOWERTO");
107 query1->addToOrderList(
"SECTOR");
109 "CRATE.CRATEID=CRATEDISABLED.CRATE_CRATEID AND BOARD.CRATE_CRATEID=CRATE.CRATEID AND "
110 "BOARD.BOARDID=TRIGGERBOARD.TRIGGERBOARDID AND CRATE.TYPE='TRIGGERCRATE'";
111 query1->setCondition(
condition, conditionData);
112 coral::ICursor& cursor1 = query1->execute();
113 while (cursor1.next()) {
115 const coral::AttributeList& row = cursor1.currentRow();
116 int sector = atoi((row[
"SECTOR"].data<std::string>()).c_str());
117 int first = atoi((row[
"TOWERTO"].data<std::string>()).c_str());
118 int last = atoi((row[
"TOWERFROM"].data<std::string>()).c_str());
119 for (
int iTower =
first; iTower <=
last; iTower++) {
120 for (
int jSegment = 0; jSegment < 12; jSegment++) {
128 coral::IQuery* query2 = schema.newQuery();
129 query2->addToTableList(
"BOARDDISABLED");
130 query2->addToTableList(
"BOARD");
131 query2->addToTableList(
"TRIGGERBOARD");
132 query2->addToOutputList(
"TRIGGERBOARD.TOWERTO",
"TOWERTO");
133 query2->addToOutputList(
"TRIGGERBOARD.TOWERFROM",
"TOWERFROM");
134 query2->addToOutputList(
"TRIGGERBOARD.SECTOR",
"SECTOR");
135 query2->addToOrderList(
"TOWERTO");
136 query2->addToOrderList(
"SECTOR");
137 condition =
"BOARD.BOARDID=BOARDDISABLED.BOARD_BOARDID AND BOARD.BOARDID=TRIGGERBOARD.TRIGGERBOARDID";
138 query2->setCondition(
condition, conditionData);
139 coral::ICursor& cursor2 = query2->execute();
140 while (cursor2.next()) {
142 const coral::AttributeList& row = cursor2.currentRow();
143 int sector = atoi((row[
"SECTOR"].data<std::string>()).c_str());
144 int first = atoi((row[
"TOWERTO"].data<std::string>()).c_str());
145 int last = atoi((row[
"TOWERFROM"].data<std::string>()).c_str());
146 for (
int iTower =
first; iTower <=
last; iTower++) {
147 for (
int jSegment = 0; jSegment < 12; jSegment++) {
187 coral::IQuery* query4 = schema.newQuery();
188 query4->addToTableList(
"CHIPDISABLED");
189 query4->addToTableList(
"CHIP");
190 query4->addToTableList(
"BOARD");
191 query4->addToTableList(
"TRIGGERBOARD");
192 query4->addToOutputList(
"TRIGGERBOARD.TOWERTO",
"TOWERTO");
193 query4->addToOutputList(
"TRIGGERBOARD.TOWERFROM",
"TOWERFROM");
194 query4->addToOutputList(
"TRIGGERBOARD.SECTOR",
"SECTOR");
195 query4->addToOutputList(
"CHIP.POSITION",
"POSITION");
196 query4->addToOrderList(
"TOWERTO");
197 query4->addToOrderList(
"SECTOR");
198 query4->addToOrderList(
"POSITION");
200 "CHIP.CHIPID=CHIPDISABLED.CHIP_CHIPID AND CHIP.BOARD_BOARDID=BOARD.BOARDID AND "
201 "BOARD.BOARDID=TRIGGERBOARD.TRIGGERBOARDID AND CHIP.TYPE='PAC'";
202 query4->setCondition(
condition, conditionData);
203 coral::ICursor& cursor4 = query4->execute();
204 while (cursor4.next()) {
206 const coral::AttributeList& row = cursor4.currentRow();
207 int sector = atoi((row[
"SECTOR"].data<std::string>()).c_str());
208 int first = atoi((row[
"TOWERTO"].data<std::string>()).c_str());
209 int last = atoi((row[
"TOWERFROM"].data<std::string>()).c_str());
210 int chipPos = row[
"POSITION"].data<
short>();
213 for (
int jSegment = 0; jSegment < 12; jSegment++) {