28 bool orChannel)
const {
49 bool orChannel)
const {
50 if(orChannel)
return nullptr;
51 if(hpbin->
isValid()==
false)
return nullptr;
56 if(!hpb)
return nullptr;
61 if(!mapId)
return nullptr;
77 int port = blockInHPB*slbInBlock+nSlb;
78 const int size = mapId->
size();
79 for(
int i=0;i<size;i++){
87 if(!slb)
return nullptr;
90 int nInSlb = hpbin->
getChannel()/(numOfBlock*2);
91 int blockInSlb = nInSlb/2;
92 int nInBlock = nInSlb%2;
93 int channel = (chInBlock/2)*nInBlock;
109 bool orChannel)
const
111 if(orChannel)
return nullptr;
112 if(hpbin->
isValid()==
false)
return nullptr;
120 if(!hpb)
return nullptr;
125 if(!mapId)
return nullptr;
156 port = blockInHPB*slbInBlock+nSlb;
157 size = mapId->
size();
158 for(
int i=0;i<size;i++){
164 blockInSlb = (hpbin->
getChannel() - nSlb*(numOfBlock*2))/2;
165 posInHpb = (hpbin->
getChannel() - (numOfBlock*2)*nSlb)%2;
166 channel = (chInBlock/2)*posInHpb;
173 port = blockInHPB*slbInBlock+nSlb;
174 size = mapId->
size();
175 for(
int i=0;i<size;i++){
181 blockInSlb = (hpbin->
getChannel() - nSlb*(numOfBlock*2))/2;
182 posInHpb = (hpbin->
getChannel() - (numOfBlock*2)*nSlb)%2;
183 channel = (chInBlock/2)*posInHpb;
188 if(blockInHPB==0 && hpbin->
getChannel()<numOfBlock) port=1;
190 size = mapId->
size();
191 for(
int i=0;i<size;i++){
197 blockInSlb = (hpbin->
getChannel())%numOfBlock;
198 if(blockInHPB == 1 && hpbin->
getChannel() >= numOfBlock) blockInSlb = blockInSlb + numOfBlock/2;
207 delete mapId; mapId =
nullptr;
208 if(!slb)
return nullptr;
213 int SLBID = slb->
getId();
214 if((chInBlock*blockInSlb+channel)>chInBlock*numOfBlock){
216 channel = channel%chInBlock;
218 }
else if( channel > chInBlock){
219 channel = channel%chInBlock;
237 bool orChannel)
const {
238 if(orChannel)
return nullptr;
239 if(slbout->
isValid()==
false)
return nullptr;
245 if(!slb)
return nullptr;
250 if(!mapId)
return nullptr;
256 if(!hpb)
return nullptr;
267 int block = port/slbInBlock;
268 int hitId = (port%slbInBlock)*2+slbout->
getBlock();
270 int channel = hitId*2 + pos;
285 if(hpb->
isValid()==
false)
return nullptr;
286 const int hpbId = hpb->
getId();
307 const int doubletMaxEntry = doubletP->
getMaxEntry();
308 for(
int i=0; i<doubletMaxEntry; i++){
312 int block = doubletP->
getEntry(i,2);
322 const int tripletMaxEntry = tripletP->
getMaxEntry();
323 for(
int i=0; i<tripletMaxEntry; i++){
327 int block = -tripletP->
getEntry(i,2);
343 if(hpb->
isValid()==
false)
return nullptr;
345 const int hpbId = hpb->
getId();
351 for(
int i=0; i<MaxEntry; i++){
364 block = -1*databaseP->
getEntry(i,2);
384 if(slb->
isValid()==
false)
return nullptr;
386 const int slbId = slb->
getId();
392 for(
int i=0; i<MaxEntry; i++){
393 if(databaseP->
getEntry(i,0)==slbId) {
395 int block = databaseP->
getEntry(i,2);
virtual TGCModuleMap * getModuleOut(const TGCModuleId *slb) const
std::array< std::array< std::unique_ptr< TGCDatabase >, TGCId::MaxModuleType >, TGCId::MaxRegionType > m_database
virtual TGCChannelId * getChannel(const TGCChannelId *channelId, bool orChannel=false) const
virtual TGCChannelId * getChannelOut(const TGCChannelId *slbout, bool orChannel=false) const
virtual TGCModuleMap * getModuleInforHPB(const TGCModuleId *hpb, TGCId::ModuleType moduleType) const
virtual TGCModuleMap * getModuleIn(const TGCModuleId *hpb) const
virtual TGCChannelId * getChannelIn(const TGCChannelId *hpbin, bool orChannel=false) const
TGCChannelId * getChannelInforHPB(const TGCChannelId *hpbin, TGCId::ModuleType moduleType, bool orChannel=false) const
virtual TGCModuleMap * getModule(const TGCModuleId *moduleId) const
TGCCable(CableType type=NoCableType)
static int getSlbInBlock(void)
virtual bool isValid() const
virtual TGCModuleId * getModule(void) const
static int getNumberOfBlock(TGCId::ModuleType moduleType)
static int getChannelInBlock(TGCId::ModuleType moduleType)
virtual int getMaxEntry(void) const
virtual int getEntry(int entry, int column) const
ModuleType getModuleType(void) const
RegionType getRegionType(void) const
SignalType getSignalType(void) const
virtual int getSector() const
MultipletType getMultipletType(void) const
SideType getSideType(void) const
virtual bool isValid(void) const
ModuleIdType getModuleIdType(void) const
void insert(int connector, TGCModuleId *moduleId)
TGCModuleId * popModuleId(int entry)