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