15 m_positive_sector(
""),
16 m_negative_sector(
""),
25 std::ostringstream disp;
26 disp <<
"No " << tech <<
" elements for Sector Type " <<
m_sector_type;
27 if (
stat) disp <<
", station " <<
stat;
28 disp <<
"!" << std::endl;
34 typedef StationMap::const_iterator cIter;
36 for (cIter
it =
p.first;
it !=
p.second; ++
it) {
37 if ((*it).second == station)
return;
43 using sIter = StationMap::const_iterator;
48 int key = (*it).second * 100;
62 int key = (*it).second * 100;
74 bool EtaCMAsetup =
true;
75 bool EvenPhiCMAsetup =
true;
76 bool OddPhiCMAsetup =
true;
97 return RPCsetup & WORsetup & EtaCMAsetup & EvenPhiCMAsetup & OddPhiCMAsetup;
101 using sIter = StationMap::const_iterator;
106 bool RPCcheck =
true;
108 for (sIter
stat = pivot.first;
stat != pivot.second; ++
stat) {
109 int Lkey = (*stat).second * 100;
110 int Ukey = (*stat).second * 100 + 99;
111 for (rIter
it =
m_RPCs.lower_bound(Lkey);
it !=
m_RPCs.upper_bound(Ukey); ++
it) { RPCcheck &= (*it).second.check(); }
114 bool WORcheck =
true;
116 for (sIter
stat = pivot.first;
stat != pivot.second; ++
stat) {
117 int Lkey = (*stat).second * 100;
118 int Ukey = (*stat).second * 100 + 99;
122 return RPCcheck & WORcheck;
128 return &(*result).second;
136 return &(*result).second;
144 return &(*result).second;
154 return &(*result).second;
161 return &(*result).second;
168 return &(*result).second;
175 return &(*result).second;
179 std::list<const EtaCMA*> CMAlist;
182 const EtaCMA* cma = &(*it).second;
183 if (cma->
id().
PAD_index() == pad) CMAlist.push_back(cma);
212 const EtaCMA* cma = &(*it).second;
242 const EtaCMA* cma = &(*it).second;
250 int& global_address)
const {
251 RPCmap::const_iterator
result =
m_RPCs.find(station * 100 + rpc_index);
253 return (*result).second.global_strip(
side, h_barrel, strip_number, global_address);
258 RPCmap::const_iterator
it =
m_RPCs.lower_bound(station * 100);
259 while (
it !=
m_RPCs.upper_bound(station * 100 + 99)) {
260 if ((*it).second.Gstrip_2_Lnumber(
side, global_address, strip_number)) {
261 rpc_index = (*it).second.number();
267 if (
side ==
Phi) {
return false; }
273 int& low_eta_strips,
int& hi_eta_strips)
const {
274 RPCmap::const_iterator
result =
m_RPCs.find(station * 100 + rpc_index);
276 return (*result).second.global_connector(
side, h_barrel, strip_number, global_address, low_eta_strips, hi_eta_strips);
280 int& strip_number)
const {
282 RPCmap::const_iterator
it =
m_RPCs.lower_bound(station * 100);
283 while (
it !=
m_RPCs.upper_bound(station * 100 + 99)) {
284 if ((*it).second.Gconn_2_Lnumber(
side, global_address, c_number, strip_number)) {
285 rpc_index = (*it).second.number();
291 if (
side ==
Phi) {
return false; }
297 const int cabling_code)
const {
302 const CMAinput IO = (*it).second.whichCMAinput(station);
304 if (cma)
list.push_back(cma);
311 const CMAinput IO = (*it).second.whichCMAinput(station);
313 if (cma)
list.push_back(cma);
319 const CMAinput IO = (*it).second.whichCMAinput(station);
321 if (cma)
list.push_back(cma);
331 unsigned int& firstEtaCode,
unsigned int& lastEtaCode,
332 unsigned int& firstPhiCode,
unsigned int& lastPhiCode)
const {
333 EtaCMAmap::const_iterator etaCMA =
find_etaCMA(
ETA.PAD_index(),
ETA.Ixx_index());
334 if (etaCMA ==
m_etaCMAs.end())
return false;
336 firstEtaCode = (*etaCMA).second.first_pivot_code();
337 lastEtaCode = (*etaCMA).second.last_pivot_code();
342 firstPhiCode = (*phiCMA).second.first_pivot_code();
343 lastPhiCode = (*phiCMA).second.last_pivot_code();
347 firstPhiCode = (*phiCMA).second.first_pivot_code();
348 lastPhiCode = (*phiCMA).second.last_pivot_code();
352 return firstEtaCode != lastEtaCode;
357 unsigned int& firstEtaCode,
unsigned int& lastEtaCode,
358 unsigned int& firstPhiCode,
unsigned int& lastPhiCode)
const {
359 EtaCMAmap::const_iterator etaCMA =
find_etaCMA(
ETA.PAD_index(),
ETA.Ixx_index());
360 if (etaCMA ==
m_etaCMAs.end())
return false;
362 firstEtaCode = (*etaCMA).second.first_lowPt_code();
363 lastEtaCode = (*etaCMA).second.last_lowPt_code();
368 firstPhiCode = (*phiCMA).second.first_lowPt_code();
369 lastPhiCode = (*phiCMA).second.last_lowPt_code();
373 firstPhiCode = (*phiCMA).second.first_lowPt_code();
374 lastPhiCode = (*phiCMA).second.last_lowPt_code();
383 unsigned int& firstEtaCode,
unsigned int& lastEtaCode,
384 unsigned int& firstPhiCode,
unsigned int& lastPhiCode)
const {
385 EtaCMAmap::const_iterator etaCMA =
find_etaCMA(
ETA.PAD_index(),
ETA.Ixx_index());
386 if (etaCMA ==
m_etaCMAs.end())
return false;
388 firstEtaCode = (*etaCMA).second.first_highPt_code();
389 lastEtaCode = (*etaCMA).second.last_highPt_code();
394 firstPhiCode = (*phiCMA).second.first_highPt_code();
395 lastPhiCode = (*phiCMA).second.last_highPt_code();
399 firstPhiCode = (*phiCMA).second.first_highPt_code();
400 lastPhiCode = (*phiCMA).second.last_highPt_code();
408 unsigned short int& stop_pivot_ch,
unsigned int& stop_pivot_code,
409 unsigned short int& start_confirm_ch,
unsigned int& start_confirm_code,
410 unsigned short int& stop_confirm_ch,
unsigned int& stop_confirm_code)
const {
411 if (
ID.type() ==
Eta) {
412 EtaCMAmap::const_iterator etaCMA =
find_etaCMA(
ID.PAD_index(),
ID.Ixx_index());
413 if (etaCMA ==
m_etaCMAs.end())
return false;
415 start_pivot_code = (*etaCMA).second.first_pivot_code();
416 stop_pivot_code = (*etaCMA).second.last_pivot_code();
417 start_confirm_code = (*etaCMA).second.first_lowPt_code();
418 stop_confirm_code = (*etaCMA).second.last_lowPt_code();
420 start_pivot_ch = (*etaCMA).second.first_pivot_channel();
421 stop_pivot_ch = (*etaCMA).second.last_pivot_channel();
422 start_confirm_ch = (*etaCMA).second.first_lowPt_channel();
423 stop_confirm_ch = (*etaCMA).second.last_lowPt_channel();
429 start_pivot_code = (*phiCMA).second.first_pivot_code();
430 stop_pivot_code = (*phiCMA).second.last_pivot_code();
431 start_confirm_code = (*phiCMA).second.first_lowPt_code();
432 stop_confirm_code = (*phiCMA).second.last_lowPt_code();
434 start_pivot_ch = (*phiCMA).second.first_pivot_channel();
435 stop_pivot_ch = (*phiCMA).second.last_pivot_channel();
436 start_confirm_ch = (*phiCMA).second.first_lowPt_channel();
437 stop_confirm_ch = (*phiCMA).second.last_lowPt_channel();
441 start_pivot_code = (*phiCMA).second.first_pivot_code();
442 stop_pivot_code = (*phiCMA).second.last_pivot_code();
443 start_confirm_code = (*phiCMA).second.first_lowPt_code();
444 stop_confirm_code = (*phiCMA).second.last_lowPt_code();
446 start_pivot_ch = (*phiCMA).second.first_pivot_channel();
447 stop_pivot_ch = (*phiCMA).second.last_pivot_channel();
448 start_confirm_ch = (*phiCMA).second.first_lowPt_channel();
449 stop_confirm_ch = (*phiCMA).second.last_lowPt_channel();
453 return !(start_confirm_ch == 999 || stop_confirm_ch == 999);
457 unsigned short int& stop_pivot_ch,
unsigned int& stop_pivot_code,
458 unsigned short int& start_confirm_ch,
unsigned int& start_confirm_code,
459 unsigned short int& stop_confirm_ch,
unsigned int& stop_confirm_code)
const {
460 if (
ID.type() ==
Eta) {
461 EtaCMAmap::const_iterator etaCMA =
find_etaCMA(
ID.PAD_index(),
ID.Ixx_index());
462 if (etaCMA ==
m_etaCMAs.end())
return false;
464 start_pivot_code = (*etaCMA).second.first_pivot_code();
465 stop_pivot_code = (*etaCMA).second.last_pivot_code();
466 start_confirm_code = (*etaCMA).second.first_highPt_code();
467 stop_confirm_code = (*etaCMA).second.last_highPt_code();
469 start_pivot_ch = (*etaCMA).second.first_pivot_channel();
470 stop_pivot_ch = (*etaCMA).second.last_pivot_channel();
471 start_confirm_ch = (*etaCMA).second.first_highPt_channel();
472 stop_confirm_ch = (*etaCMA).second.last_highPt_channel();
478 start_pivot_code = (*phiCMA).second.first_pivot_code();
479 stop_pivot_code = (*phiCMA).second.last_pivot_code();
480 start_confirm_code = (*phiCMA).second.first_highPt_code();
481 stop_confirm_code = (*phiCMA).second.last_highPt_code();
483 start_pivot_ch = (*phiCMA).second.first_pivot_channel();
484 stop_pivot_ch = (*phiCMA).second.last_pivot_channel();
485 start_confirm_ch = (*phiCMA).second.first_highPt_channel();
486 stop_confirm_ch = (*phiCMA).second.last_highPt_channel();
490 start_pivot_code = (*phiCMA).second.first_pivot_code();
491 stop_pivot_code = (*phiCMA).second.last_pivot_code();
492 start_confirm_code = (*phiCMA).second.first_highPt_code();
493 stop_confirm_code = (*phiCMA).second.last_highPt_code();
495 start_pivot_ch = (*phiCMA).second.first_pivot_channel();
496 stop_pivot_ch = (*phiCMA).second.last_pivot_channel();
497 start_confirm_ch = (*phiCMA).second.first_highPt_channel();
498 stop_confirm_ch = (*phiCMA).second.last_highPt_channel();
502 return !(start_confirm_ch == 999 || stop_confirm_ch == 999);
508 return (etaCMA !=
m_etaCMAs.end()) ? &((*etaCMA).second) :
nullptr;
513 return (phiCMA !=
m_evenphiCMAs.end()) ? &((*phiCMA).second) :
nullptr;
526 unsigned short int Channel2,
short int number)
const {
529 return (*etaCMA).second.correct(
type,
it, ly, Channel1, Channel2,
number);
534 return (*phiCMA).second.correct(
type,
it, ly, Channel1, Channel2,
number);
538 return (*phiCMA).second.correct(
type,
it, ly, Channel1, Channel2,
number);
545 int logic_sector,
unsigned short int lh,
unsigned short int ijk,
546 unsigned short int Channel)
const {
547 std::list<unsigned int> StripCodes;
552 if (etaCMA ==
m_etaCMAs.end())
return StripCodes;
553 (*etaCMA).second.give_strip_code(logic_sector,
lh, ijk,
Channel, StripCodes);
559 (*phiCMA).second.give_strip_code(logic_sector,
lh, ijk,
Channel, StripCodes);
564 (*phiCMA).second.give_strip_code(logic_sector,
lh, ijk,
Channel, StripCodes);
574 std::ostringstream
str;
576 str << std::setw(3) << sector << std::ends;
579 str << std::setw(3) << sector - 32 << std::ends;
587 int klw = station * 100;
588 int khg = station * 100 + 99;
590 if (station == 0) khg = 10 * 100 + 99;
592 bool all = ele ==
name() || ele.empty();
593 bool printed =
false;
595 bool nRPC = !
m_RPCs.empty();
596 bool nWOR = !
m_WORs.empty();
602 stream <<
"It applies to negative logic sector n. ";
604 stream <<
" logic sector n. ";
607 if (nRPC && (ele == (*
m_RPCs.begin()).second.name() ||
all)) {
609 RPCmap::const_iterator low =
m_RPCs.lower_bound(klw);
610 RPCmap::const_iterator high =
m_RPCs.upper_bound(khg);
612 stream <<
" RPCs chamber on station " << station << std::endl;
614 for (RPCmap::const_iterator
it = low;
it != high; ++
it) {
617 else if (
obj == (*it).second.number())
622 if (nWOR && (ele == (*
m_WORs.begin()).second.name() ||
all)) {
624 WORmap::const_iterator low =
m_WORs.lower_bound(klw);
625 WORmap::const_iterator high =
m_WORs.upper_bound(khg);
627 stream <<
" WORs links on station " << station << std::endl;
629 for (WORmap::const_iterator
it = low;
it != high; ++
it) {
632 else if (
obj == (*it).second.number())
637 if (nEtaCMA && (ele == (*
m_etaCMAs.begin()).second.name() ||
all)) {
639 stream <<
"It contains " <<
m_etaCMAs.size() <<
" eta CMA:" << std::endl;
640 EtaCMAmap::const_iterator ei;
644 else if (
obj == (*ei).second.number())
649 if (nEvenPhiCMA && (ele == (*
m_evenphiCMAs.begin()).second.name() ||
all)) {
653 EvenPhiCMAmap::const_iterator
ev;
658 else if (
obj == (*ev).second.number())
663 if (nOddPhiCMA && (ele == (*
m_oddphiCMAs.begin()).second.name() ||
all)) {
667 OddPhiCMAmap::const_iterator od;
672 else if (
obj == (*od).second.number())
680 stream <<
"It contains " <<
m_etaCMAs.size() <<
" eta CMA:" << std::endl;
681 EtaCMAmap::const_iterator ei;
686 else if (
obj == (*ei).second.number())
692 EvenPhiCMAmap::const_iterator
ev;
696 else if (
obj == (*ev).second.number())
702 OddPhiCMAmap::const_iterator od;
706 else if (
obj == (*od).second.number())
713 stream <<
"No " << ele <<
" elements are present into this map!" << std::endl;
723 while (std::unique_ptr<RPCchamber> cham =
data.give_rpc()) {
724 int key =
data.station() * 100;
725 std::pair<RPCmap::iterator, bool> ins =
m_RPCs.insert(RPCmap::value_type(
key + cham->number(), *cham));
734 int div = ((*current).second.number()) ? 1 : 2;
735 int eta_st = (*current).second.eta_strips() / div;
736 int eta_st_of = (*current).second.eta_strip_global() / div;
737 int eta_co = (*current).second.eta_connectors() / div;
738 int eta_co_of = (*current).second.eta_conn_global() / div;
741 (*current).second.set_eta_st_global(eta_st + eta_st_of);
742 (*current).second.set_eta_co_global(eta_co + eta_co_of);
749 << std::endl << *cham << std::endl <<
"in " <<
display.str() <<
endmsg;
757 while (std::unique_ptr<WiredOR> Wor =
data.give_wor()) {
758 int key =
data.station() * 100;
759 std::pair<WORmap::iterator, bool> ins =
m_WORs.insert(WORmap::value_type(
key + Wor->number(), *Wor));
765 << std::endl << *Wor << std::endl <<
"in " <<
display.str() <<
endmsg;
773 while (std::unique_ptr<EtaCMA> CMA{
data.give_eta_cma()}) {
774 std::pair<EtaCMAmap::iterator, bool> ins =
m_etaCMAs.insert(EtaCMAmap::value_type(CMA->id(), *CMA));
778 int cma_start = CMA->pivot_start_ch();
779 int ins_start = (*inserted).second.pivot_start_ch();
780 if (cma_start * ins_start > 0) {
784 << std::endl << *CMA << std::endl <<
"in " <<
display.str() <<
endmsg;
787 (*inserted).second += *CMA;
795 while (std::unique_ptr<EvenPhiCMA> CMA{
data.give_evenphi_cma()}) {
796 std::pair<EvenPhiCMAmap::iterator, bool> ins =
m_evenphiCMAs.insert(EvenPhiCMAmap::value_type(CMA->id(), *CMA));
801 << std::endl << *CMA << std::endl <<
"in " <<
display.str() <<
endmsg;
806 while (std::unique_ptr<OddPhiCMA> CMA{
data.give_oddphi_cma()}) {
807 std::pair<OddPhiCMAmap::iterator, bool> ins =
m_oddphiCMAs.insert(OddPhiCMAmap::value_type(CMA->id(), *CMA));
812 << std::endl << *CMA << std::endl <<
"in " <<
display.str() <<
endmsg;
821 while (std::unique_ptr<EtaCMA> CMA =
data.give_eta_cma()) {
822 std::pair<EtaCMAmap::iterator, bool> ins =
m_etaCMAs.insert(EtaCMAmap::value_type(CMA->id(), *CMA));
826 int cma_start = CMA->pivot_start_ch();
827 int ins_start = (*inserted).second.pivot_start_ch();
828 if (cma_start * ins_start > 0) {
832 << std::endl << *CMA << std::endl <<
"in " <<
display.str() <<
endmsg;
835 (*inserted).second += *CMA;