70 int st_effective = strip_number - 1;
71 if (!i && side ==
Negative) st_effective = abs(st_effective - final_strip) - 1;
82 }
while (++strip_number <= final_strip);
102 int st_effective = strip_number - 1;
103 if (!i && side ==
Negative) st_effective = abs(st_effective - final_strip) - 1;
114 }
while (++strip_number <= final_strip);
134 int st_effective = strip_number - 1;
135 if (!i && side ==
Negative) st_effective = abs(st_effective - final_strip) - 1;
146 }
while (++strip_number <= final_strip);
271 std::string LVL1_configuration_repository;
272 LVL1_configuration_repository =
"ATLAS.data";
276 SectorLogicSetup::SECTORlist::const_iterator it = sectors.begin();
279 sprintf(s_tag,
"s%02d", *it);
282 sprintf(t_tag,
"t%1d",
id().PAD_index());
284 char c_tag[4] = {
'_',
'c',
'2',
'\0'};
285 if (
id().Ixx_index() == 1) c_tag[2] =
'3';
287 std::ifstream CMAprogLow;
288 std::istringstream CMAprogLow_COOL;
292 const std::map<std::string, std::string>* p_trigroads =
setup.GetPtoTrigRoads();
296 if (p_trigroads ==
nullptr) {
297 while (!CMAprogLow.is_open() && it != sectors.end()) {
298 std::ostringstream namestr;
301 dir =
setup.online_database();
302 namestr << dir <<
"/" << s_tag <<
"_" << t_tag <<
"_pl" << c_tag <<
".txt" << std::ends;
304 namestr.str().copy(
name, namestr.str().length(), 0);
305 name[namestr.str().length()] = 0;
306 if (log.level() <= MSG::DEBUG) {
307 log <<
"filename for the trigger roads " <<
name <<
endmsg;
310 CMAprogLow.open(
name);
317 while (CMAprogLow_COOL.str().empty() && it != sectors.end()) {
318 std::ostringstream namestr;
319 namestr << s_tag <<
"_" << t_tag <<
"_pl" << c_tag <<
".txt" << std::ends;
320 namestr.str().copy(
name, namestr.str().length(), 0);
321 name[namestr.str().length()] = 0;
322 std::map<std::string, std::string>::const_iterator itc;
323 itc = p_trigroads->find(
name);
324 if (itc != p_trigroads->end()) {
325 CMAprogLow_COOL.str(itc->second.c_str());
327 if (log.level() <= MSG::VERBOSE) {
328 log << MSG::VERBOSE <<
"EtaCMA low: key " <<
name <<
"found in the Trigger Road Map --> OK"
329 <<
", EtaCMA low: key " << itc->second.c_str()
330 <<
", Etacma:CMAPROGLOW " << CMAprogLow_COOL.str()
338 if (CMAprogLow.is_open()) {
339 std::unique_ptr<CMAprogram> program = std::make_unique<CMAprogram>(CMAprogLow,
true);
340 if (program->check()) {
342 if (
setup.cosmic()) {
346 for (
unsigned int i = 0; i < 3; ++i) {
348 if (log.level() <= MSG::DEBUG) {
349 log << MSG::DEBUG << s_tag <<
": " <<
id() <<
": low-pt: has threshold " << i
350 <<
" not programmed." <<
endmsg;
356 if (log.level() <= MSG::DEBUG) {
357 log << MSG::DEBUG <<
"EtaCMA::setup low_pt program has been read ---- " <<
endmsg;
359 }
else if (!CMAprogLow_COOL.str().empty()) {
360 std::unique_ptr<CMAprogram> program = std::make_unique<CMAprogram>(CMAprogLow_COOL,
true);
361 if (program->check()) {
363 if (
setup.cosmic()) {
367 for (
unsigned int i = 0; i < 3; ++i) {
369 if (log.level() <= MSG::DEBUG) {
370 log << MSG::DEBUG << s_tag <<
": " <<
id() <<
": low-pt: has threshold " << i
371 <<
" not programmed." <<
endmsg;
376 CMAprogLow_COOL.str(
"");
378 if (log.level() <= MSG::DEBUG) {
379 log << MSG::DEBUG <<
name <<
" not found! Putting a dummy configuration" <<
endmsg;
385 it = sectors.begin();
386 std::ifstream CMAprogHigh;
387 std::istringstream CMAprogHigh_COOL;
389 if (p_trigroads ==
nullptr) {
390 while (!CMAprogHigh.is_open() && it != sectors.end()) {
391 std::ostringstream namestr;
393 dir =
setup.online_database();
394 namestr << dir <<
"/" << s_tag <<
"_" << t_tag <<
"_ph" << c_tag <<
".txt" << std::ends;
396 namestr.str().copy(
name, namestr.str().length(), 0);
397 name[namestr.str().length()] = 0;
398 if (log.level() <= MSG::DEBUG) {
399 log << MSG::DEBUG <<
"filename for the trigger roads " <<
name <<
endmsg;
401 CMAprogHigh.open(
name);
408 while (CMAprogHigh_COOL.str().empty() && it != sectors.end()) {
409 std::ostringstream namestr;
410 namestr << s_tag <<
"_" << t_tag <<
"_ph" << c_tag <<
".txt" << std::ends;
411 namestr.str().copy(
name, namestr.str().length(), 0);
412 name[namestr.str().length()] = 0;
413 std::map<std::string, std::string>::const_iterator itc;
414 itc = p_trigroads->find(
name);
415 if (itc != p_trigroads->end()) {
416 if (log.level() <= MSG::VERBOSE) {
417 log << MSG::VERBOSE <<
"EtaCMA high: key " <<
name <<
"found in the Trigger Road Map --> OK"
418 <<
", EtaCMA high: key " << itc->second.c_str() <<
endmsg;
420 CMAprogHigh_COOL.str(itc->second.c_str());
421 if (log.level() <= MSG::VERBOSE) {
422 log << MSG::VERBOSE <<
"EtaCMA:CMAPROGHIGH " << CMAprogHigh_COOL.str() <<
endmsg;
430 if (CMAprogHigh.is_open()) {
431 std::unique_ptr<CMAprogram> program = std::make_unique<CMAprogram>(CMAprogHigh,
true);
432 if (program->check()) {
434 if (
setup.cosmic()) {
438 for (
unsigned int i = 0; i < 3; ++i) {
440 if (log.level() <= MSG::DEBUG) {
441 log << MSG::DEBUG << s_tag <<
": " <<
id() <<
": high-pt: has threshold " << i
442 <<
" not programmed." <<
endmsg;
448 if (log.level() <= MSG::DEBUG) {
449 log << MSG::DEBUG <<
"EtaCMA::setup high_pt program has been read ---- " <<
endmsg;
451 }
else if (!CMAprogHigh_COOL.str().empty()) {
452 std::unique_ptr<CMAprogram> program = std::make_unique<CMAprogram>(CMAprogHigh_COOL,
true);
453 if (program->check()) {
455 if (
setup.cosmic()) {
459 for (
unsigned int i = 0; i < 3; ++i) {
461 if (log.level() <= MSG::DEBUG) {
462 log << MSG::DEBUG << s_tag <<
": " <<
id() <<
": high-pt: has threshold " << i
463 <<
" not programmed." <<
endmsg;
468 CMAprogHigh_COOL.str(
"");
470 if (log.level() <= MSG::DEBUG) {
471 log << MSG::DEBUG <<
" not found! Putting a dummy configuration" <<
endmsg;