252 {
253
255
256
262 return false;
263 }
266 return false;
267 } else {
270 return false;
271 }
272 }
273 }
274
275
277
278
280
281
282 std::string LVL1_configuration_repository;
283 LVL1_configuration_repository = "ATLAS.data";
284
285
287 SectorLogicSetup::SECTORlist::const_iterator
it = sectors.begin();
288
289 char s_tag[4];
290 sprintf(s_tag, "s%02d", *it);
291
292 char t_tag[3];
293 sprintf(t_tag, "t%1d", id().PAD_index());
294
295 char c_tag[4] = {'_', 'c', '2', '\0'};
296 if (id().Ixx_index() == 1) c_tag[2] = '3';
297
298 std::ifstream CMAprogLow;
299 std::istringstream CMAprogLow_COOL;
301
302
304
305
306
307 if (p_trigroads == nullptr) {
308 while (!CMAprogLow.is_open() && it != sectors.end()) {
309 std::ostringstream namestr;
310
313 namestr <<
dir <<
"/" << s_tag <<
"_" << t_tag <<
"_pl" << c_tag <<
".txt" << std::ends;
314
315 namestr.str().copy(
name, namestr.str().length(), 0);
316 name[namestr.str().length()] = 0;
317 if (
log.level() <= MSG::DEBUG) {
319 }
320
321 CMAprogLow.open(
name);
323 namestr.clear();
324 }
325 }
326
327 else {
328 while (CMAprogLow_COOL.str().empty() && it != sectors.end()) {
329 std::ostringstream namestr;
330 namestr << s_tag << "_" << t_tag << "_pl" << c_tag << ".txt" << std::ends;
331 namestr.str().copy(
name, namestr.str().length(), 0);
332 name[namestr.str().length()] = 0;
333 TrigRoadsMap::const_iterator itc;
334 itc = p_trigroads->find(
name);
335 if (itc != p_trigroads->end()) {
336 CMAprogLow_COOL.str(itc->second.c_str());
337
338 if (
log.level() <= MSG::VERBOSE) {
339 log << MSG::VERBOSE <<
"EtaCMA low: key " <<
name <<
"found in the Trigger Road Map --> OK"
340 << ", EtaCMA low: key " << itc->second.c_str()
341 << ", Etacma:CMAPROGLOW " << CMAprogLow_COOL.str()
343 }
344 }
346 namestr.clear();
347 }
348 }
349 if (CMAprogLow.is_open()) {
350 std::unique_ptr<CMAprogram> program = std::make_unique<CMAprogram>(CMAprogLow, true);
351 if (program->check()) {
353 if (
setup.cosmic()) {
356 }
357 for (
unsigned int i = 0;
i < 3; ++
i) {
359 if (
log.level() <= MSG::DEBUG) {
360 log << MSG::DEBUG << s_tag <<
": " <<
id() <<
": low-pt: has threshold " <<
i
361 <<
" not programmed." <<
endmsg;
362 }
363 }
364 }
365 }
366 CMAprogLow.close();
367 if (
log.level() <= MSG::DEBUG) {
368 log << MSG::DEBUG <<
"EtaCMA::setup low_pt program has been read ---- " <<
endmsg;
369 }
370 } else if (!CMAprogLow_COOL.str().empty()) {
371 std::unique_ptr<CMAprogram> program = std::make_unique<CMAprogram>(CMAprogLow_COOL, true);
372 if (program->check()) {
374 if (
setup.cosmic()) {
377 }
378 for (
unsigned int i = 0;
i < 3; ++
i) {
380 if (
log.level() <= MSG::DEBUG) {
381 log << MSG::DEBUG << s_tag <<
": " <<
id() <<
": low-pt: has threshold " <<
i
382 <<
" not programmed." <<
endmsg;
383 }
384 }
385 }
386 }
387 CMAprogLow_COOL.str("");
388 } else {
389 if (
log.level() <= MSG::DEBUG) {
390 log << MSG::DEBUG <<
name <<
" not found! Putting a dummy configuration" <<
endmsg;
391 }
394 }
395
396 it = sectors.begin();
397 std::ifstream CMAprogHigh;
398 std::istringstream CMAprogHigh_COOL;
399
400 if (p_trigroads == nullptr) {
401 while (!CMAprogHigh.is_open() && it != sectors.end()) {
402 std::ostringstream namestr;
405 namestr <<
dir <<
"/" << s_tag <<
"_" << t_tag <<
"_ph" << c_tag <<
".txt" << std::ends;
406
407 namestr.str().copy(
name, namestr.str().length(), 0);
408 name[namestr.str().length()] = 0;
409 if (
log.level() <= MSG::DEBUG) {
410 log << MSG::DEBUG <<
"filename for the trigger roads " <<
name <<
endmsg;
411 }
412 CMAprogHigh.open(
name);
414 namestr.clear();
415 }
416 }
417
418 else {
419 while (CMAprogHigh_COOL.str().empty() && it != sectors.end()) {
420 std::ostringstream namestr;
421 namestr << s_tag << "_" << t_tag << "_ph" << c_tag << ".txt" << std::ends;
422 namestr.str().copy(
name, namestr.str().length(), 0);
423 name[namestr.str().length()] = 0;
424 TrigRoadsMap::const_iterator itc;
425 itc = p_trigroads->find(
name);
426 if (itc != p_trigroads->end()) {
427 if (
log.level() <= MSG::VERBOSE) {
428 log << MSG::VERBOSE <<
"EtaCMA high: key " <<
name <<
"found in the Trigger Road Map --> OK"
429 <<
", EtaCMA high: key " << itc->second.c_str() <<
endmsg;
430 }
431 CMAprogHigh_COOL.str(itc->second.c_str());
432 if (
log.level() <= MSG::VERBOSE) {
433 log << MSG::VERBOSE <<
"EtaCMA:CMAPROGHIGH " << CMAprogHigh_COOL.str() <<
endmsg;
434 }
435 }
437 namestr.clear();
438 }
439 }
440
441 if (CMAprogHigh.is_open()) {
442 std::unique_ptr<CMAprogram> program = std::make_unique<CMAprogram>(CMAprogHigh, true);
443 if (program->check()) {
445 if (
setup.cosmic()) {
448 }
449 for (
unsigned int i = 0;
i < 3; ++
i) {
451 if (
log.level() <= MSG::DEBUG) {
452 log << MSG::DEBUG << s_tag <<
": " <<
id() <<
": high-pt: has threshold " <<
i
453 <<
" not programmed." <<
endmsg;
454 }
455 }
456 }
457 }
458 CMAprogHigh.close();
459 if (
log.level() <= MSG::DEBUG) {
460 log << MSG::DEBUG <<
"EtaCMA::setup high_pt program has been read ---- " <<
endmsg;
461 }
462 } else if (!CMAprogHigh_COOL.str().empty()) {
463 std::unique_ptr<CMAprogram> program = std::make_unique<CMAprogram>(CMAprogHigh_COOL, true);
464 if (program->check()) {
466 if (
setup.cosmic()) {
469 }
470 for (
unsigned int i = 0;
i < 3; ++
i) {
472 if (
log.level() <= MSG::DEBUG) {
473 log << MSG::DEBUG << s_tag <<
": " <<
id() <<
": high-pt: has threshold " <<
i
474 <<
" not programmed." <<
endmsg;
475 }
476 }
477 }
478 }
479 CMAprogHigh_COOL.str("");
480 } else {
481 if (
log.level() <= MSG::DEBUG) {
482 log << MSG::DEBUG <<
" not found! Putting a dummy configuration" <<
endmsg;
483 }
486 }
487
488 return true;
489}
std::string two_obj_error_message(const std::string &, CMAparameters *)
bool cable_CMA_channels(HalfType)
EtaCMA(const parseParams &parse)
bool doInversion(SectorLogicSetup &)
bool begin_at_RPC_Z_boundary(void) const
bool end_at_RPC_Z_boundary(void) const
bool connect(SectorLogicSetup &)
std::map< std::string, std::string, std::less<> > TrigRoadsMap