7#include "GaudiKernel/StatusCode.h"
29 const std::string& filenameInPP,
30 const std::string& filenamePPToSL,
31 const std::string& filenameSLBToROD)
56 for (
auto& p : m_slbModuleIdMap) {
88 std::scoped_lock lock (
m_mutex);
90 int indexFromReadoutWithoutChannel
92 std::map<int, TGCModuleId*>::iterator it
93 = m_slbModuleIdMap.find(indexFromReadoutWithoutChannel);
94 if(it!=m_slbModuleIdMap.end()) {
101 int readoutSector = rodId -1 ;
107 m_slbModuleIdMap.insert(std::pair<int, TGCModuleId*>(indexFromReadoutWithoutChannel, 0));
113 const int sswMapsize = sswMap->
size();
114 for(
int i=0; i<sswMapsize; i++){
115 if((sswMap->
moduleId(i))->getId()==sswId){
123 m_slbModuleIdMap.insert(std::pair<int, TGCModuleId*>(indexFromReadoutWithoutChannel, 0));
132 m_slbModuleIdMap.insert(std::pair<int, TGCModuleId*>(indexFromReadoutWithoutChannel, 0));
138 const int slbMapsize = slbMap->
size();
139 for(
int i=0; i<slbMapsize; i++){
150 m_slbModuleIdMap.insert(std::pair<int, TGCModuleId*>(indexFromReadoutWithoutChannel, 0));
154 m_slbModuleIdMap.
insert(std::pair<int, TGCModuleId*>(indexFromReadoutWithoutChannel, slb));
167 int readoutSector = rodId -1 ;
172 if(!sswMap)
return rxId;
176 const int sswMapsize = sswMap->
size();
177 for(
int i=0; i<sswMapsize; i++){
178 if((sswMap->
moduleId(i))->getId()==sswId){
185 if(!found || !ssw)
return rxId;
191 if(!slbMap)
return rxId;
195 const int slbMapsize = slbMap->
size();
196 for(
int i=0; i<slbMapsize; i++){
217 int readoutSector = rodId -1 ;
222 if(!sswMap)
return nullptr;
226 const int size = sswMap->
size();
227 for(
int i=0; i<size; i++){
228 if((sswMap->
moduleId(i))->getId()==sswId){
235 if(!found || !ssw)
return nullptr;
241 if(!slbMap)
return nullptr;
244 int ip = slbMap->
find(rxId);
245 if(ip <0 || ip >= slbMap->
size()){
246 delete slbMap; slbMap =
nullptr;
252 if(!slb)
return nullptr;
271 if(!slb)
return false;
278 if(!sswMap)
return false;
283 if(!ssw)
return false;
287 sswId = ssw->
getId();
297 delete ssw; ssw =
nullptr;
303 const int size = slbMap->
size();
304 for(
int i=0; i<size; i++){
334 if(!rodMap)
return false;
339 if(!rod)
return false;
342 rodId = rod->getId();
362 bool orChannel)
const
371 int readoutSector = (rodId -1);
372 int sector = sectorInReadout;
395 if(!hpbin.
isValid())
return false;
398 if(!slbout)
return 0;
406 if(!slbin)
return false;
411 if(!slb)
return false;
435 int & sectorInReadout,
443 sectorInReadout = -1;
471 hpbId = hpbin->
getId();
491 bool orChannel = flag;
509 if(!slbin)
return false;
541 if(!slbin.
isValid())
return false;
544 if(!slbout)
return false;
560 bool orChannel)
const {
565 if(!slb)
return nullptr;
573 if(!slbin.
isValid())
return nullptr;
586 bool orChannel)
const {
598 if(!slbin)
return false;
603 if(!slb)
return false;
618 bool orChannel)
const {
619 switch(channelId->getChannelIdType()){
625 if(!asdout)
return nullptr;
632 if(!ppin)
return nullptr;
639 if(!ppout)
return nullptr;
656 if(!ppin)
return nullptr;
663 if(!ppout)
return nullptr;
677 return m_cableInPP->getChannel(channelId,orChannel);
681 return m_cableInPP->getChannel(channelId,orChannel);
690 if(!slbout)
return nullptr;
703 if(!ppout)
return nullptr;
710 if(!ppin)
return nullptr;
721 if(!ppout)
return nullptr;
728 if(!ppin)
return nullptr;
735 if(!asdout)
return nullptr;
755 if(!slbout)
return nullptr;
817 const int sbLoc)
const {
bool getReadoutFromLowPtCoincidence(TGCId::SideType side, int rodId, int sswId, int sbLoc, int &channel, int block, int pos, bool middle=false) const
bool getLowPtCoincidenceFromReadout(TGCId::SideType side, int rodId, int sswId, int sbLoc, int channel, int &block, int &pos, bool middle=false) const
TGCCableSLBToHPB * m_cableSLBToHPB
bool getReadoutFromASDOut(const TGCChannelASDOut *asdout, TGCId::SideType &side, int &rodId, int &sswId, int &sbLoc, int &channel, bool orChannel=false) const
int getRxIdFromReadout(TGCId::SideType side, int rodId, int sswId, int sbLoc) const
bool getHighPtIDFromReadout(TGCId::SideType side, int rodId, int sswId, int sbLoc, int channel, TGCId::SignalType &signal, TGCId::RegionType ®ion, int §orInReadout, int &hpbId, int &block, int &hitId, int &pos) const
TGCCablePPToSLB * m_cablePPToSLB
TGCModuleMap * getModule(const TGCModuleId *moduleId, TGCModuleId::ModuleIdType type) const
TGCCableHPBToSL * m_cableHPBToSL
TGCCableSSWToROD * m_cableSSWToROD
TGCChannelId * getASDOutFromReadout(TGCId::SideType side, int rodId, int sswId, int sbLoc, int channel, bool orChannel=false) const
TGCChannelId * getChannel(const TGCChannelId *channelId, TGCChannelId::ChannelIdType type, bool orChannel=false) const
TGCCableInASD * m_cableInASD
TGCCableSLBToSSW * m_cableSLBToSSW
int getIndexFromReadoutWithoutChannel(const TGCId::SideType side, const int rodId, const int sswId, const int sbLoc) const
TGCCableInPP * m_cableInPP
virtual TGCChannelId * getASDOutChannel(const TGCChannelId *slb_in) const
TGCCableASDToPP * m_cableASDToPP
virtual ~TGCCabling(void)
bool getReadoutFromSLB(const TGCModuleSLB *slb, TGCId::SideType &side, int &rodId, int &sswId, int &sbLoc) const
TGCCableInSLB * m_cableInSLB
bool getReadoutFromHighPtID(TGCId::SideType side, int rodId, int &sswId, int &sbLoc, int &channel, TGCId::SignalType signal, TGCId::RegionType region, int sectorInReadout, int hpbId, int block, int hitId, int pos, TGCId::ModuleType moduleType, bool orChannel) const
const TGCModuleId * getSLBFromReadout(TGCId::SideType side, int rodId, int sswId, int sbLoc) const
TGCModuleId * getSLBFromRxId(TGCId::SideType side, int rodId, int sswId, int rxId) const
StatusCode updateCableASDToPP()
virtual bool isValid(void) const
virtual bool isValid() const
virtual TGCModuleId * getModule(void) const
virtual bool isValid(void) const
ModuleType getModuleType(void) const
static constexpr int NUM_ENDCAP_SECTOR
RegionType getRegionType(void) const
SignalType getSignalType(void) const
static constexpr int N_RODS
virtual int getSector() const
int getSectorInReadout(void) const
SideType getSideType(void) const
static constexpr int NUM_FORWARD_SECTOR
ModuleIdType getModuleIdType(void) const
void insert(int connector, TGCModuleId *moduleId)
TGCModuleId * moduleId(int entry)
TGCModuleId * popModuleId(int entry)