33 const bool orChannel)
const {
44 const bool orChannel)
const {
45 if(ppout->
isValid()==
false)
return nullptr;
61 int id=-1, block=-1, channel=-1;
64 for(
int idatabaseP=0; idatabaseP<ndatabaseP; idatabaseP++) {
80 id = databaseP[idatabaseP]->
getEntry(i,3);
81 block = databaseP[idatabaseP]->
getEntry(i,4);
82 channel = databaseP[idatabaseP]->
getEntry(i,5);
83 if(
id==-1 && block==-1 && channel==-1)
continue;
88 if(databaseP[idatabaseP]->getEntrySize(i)==9) {
89 id = databaseP[idatabaseP]->
getEntry(i,6);
90 block = databaseP[idatabaseP]->
getEntry(i,7);
91 channel = databaseP[idatabaseP]->
getEntry(i,8);
97 if(!found)
return nullptr;
112 const bool orChannel)
const {
113 if(ppin->
isValid()==
false)
return nullptr;
116 const int ppinBlock = ppin->
getBlock();
117 const int ppinId = ppin->
getId();
124 for(
int i=0; i<MaxEntry; i++){
125 bool cond1 = (databaseP->
getEntry(i,5)==ppinChannel)&&
126 (databaseP->
getEntry(i,4)==ppinBlock)&&
130 (databaseP->
getEntry(i,8)==ppinChannel)&&
131 (databaseP->
getEntry(i,7)==ppinBlock)&&
136 int block = databaseP->
getEntry(i,1);
137 int channel = databaseP->
getEntry(i,2);
140 int channelInSLB = -1;
141 bool adjacent =
false;
143 if(block==0||block==2){
148 if(channel<lengthOfD){
152 channelInSLB = channel;
153 if(channelInSLB<adjacentOfD||channelInSLB>=lengthOfD-adjacentOfD)
159 channelInSLB = channel-lengthOfD;
160 if(channelInSLB<adjacentOfC||channelInSLB>=lengthOfC-adjacentOfC)
164 if(block==1||block==3){
169 if(channel<lengthOfB){
173 channelInSLB = channel;
174 if(channelInSLB<adjacentOfB||channelInSLB>=lengthOfB-adjacentOfB)
180 channelInSLB = channel-lengthOfB;
181 if(channelInSLB<adjacentOfA||channelInSLB>=lengthOfA-adjacentOfA)
192 if(adjacent==orChannel){
virtual TGCChannelId * getChannelOut(const TGCChannelId *ppin, const bool orChannel=false) const
std::array< std::array< std::unique_ptr< TGCDatabase >, TGCId::MaxModuleType >, TGCId::MaxRegionType > m_database
virtual TGCChannelId * getChannel(const TGCChannelId *channelId, const bool orChannel=false) const
virtual TGCChannelId * getChannelIn(const TGCChannelId *ppout, const bool orChannel=false) const
TGCCable(CableType type=NoCableType)
virtual bool isValid() const
static int getAdjacentOfSLB(TGCId::ModuleType moduleType, CellType cellType)
static int getLengthOfSLB(TGCId::ModuleType moduleType, CellType cellType)
virtual int getIndexDBIn(int *indexIn) const
virtual int getMaxEntry(void) const
virtual int getEntry(int entry, int column) const
virtual int getEntrySize(int entry) const
ModuleType getModuleType(void) const
RegionType getRegionType(void) const
virtual int getSector() const
SideType getSideType(void) const