117 {
118 if(ppin->isValid()==false) return nullptr;
119
120 const int ppinChannel = ppin->getChannel();
121 const int ppinBlock = ppin->getBlock();
122 const int ppinId = ppin->getId();
123
124 TGCDatabase* databaseP =
125 m_database[ppin->getRegionType()][ppin->getModuleType()].get();
126
127 TGCChannelPPOut* ppout = nullptr;
128 const int MaxEntry = databaseP->getMaxEntry();
129 for(
int i=0;
i<MaxEntry;
i++){
130 bool cond1 = (databaseP->getEntry(i,5)==ppinChannel)&&
131 (databaseP->getEntry(i,4)==ppinBlock)&&
132 (databaseP->getEntry(i,3)==ppinId);
133
134 bool cond2 = (databaseP->getEntrySize(i)==9)&&
135 (databaseP->getEntry(i,8)==ppinChannel)&&
136 (databaseP->getEntry(i,7)==ppinBlock)&&
137 (databaseP->getEntry(i,6)==ppinId);
138
139 if(cond1 || cond2) {
140 int id = databaseP->getEntry(i,0);
141 int block = databaseP->getEntry(i,1);
142 int channel = databaseP->getEntry(i,2);
143
144
145 int channelInSLB = -1;
148 if(block==0||block==2){
153 if(channel<lengthOfD){
156
158 if(channelInSLB<adjacentOfD||channelInSLB>=lengthOfD-adjacentOfD)
160 } else {
163
164 channelInSLB =
channel-lengthOfD;
165 if(channelInSLB<adjacentOfC||channelInSLB>=lengthOfC-adjacentOfC)
167 }
168 }
169 if(block==1||block==3){
174 if(channel<lengthOfB){
177
179 if(channelInSLB<adjacentOfB||channelInSLB>=lengthOfB-adjacentOfB)
181 } else {
184
185 channelInSLB =
channel-lengthOfB;
186 if(channelInSLB<adjacentOfA||channelInSLB>=lengthOfA-adjacentOfA)
188 }
189 }
190
193
195 }
196
197 if(adjacent==orChannel){
198 ppout = new TGCChannelPPOut(ppin->getSideType(),
199 ppin->getModuleType(),
200 ppin->getRegionType(),
201 ppin->getSector(),
202 id,
203 block,
204 channel);
205 break;
206 }
207 }
208 }
209
210 return ppout;
211}
static int getAdjacentOfSLB(TGCId::ModuleType moduleType, CellType cellType)
static int getLengthOfSLB(TGCId::ModuleType moduleType, CellType cellType)
bool adjacent(unsigned int strip1, unsigned int strip2)