11 char *c_user = std::getenv(
"CSCMAP_AUTH_USER");
12 char *c_pass = std::getenv(
"CSCMAP_AUTH_PASSWORD");
15 con =
env->createConnection(
db_user, db_pass,
"cms_orcoff_prod");
16 std::cout <<
"Connection to mapping DB is done." << std::endl;
23 env->terminateConnection(
con);
24 oracle::occi::Environment::terminateEnvironment(
env);
28 oracle::occi::Statement *stmt =
con->createStatement();
31 "begin cms_emu_cern.cscmap.chamberid_crate(:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, " 32 ":16, :17, :18, :19, :20); end;");
34 stmt->setInt(1, chamberid);
35 stmt->registerOutParam(2, oracle::occi::OCCISTRING, 10);
36 stmt->registerOutParam(3, oracle::occi::OCCIINT);
37 stmt->registerOutParam(4, oracle::occi::OCCIINT);
38 stmt->registerOutParam(5, oracle::occi::OCCIINT);
39 stmt->registerOutParam(6, oracle::occi::OCCIINT);
40 stmt->registerOutParam(7, oracle::occi::OCCIINT);
41 stmt->registerOutParam(8, oracle::occi::OCCIINT);
42 stmt->registerOutParam(9, oracle::occi::OCCIINT);
43 stmt->registerOutParam(10, oracle::occi::OCCISTRING, 10);
44 stmt->registerOutParam(11, oracle::occi::OCCIINT);
45 stmt->registerOutParam(12, oracle::occi::OCCIINT);
46 stmt->registerOutParam(13, oracle::occi::OCCIINT);
47 stmt->registerOutParam(14, oracle::occi::OCCIINT);
48 stmt->registerOutParam(15, oracle::occi::OCCIINT);
49 stmt->registerOutParam(16, oracle::occi::OCCIINT);
50 stmt->registerOutParam(17, oracle::occi::OCCIINT);
51 stmt->registerOutParam(18, oracle::occi::OCCIINT);
52 stmt->registerOutParam(19, oracle::occi::OCCIINT);
53 stmt->registerOutParam(20, oracle::occi::OCCIINT);
57 item->chamberLabel = stmt->getString(10);
58 item->chamberId = chamberid;
59 int chamber = chamberid / 10 % 100;
69 item->cscIndex = stmt->getInt(13);
70 item->layerIndex = stmt->getInt(14);
71 item->stripIndex = stmt->getInt(15);
72 item->anodeIndex = stmt->getInt(16);
73 item->strips = stmt->getInt(11);
74 item->anodes = stmt->getInt(12);
75 item->crateLabel = stmt->getString(2);
76 item->crateid = stmt->getInt(3);
77 item->sector = stmt->getInt(8);
78 item->trig_sector = stmt->getInt(9);
79 item->dmb = stmt->getInt(5);
80 item->cscid = stmt->getInt(7);
83 "begin cms_emu_cern.ddumap.chamberid_ddu(:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, " 84 ":17, :18, :19); end;");
86 stmt->setInt(1, chamberid);
87 stmt->registerOutParam(2, oracle::occi::OCCIINT);
88 stmt->registerOutParam(3, oracle::occi::OCCIINT);
89 stmt->registerOutParam(4, oracle::occi::OCCIINT);
90 stmt->registerOutParam(5, oracle::occi::OCCIINT);
91 stmt->registerOutParam(6, oracle::occi::OCCISTRING, 10);
92 stmt->registerOutParam(7, oracle::occi::OCCIINT);
93 stmt->registerOutParam(8, oracle::occi::OCCIINT);
94 stmt->registerOutParam(9, oracle::occi::OCCIINT);
95 stmt->registerOutParam(10, oracle::occi::OCCISTRING, 10);
96 stmt->registerOutParam(11, oracle::occi::OCCIINT);
97 stmt->registerOutParam(12, oracle::occi::OCCISTRING, 10);
98 stmt->registerOutParam(13, oracle::occi::OCCIINT);
99 stmt->registerOutParam(14, oracle::occi::OCCISTRING, 10);
100 stmt->registerOutParam(15, oracle::occi::OCCIINT);
101 stmt->registerOutParam(16, oracle::occi::OCCIINT);
102 stmt->registerOutParam(17, oracle::occi::OCCIINT);
103 stmt->registerOutParam(18, oracle::occi::OCCIINT);
104 stmt->registerOutParam(19, oracle::occi::OCCIINT);
108 item->ddu = stmt->getInt(2);
109 item->ddu_input = stmt->getInt(5);
110 item->slink = stmt->getInt(7);
112 item->fed_crate = stmt->getInt(3);
113 item->ddu_slot = stmt->getInt(4);
114 item->dcc_fifo = stmt->getString(6);
115 item->fiber_crate = stmt->getInt(8);
116 item->fiber_pos = stmt->getInt(9);
117 item->fiber_socket = stmt->getString(10);
119 con->terminateStatement(stmt);
123 oracle::occi::Statement *stmt =
con->createStatement();
126 "begin cms_emu_cern.cscmap.crateid_chamber(:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, " 129 stmt->setInt(1,
crate);
130 stmt->setInt(2, dmb);
131 stmt->registerOutParam(3, oracle::occi::OCCISTRING, 10);
132 stmt->registerOutParam(4, oracle::occi::OCCIINT);
133 stmt->registerOutParam(5, oracle::occi::OCCIINT);
134 stmt->registerOutParam(6, oracle::occi::OCCIINT);
135 stmt->registerOutParam(7, oracle::occi::OCCIINT);
136 stmt->registerOutParam(8, oracle::occi::OCCIINT);
137 stmt->registerOutParam(9, oracle::occi::OCCIINT);
138 stmt->registerOutParam(10, oracle::occi::OCCIINT);
139 stmt->registerOutParam(11, oracle::occi::OCCISTRING, 10);
140 stmt->registerOutParam(12, oracle::occi::OCCIINT);
141 stmt->registerOutParam(13, oracle::occi::OCCIINT);
142 stmt->registerOutParam(14, oracle::occi::OCCIINT);
143 stmt->registerOutParam(15, oracle::occi::OCCIINT);
144 stmt->registerOutParam(16, oracle::occi::OCCIINT);
145 stmt->registerOutParam(17, oracle::occi::OCCIINT);
149 item->chamberLabel = stmt->getString(3);
150 item->chamberId = stmt->getInt(4);
151 int chamberid =
item->chamberId;
152 int chamber = chamberid / 10 % 100;
162 item->cscIndex = stmt->getInt(14);
163 item->layerIndex = stmt->getInt(15);
164 item->stripIndex = stmt->getInt(16);
165 item->anodeIndex = stmt->getInt(17);
166 item->strips = stmt->getInt(12);
167 item->anodes = stmt->getInt(13);
168 item->crateLabel = stmt->getString(11);
169 item->crateid = stmt->getInt(9);
170 item->sector = stmt->getInt(7);
171 item->trig_sector = stmt->getInt(8);
173 item->cscid = stmt->getInt(5);
176 "begin cms_emu_cern.ddumap.chamberid_ddu(:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, " 177 ":17, :18, :19); end;");
179 stmt->setInt(1, chamberid);
180 stmt->registerOutParam(2, oracle::occi::OCCIINT);
181 stmt->registerOutParam(3, oracle::occi::OCCIINT);
182 stmt->registerOutParam(4, oracle::occi::OCCIINT);
183 stmt->registerOutParam(5, oracle::occi::OCCIINT);
184 stmt->registerOutParam(6, oracle::occi::OCCISTRING, 10);
185 stmt->registerOutParam(7, oracle::occi::OCCIINT);
186 stmt->registerOutParam(8, oracle::occi::OCCIINT);
187 stmt->registerOutParam(9, oracle::occi::OCCIINT);
188 stmt->registerOutParam(10, oracle::occi::OCCISTRING, 10);
189 stmt->registerOutParam(11, oracle::occi::OCCIINT);
190 stmt->registerOutParam(12, oracle::occi::OCCISTRING, 10);
191 stmt->registerOutParam(13, oracle::occi::OCCIINT);
192 stmt->registerOutParam(14, oracle::occi::OCCISTRING, 10);
193 stmt->registerOutParam(15, oracle::occi::OCCIINT);
194 stmt->registerOutParam(16, oracle::occi::OCCIINT);
195 stmt->registerOutParam(17, oracle::occi::OCCIINT);
196 stmt->registerOutParam(18, oracle::occi::OCCIINT);
197 stmt->registerOutParam(19, oracle::occi::OCCIINT);
201 item->ddu = stmt->getInt(2);
202 item->ddu_input = stmt->getInt(5);
203 item->slink = stmt->getInt(7);
205 item->fed_crate = stmt->getInt(3);
206 item->ddu_slot = stmt->getInt(4);
207 item->dcc_fifo = stmt->getString(6);
208 item->fiber_crate = stmt->getInt(8);
209 item->fiber_pos = stmt->getInt(9);
210 item->fiber_socket = stmt->getString(10);
212 con->terminateStatement(stmt);
216 oracle::occi::Statement *stmt =
con->createStatement();
219 "begin cms_emu_cern.ddumap.ddu_chamber(:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, " 220 ":17, :18, :19); end;");
222 stmt->setInt(1, rui);
223 stmt->setInt(2, ddu_input);
224 stmt->registerOutParam(3, oracle::occi::OCCIINT);
225 stmt->registerOutParam(4, oracle::occi::OCCIINT);
226 stmt->registerOutParam(5, oracle::occi::OCCISTRING, 10);
227 stmt->registerOutParam(6, oracle::occi::OCCIINT);
228 stmt->registerOutParam(7, oracle::occi::OCCIINT);
229 stmt->registerOutParam(8, oracle::occi::OCCIINT);
230 stmt->registerOutParam(9, oracle::occi::OCCISTRING, 10);
231 stmt->registerOutParam(10, oracle::occi::OCCIINT);
232 stmt->registerOutParam(11, oracle::occi::OCCISTRING, 10);
233 stmt->registerOutParam(12, oracle::occi::OCCIINT);
234 stmt->registerOutParam(13, oracle::occi::OCCISTRING, 10);
235 stmt->registerOutParam(14, oracle::occi::OCCIINT);
236 stmt->registerOutParam(15, oracle::occi::OCCIINT);
237 stmt->registerOutParam(16, oracle::occi::OCCIINT);
238 stmt->registerOutParam(17, oracle::occi::OCCIINT);
239 stmt->registerOutParam(18, oracle::occi::OCCIINT);
240 stmt->registerOutParam(19, oracle::occi::OCCIINT);
245 item->ddu_input = ddu_input;
246 item->slink = stmt->getInt(6);
248 item->fed_crate = stmt->getInt(3);
249 item->ddu_slot = stmt->getInt(4);
250 item->dcc_fifo = stmt->getString(5);
251 item->fiber_crate = stmt->getInt(7);
252 item->fiber_pos = stmt->getInt(8);
253 item->fiber_socket = stmt->getString(9);
254 int chamberid = stmt->getInt(14);
257 "begin cms_emu_cern.cscmap.chamberid_crate(:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, " 258 ":16, :17, :18, :19, :20); end;");
260 stmt->setInt(1, chamberid);
261 stmt->registerOutParam(2, oracle::occi::OCCISTRING, 10);
262 stmt->registerOutParam(3, oracle::occi::OCCIINT);
263 stmt->registerOutParam(4, oracle::occi::OCCIINT);
264 stmt->registerOutParam(5, oracle::occi::OCCIINT);
265 stmt->registerOutParam(6, oracle::occi::OCCIINT);
266 stmt->registerOutParam(7, oracle::occi::OCCIINT);
267 stmt->registerOutParam(8, oracle::occi::OCCIINT);
268 stmt->registerOutParam(9, oracle::occi::OCCIINT);
269 stmt->registerOutParam(10, oracle::occi::OCCISTRING, 10);
270 stmt->registerOutParam(11, oracle::occi::OCCIINT);
271 stmt->registerOutParam(12, oracle::occi::OCCIINT);
272 stmt->registerOutParam(13, oracle::occi::OCCIINT);
273 stmt->registerOutParam(14, oracle::occi::OCCIINT);
274 stmt->registerOutParam(15, oracle::occi::OCCIINT);
275 stmt->registerOutParam(16, oracle::occi::OCCIINT);
276 stmt->registerOutParam(17, oracle::occi::OCCIINT);
277 stmt->registerOutParam(18, oracle::occi::OCCIINT);
278 stmt->registerOutParam(19, oracle::occi::OCCIINT);
279 stmt->registerOutParam(20, oracle::occi::OCCIINT);
283 item->chamberLabel = stmt->getString(10);
284 item->chamberId = chamberid;
285 int chamber = chamberid / 10 % 100;
295 item->cscIndex = stmt->getInt(13);
296 item->layerIndex = stmt->getInt(14);
297 item->stripIndex = stmt->getInt(15);
298 item->anodeIndex = stmt->getInt(16);
299 item->strips = stmt->getInt(11);
300 item->anodes = stmt->getInt(12);
301 item->crateLabel = stmt->getString(2);
302 item->crateid = stmt->getInt(3);
303 item->sector = stmt->getInt(8);
304 item->trig_sector = stmt->getInt(9);
305 item->dmb = stmt->getInt(5);
306 item->cscid = stmt->getInt(7);
310 con->terminateStatement(stmt);
void ruiddu(int rui, int ddu_input, CSCMapItem::MapItem *item)
~cscmap1() noexcept(false)
void chamber(int chamberid, CSCMapItem::MapItem *item)
oracle::occi::Connection * con
cscmap1() noexcept(false)
oracle::occi::Environment * env
void cratedmb(int crate, int dmb, CSCMapItem::MapItem *item)