44#include "eformat/DetectorMask.h"
45#include "eformat/SourceIdentifier.h"
123 return StatusCode::SUCCESS;
134 return StatusCode::SUCCESS;
141 const EventContext& ctx = Gaudi::Hive::currentContext();
158 if (doTileMu && !
m_tgcArgs.useRun3Config()) {
171 std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>> tgcrdo;
178 ATH_CHECK(wh_muctpiTgc.
record(std::make_unique<LVL1MUONIF::Lvl1MuCTPIInputPhase1>()));
182 StatusCode
sc = StatusCode::SUCCESS;
184 sc = StatusCode::SUCCESS;
213 if(rdoContIn->
size()>0) {
215 for(; itR!=rdoContIn->
end(); ++itR){
216 const TgcRdo* rdoIn = (*itR);
218 std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>
::iterator itRdo = tgcrdo.find(subDetectorRod);
219 if (itRdo!=tgcrdo.end()) {
223 itRdo->second->push_back(std::make_unique<TgcRawData>(*rd));
231 auto trgContainer=std::make_unique<TgcRdoContainer>();
232 for(
const auto& tgcRdoMap : tgcrdo){
233 for(
const auto rawData : *tgcRdoMap.second){
234 trgContainer->push_back(rawData);
245 std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>& tgcrdo)
249 std::map<Identifier, int> tgcDigitIDs;
250 std::map<Identifier, int>::iterator itCh;
269 for(
int j=0; j<
m_system->getNumberOfOctant(); j+=1){
270 for(
int k=0; k<
m_system->getNumberOfModule(); k+=1){
272 if((sector!=0)&&(sector->
hasHit())){
287 int sectoraddr_endcap = 0;
288 int sectoraddr_forward = 0;
289 for(
int j=0; j<
m_system->getNumberOfOctant(); j+=1){
290 for(
int k=0; k<
m_system->getNumberOfModule(); k+=1){
293 if(sector==0)
continue;
317 size_t tgcsystem=0,subsystem=0;
321 std::shared_ptr<TGCTrackSelectorOut> trackSelectorOut;
324 std::shared_ptr<LVL1TGC::TGCNSW> nsw =
m_system->getNSW();
333 sectorId = ((
module/3)*2+module%3) + sector->getOctantId()*6;
334 std::shared_ptr<const LVL1TGC::NSWTrigOut> pNSWOut = nsw->getOutput(sector->
getRegionType(),
339 for(
bool NSWmonitor : pNSWOut->getNSWmonitor() ){
347 muctpiinputPhase1->
setSectorLogicData(sldata,tgcsystem,subsystem,sectoraddr_endcap++,muctpiBcId);
349 LVL1MUONIF::Lvl1MuForwardSectorLogicDataPhase1 sldata;
350 tgcsystem = LVL1MUONIF::Lvl1MuCTPIInputPhase1::idForwardSystem();
351 if(trackSelectorOut != 0) FillSectorLogicData(&sldata,trackSelectorOut.get());
353 if ( m_tgcArgs.USE_NSW() ) {
354 sectorId = (module/3) + sector->getOctantId()*3;
355 std::shared_ptr<const LVL1TGC::NSWTrigOut> pNSWOut = nsw->getOutput(sector->getRegionType(),
360 for(bool NSWmonitor : pNSWOut->getNSWmonitor() ){
368 muctpiinputPhase1->
setSectorLogicData(sldata,tgcsystem,subsystem,sectoraddr_forward++,muctpiBcId);
371 trackSelectorOut.get()->reset();
380 return StatusCode::SUCCESS;
386 std::map<Identifier, int>& TgcDigitIDs)
398 ATH_MSG_DEBUG(
"This channel is masked! offlineID=" << channelId);
401 TgcDigitIDs.emplace(channelId, 1);
409 TgcDigitIDs.emplace(Id, 1);
420 const std::map<Identifier, int>& tgcDigitIDs,
TGCEvent& event)
423 for(
const auto& itCh : tgcDigitIDs) {
425 int subsystemNumber{0}, octantNumber{0}, moduleNumber{0},
426 layerNumber{0}, rNumber{0}, wireOrStrip{0}, channelNumber{0};
427 bool status = cabling.getOnlineIDfromOfflineID(channelId,
437 ATH_MSG_INFO(
"Fail to getOnlineIDfromOfflineID for " << channelId);
440 int subDetectorID, srodID, sswID, sbLoc, channelID;
447 fstatus = cabling.getReadoutIDfromOfflineID(channelId,
453 fstatus = cabling.getSLBIDfromReadoutID(
phi, isAside, isEndcap,
456 srodID, sswID,sbLoc);
460 <<
" octant#=" << octantNumber
461 <<
" mod#=" << moduleNumber
462 <<
" layer#=" << layerNumber <<
" r#=" << rNumber
463 <<
" isStrip=" << wireOrStrip
464 <<
" ch#=" << channelNumber <<
endmsg
465 <<
" --> readoutID: sudetID=" << subDetectorID
466 <<
" srodID=" << srodID <<
" sswID=" << sswID
467 <<
" slbID=" << slbID <<
" chID=" << channelID);
472 event.NewASDOut(
index,
477 ATH_MSG_INFO(
"Fail to getSLBIDfromOfflineID for " << channelId);
483 <<
" vector size : " << event.GetNASDOut() );
484 for(
int iout=1; iout<=
event.GetNASDOut(); iout++){
485 TGCASDOut* asdout = (
event.GetASDOutVector()[iout-1]);
505 if(trackSelectorOut ==0)
return;
512 for(
int trackNumber=0;trackNumber!=trackSelectorOut->
getNCandidate();trackNumber++){
514 sldata->
roi(trackNumber,((trackSelectorOut->
getR(trackNumber))<<2)+(trackSelectorOut->
getPhi(trackNumber)));
515 sldata->
pt(trackNumber,trackSelectorOut->
getPtLevel(trackNumber));
516 if (trackSelectorOut->
getInnerVeto(trackNumber)) sldata->
ovl(trackNumber,1);
517 else sldata->
ovl(trackNumber,0);
532 std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>& tgcrdo)
536 int subDetectorId, rodId, sswId, sbLoc, secId, secIdEIFI;
538 bool isAside, isEndcap;
int phi, moduleType, id, phiEIFI;
539 isAside = (sector->
getSideId()==0 ? 1 : 0);
548 secId = (isEndcap ? (module/3)*2+module%3 :
module/3);
552 secIdEIFI = module%3;
554 phiEIFI = (secIdEIFI+23+sector->
getOctantId()*3)%24+1;
557 const int NumberOfSLBType = 6;
559 for(
int itype=0; itype<NumberOfSLBType; itype++) {
560 moduleType = getLPTTypeInRawData(itype);
563 for(unsigned int index=0; index<sector->getNumberOfSB(itype); index++) {
564 TGCSlaveBoard * slb = sector->getSB(itype, index);
565 if (0==slb) continue;
567 const TGCSlaveBoardOut * out = slb->getOutput();
568 if (0==out) continue;
570 bool isEIFI = (moduleType==TgcRawData::SLB_TYPE_INNER_WIRE ||
571 moduleType==TgcRawData::SLB_TYPE_INNER_STRIP);
575 cabling.getReadoutIDfromSLBID((isEIFI ? phiEIFI : phi),
578 subDetectorId, rodId,
581 ATH_MSG_DEBUG(
"TGCcablignSvc::getReadoutIDfromSLBID fails");
582 ATH_MSG_DEBUG(
"phi=" << phi
583 <<
" side=" << ((isAside) ?
"A":
"C")
584 <<
" region=" << ((isEndcap) ?
"Endcap" :
"Forward")
585 <<
" type=" << moduleType
587 <<
" subDetectorId=" << subDetectorId
588 <<
" rodId=" << rodId
589 <<
" sswId=" << sswId
590 <<
" sbLoc=" << sbLoc);
595 for(int iData=0; iData<out->getNumberOfData(); iData++) {
596 if (!out->getHit(iData)) continue;
599 TgcRawData::SlbType type = (TgcRawData::SlbType)moduleType;
600 int subMat = iData % 4;
602 if (type==TgcRawData::SLB_TYPE_TRIPLET_STRIP ) {
606 } else if ( (type==TgcRawData::SLB_TYPE_INNER_WIRE ) ||
607 (type==TgcRawData::SLB_TYPE_INNER_STRIP) ) {
610 std::unique_ptr<TgcRawData> rawdata(new TgcRawData(bcTag,
611 static_cast<uint16_t>(subDetectorId),
612 static_cast<uint16_t>(rodId),
613 static_cast<uint16_t>(sswId),
614 static_cast<uint16_t>(sbLoc),
616 type, out->getDev(iData), seg, subMat,
617 out->getPos(iData)));
618 addRawData(std::move(rawdata), tgcrdo);
622 bool setEIFITriggerBit =
623 m_innerTrackletSlotHolder.setTriggerBit(sector->getSideId(),
626 TGCInnerTrackletSlot::EI : TGCInnerTrackletSlot::FI),
627 (type==TgcRawData::SLB_TYPE_INNER_WIRE ?
628 TGCInnerTrackletSlot::WIRE : TGCInnerTrackletSlot::STRIP),
629 static_cast<unsigned int>(subMat),
632 if(!setEIFITriggerBit) {
633 ATH_MSG_INFO(
"Fail to set Inner trigger bit of"
634 <<
" sideId= " << sector->getSideId()
635 <<
" slotId= " << phiEIFI
636 <<
" region= " << (isEndcap ?
"EI" :
"FI")
637 <<
" readout= " << (type==TgcRawData::SLB_TYPE_INNER_WIRE ?
"WIRE" :
"STRIP")
638 <<
" subMat(iBit)= " << static_cast<unsigned int>(subMat) );
642 ATH_MSG_DEBUG(
" recordRdoSLB : reg=" << (isEndcap ?
"EC" :
"FWD")
643 <<
" srod=" << rodId <<
" sswId=" << sswId
644 <<
" SBLoc=" << sbLoc <<
" type=" << itype
645 <<
" iData(subMat:seg)=" << iData <<
" pos="
646 << out->getPos(iData) <<
" dev=" << out->getDev(iData) );
657 std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>& tgcrdo)
659 if(sector->
hasHit() ==
false)
return;
662 int subDetectorId{0}, rodId{0}, sswId{0}, sbLoc{0}, secId{0};
665 int startEndcapSector{0}, coverageOfEndcapSector{0};
666 int startForwardSector{0}, coverageOfForwardSector{0};
668 cabling.getCoveragefromSRodID(rodId,
670 coverageOfEndcapSector,
672 coverageOfForwardSector
678 bool isAside{
false}, isEndcap{
false}, isStrip{
false};
686 sectorId = ((
module/3)*2+module%3) + sector->getOctantId()*6;
688 sectorId = (
module/3) + sector->getOctantId()*3;
694 secId = sectorId % coverageOfEndcapSector;
696 secId = sectorId % coverageOfForwardSector;
699 phi = (isEndcap ? (sectorId+46)%48+1 : (sectorId+23)%24+1);
701 for(
int itype=0; itype<2; itype++) {
702 isStrip = (itype==0 ? 0 : 1);
703 for(
unsigned int ihpb=0; ihpb<sector->
getNumberOfHPB(itype); ihpb++) {
705 if (0==hpb)
continue;
707 if (0==out)
continue;
710 bool status = cabling.getReadoutIDfromHPTID(
phi, isAside, isEndcap, isStrip, hpb->
getId(),
711 subDetectorId, rodId, sswId, sbLoc);
720 if (!out->getSel(ichip, icand))
continue;
723 int hitId = out->getHitID(ichip, icand);
724 cabling.getRDOHighPtIDfromSimHighPtID(!isEndcap, isStrip,
726 bool isHPT = out->getPt(ichip,icand)==
PtHigh ? 1 : 0;
727 auto rawdata = std::make_unique<TgcRawData>(
bcTag,
728 static_cast<uint16_t
>(subDetectorId),
729 static_cast<uint16_t
>(rodId),
732 isStrip, (!isEndcap), secId, chip, icand,
734 out->getPos(ichip, icand),
735 out->getDev(ichip, icand),
741 <<
" side=" << ( (isAside)?
"A" :
"C")
742 << (isEndcap ?
"EC" :
"FWD")
743 <<
" w/s=" << ( (isStrip)?
"s" :
"w")
744 <<
" id=" << hpb->
getId()
748 <<
" block=" << out->getHitID(ichip, icand)
749 <<
" subMatrix=" << out->getPos(ichip, icand)
750 <<
" dev=" << out->getDev(ichip, icand)
751 <<
" srod=" << rodId <<
" sswId=" << sswId <<
" SBLoc=" << sbLoc );
755 isEndcap && isStrip &&
758 if (hitId == 1) oredId = 5;
759 else if (hitId == 2) oredId = 6;
760 else if (hitId == 5) oredId = 1;
761 else if (hitId == 6) oredId = 2;
763 auto rawdata2 = std::make_unique<TgcRawData>(
bcTag,
764 static_cast<uint16_t
>(subDetectorId),
765 static_cast<uint16_t
>(rodId),
768 isStrip, (!isEndcap), secId, chip, icand,
770 out->getPos(ichip, icand),
771 out->getDev(ichip, icand),
791 std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>& tgcrdo)
793 const bool isAside = sector->
getSideId()==0;
795 if (!isEndcap)
return;
802 int sectorId = ((
module/3)*2+module%3) + octant*6;
803 int phi = (sectorId+46)%48+1;
806 int subDetectorId=0, rodId=0, sswId=0, sbLoc=0;
808 bool status = cabling.getSReadoutIDfromSLID(
phi, isAside, isEndcap,
809 subDetectorId, rodId, sswId, sbLoc);
811 ATH_MSG_WARNING(
"TGCcablingSvc::ReadoutIDfromSLID fails in recordRdoInner()" );
818 int startEndcapSector{0}, coverageOfEndcapSector{0};
819 int startForwardSector{0}, coverageOfForwardSector{0};
820 if (!cabling.getCoveragefromSRodID(rodId,
822 coverageOfEndcapSector,
824 coverageOfForwardSector
827 ATH_MSG_WARNING(
"LVL1TGCTrigger::recordRdoInner --- bad rodId " << rodId );
832 secId = sectorId % coverageOfEndcapSector;
841 octant, module, innerTrackletSlots);
843 std::array<int, n_slots>inner_eifi;
846 for (
int i_slot = 0; i_slot < n_slots; i_slot++) {
847 if (inner_eifi[i_slot] > 0) {
848 auto rawdata_eifi = std::make_unique<TgcRawData>(
bcTag,
849 static_cast<uint16_t
>(subDetectorId),
850 static_cast<uint16_t
>(rodId),
855 static_cast<uint16_t
>(inner_eifi[i_slot]),
857 static_cast<uint16_t
>(i_slot) );
863 int inner_tile =
m_system->getTMDB()->getInnerTileBits(sector->
getSideId(), sectorId);
865 if (inner_tile > 0) {
868 auto rawdata_tile = std::make_unique<TgcRawData>(
bcTag,
869 static_cast<uint16_t
>(subDetectorId),
870 static_cast<uint16_t
>(rodId),
883 std::shared_ptr<const LVL1TGC::NSWTrigOut> nsw_trigout =
m_system->getNSW()->getOutput(region, !isAside, sectorId);
884 for (
int icand=0; icand<(int)nsw_trigout->getNSWeta().size(); icand++ ){
885 auto rawdata_nsw = std::make_unique<TgcRawData>(
bcTag,
886 static_cast<uint16_t
>(subDetectorId),
887 static_cast<uint16_t
>(rodId),
891 static_cast<uint16_t
>(secId),
892 static_cast<uint16_t
>(nsw_trigout->getNSWeta().at(icand)),
893 static_cast<uint16_t
>(nsw_trigout->getNSWphi().at(icand)),
894 static_cast<uint16_t
>(icand),
895 static_cast<uint16_t
>(nsw_trigout->getNSWDtheta().at(icand)),
898 static_cast<uint16_t
>(nsw_trigout->getNSWTriggerProcessor().at(icand)));
905 std::shared_ptr<const LVL1TGC::BIS78TrigOut> bis78_trigout =
m_system->getBIS78()->getOutput(sectorId);
906 for (
int icand=0; icand<(int)bis78_trigout->getBIS78eta().size(); icand++ ){
907 auto rawdata_bis78 = std::make_unique<TgcRawData>(
bcTag,
908 static_cast<uint16_t
>(subDetectorId),
909 static_cast<uint16_t
>(rodId),
913 static_cast<uint16_t
>(secId),
914 static_cast<uint16_t
>(bis78_trigout->getBIS78eta().at(icand)),
915 static_cast<uint16_t
>(bis78_trigout->getBIS78phi().at(icand)),
916 static_cast<uint16_t
>(icand),
917 static_cast<uint16_t
>(bis78_trigout->getBIS78Deta().at(icand)),
918 static_cast<uint16_t
>(bis78_trigout->getBIS78Dphi().at(icand)));
927 std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>& tgcrdo)
930 std::shared_ptr<TGCTrackSelectorOut> selectorOut;
933 if (selectorOut ==
nullptr)
return;
934 if (selectorOut->getNCandidate() == 0)
return;
942 int Zdir= (isAside) ? 1 : -1;
948 sectorId = ((
module/3)*2+module%3) + sector->getOctantId()*6;
950 sectorId = (
module/3) + sector->getOctantId()*3;
956 int startEndcapSector{0}, coverageOfEndcapSector{0};
957 int startForwardSector{0}, coverageOfForwardSector{0};
959 cabling.getCoveragefromSRodID(rodId,
961 coverageOfEndcapSector,
963 coverageOfForwardSector
967 secId = sectorId % coverageOfEndcapSector;
969 secId = sectorId % coverageOfForwardSector;
973 phi = (isEndcap ? (sectorId+46)%48+1 : (sectorId+23)%24+1);
976 int subDetectorId = 0, sswId = 0, sbLoc = 0;
977 bool status = cabling.getSReadoutIDfromSLID(
phi, isAside, isEndcap,
978 subDetectorId, rodId, sswId, sbLoc);
981 << (isEndcap ?
" Endcap-" :
" Forward-")
982 << (isAside ?
"A " :
"C ")
988 int inner=0, coinFlag=0;
990 for (
unsigned int icand=0; icand < (
unsigned int)selectorOut->getNCandidate(); ++icand) {
992 bool muplus =
getCharge(selectorOut->getDR(icand), Zdir)==1 ? 1 : 0;
993 threshold = selectorOut->getPtLevel(icand);
994 roi = ((selectorOut->getR(icand))<<2)+(selectorOut->getPhi(icand));
995 if (selectorOut->getInnerVeto(icand))
veto = 1;
998 inner = selectorOut->getInnerCoincidenceFlag(icand);
999 coinFlag = selectorOut->getCoincidenceType(icand);
1002 auto rawdata = std::make_unique<TgcRawData>(
bcTag,
1003 static_cast<uint16_t
>(subDetectorId),
1004 static_cast<uint16_t
>(rodId),
1014 <<
" side=" << (isAside ?
"A " :
"C ")
1015 <<
" reg=" << (isEndcap ?
"EC" :
"FWD")
1017 <<
" cand=" <<
index
1018 <<
" charge=" << (muplus ?
"mu+" :
"mu-")
1022 <<
" srod=" << rodId <<
" sswId=" << sswId <<
" SBLoc=" << sbLoc
1023 <<
" inner=" << inner <<
" coinFlag=" << coinFlag );
1031 if (fname.empty())
return StatusCode::SUCCESS;
1034 if( fullName.empty())
1037 std::ifstream fin(fullName.c_str());
1039 ATH_MSG_FATAL(
"Cannot open file " << (fullName.empty() ? fname : fullName));
1040 return StatusCode::FAILURE;
1045 std::vector<std::string> mask;
1047 while(getline(fin,aLine)) {
1048 if (aLine.compare(0,3,
"///")!=0)
break;
1050 int id_type = atoi(aLine.c_str());
1051 while(getline(fin,aLine)) {
1052 if (!aLine.empty()) mask.push_back(aLine);
1057 std::vector<int> ids;
1059 int nmasked=0, nfired=0;
1060 for(
int ich=0; ich<(int)mask.size(); ich++) {
1061 std::string ch = mask[ich];
1065 if (id_type==1 && ids.size()==8) {
1066 int sysno1 = (ids[1]==-99 ? -1 : ids[1]);
int sysno2=(ids[1]==-99 ? 1 : ids[1]);
1067 int octno1 = (ids[2]==-99 ? 0 : ids[2]);
int octno2=(ids[2]==-99 ? 7 : ids[2]);
1068 for(
int sysno=sysno1; sysno<=sysno2; sysno+=2) {
1069 for(
int octno=octno1; octno<=octno2; octno++) {
1070 bool status = cabling.getOfflineIDfromOnlineID(
ID,sysno,octno,
1071 ids[3],ids[4],ids[5],ids[6],ids[7]);
1073 <<
" sys=" << sysno <<
" oct=" << octno <<
" modno=" << ids[3]
1074 <<
" layerno=" << ids[4] <<
" rNumber=" << ids[5]
1075 <<
" strip=" << ids[6] <<
" chno=" << ids[7] );
1078 ATH_MSG_WARNING(
"This onlineID is not valid and cannot be converted to offline ID." );
1079 ATH_MSG_WARNING(
"sys=" << sysno <<
" oct=" << octno <<
" modno=" << ids[3]
1080 <<
" layerno=" << ids[4] <<
" rNumber=" << ids[5]
1081 <<
" strip=" << ids[6] <<
" chno=" << ids[7] );
1084 if (OnOff==0) nmasked+=1;
1085 else if (OnOff==1) nfired+=1;
1090 }
else if (id_type==2 && ids.size()==6) {
1091 int sysno1 = (ids[1]==-99 ? 103 : ids[1]);
int sysno2=(ids[1]==-99 ? 104 : ids[1]);
1092 int octno1 = (ids[2]==-99 ? 0 : ids[2]);
int octno2=(ids[2]==-99 ? 7 : ids[2]);
1093 for(
int sysno=sysno1; sysno<=sysno2; sysno+=1) {
1094 for(
int octno=octno1; octno<=octno2; octno++) {
1095 bool status = cabling.getOfflineIDfromReadoutID(
ID, sysno,octno,ids[3],ids[4],ids[5]);
1097 <<
" subdetectorID=" << sysno <<
" rodId=" << octno <<
" sswID=" << ids[3]
1098 <<
" SBLoc=" << ids[4] <<
" channelId=" << ids[5] );
1100 ATH_MSG_WARNING(
"This readoutID is not valid and cannot be converted to offline ID " );
1101 ATH_MSG_WARNING(
"subdetectorID=" << sysno <<
" rodId=" << octno <<
" sswID=" << ids[3]
1102 <<
" SBLoc=" << ids[4] <<
" channelId=" << ids[5] );
1105 if (OnOff==0) nmasked+=1;
1106 else if (OnOff==1) nfired+=1;
1111 }
else if (id_type==3 && ids.size()==2) {
1115 if (OnOff==0) nmasked+=1;
1116 else if (OnOff==1) nfired+=1;
1119 ATH_MSG_INFO(
"Invalid input. Idtype or number of parameters are invalid: idtype=" << id_type
1120 <<
" number of elements = " << ids.size() );
1121 return StatusCode::FAILURE;
1125 ATH_MSG_INFO(
"Total number of masked channels ... " << nmasked);
1126 ATH_MSG_INFO(
"Total number of fired channels ... " << nfired);
1128 return StatusCode::SUCCESS;
1135 ATH_MSG_DEBUG(
"Retrieving Detector Mask from ByteStream metadata container");
1137 if (bsmdc.isValid() && !bsmdc->empty()) {
1139 uint64_t detMaskLeast = metadata->getDetectorMask();
1140 uint64_t detMaskMost = metadata->getDetectorMask2();
1142 std::vector<eformat::SubDetector> subDetOff;
1143 eformat::helper::DetectorMask(~detMaskLeast, ~detMaskMost).sub_detectors(subDetOff);
1144 auto sideA = std::find_if(subDetOff.begin(), subDetOff.end(), [](
const eformat::SubDetector &s) {
1145 return (s == eformat::MUON_MMEGA_ENDCAP_A_SIDE || s == eformat::MUON_STGC_ENDCAP_A_SIDE); });
1146 auto sideC = std::find_if(subDetOff.begin(), subDetOff.end(), [](
const eformat::SubDetector &s) {
1147 return (s == eformat::MUON_MMEGA_ENDCAP_C_SIDE || s == eformat::MUON_STGC_ENDCAP_C_SIDE); });
1149 if (sideA != std::end(subDetOff))
tgcArgs()->set_NSWSideInfo(
m_NSWSideInfo.value().erase(0,1));
1150 else if (sideC != std::end(subDetOff))
tgcArgs()->set_NSWSideInfo(
m_NSWSideInfo.value().erase(1,1));
1151 else if (sideA != std::end(subDetOff) && sideC != std::end(subDetOff))
tgcArgs()->set_NSWSideInfo(
"");
1153 return StatusCode::SUCCESS;
1159 if (
str.empty())
return;
1160 std::string line=
str;
1162 if (line.empty())
break;
1163 int i = line.find(
' ');
1164 if (i==(
int)std::string::npos && !line.empty()) {
1165 v.push_back(atoi(line.c_str()));
1168 std::string temp = line;
1169 temp.erase(i,line.size());
1170 v.push_back(atoi(temp.c_str()));
1180 return (dR >=0 ? 1 : -1 );
1207 std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>& tgcrdo)
1210 std::pair<int, int> subDetectorRod(rawdata->subDetectorId(), rawdata->rodId());
1211 std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>
::iterator itRdo = tgcrdo.find(subDetectorRod);
1213 if (itRdo==tgcrdo.end()) {
1216 auto thisRdo = std::make_unique<TgcRdo>(rawdata->subDetectorId(), rawdata->rodId(), rawdata->bcId(), rawdata->l1Id());
1217 thisRdo->push_back(std::move(rawdata));
1218 tgcrdo.insert(std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>
::value_type(subDetectorRod, std::move(thisRdo)));
1220 itRdo->second->push_back(std::move(rawdata));
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
std::vector< Identifier > ID
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
uint16_t bcId(uint32_t data)
unsigned bcTag(unsigned bcBitMap)
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Header file for AthHistogramAlgorithm.
const_iterator end() const
return const_iterator for end of container
size_t size() const
Duplicate of fullSize for backwards compatability.
const_iterator begin() const
return const_iterator for first entry
Class representing data from an endcap SL board.
Base class for the data coming from one SL board.
int goodmf(size_t id) const
int bw2or3(size_t id) const
int charge(size_t id) const
int innercoin(size_t id) const
void clear2candidatesInSector()
void clear2candidates(size_t id)
void set2candidates(size_t id)
BooleanProperty m_useRun3Config
std::map< Identifier, int > m_MaskedChannel
mask channel map
void recordRdoSLB(const Muon::TgcCablingMap &cabling, TGCSector *, std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > &)
BooleanProperty m_USE_CONDDB
StringProperty m_NSWSideInfo
TGCInnerTrackletSlotHolder m_innerTrackletSlotHolder
BooleanProperty m_INNERVETO
int getLPTTypeInRawData(int type)
SG::ReadHandleKey< Muon::NSW_TrigRawDataContainer > m_keyNSWTrigOut
virtual StatusCode execute() override
void recordRdoHPT(const Muon::TgcCablingMap &cabling, TGCSector *, std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > &)
uint16_t m_bctagInProcess
virtual StatusCode start() override
virtual ~LVL1TGCTrigger()
SG::ReadHandleKey< Muon::RpcBis78_TrigRawDataContainer > m_keyBIS78TrigOut
SG::ReadHandleKey< TgcDigitContainer > m_keyTgcDigit
TGCDatabaseManager * m_db
SG::ReadCondHandleKey< TGCTriggerLUTs > m_readLUTs_CondKey
void recordRdoSL(const Muon::TgcCablingMap &cabling, TGCSector *, std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > &)
BooleanProperty m_FORCENSWCOIN
SG::ReadCondHandleKey< Muon::TgcCablingMap > m_cablingKey
void recordRdoInner(const Muon::TgcCablingMap &cabling, TGCSector *, std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > &)
int getCharge(int dR, int Zdir)
SG::ReadHandleKey< TgcRdoContainer > m_keyTgcRdoIn
SG::ReadHandleKey< TileMuonReceiverContainer > m_keyTileMu
ShortProperty m_CurrentBunchTag
property, see LVL1TGCTrigger::LVL1TGCTrigger
virtual StatusCode finalize() override
StatusCode processOneBunch(const Muon::TgcCablingMap &cabling, const TgcDigitContainer *, LVL1MUONIF::Lvl1MuCTPIInputPhase1 *, std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > &)
virtual StatusCode initialize() override
SG::ReadCondHandleKey< TGCTriggerData > m_readCondKey
void extractFromString(const std::string &, std::vector< int > &)
SG::WriteHandleKey< TgcRdoContainer > m_keyTgcRdo
LVL1TGCTrigger(const std::string &name, ISvcLocator *pSvcLocator)
standard constructor and destructor for algorithms
SG::WriteHandleKey< LVL1MUONIF::Lvl1MuCTPIInputPhase1 > m_muctpiPhase1Key
BooleanProperty m_USEINNER
BooleanProperty m_USEBIS78
BooleanProperty m_ProcessAllBunches
SG::ReadHandleKey< ByteStreamMetadataContainer > m_bsMetaDataContRHKey
bool addRawData(std::unique_ptr< TgcRawData > rawdata, std::map< std::pair< int, int >, std::unique_ptr< TgcRdo > > &tgcrdo)
void fillTGCEvent(const Muon::TgcCablingMap &cabling, const std::map< Identifier, int > &, TGCEvent &)
std::unique_ptr< TGCElectronicsSystem > m_system
StringProperty m_MaskFileName12
property, see LVL1TGCTrigger::LVL1TGCTrigger
BooleanProperty m_OutputTgcRDO
property, see LVL1TGCTrigger::LVL1TGCTrigger
BooleanProperty m_SHPTORED
StatusCode getMaskedChannel(const Muon::TgcCablingMap &cabling)
void FillSectorLogicData(LVL1MUONIF::Lvl1MuSectorLogicDataPhase1 *sldata, const TGCTrackSelectorOut *trackSelectorOut)
void doMaskOperation(const TgcDigitContainer *, std::map< Identifier, int > &)
std::unique_ptr< TGCTimingManager > m_TimingManager
const TGCReadoutIndex & GetTGCReadoutIndex() const
TGCSignalType GetSignalType() const
TGCHighPtChipOut * getOutput()
static constexpr int s_NHitInTrackSelector
@ NUMBER_OF_SLOTS_PER_TRIGGER_SECTOR
int GetLayerNumber() const
int GetOctantNumber() const
TGCZDirection GetZDirection() const
int GetModuleNumber() const
void setInnerTrackletSlots(const TGCInnerTrackletSlot *innerTrackletSlots[])
void getTrackSelectorOutput(std::shared_ptr< TGCTrackSelectorOut > &trackSelectorOut) const
TGCHighPtBoard * getHPB(int type, int index) const
TGCRegionType getRegionType() const
unsigned int getNumberOfHPB(int type) const
LVL1TGC::TGCSide getSideId() const
int getPtLevel(int order) const
int getPhi(int order) const
int getNCandidate() const
int getCoincidenceType(int order) const
int getCharge(int order) const
@ NCandidateInTrackSelector
int getInnerCoincidenceFlag(int order) const
bool getInnerVeto(int order) const
int getR(int order) const
int getGoodMFFlag(int order) const
static std::string find_file(const std::string &logical_file_name, const std::string &search_path)
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
pointer_type ptr()
Dereference the pointer.
bool isActive(int cwtype) const
Use IdentifiableContainer with TgcDigitCollection.
An unit object of TGC ROD output.
uint16_t subDetectorId() const
std::vector< std::string > veto
these patterns are anded
TGCSide
The sides of TGC (A- or C-side)
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())