71 int st_effective = strip_number - 1;
72 if (!i && side ==
Negative) st_effective = abs(st_effective - final_strip) - 1;
83 }
while (++strip_number <= final_strip);
104 int st_effective = strip_number - 1;
105 if (!i && side ==
Negative) st_effective = abs(st_effective - final_strip) - 1;
116 }
while (++strip_number <= final_strip);
139 int st_effective = strip_number - 1;
140 if (!i && side ==
Negative) st_effective = abs(st_effective - final_strip) - 1;
151 }
while (++strip_number <= final_strip);
276 std::string LVL1_configuration_repository;
277 LVL1_configuration_repository =
"ATLAS.data";
281 SectorLogicSetup::SECTORlist::const_iterator it = sectors.begin();
284 sprintf(s_tag,
"s%02d", *it);
287 sprintf(t_tag,
"t%1d",
id().PAD_index());
289 char c_tag[4] = {
'_',
'c',
'2',
'\0'};
290 if (
id().Ixx_index() == 1) c_tag[2] =
'3';
292 std::ifstream CMAprogLow;
293 std::istringstream CMAprogLow_COOL;
297 const std::map<std::string, std::string>* p_trigroads =
setup.GetPtoTrigRoads();
301 if (p_trigroads ==
nullptr) {
302 while (!CMAprogLow.is_open() && it != sectors.end()) {
303 std::ostringstream namestr;
306 dir =
setup.online_database();
307 namestr << dir <<
"/" << s_tag <<
"_" << t_tag <<
"_pl" << c_tag <<
".txt" << std::ends;
309 namestr.str().copy(
name, namestr.str().length(), 0);
310 name[namestr.str().length()] = 0;
311 if (log.level() <= MSG::DEBUG) {
312 log <<
"filename for the trigger roads " <<
name <<
endmsg;
315 CMAprogLow.open(
name);
322 while (CMAprogLow_COOL.str().empty() && it != sectors.end()) {
323 std::ostringstream namestr;
324 namestr << s_tag <<
"_" << t_tag <<
"_pl" << c_tag <<
".txt" << std::ends;
325 namestr.str().copy(
name, namestr.str().length(), 0);
326 name[namestr.str().length()] = 0;
327 std::map<std::string, std::string>::const_iterator itc;
328 itc = p_trigroads->find(
name);
329 if (itc != p_trigroads->end()) {
330 CMAprogLow_COOL.str(itc->second.c_str());
332 if (log.level() <= MSG::VERBOSE) {
333 log << MSG::VERBOSE <<
"EtaCMA low: key " <<
name <<
"found in the Trigger Road Map --> OK"
334 <<
", EtaCMA low: key " << itc->second.c_str()
335 <<
", Etacma:CMAPROGLOW " << CMAprogLow_COOL.str()
343 if (CMAprogLow.is_open()) {
344 std::unique_ptr<CMAprogram> program = std::make_unique<CMAprogram>(CMAprogLow,
true);
345 if (program->check()) {
347 if (
setup.cosmic()) {
351 for (
unsigned int i = 0; i < 3; ++i) {
353 if (log.level() <= MSG::DEBUG) {
354 log << MSG::DEBUG << s_tag <<
": " <<
id() <<
": low-pt: has threshold " << i
355 <<
" not programmed." <<
endmsg;
361 if (log.level() <= MSG::DEBUG) {
362 log << MSG::DEBUG <<
"EtaCMA::setup low_pt program has been read ---- " <<
endmsg;
364 }
else if (!CMAprogLow_COOL.str().empty()) {
365 std::unique_ptr<CMAprogram> program = std::make_unique<CMAprogram>(CMAprogLow_COOL,
true);
366 if (program->check()) {
368 if (
setup.cosmic()) {
372 for (
unsigned int i = 0; i < 3; ++i) {
374 if (log.level() <= MSG::DEBUG) {
375 log << MSG::DEBUG << s_tag <<
": " <<
id() <<
": low-pt: has threshold " << i
376 <<
" not programmed." <<
endmsg;
381 CMAprogLow_COOL.str(
"");
383 if (log.level() <= MSG::DEBUG) {
384 log << MSG::DEBUG <<
name <<
" not found! Putting a dummy configuration" <<
endmsg;
390 it = sectors.begin();
391 std::ifstream CMAprogHigh;
392 std::istringstream CMAprogHigh_COOL;
394 if (p_trigroads ==
nullptr) {
395 while (!CMAprogHigh.is_open() && it != sectors.end()) {
396 std::ostringstream namestr;
398 dir =
setup.online_database();
399 namestr << dir <<
"/" << s_tag <<
"_" << t_tag <<
"_ph" << c_tag <<
".txt" << std::ends;
401 namestr.str().copy(
name, namestr.str().length(), 0);
402 name[namestr.str().length()] = 0;
403 if (log.level() <= MSG::DEBUG) {
404 log << MSG::DEBUG <<
"filename for the trigger roads " <<
name <<
endmsg;
406 CMAprogHigh.open(
name);
413 while (CMAprogHigh_COOL.str().empty() && it != sectors.end()) {
414 std::ostringstream namestr;
415 namestr << s_tag <<
"_" << t_tag <<
"_ph" << c_tag <<
".txt" << std::ends;
416 namestr.str().copy(
name, namestr.str().length(), 0);
417 name[namestr.str().length()] = 0;
418 std::map<std::string, std::string>::const_iterator itc;
419 itc = p_trigroads->find(
name);
420 if (itc != p_trigroads->end()) {
421 if (log.level() <= MSG::VERBOSE) {
422 log << MSG::VERBOSE <<
"EtaCMA high: key " <<
name <<
"found in the Trigger Road Map --> OK"
423 <<
", EtaCMA high: key " << itc->second.c_str() <<
endmsg;
425 CMAprogHigh_COOL.str(itc->second.c_str());
426 if (log.level() <= MSG::VERBOSE) {
427 log << MSG::VERBOSE <<
"EtaCMA:CMAPROGHIGH " << CMAprogHigh_COOL.str() <<
endmsg;
435 if (CMAprogHigh.is_open()) {
436 std::unique_ptr<CMAprogram> program = std::make_unique<CMAprogram>(CMAprogHigh,
true);
437 if (program->check()) {
439 if (
setup.cosmic()) {
443 for (
unsigned int i = 0; i < 3; ++i) {
445 if (log.level() <= MSG::DEBUG) {
446 log << MSG::DEBUG << s_tag <<
": " <<
id() <<
": high-pt: has threshold " << i
447 <<
" not programmed." <<
endmsg;
453 if (log.level() <= MSG::DEBUG) {
454 log << MSG::DEBUG <<
"EtaCMA::setup high_pt program has been read ---- " <<
endmsg;
456 }
else if (!CMAprogHigh_COOL.str().empty()) {
457 std::unique_ptr<CMAprogram> program = std::make_unique<CMAprogram>(CMAprogHigh_COOL,
true);
458 if (program->check()) {
460 if (
setup.cosmic()) {
464 for (
unsigned int i = 0; i < 3; ++i) {
466 if (log.level() <= MSG::DEBUG) {
467 log << MSG::DEBUG << s_tag <<
": " <<
id() <<
": high-pt: has threshold " << i
468 <<
" not programmed." <<
endmsg;
473 CMAprogHigh_COOL.str(
"");
475 if (log.level() <= MSG::DEBUG) {
476 log << MSG::DEBUG <<
" not found! Putting a dummy configuration" <<
endmsg;