44 #include "eformat/DetectorMask.h" 
   45 #include "eformat/SourceIdentifier.h" 
   53   m_innerTrackletSlotHolder( tgcArgs() ),
 
   58 LVL1TGCTrigger::~LVL1TGCTrigger()
 
   74     m_tgcArgs.set_MSGLEVEL(msgLevel());
 
   75     m_tgcArgs.set_SHPT_ORED( m_SHPTORED.value() );
 
   76     m_tgcArgs.set_USE_INNER( m_USEINNER.value() );
 
   77     m_tgcArgs.set_INNER_VETO( m_INNERVETO.value() );
 
   78     m_tgcArgs.set_TILE_MU( m_TILEMU.value() );
 
   79     m_tgcArgs.set_USE_NSW( m_USENSW.value() );
 
   80     m_tgcArgs.set_USE_BIS78( m_USEBIS78.value() );
 
   81     m_tgcArgs.set_FORCE_NSW_COIN( m_FORCENSWCOIN.value() );
 
   83     m_tgcArgs.set_USE_CONDDB( m_USE_CONDDB.value() );
 
   84     m_tgcArgs.set_useRun3Config( m_useRun3Config.value() );
 
   86     m_tgcArgs.set_NSWSideInfo( m_NSWSideInfo.value() );
 
   88     ATH_CHECK( m_readCondKey.initialize(!m_useRun3Config.value()) );
 
   89     ATH_CHECK( m_readLUTs_CondKey.initialize(m_useRun3Config.value()) );
 
   93     if(m_useRun3Config.value()){
 
   94       m_tgcArgs.set_USE_CONDDB(
false);
 
  104     m_system = std::make_unique<TGCElectronicsSystem>(&m_tgcArgs,m_db);
 
  106     m_TimingManager = std::make_unique<TGCTimingManager>(m_readCondKey);
 
  107     m_TimingManager->setBunchCounter(0);
 
  109     m_nEventInSector = 0;
 
  115     ATH_CHECK(m_keyNSWTrigOut.initialize(tgcArgs()->USE_NSW())); 
 
  116     ATH_CHECK(m_keyBIS78TrigOut.initialize(tgcArgs()->USE_BIS78())); 
 
  117     ATH_CHECK(m_muctpiPhase1Key.initialize(tgcArgs()->useRun3Config()));
 
  118     ATH_CHECK(m_keyTgcRdo.initialize(tgcArgs()->useRun3Config()));
 
  122     m_MaskedChannel.clear();
 
  124     return StatusCode::SUCCESS;
 
  130     ATH_MSG_DEBUG(
"LVL1TGCTrigger::finalize() called" << 
" m_nEventInSector = " << m_nEventInSector);
 
  132     if (m_db) 
delete m_db;
 
  135     return StatusCode::SUCCESS;
 
  142     const EventContext& ctx = getContext();
 
  146       if(getCabling().isFailure()) 
return StatusCode::FAILURE;
 
  154       if(getMaskedChannel().isFailure()) 
return StatusCode::FAILURE;
 
  159     bool doTileMu = m_tgcArgs.TILE_MU();
 
  161     if (doTileMu && !m_tgcArgs.useRun3Config()) {   
 
  168     bool doNSW = m_tgcArgs.USE_NSW();
 
  171     bool doBIS78 = m_tgcArgs.USE_BIS78();
 
  174     std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>  tgcrdo;
 
  179     if(!readTgcDigitContainer.
isValid()){
 
  181       return StatusCode::FAILURE;
 
  186     ATH_CHECK(wh_muctpiTgc.
record(std::make_unique<LVL1MUONIF::Lvl1MuCTPIInputPhase1>()));
 
  192       sc = StatusCode::SUCCESS;
 
  195       if (doTileMu && bc == m_CurrentBunchTag) {
 
  196         ATH_CHECK(m_system->getTMDB()->retrieve(m_keyTileMu, ctx));
 
  200       if(doNSW && bc==m_CurrentBunchTag){  
 
  201         ATH_CHECK(m_system->getNSW()->retrieve(m_keyNSWTrigOut, ctx));
 
  205       if(doBIS78 && bc == m_CurrentBunchTag){  
 
  206         ATH_CHECK(m_system->getBIS78()->retrieve(m_keyBIS78TrigOut, ctx));
 
  209       if (m_ProcessAllBunches || bc == m_CurrentBunchTag) {
 
  210         m_bctagInProcess = bc;
 
  211         sc = processOneBunch(tgc_container, muctpiinputPhase1, tgcrdo);
 
  213       if (
sc.isFailure()) {
 
  214         ATH_MSG_FATAL(
"Fail to process the bunch " << m_bctagInProcess);
 
  224       ATH_MSG_WARNING(
"Cannot retrieve TgcRdoContainer with key=" << m_keyTgcRdoIn.key());
 
  226     }
else if(rdoContIn->
size()>0) { 
 
  228       for(; itR!=rdoContIn->
end(); ++itR){
 
  229     const TgcRdo* rdoIn = (*itR);
 
  231         std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>
::iterator itRdo = tgcrdo.find(subDetectorRod);
 
  232         if (itRdo!=tgcrdo.end()) {  
 
  236             itRdo->second->push_back(std::make_unique<TgcRawData>(*rd));
 
  244     auto trgContainer=std::make_unique<TgcRdoContainer>();
 
  245     for(
const auto& tgcRdoMap : tgcrdo){
 
  246       for(
const auto rawData : *tgcRdoMap.second){
 
  247     trgContainer->push_back(rawData);
 
  257                        std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>&  tgcrdo)
 
  259     ATH_MSG_DEBUG(
"start processOneBunch: for BC=" << m_bctagInProcess);
 
  261     std::map<Identifier, int> tgcDigitIDs;
 
  265     doMaskOperation(tgc_container, tgcDigitIDs);
 
  269     fillTGCEvent(tgcDigitIDs, 
event);
 
  273     m_TimingManager->increaseBunchCounter();
 
  274     m_system->distributeSignal(&
event);
 
  277     m_innerTrackletSlotHolder.clearTriggerBits();
 
  281       for( 
int j=0; j<m_system->getNumberOfOctant(); j+=1){
 
  282         for( 
int k=0; 
k<m_system->getNumberOfModule(); 
k+=1){
 
  284           if((sector!=0)&&(sector->
hasHit())){
 
  286             m_TimingManager->startPatchPanel(sector, m_db);
 
  287             m_TimingManager->startSlaveBoard(sector);
 
  288             if (m_OutputTgcRDO.value()) recordRdoSLB(sector, tgcrdo);
 
  297     int muctpiBcId = m_bctagInProcess - muctpiBcId_offset;
 
  299       int sectoraddr_endcap = 0;
 
  300       int sectoraddr_forward = 0;
 
  301       for(
int j=0; j<m_system->getNumberOfOctant(); j+=1){
 
  302         for(
int k=0; 
k<m_system->getNumberOfModule(); 
k+=1){
 
  305           if(sector==0) 
continue;
 
  307           m_TimingManager->startHighPtBoard(sector);
 
  308           if (m_OutputTgcRDO.value()) recordRdoHPT(sector, tgcrdo);
 
  316               m_innerTrackletSlotHolder.getInnerTrackletSlots(
i, j, 
k, innerTrackletSlots);
 
  320           m_TimingManager->startSectorLogic(sector);
 
  324           if (m_OutputTgcRDO.value() && m_tgcArgs.USE_INNER()) recordRdoInner(sector, tgcrdo);
 
  327           if (m_OutputTgcRDO.value()) recordRdoSL(sector, tgcrdo);
 
  333       std::shared_ptr<TGCTrackSelectorOut>  trackSelectorOut;
 
  336       std::shared_ptr<LVL1TGC::TGCNSW> nsw = m_system->getNSW();
 
  342             if(trackSelectorOut != 0) FillSectorLogicData(&sldata,trackSelectorOut.get());
 
  344         if ( m_tgcArgs.USE_NSW() ){
 
  363             if(trackSelectorOut != 0) FillSectorLogicData(&sldata,trackSelectorOut.get());
 
  365         if ( m_tgcArgs.USE_NSW() ) {
 
  383       trackSelectorOut.get()->
reset();
 
  392     return StatusCode::SUCCESS;
 
  398                                      std::map<Identifier, int>& TgcDigitIDs)
 
  405         if (
h->bcTag()!=m_bctagInProcess) 
continue;
 
  408         const auto itCh = m_MaskedChannel.find(
channelId);
 
  409         if (itCh!=m_MaskedChannel.end() && itCh->second==0) {
 
  418     for(
const auto& [Id, OnOff] : m_MaskedChannel) {
 
  421         TgcDigitIDs.emplace(Id, 1);
 
  431 void  LVL1TGCTrigger::fillTGCEvent(
const std::map<Identifier, int>& tgcDigitIDs, 
TGCEvent& 
event)
 
  434     for(
const auto& itCh : tgcDigitIDs) {
 
  456         int subDetectorID, srodID, sswID, sbLoc, channelID;
 
  463         fstatus = m_cabling->getReadoutIDfromOfflineID(
channelId,
 
  469           fstatus = m_cabling->getSLBIDfromReadoutID(
phi, isAside, isEndcap,
 
  472                                                      srodID, sswID,sbLoc);
 
  476                           << 
" octant#=" << octantNumber
 
  477                           << 
" mod#=" << moduleNumber
 
  478                           << 
" layer#=" << layerNumber << 
" r#=" << rNumber
 
  479                           << 
" isStrip=" << wireOrStrip
 
  480                           << 
" ch#=" << channelNumber << 
endmsg 
  481                           << 
" --> readoutID: sudetID=" << subDetectorID
 
  482                           << 
" srodID=" << srodID << 
" sswID=" << sswID
 
  483                           << 
" slbID=" << slbID << 
" chID=" << channelID);
 
  488           event.NewASDOut(
index,
 
  499                     << 
"  vector size : " << 
event.GetNASDOut() );
 
  500       for(
int iout=1; iout<= 
event.GetNASDOut(); iout++){
 
  501         TGCASDOut* asdout = (
event.GetASDOutVector()[iout-1]);
 
  521     if(trackSelectorOut ==0) 
return;
 
  526     sldata->
bcid(m_bctagInProcess - muctpiBcId_offset);
 
  547                   std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>&  tgcrdo)
 
  551     int subDetectorId, rodId, sswId, sbLoc, secId, secIdEIFI;
 
  553     bool isAside, isEndcap; 
int phi, moduleType, 
id, phiEIFI;
 
  554     isAside = (sector->
getSideId()==0  ? 1 : 0);
 
  569     phiEIFI = (secIdEIFI+23+sector->
getOctantId()*3)%24+1;
 
  572     const int NumberOfSLBType = 6;
 
  574     for(
int itype=0; itype<NumberOfSLBType; itype++) {
 
  575       moduleType = getLPTTypeInRawData(itype);
 
  580         if (0==slb) 
continue;
 
  583         if (0==
out) 
continue;
 
  590           m_cabling->getReadoutIDfromSLBID((isEIFI ? phiEIFI : 
phi),
 
  593                                            subDetectorId, rodId,
 
  598                          << 
" side=" << ((isAside) ? 
"A": 
"C")
 
  599                          << 
" region=" << ((isEndcap) ? 
"Endcap" : 
"Forward")
 
  600                          << 
" type="   << moduleType
 
  602                          << 
" subDetectorId=" << subDetectorId
 
  603                          << 
" rodId=" << rodId
 
  604                          << 
" sswId=" << sswId
 
  605                          << 
" sbLoc=" << sbLoc);
 
  610         for(
int iData=0; iData<
out->getNumberOfData(); iData++) { 
 
  611           if (!
out->getHit(iData)) 
continue;
 
  615           int subMat = iData % 4;
 
  626                                                                  static_cast<uint16_t>(subDetectorId),
 
  631                                                                  type, 
out->getDev(iData), seg, subMat,
 
  632                                                                  out->getPos(iData)));
 
  633           addRawData(std::move(rawdata), tgcrdo);
 
  637             bool setEIFITriggerBit =
 
  638               m_innerTrackletSlotHolder.setTriggerBit(sector->
getSideId(),
 
  644                                                       static_cast<unsigned int>(subMat),
 
  647             if(!setEIFITriggerBit) {
 
  650                            << 
" slotId= " << phiEIFI
 
  651                            << 
" region= " << (isEndcap ? 
"EI" : 
"FI")
 
  653                            << 
" subMat(iBit)= " << 
static_cast<unsigned int>(subMat) );
 
  657           ATH_MSG_DEBUG(
" recordRdoSLB : reg=" << (isEndcap ? 
"EC" : 
"FWD")
 
  658                         << 
" srod=" << rodId << 
" sswId=" << sswId
 
  659                         << 
" SBLoc=" << sbLoc << 
" type=" << itype
 
  660                         << 
" iData(subMat:seg)=" << iData << 
" pos=" 
  661                         << 
out->getPos(iData) << 
" dev=" << 
out->getDev(iData) );
 
  671                   std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>& tgcrdo)
 
  673   if(sector->
hasHit() == 
false) 
return;
 
  676     int subDetectorId, rodId, sswId, sbLoc, secId;
 
  679     int startEndcapSector, coverageOfEndcapSector;
 
  680     int startForwardSector, coverageOfForwardSector;
 
  682     m_cabling->getCoveragefromSRodID(rodId,
 
  684                                      coverageOfEndcapSector,
 
  686                                      coverageOfForwardSector
 
  707       secId = sectorId % coverageOfEndcapSector;
 
  709       secId = sectorId % coverageOfForwardSector;
 
  712     phi = (isEndcap ? (sectorId+46)%48+1 : (sectorId+23)%24+1);
 
  714     for(
int itype=0; itype<2; itype++) { 
 
  716       for(
unsigned int ihpb=0; ihpb<sector->
getNumberOfHPB(itype); ihpb++) { 
 
  718         if (0==hpb) 
continue;
 
  720         if (0==
out) 
continue;
 
  724                                                        subDetectorId, rodId, sswId, sbLoc);
 
  733             if (!
out->getSel(ichip, icand)) 
continue; 
 
  736             int hitId =  
out->getHitID(ichip, icand);
 
  737             m_cabling->getRDOHighPtIDfromSimHighPtID(!isEndcap, 
isStrip,
 
  739             bool isHPT = 
out->getPt(ichip,icand)==
PtHigh ? 1 : 0;
 
  741                                                                    static_cast<uint16_t>(subDetectorId),
 
  745                                                                    isStrip, (!isEndcap), secId, chip, icand,
 
  747                                                                    out->getPos(ichip, icand),
 
  748                                                                    out->getDev(ichip, icand),
 
  750             addRawData(std::move(rawdata), tgcrdo);
 
  754                            << 
" side=" << ( (isAside)? 
"A" : 
"C")
 
  755                            << (isEndcap ? 
"EC" : 
"FWD")
 
  756                            << 
" w/s=" << ( (
isStrip)? 
"s" : 
"w")
 
  757                            << 
" id=" <<  hpb->
getId()
 
  761                            << 
" block=" << 
out->getHitID(ichip, icand)
 
  762                            << 
" subMatrix=" << 
out->getPos(ichip, icand)
 
  763                            << 
" dev=" << 
out->getDev(ichip, icand)
 
  764                            << 
" srod=" << rodId << 
" sswId=" << sswId << 
" SBLoc=" << sbLoc );
 
  767             if (   m_tgcArgs.SHPT_ORED() &&
 
  771               if (hitId == 1) oredId = 5;
 
  772               else if (hitId == 2) oredId = 6;
 
  773               else if (hitId == 5) oredId = 1;
 
  774               else if (hitId == 6) oredId = 2;
 
  776                 std::unique_ptr<TgcRawData> rawdata2(
 
  778                                                                         static_cast<uint16_t>(subDetectorId),
 
  782                                                                         isStrip, (!isEndcap), secId, chip, icand,
 
  784                                                                         out->getPos(ichip, icand),
 
  785                                                                         out->getDev(ichip, icand),
 
  787                 addRawData(std::move(rawdata2), tgcrdo);
 
  804                 std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>& tgcrdo)
 
  808     if (!isEndcap) 
return;
 
  814     int phi = (sectorId+46)%48+1;
 
  817     int subDetectorId=0, rodId=0, sswId=0, sbLoc=0;
 
  819     bool status = m_cabling->getSReadoutIDfromSLID(
phi, isAside, isEndcap,
 
  820                                                    subDetectorId, rodId, sswId, sbLoc);
 
  822       ATH_MSG_WARNING(
"TGCcablingSvc::ReadoutIDfromSLID fails in recordRdoInner()" );
 
  829     int startEndcapSector, coverageOfEndcapSector;
 
  830     int startForwardSector, coverageOfForwardSector;
 
  831     if (!m_cabling->getCoveragefromSRodID(rodId,
 
  833                                           coverageOfEndcapSector,
 
  835                                           coverageOfForwardSector
 
  838       ATH_MSG_WARNING(
"LVL1TGCTrigger::recordRdoInner --- bad rodId " << rodId );
 
  844       secId = sectorId % coverageOfEndcapSector;
 
  846       secId = sectorId % coverageOfForwardSector;
 
  855     m_innerTrackletSlotHolder.getInnerTrackletSlots(sector->
getSideId(),
 
  856                                                     octant, 
module, innerTrackletSlots);
 
  858     std::array<int, n_slots>inner_eifi;
 
  859     m_innerTrackletSlotHolder.getInnerTrackletBits(innerTrackletSlots, inner_eifi);
 
  861     for (
int i_slot = 0; i_slot < n_slots; i_slot++) {
 
  862       if (inner_eifi[i_slot] > 0) {
 
  864                                                                     static_cast<uint16_t>(subDetectorId),
 
  870                                                                     static_cast<uint16_t>(inner_eifi[i_slot]),
 
  873         addRawData(std::move(rawdata_eifi), tgcrdo);
 
  878     int inner_tile = m_system->getTMDB()->getInnerTileBits(sector->
getSideId(), sectorId);
 
  880     if (inner_tile > 0) {
 
  884                                                                    static_cast<uint16_t>(subDetectorId),
 
  892       addRawData(std::move(rawdata_tile), tgcrdo);
 
  898       std::shared_ptr<const LVL1TGC::NSWTrigOut> nsw_trigout = m_system->getNSW()->getOutput(region, !isAside, sectorId);
 
  899       for ( 
int icand=0; icand<(
int)nsw_trigout->
getNSWeta().size(); icand++ ){
 
  901                                                                     static_cast<uint16_t>(subDetectorId),
 
  914         addRawData(std::move(rawdata_nsw), tgcrdo);
 
  920       std::shared_ptr<const LVL1TGC::BIS78TrigOut> bis78_trigout = m_system->getBIS78()->getOutput(sectorId);
 
  921       for ( 
int icand=0; icand<(
int)bis78_trigout->
getBIS78eta().size(); icand++ ){
 
  923                                                                       static_cast<uint16_t>(subDetectorId),
 
  934         addRawData(std::move(rawdata_bis78), tgcrdo);
 
  941                  std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>& tgcrdo)
 
  944   std::shared_ptr<TGCTrackSelectorOut>  selectorOut;
 
  947   if (selectorOut == 
nullptr) 
return;
 
  956   int Zdir= (isAside) ? 1 : -1;
 
  970     int startEndcapSector, coverageOfEndcapSector;
 
  971     int startForwardSector, coverageOfForwardSector;
 
  973     m_cabling->getCoveragefromSRodID(rodId,
 
  975                                      coverageOfEndcapSector,
 
  977                                      coverageOfForwardSector
 
  981       secId = sectorId % coverageOfEndcapSector;
 
  983       secId = sectorId % coverageOfForwardSector;
 
  987     phi = (isEndcap ? (sectorId+46)%48+1 : (sectorId+23)%24+1);
 
  990     int subDetectorId = 0, sswId = 0, sbLoc = 0;
 
  991     bool status = m_cabling->getSReadoutIDfromSLID(
phi, isAside, isEndcap,
 
  992                                                    subDetectorId, rodId, sswId, sbLoc);
 
  995                       << (isEndcap ? 
"  Endcap-" : 
"  Forward-")
 
  996                       << (isAside  ? 
"A  " : 
"C  ")
 
 1002     int inner=0, coinFlag=0;
 
 1004     for (
unsigned int icand=0; icand < (
unsigned int)selectorOut->
getNCandidate(); ++icand) {
 
 1006       bool muplus = getCharge(selectorOut->
getDR(icand), Zdir)==1 ? 1 : 0;
 
 1008       roi = ((selectorOut->
getR(icand))<<2)+(selectorOut->
getPhi(icand));
 
 1017                                                              static_cast<uint16_t>(subDetectorId),
 
 1025       addRawData(std::move(rawdata), tgcrdo);
 
 1028                     << 
" side=" << (isAside  ? 
"A  " : 
"C  ")
 
 1029                     << 
" reg=" << (isEndcap ? 
"EC" : 
"FWD")
 
 1031                     << 
" cand=" << 
index 
 1032                     << 
" charge=" << (muplus ? 
"mu+" : 
"mu-")
 
 1036                     << 
" srod=" << rodId << 
" sswId=" << sswId << 
" SBLoc=" << sbLoc 
 
 1037             << 
" inner=" << inner << 
" coinFlag=" << coinFlag );
 
 1045     std::string 
fname=m_MaskFileName12.value();
 
 1046     if (
fname.empty()) 
return StatusCode::SUCCESS;
 
 1055       return StatusCode::FAILURE;
 
 1060     std::vector<std::string> 
mask;
 
 1062     while(getline(
fin,aLine)) {
 
 1063       if (aLine.compare(0,3,
"///")!=0) 
break;
 
 1065     int id_type = 
atoi(aLine.c_str());
 
 1066     while(getline(
fin,aLine)) {
 
 1067       if (!aLine.empty()) 
mask.push_back(aLine);
 
 1072     std::vector<int> 
ids;
 
 1074     int nmasked=0, nfired=0;
 
 1075     for(
int ich=0; ich<(
int)
mask.size(); ich++) {
 
 1076       std::string 
ch = 
mask[ich];
 
 1077       extractFromString(
ch, 
ids);
 
 1080       if (id_type==1 && 
ids.size()==8) { 
 
 1081         int sysno1 = (
ids[1]==-99 ? -1 : 
ids[1]);  
int sysno2=(
ids[1]==-99 ? 1 : 
ids[1]);
 
 1082         int octno1 = (
ids[2]==-99 ? 0  : 
ids[2]);  
int octno2=(
ids[2]==-99 ? 7 : 
ids[2]);
 
 1083         for(
int sysno=sysno1; sysno<=sysno2; sysno+=2) {
 
 1084           for(
int octno=octno1; octno<=octno2; octno++) {
 
 1085             bool status = m_cabling->getOfflineIDfromOnlineID(
ID,sysno,octno,
 
 1088                              << 
" sys=" << sysno << 
" oct=" << octno << 
" modno=" << 
ids[3]
 
 1089                              << 
" layerno=" << 
ids[4] << 
" rNumber=" << 
ids[5]
 
 1090                              << 
" strip=" << 
ids[6] << 
" chno=" << 
ids[7] );
 
 1093               ATH_MSG_WARNING(
"This onlineID is not valid and cannot be converted to offline ID." );
 
 1095                               << 
" layerno=" << 
ids[4] << 
" rNumber=" << 
ids[5]
 
 1096                               << 
" strip=" << 
ids[6] << 
" chno=" << 
ids[7] );
 
 1098               m_MaskedChannel.insert(std::map<Identifier, int>::value_type(
ID, OnOff));
 
 1099               if (OnOff==0)      nmasked+=1;
 
 1100               else if (OnOff==1) nfired+=1;
 
 1105       } 
else if (id_type==2 && 
ids.size()==6) { 
 
 1106         int sysno1 = (
ids[1]==-99 ? 103 : 
ids[1]);  
int sysno2=(
ids[1]==-99 ? 104 : 
ids[1]);
 
 1107         int octno1 = (
ids[2]==-99 ? 0  : 
ids[2]);  
int octno2=(
ids[2]==-99 ? 7 : 
ids[2]);
 
 1108         for(
int sysno=sysno1; sysno<=sysno2; sysno+=1) {
 
 1109           for(
int octno=octno1; octno<=octno2; octno++) {
 
 1110             bool status = m_cabling->getOfflineIDfromReadoutID(
ID, sysno,octno,
ids[3],
ids[4],
ids[5]);
 
 1112                              << 
" subdetectorID=" << sysno << 
" rodId=" << octno << 
" sswID=" << 
ids[3]
 
 1113                              << 
" SBLoc=" << 
ids[4] << 
" channelId=" << 
ids[5] );
 
 1115               ATH_MSG_WARNING(
"This readoutID is not valid and cannot be converted to offline ID " );
 
 1116               ATH_MSG_WARNING(
"subdetectorID=" << sysno << 
" rodId=" << octno << 
" sswID=" << 
ids[3]
 
 1117                               << 
" SBLoc=" << 
ids[4] << 
" channelId=" << 
ids[5] );
 
 1119               m_MaskedChannel.insert(std::map<Identifier, int>::value_type(
ID, OnOff));
 
 1120               if (OnOff==0)      nmasked+=1;
 
 1121               else if (OnOff==1) nfired+=1;
 
 1126       } 
else if (id_type==3 && 
ids.size()==2) { 
 
 1129         m_MaskedChannel.insert(std::map<Identifier, int>::value_type(
ID, OnOff));
 
 1130         if (OnOff==0)      nmasked+=1;
 
 1131         else if (OnOff==1) nfired+=1;
 
 1134         ATH_MSG_INFO(
"Invalid input. Idtype or number of parameters are invalid: idtype=" << id_type
 
 1135                      << 
" number of elements = " << 
ids.size() );
 
 1136         return StatusCode::FAILURE;
 
 1140     ATH_MSG_INFO(
"Total number of masked channels ... " << nmasked);
 
 1141     ATH_MSG_INFO(
"Total number of fired  channels ... " << nfired);
 
 1143     return StatusCode::SUCCESS;
 
 1148   if (m_bsMetaDataContRHKey.key().empty()) 
return StatusCode::SUCCESS;
 
 1150   ATH_MSG_DEBUG(
"Retrieving Detector Mask from ByteStream metadata container");
 
 1152   if (bsmdc.isValid() && !bsmdc->empty()) {
 
 1157     std::vector<eformat::SubDetector> subDetOff;
 
 1158     eformat::helper::DetectorMask(~detMaskLeast, ~detMaskMost).sub_detectors(subDetOff);
 
 1159     auto sideA = std::find_if(subDetOff.begin(), subDetOff.end(), [](
const eformat::SubDetector &
s) {
 
 1160         return (s == eformat::MUON_MMEGA_ENDCAP_A_SIDE || s == eformat::MUON_STGC_ENDCAP_A_SIDE); });
 
 1161     auto sideC = std::find_if(subDetOff.begin(), subDetOff.end(), [](
const eformat::SubDetector &
s) {
 
 1162         return (s == eformat::MUON_MMEGA_ENDCAP_C_SIDE || s == eformat::MUON_STGC_ENDCAP_C_SIDE); });
 
 1164     if (
sideA != 
std::end(subDetOff)) tgcArgs()->set_NSWSideInfo(m_NSWSideInfo.value().erase(0,1));
 
 1165     else if (
sideC != 
std::end(subDetOff)) tgcArgs()->set_NSWSideInfo(m_NSWSideInfo.value().erase(1,1));
 
 1168   return StatusCode::SUCCESS;
 
 1172 void LVL1TGCTrigger::extractFromString(
const std::string& 
str, std::vector<int> & 
v) {
 
 1174     if (
str.empty()) 
return;
 
 1177       if (
line.empty()) 
break;
 
 1178       int i = 
line.find(
' ');
 
 1179       if (
i==(
int)std::string::npos && !
line.empty()) {
 
 1183       std::string temp = 
line;
 
 1184       temp.erase(
i,
line.size());
 
 1185       v.push_back(
atoi(temp.c_str()));
 
 1191 int LVL1TGCTrigger::getCharge(
int dR, 
int ) {
 
 1195     return (dR >=0 ? 1 : -1 );
 
 1200 int LVL1TGCTrigger::getLPTTypeInRawData(
int type)
 
 1221   bool LVL1TGCTrigger::addRawData(std::unique_ptr<TgcRawData> rawdata,
 
 1222                                   std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>& tgcrdo)
 
 1226     std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>
::iterator itRdo = tgcrdo.find(subDetectorRod);
 
 1228     if (itRdo==tgcrdo.end()) {
 
 1233       tgcrdo.insert(std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>::
value_type(subDetectorRod, std::move(thisRdo)));
 
 1235       itRdo->second->push_back(std::move(rawdata));
 
 1248   int maxRodId, maxSRodId, maxSswId, maxSbloc,minChannelId, maxChannelId;
 
 1249   m_cabling->getReadoutIDRanges( maxRodId, maxSRodId, maxSswId, maxSbloc,minChannelId, maxChannelId);
 
 1250   if (maxRodId ==12) {
 
 1253       ATH_MSG_FATAL(
"Old TGCcablingSvc(octant segmentation) can not be used !");
 
 1254       return StatusCode::FAILURE;
 
 1259   return StatusCode::SUCCESS;