19 m_database[TGCId::Endcap][TGCId::WT] = std::make_unique<TGCDatabasePPToSL>(filename,
"SB EWT");
20 m_database[TGCId::Endcap][TGCId::WD] = std::make_unique<TGCDatabasePPToSL>(filename,
"SB EWD");
21 m_database[TGCId::Endcap][TGCId::ST] = std::make_unique<TGCDatabasePPToSL>(filename,
"SB EST");
22 m_database[TGCId::Endcap][TGCId::SD] = std::make_unique<TGCDatabasePPToSL>(filename,
"SB ESD");
23 m_database[TGCId::Forward][TGCId::WT] = std::make_unique<TGCDatabasePPToSL>(filename,
"SB FWT");
24 m_database[TGCId::Forward][TGCId::WD] = std::make_unique<TGCDatabasePPToSL>(filename,
"SB FWD");
25 m_database[TGCId::Forward][TGCId::ST] = std::make_unique<TGCDatabasePPToSL>(filename,
"SB FST");
26 m_database[TGCId::Forward][TGCId::SD] = std::make_unique<TGCDatabasePPToSL>(filename,
"SB FSD");
29TGCCableSLBToHPB::~TGCCableSLBToHPB() =
default;
32 bool orChannel)
const {
53 bool orChannel)
const {
54 if(orChannel)
return nullptr;
55 if(hpbin->
isValid()==
false)
return nullptr;
60 if(!hpb)
return nullptr;
65 if(!mapId)
return nullptr;
81 int port = blockInHPB*slbInBlock+nSlb;
82 const int size = mapId->
size();
83 for(
int i=0;i<size;i++){
91 if(!slb)
return nullptr;
94 int nInSlb = hpbin->
getChannel()/(numOfBlock*2);
95 int blockInSlb = nInSlb/2;
96 int nInBlock = nInSlb%2;
97 int channel = (chInBlock/2)*nInBlock;
113 bool orChannel)
const
115 if(orChannel)
return nullptr;
116 if(hpbin->
isValid()==
false)
return nullptr;
124 if(!hpb)
return nullptr;
129 if(!mapId)
return nullptr;
160 port = blockInHPB*slbInBlock+nSlb;
161 size = mapId->
size();
162 for(
int i=0;i<size;i++){
168 blockInSlb = (hpbin->
getChannel() - nSlb*(numOfBlock*2))/2;
169 posInHpb = (hpbin->
getChannel() - (numOfBlock*2)*nSlb)%2;
170 channel = (chInBlock/2)*posInHpb;
177 port = blockInHPB*slbInBlock+nSlb;
178 size = mapId->
size();
179 for(
int i=0;i<size;i++){
185 blockInSlb = (hpbin->
getChannel() - nSlb*(numOfBlock*2))/2;
186 posInHpb = (hpbin->
getChannel() - (numOfBlock*2)*nSlb)%2;
187 channel = (chInBlock/2)*posInHpb;
192 if(blockInHPB==0 && hpbin->
getChannel()<numOfBlock) port=1;
194 size = mapId->
size();
195 for(
int i=0;i<size;i++){
201 blockInSlb = (hpbin->
getChannel())%numOfBlock;
202 if(blockInHPB == 1 && hpbin->
getChannel() >= numOfBlock) blockInSlb = blockInSlb + numOfBlock/2;
211 delete mapId; mapId =
nullptr;
212 if(!slb)
return nullptr;
217 int SLBID = slb->
getId();
218 if((chInBlock*blockInSlb+channel)>chInBlock*numOfBlock){
220 channel = channel%chInBlock;
222 }
else if( channel > chInBlock){
223 channel = channel%chInBlock;
241 bool orChannel)
const {
242 if(orChannel)
return nullptr;
243 if(slbout->
isValid()==
false)
return nullptr;
249 if(!slb)
return nullptr;
254 if(!mapId)
return nullptr;
260 if(!hpb)
return nullptr;
271 int block = port/slbInBlock;
272 int hitId = (port%slbInBlock)*2+slbout->
getBlock();
274 int channel = hitId*2 + pos;
289 if(hpb->
isValid()==
false)
return nullptr;
290 const int hpbId = hpb->
getId();
311 const int doubletMaxEntry = doubletP->
getMaxEntry();
312 for(
int i=0; i<doubletMaxEntry; i++){
316 int block = doubletP->
getEntry(i,2);
326 const int tripletMaxEntry = tripletP->
getMaxEntry();
327 for(
int i=0; i<tripletMaxEntry; i++){
331 int block = -tripletP->
getEntry(i,2);
347 if(hpb->
isValid()==
false)
return nullptr;
349 const int hpbId = hpb->
getId();
355 for(
int i=0; i<MaxEntry; i++){
368 block = -1*databaseP->
getEntry(i,2);
388 if(slb->
isValid()==
false)
return nullptr;
390 const int slbId = slb->
getId();
396 for(
int i=0; i<MaxEntry; i++){
397 if(databaseP->
getEntry(i,0)==slbId) {
399 int block = databaseP->
getEntry(i,2);
bool getModule(std::istream &s, RegSelModule &m)
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
TGCCableSLBToHPB(void)=delete
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)