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);
59 int chamber = chamberid / 10 % 100;
60 int rest = (chamberid - chamber * 10) / 1000;
62 rest = (rest -
ring) / 10;
73 item->
strips = stmt->getInt(11);
74 item->
anodes = stmt->getInt(12);
76 item->
crateid = stmt->getInt(3);
77 item->
sector = stmt->getInt(8);
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);
110 item->
slink = stmt->getInt(7);
114 item->
dcc_fifo = stmt->getString(6);
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);
152 int chamber = chamberid / 10 % 100;
153 int rest = (chamberid - chamber * 10) / 1000;
154 int ring = rest % 10;
155 rest = (rest -
ring) / 10;
166 item->
strips = stmt->getInt(12);
167 item->
anodes = stmt->getInt(13);
169 item->
crateid = stmt->getInt(9);
170 item->
sector = stmt->getInt(7);
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);
203 item->
slink = stmt->getInt(7);
207 item->
dcc_fifo = stmt->getString(6);
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);
246 item->
slink = stmt->getInt(6);
250 item->
dcc_fifo = stmt->getString(5);
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);
285 int chamber = chamberid / 10 % 100;
286 int rest = (chamberid - chamber * 10) / 1000;
287 int ring = rest % 10;
288 rest = (rest -
ring) / 10;
299 item->
strips = stmt->getInt(11);
300 item->
anodes = stmt->getInt(12);
302 item->
crateid = stmt->getInt(3);
303 item->
sector = stmt->getInt(8);
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)