41#include "eformat/DetectorMask.h"
42#include "eformat/SourceIdentifier.h"
124 return StatusCode::SUCCESS;
135 return StatusCode::SUCCESS;
142 const EventContext& ctx = Gaudi::Hive::currentContext();
159 if (doTileMu && !
m_tgcArgs.useRun3Config()) {
172 std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>> tgcrdo;
179 ATH_CHECK(wh_muctpiTgc.
record(std::make_unique<LVL1MUONIF::Lvl1MuCTPIInputPhase1>()));
183 StatusCode
sc = StatusCode::SUCCESS;
185 sc = StatusCode::SUCCESS;
214 if(rdoContIn->
size()>0) {
216 for(; itR!=rdoContIn->
end(); ++itR){
217 const TgcRdo* rdoIn = (*itR);
219 std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>
::iterator itRdo = tgcrdo.find(subDetectorRod);
220 if (itRdo!=tgcrdo.end()) {
224 itRdo->second->push_back(std::make_unique<TgcRawData>(*rd));
232 auto trgContainer=std::make_unique<TgcRdoContainer>();
233 for(
const auto& tgcRdoMap : tgcrdo){
234 for(
const auto rawData : *tgcRdoMap.second){
235 trgContainer->push_back(rawData);
246 std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>& tgcrdo)
250 std::map<Identifier, int> tgcDigitIDs;
251 std::map<Identifier, int>::iterator itCh;
270 for(
int j=0; j<
m_system->getNumberOfOctant(); j+=1){
271 for(
int k=0; k<
m_system->getNumberOfModule(); k+=1){
273 if((sector!=0)&&(sector->
hasHit())){
288 int sectoraddr_endcap = 0;
289 int sectoraddr_forward = 0;
290 for(
int j=0; j<
m_system->getNumberOfOctant(); j+=1){
291 for(
int k=0; k<
m_system->getNumberOfModule(); k+=1){
294 if(sector==0)
continue;
318 size_t tgcsystem=0,subsystem=0;
322 std::shared_ptr<TGCTrackSelectorOut> trackSelectorOut;
325 std::shared_ptr<LVL1TGC::TGCNSW> nsw =
m_system->getNSW();
334 sectorId = ((
module/3)*2+module%3) + sector->getOctantId()*6;
335 std::shared_ptr<const LVL1TGC::NSWTrigOut> pNSWOut = nsw->getOutput(sector->
getRegionType(),
340 for(
bool NSWmonitor : pNSWOut->getNSWmonitor() ){
348 muctpiinputPhase1->
setSectorLogicData(sldata,tgcsystem,subsystem,sectoraddr_endcap++,muctpiBcId);
350 LVL1MUONIF::Lvl1MuForwardSectorLogicDataPhase1 sldata;
351 tgcsystem = LVL1MUONIF::Lvl1MuCTPIInputPhase1::idForwardSystem();
352 if(trackSelectorOut != 0) FillSectorLogicData(&sldata,trackSelectorOut.get());
354 if ( m_tgcArgs.USE_NSW() ) {
355 sectorId = (module/3) + sector->getOctantId()*3;
356 std::shared_ptr<const LVL1TGC::NSWTrigOut> pNSWOut = nsw->getOutput(sector->getRegionType(),
361 for(bool NSWmonitor : pNSWOut->getNSWmonitor() ){
369 muctpiinputPhase1->
setSectorLogicData(sldata,tgcsystem,subsystem,sectoraddr_forward++,muctpiBcId);
372 trackSelectorOut.get()->reset();
381 return StatusCode::SUCCESS;
387 std::map<Identifier, int>& TgcDigitIDs)
399 ATH_MSG_DEBUG(
"This channel is masked! offlineID=" << channelId);
402 TgcDigitIDs.emplace(channelId, 1);
410 TgcDigitIDs.emplace(Id, 1);
421 const std::map<Identifier, int>& tgcDigitIDs,
TGCEvent& event)
424 for(
const auto& itCh : tgcDigitIDs) {
426 int subsystemNumber{0}, octantNumber{0}, moduleNumber{0},
427 layerNumber{0}, rNumber{0}, wireOrStrip{0}, channelNumber{0};
428 bool status = cabling.getOnlineIDfromOfflineID(channelId,
438 ATH_MSG_INFO(
"Fail to getOnlineIDfromOfflineID for " << channelId);
441 int subDetectorID, srodID, sswID, sbLoc, channelID;
448 fstatus = cabling.getReadoutIDfromOfflineID(channelId,
454 fstatus = cabling.getSLBIDfromReadoutID(
phi, isAside, isEndcap,
457 srodID, sswID,sbLoc);
461 <<
" octant#=" << octantNumber
462 <<
" mod#=" << moduleNumber
463 <<
" layer#=" << layerNumber <<
" r#=" << rNumber
464 <<
" isStrip=" << wireOrStrip
465 <<
" ch#=" << channelNumber <<
endmsg
466 <<
" --> readoutID: sudetID=" << subDetectorID
467 <<
" srodID=" << srodID <<
" sswID=" << sswID
468 <<
" slbID=" << slbID <<
" chID=" << channelID);
473 event.NewASDOut(
index,
478 ATH_MSG_INFO(
"Fail to getSLBIDfromOfflineID for " << channelId);
484 <<
" vector size : " << event.GetNASDOut() );
485 for(
int iout=1; iout<=
event.GetNASDOut(); iout++){
486 TGCASDOut* asdout = (
event.GetASDOutVector()[iout-1]);
506 if(trackSelectorOut ==0)
return;
513 for(
int trackNumber=0;trackNumber!=trackSelectorOut->
getNCandidate();trackNumber++){
515 sldata->
roi(trackNumber,((trackSelectorOut->
getR(trackNumber))<<2)+(trackSelectorOut->
getPhi(trackNumber)));
516 sldata->
pt(trackNumber,trackSelectorOut->
getPtLevel(trackNumber));
517 if (trackSelectorOut->
getInnerVeto(trackNumber)) sldata->
ovl(trackNumber,1);
518 else sldata->
ovl(trackNumber,0);
533 std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>& tgcrdo)
537 int subDetectorId, rodId, sswId, sbLoc, secId, secIdEIFI;
539 bool isAside, isEndcap;
int phi, moduleType, id, phiEIFI;
540 isAside = (sector->
getSideId()==0 ? 1 : 0);
549 secId = (isEndcap ? (module/3)*2+module%3 :
module/3);
553 secIdEIFI = module%3;
555 phiEIFI = (secIdEIFI+23+sector->
getOctantId()*3)%24+1;
558 const int NumberOfSLBType = 6;
560 for(
int itype=0; itype<NumberOfSLBType; itype++) {
561 moduleType = getLPTTypeInRawData(itype);
564 for(unsigned int index=0; index<sector->getNumberOfSB(itype); index++) {
565 TGCSlaveBoard * slb = sector->getSB(itype, index);
566 if (0==slb) continue;
568 const TGCSlaveBoardOut * out = slb->getOutput();
569 if (0==out) continue;
571 bool isEIFI = (moduleType==TgcRawData::SLB_TYPE_INNER_WIRE ||
572 moduleType==TgcRawData::SLB_TYPE_INNER_STRIP);
576 cabling.getReadoutIDfromSLBID((isEIFI ? phiEIFI : phi),
579 subDetectorId, rodId,
582 ATH_MSG_DEBUG(
"TGCcablignSvc::getReadoutIDfromSLBID fails");
583 ATH_MSG_DEBUG(
"phi=" << phi
584 <<
" side=" << ((isAside) ?
"A":
"C")
585 <<
" region=" << ((isEndcap) ?
"Endcap" :
"Forward")
586 <<
" type=" << moduleType
588 <<
" subDetectorId=" << subDetectorId
589 <<
" rodId=" << rodId
590 <<
" sswId=" << sswId
591 <<
" sbLoc=" << sbLoc);
596 for(int iData=0; iData<out->getNumberOfData(); iData++) {
597 if (!out->getHit(iData)) continue;
600 TgcRawData::SlbType type = (TgcRawData::SlbType)moduleType;
601 int subMat = iData % 4;
603 if (type==TgcRawData::SLB_TYPE_TRIPLET_STRIP ) {
607 } else if ( (type==TgcRawData::SLB_TYPE_INNER_WIRE ) ||
608 (type==TgcRawData::SLB_TYPE_INNER_STRIP) ) {
611 std::unique_ptr<TgcRawData> rawdata(new TgcRawData(bcTag,
612 static_cast<uint16_t>(subDetectorId),
613 static_cast<uint16_t>(rodId),
614 static_cast<uint16_t>(sswId),
615 static_cast<uint16_t>(sbLoc),
617 type, out->getDev(iData), seg, subMat,
618 out->getPos(iData)));
619 addRawData(std::move(rawdata), tgcrdo);
623 bool setEIFITriggerBit =
624 m_innerTrackletSlotHolder.setTriggerBit(sector->getSideId(),
627 TGCInnerTrackletSlot::EI : TGCInnerTrackletSlot::FI),
628 (type==TgcRawData::SLB_TYPE_INNER_WIRE ?
629 TGCInnerTrackletSlot::WIRE : TGCInnerTrackletSlot::STRIP),
630 static_cast<unsigned int>(subMat),
633 if(!setEIFITriggerBit) {
634 ATH_MSG_INFO(
"Fail to set Inner trigger bit of"
635 <<
" sideId= " << sector->getSideId()
636 <<
" slotId= " << phiEIFI
637 <<
" region= " << (isEndcap ?
"EI" :
"FI")
638 <<
" readout= " << (type==TgcRawData::SLB_TYPE_INNER_WIRE ?
"WIRE" :
"STRIP")
639 <<
" subMat(iBit)= " << static_cast<unsigned int>(subMat) );
643 ATH_MSG_DEBUG(
" recordRdoSLB : reg=" << (isEndcap ?
"EC" :
"FWD")
644 <<
" srod=" << rodId <<
" sswId=" << sswId
645 <<
" SBLoc=" << sbLoc <<
" type=" << itype
646 <<
" iData(subMat:seg)=" << iData <<
" pos="
647 << out->getPos(iData) <<
" dev=" << out->getDev(iData) );
658 std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>& tgcrdo)
660 if(sector->
hasHit() ==
false)
return;
663 int subDetectorId{0}, rodId{0}, sswId{0}, sbLoc{0}, secId{0};
666 int startEndcapSector{0}, coverageOfEndcapSector{0};
667 int startForwardSector{0}, coverageOfForwardSector{0};
669 cabling.getCoveragefromSRodID(rodId,
671 coverageOfEndcapSector,
673 coverageOfForwardSector
679 bool isAside{
false}, isEndcap{
false}, isStrip{
false};
687 sectorId = ((
module/3)*2+module%3) + sector->getOctantId()*6;
689 sectorId = (
module/3) + sector->getOctantId()*3;
694 if (isEndcap && (coverageOfEndcapSector!=0)){
695 secId = sectorId % coverageOfEndcapSector;
697 if (coverageOfForwardSector != 0){
698 secId = sectorId % coverageOfForwardSector;
702 phi = (isEndcap ? (sectorId+46)%48+1 : (sectorId+23)%24+1);
704 for(
int itype=0; itype<2; itype++) {
705 isStrip = (itype==0 ? 0 : 1);
706 for(
unsigned int ihpb=0; ihpb<sector->
getNumberOfHPB(itype); ihpb++) {
708 if (0==hpb)
continue;
710 if (0==out)
continue;
713 bool status = cabling.getReadoutIDfromHPTID(
phi, isAside, isEndcap, isStrip, hpb->
getId(),
714 subDetectorId, rodId, sswId, sbLoc);
723 if (!out->getSel(ichip, icand))
continue;
726 int hitId = out->getHitID(ichip, icand);
727 cabling.getRDOHighPtIDfromSimHighPtID(!isEndcap, isStrip,
729 bool isHPT = out->getPt(ichip,icand)==
PtHigh ? 1 : 0;
730 auto rawdata = std::make_unique<TgcRawData>(
bcTag,
731 static_cast<uint16_t
>(subDetectorId),
732 static_cast<uint16_t
>(rodId),
735 isStrip, (!isEndcap), secId, chip, icand,
737 out->getPos(ichip, icand),
738 out->getDev(ichip, icand),
744 <<
" side=" << ( (isAside)?
"A" :
"C")
745 << (isEndcap ?
"EC" :
"FWD")
746 <<
" w/s=" << ( (isStrip)?
"s" :
"w")
747 <<
" id=" << hpb->
getId()
751 <<
" block=" << out->getHitID(ichip, icand)
752 <<
" subMatrix=" << out->getPos(ichip, icand)
753 <<
" dev=" << out->getDev(ichip, icand)
754 <<
" srod=" << rodId <<
" sswId=" << sswId <<
" SBLoc=" << sbLoc );
758 isEndcap && isStrip &&
761 if (hitId == 1) oredId = 5;
762 else if (hitId == 2) oredId = 6;
763 else if (hitId == 5) oredId = 1;
764 else if (hitId == 6) oredId = 2;
766 auto rawdata2 = std::make_unique<TgcRawData>(
bcTag,
767 static_cast<uint16_t
>(subDetectorId),
768 static_cast<uint16_t
>(rodId),
771 isStrip, (!isEndcap), secId, chip, icand,
773 out->getPos(ichip, icand),
774 out->getDev(ichip, icand),
794 std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>& tgcrdo)
796 const bool isAside = sector->
getSideId()==0;
798 if (!isEndcap)
return;
805 int sectorId = ((
module/3)*2+module%3) + octant*6;
806 int phi = (sectorId+46)%48+1;
809 int subDetectorId=0, rodId=0, sswId=0, sbLoc=0;
811 bool status = cabling.getSReadoutIDfromSLID(
phi, isAside, isEndcap,
812 subDetectorId, rodId, sswId, sbLoc);
814 ATH_MSG_WARNING(
"TGCcablingSvc::ReadoutIDfromSLID fails in recordRdoInner()" );
821 int startEndcapSector{0}, coverageOfEndcapSector{0};
822 int startForwardSector{0}, coverageOfForwardSector{0};
823 if (!cabling.getCoveragefromSRodID(rodId,
825 coverageOfEndcapSector,
827 coverageOfForwardSector
830 ATH_MSG_WARNING(
"LVL1TGCTrigger::recordRdoInner --- bad rodId " << rodId );
835 secId = sectorId % coverageOfEndcapSector;
844 octant, module, innerTrackletSlots);
846 std::array<int, n_slots>inner_eifi;
849 for (
int i_slot = 0; i_slot < n_slots; i_slot++) {
850 if (inner_eifi[i_slot] > 0) {
851 auto rawdata_eifi = std::make_unique<TgcRawData>(
bcTag,
852 static_cast<uint16_t
>(subDetectorId),
853 static_cast<uint16_t
>(rodId),
858 static_cast<uint16_t
>(inner_eifi[i_slot]),
860 static_cast<uint16_t
>(i_slot) );
866 int inner_tile =
m_system->getTMDB()->getInnerTileBits(sector->
getSideId(), sectorId);
868 if (inner_tile > 0) {
871 auto rawdata_tile = std::make_unique<TgcRawData>(
bcTag,
872 static_cast<uint16_t
>(subDetectorId),
873 static_cast<uint16_t
>(rodId),
886 std::shared_ptr<const LVL1TGC::NSWTrigOut> nsw_trigout =
m_system->getNSW()->getOutput(region, !isAside, sectorId);
887 for (
int icand=0; icand<(int)nsw_trigout->getNSWeta().size(); icand++ ){
888 auto rawdata_nsw = std::make_unique<TgcRawData>(
bcTag,
889 static_cast<uint16_t
>(subDetectorId),
890 static_cast<uint16_t
>(rodId),
894 static_cast<uint16_t
>(secId),
895 static_cast<uint16_t
>(nsw_trigout->getNSWeta().at(icand)),
896 static_cast<uint16_t
>(nsw_trigout->getNSWphi().at(icand)),
897 static_cast<uint16_t
>(icand),
898 static_cast<uint16_t
>(nsw_trigout->getNSWDtheta().at(icand)),
901 static_cast<uint16_t
>(nsw_trigout->getNSWTriggerProcessor().at(icand)));
908 std::shared_ptr<const LVL1TGC::BIS78TrigOut> bis78_trigout =
m_system->getBIS78()->getOutput(sectorId);
909 for (
int icand=0; icand<(int)bis78_trigout->getBIS78eta().size(); icand++ ){
910 auto rawdata_bis78 = std::make_unique<TgcRawData>(
bcTag,
911 static_cast<uint16_t
>(subDetectorId),
912 static_cast<uint16_t
>(rodId),
916 static_cast<uint16_t
>(secId),
917 static_cast<uint16_t
>(bis78_trigout->getBIS78eta().at(icand)),
918 static_cast<uint16_t
>(bis78_trigout->getBIS78phi().at(icand)),
919 static_cast<uint16_t
>(icand),
920 static_cast<uint16_t
>(bis78_trigout->getBIS78Deta().at(icand)),
921 static_cast<uint16_t
>(bis78_trigout->getBIS78Dphi().at(icand)));
930 std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>& tgcrdo)
933 std::shared_ptr<TGCTrackSelectorOut> selectorOut;
936 if (selectorOut ==
nullptr)
return;
937 if (selectorOut->getNCandidate() == 0)
return;
945 int Zdir= (isAside) ? 1 : -1;
951 sectorId = ((
module/3)*2+module%3) + sector->getOctantId()*6;
953 sectorId = (
module/3) + sector->getOctantId()*3;
959 int startEndcapSector{0}, coverageOfEndcapSector{0};
960 int startForwardSector{0}, coverageOfForwardSector{0};
962 cabling.getCoveragefromSRodID(rodId,
964 coverageOfEndcapSector,
966 coverageOfForwardSector
969 if (isEndcap && (coverageOfEndcapSector != 0)){
970 secId = sectorId % coverageOfEndcapSector;
972 if (coverageOfForwardSector !=0 ){
973 secId = sectorId % coverageOfForwardSector;
978 phi = (isEndcap ? (sectorId+46)%48+1 : (sectorId+23)%24+1);
981 int subDetectorId = 0, sswId = 0, sbLoc = 0;
982 bool status = cabling.getSReadoutIDfromSLID(
phi, isAside, isEndcap,
983 subDetectorId, rodId, sswId, sbLoc);
986 << (isEndcap ?
" Endcap-" :
" Forward-")
987 << (isAside ?
"A " :
"C ")
993 int inner=0, coinFlag=0;
995 for (
unsigned int icand=0; icand < (
unsigned int)selectorOut->getNCandidate(); ++icand) {
997 bool muplus =
getCharge(selectorOut->getDR(icand), Zdir)==1 ? 1 : 0;
998 threshold = selectorOut->getPtLevel(icand);
999 roi = ((selectorOut->getR(icand))<<2)+(selectorOut->getPhi(icand));
1000 if (selectorOut->getInnerVeto(icand))
veto = 1;
1003 inner = selectorOut->getInnerCoincidenceFlag(icand);
1004 coinFlag = selectorOut->getCoincidenceType(icand);
1007 auto rawdata = std::make_unique<TgcRawData>(
bcTag,
1008 static_cast<uint16_t
>(subDetectorId),
1009 static_cast<uint16_t
>(rodId),
1019 <<
" side=" << (isAside ?
"A " :
"C ")
1020 <<
" reg=" << (isEndcap ?
"EC" :
"FWD")
1022 <<
" cand=" <<
index
1023 <<
" charge=" << (muplus ?
"mu+" :
"mu-")
1027 <<
" srod=" << rodId <<
" sswId=" << sswId <<
" SBLoc=" << sbLoc
1028 <<
" inner=" << inner <<
" coinFlag=" << coinFlag );
1036 if (fname.empty())
return StatusCode::SUCCESS;
1039 if( fullName.empty())
1042 std::ifstream fin(fullName.c_str());
1044 ATH_MSG_FATAL(
"Cannot open file " << (fullName.empty() ? fname : fullName));
1045 return StatusCode::FAILURE;
1050 std::vector<std::string> mask;
1052 while(getline(fin,aLine)) {
1053 if (aLine.compare(0,3,
"///")!=0)
break;
1055 int id_type = atoi(aLine.c_str());
1056 while(getline(fin,aLine)) {
1057 if (!aLine.empty()) mask.push_back(aLine);
1062 std::vector<int> ids;
1064 int nmasked=0, nfired=0;
1065 for(
int ich=0; ich<(int)mask.size(); ich++) {
1066 std::string ch = mask[ich];
1070 if (id_type==1 && ids.size()==8) {
1071 int sysno1 = (ids[1]==-99 ? -1 : ids[1]);
int sysno2=(ids[1]==-99 ? 1 : ids[1]);
1072 int octno1 = (ids[2]==-99 ? 0 : ids[2]);
int octno2=(ids[2]==-99 ? 7 : ids[2]);
1073 for(
int sysno=sysno1; sysno<=sysno2; sysno+=2) {
1074 for(
int octno=octno1; octno<=octno2; octno++) {
1075 bool status = cabling.getOfflineIDfromOnlineID(ID,sysno,octno,
1076 ids[3],ids[4],ids[5],ids[6],ids[7]);
1077 ATH_MSG_VERBOSE( (OnOff==0 ?
"Mask" :
"Fire") <<
" : offlineID=" << ID
1078 <<
" sys=" << sysno <<
" oct=" << octno <<
" modno=" << ids[3]
1079 <<
" layerno=" << ids[4] <<
" rNumber=" << ids[5]
1080 <<
" strip=" << ids[6] <<
" chno=" << ids[7] );
1083 ATH_MSG_WARNING(
"This onlineID is not valid and cannot be converted to offline ID." );
1084 ATH_MSG_WARNING(
"sys=" << sysno <<
" oct=" << octno <<
" modno=" << ids[3]
1085 <<
" layerno=" << ids[4] <<
" rNumber=" << ids[5]
1086 <<
" strip=" << ids[6] <<
" chno=" << ids[7] );
1088 m_MaskedChannel.insert(std::map<Identifier, int>::value_type(ID, OnOff));
1089 if (OnOff==0) nmasked+=1;
1090 else if (OnOff==1) nfired+=1;
1095 }
else if (id_type==2 && ids.size()==6) {
1096 int sysno1 = (ids[1]==-99 ? 103 : ids[1]);
int sysno2=(ids[1]==-99 ? 104 : ids[1]);
1097 int octno1 = (ids[2]==-99 ? 0 : ids[2]);
int octno2=(ids[2]==-99 ? 7 : ids[2]);
1098 for(
int sysno=sysno1; sysno<=sysno2; sysno+=1) {
1099 for(
int octno=octno1; octno<=octno2; octno++) {
1100 bool status = cabling.getOfflineIDfromReadoutID(ID, sysno,octno,ids[3],ids[4],ids[5]);
1101 ATH_MSG_VERBOSE( (OnOff==0 ?
"Mask" :
"Fire") <<
" : offlineID=" << ID
1102 <<
" subdetectorID=" << sysno <<
" rodId=" << octno <<
" sswID=" << ids[3]
1103 <<
" SBLoc=" << ids[4] <<
" channelId=" << ids[5] );
1105 ATH_MSG_WARNING(
"This readoutID is not valid and cannot be converted to offline ID " );
1106 ATH_MSG_WARNING(
"subdetectorID=" << sysno <<
" rodId=" << octno <<
" sswID=" << ids[3]
1107 <<
" SBLoc=" << ids[4] <<
" channelId=" << ids[5] );
1109 m_MaskedChannel.insert(std::map<Identifier, int>::value_type(ID, OnOff));
1110 if (OnOff==0) nmasked+=1;
1111 else if (OnOff==1) nfired+=1;
1116 }
else if (id_type==3 && ids.size()==2) {
1118 ATH_MSG_DEBUG((OnOff==0 ?
"Mask" :
"Fire") <<
" : offlineID=" << ID);
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;
1124 ATH_MSG_INFO(
"Invalid input. Idtype or number of parameters are invalid: idtype=" << id_type
1125 <<
" number of elements = " << ids.size() );
1126 return StatusCode::FAILURE;
1130 ATH_MSG_INFO(
"Total number of masked channels ... " << nmasked);
1131 ATH_MSG_INFO(
"Total number of fired channels ... " << nfired);
1133 return StatusCode::SUCCESS;
1140 ATH_MSG_DEBUG(
"Retrieving Detector Mask from ByteStream metadata container");
1142 if (bsmdc.isValid() && !bsmdc->empty()) {
1144 uint64_t detMaskLeast = metadata->getDetectorMask();
1145 uint64_t detMaskMost = metadata->getDetectorMask2();
1147 std::vector<eformat::SubDetector> subDetOff;
1148 eformat::helper::DetectorMask(~detMaskLeast, ~detMaskMost).sub_detectors(subDetOff);
1149 auto sideA = std::find_if(subDetOff.begin(), subDetOff.end(), [](
const eformat::SubDetector &s) {
1150 return (s == eformat::MUON_MMEGA_ENDCAP_A_SIDE || s == eformat::MUON_STGC_ENDCAP_A_SIDE); });
1151 auto sideC = std::find_if(subDetOff.begin(), subDetOff.end(), [](
const eformat::SubDetector &s) {
1152 return (s == eformat::MUON_MMEGA_ENDCAP_C_SIDE || s == eformat::MUON_STGC_ENDCAP_C_SIDE); });
1154 if (sideA != std::end(subDetOff))
tgcArgs()->set_NSWSideInfo(
m_NSWSideInfo.value().erase(0,1));
1155 else if (sideC != std::end(subDetOff))
tgcArgs()->set_NSWSideInfo(
m_NSWSideInfo.value().erase(1,1));
1156 else if (sideA != std::end(subDetOff) && sideC != std::end(subDetOff))
tgcArgs()->set_NSWSideInfo(
"");
1158 return StatusCode::SUCCESS;
1164 if (
str.empty())
return;
1165 std::string line=
str;
1167 if (line.empty())
break;
1168 int i = line.find(
' ');
1169 if (i==(
int)std::string::npos && !line.empty()) {
1170 v.push_back(atoi(line.c_str()));
1173 std::string temp = line;
1174 temp.erase(i,line.size());
1175 v.push_back(atoi(temp.c_str()));
1185 return (dR >=0 ? 1 : -1 );
1212 std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>& tgcrdo)
1215 std::pair<int, int> subDetectorRod(rawdata->subDetectorId(), rawdata->rodId());
1216 std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>
::iterator itRdo = tgcrdo.find(subDetectorRod);
1218 if (itRdo==tgcrdo.end()) {
1221 auto thisRdo = std::make_unique<TgcRdo>(rawdata->subDetectorId(), rawdata->rodId(), rawdata->bcId(), rawdata->l1Id());
1222 thisRdo->push_back(std::move(rawdata));
1223 tgcrdo.insert(std::map<std::pair<int, int>, std::unique_ptr<TgcRdo>>::value_type(subDetectorRod, std::move(thisRdo)));
1225 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)
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())