77 int st_effective = strip_number - 1;
78 if (!i && side ==
Negative) st_effective = abs(st_effective - final_strip) - 1;
89 }
while (++strip_number <= final_strip);
110 int st_effective = strip_number - 1;
111 if (!i && side ==
Negative) st_effective = abs(st_effective - final_strip) - 1;
122 }
while (++strip_number <= final_strip);
145 int st_effective = strip_number - 1;
146 if (!i && side ==
Negative) st_effective = abs(st_effective - final_strip) - 1;
157 }
while (++strip_number <= final_strip);
282 std::string LVL1_configuration_repository;
283 LVL1_configuration_repository =
"ATLAS.data";
287 SectorLogicSetup::SECTORlist::const_iterator it = sectors.begin();
290 sprintf(s_tag,
"s%02d", *it);
293 sprintf(t_tag,
"t%1d",
id().PAD_index());
295 char c_tag[4] = {
'_',
'c',
'2',
'\0'};
296 if (
id().Ixx_index() == 1) c_tag[2] =
'3';
298 std::ifstream CMAprogLow;
299 std::istringstream CMAprogLow_COOL;
307 if (p_trigroads ==
nullptr) {
308 while (!CMAprogLow.is_open() && it != sectors.end()) {
309 std::ostringstream namestr;
312 dir =
setup.online_database();
313 namestr << dir <<
"/" << s_tag <<
"_" << t_tag <<
"_pl" << c_tag <<
".txt" << std::ends;
315 namestr.str().copy(
name, namestr.str().length(), 0);
316 name[namestr.str().length()] = 0;
317 if (log.level() <= MSG::DEBUG) {
318 log <<
"filename for the trigger roads " <<
name <<
endmsg;
321 CMAprogLow.open(
name);
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());
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()
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()) {
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;
367 if (log.level() <= MSG::DEBUG) {
368 log << MSG::DEBUG <<
"EtaCMA::setup low_pt program has been read ---- " <<
endmsg;
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()) {
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;
387 CMAprogLow_COOL.str(
"");
389 if (log.level() <= MSG::DEBUG) {
390 log << MSG::DEBUG <<
name <<
" not found! Putting a dummy configuration" <<
endmsg;
396 it = sectors.begin();
397 std::ifstream CMAprogHigh;
398 std::istringstream CMAprogHigh_COOL;
400 if (p_trigroads ==
nullptr) {
401 while (!CMAprogHigh.is_open() && it != sectors.end()) {
402 std::ostringstream namestr;
404 dir =
setup.online_database();
405 namestr << dir <<
"/" << s_tag <<
"_" << t_tag <<
"_ph" << c_tag <<
".txt" << std::ends;
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;
412 CMAprogHigh.open(
name);
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;
431 CMAprogHigh_COOL.str(itc->second.c_str());
432 if (log.level() <= MSG::VERBOSE) {
433 log << MSG::VERBOSE <<
"EtaCMA:CMAPROGHIGH " << CMAprogHigh_COOL.str() <<
endmsg;
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()) {
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;
459 if (log.level() <= MSG::DEBUG) {
460 log << MSG::DEBUG <<
"EtaCMA::setup high_pt program has been read ---- " <<
endmsg;
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()) {
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;
479 CMAprogHigh_COOL.str(
"");
481 if (log.level() <= MSG::DEBUG) {
482 log << MSG::DEBUG <<
" not found! Putting a dummy configuration" <<
endmsg;