ATLAS Offline Software
Loading...
Searching...
No Matches
MuonTGC_Cabling::TGCCableSLBToSSW Class Reference

#include <TGCCableSLBToSSW.h>

Inheritance diagram for MuonTGC_Cabling::TGCCableSLBToSSW:
Collaboration diagram for MuonTGC_Cabling::TGCCableSLBToSSW:

Public Types

enum  { SL = TGCId::MaxModuleType , MaxModuleType = TGCId::MaxModuleType + 1 }
enum  CableType {
  NoCableType =-1 , InASD , ASDToPP , InPP ,
  PPToSLB , InSLB , SLBToHPB , HPBToSL ,
  SLBToSSW , SSWToROD , MaxCableType
}

Public Member Functions

 TGCCableSLBToSSW (const std::string &filename)
virtual ~TGCCableSLBToSSW ()=default
virtual TGCModuleMapgetModule (const TGCModuleId *moduleId) const
CableType getCableType (void) const

Protected Member Functions

virtual TGCChannelIdgetChannelIn (const TGCChannelId *, bool) const
virtual TGCChannelIdgetChannelOut (const TGCChannelId *, bool) const

Private Member Functions

 TGCCableSLBToSSW ()=delete
virtual TGCModuleMapgetModuleIn (const TGCModuleId *ssw) const
virtual TGCModuleMapgetModuleOut (const TGCModuleId *slb) const

Private Attributes

std::array< std::array< std::unique_ptr< TGCDatabase >, MaxModuleType >, TGCId::MaxRegionTypem_database
CableType m_type

Detailed Description

Definition at line 18 of file TGCCableSLBToSSW.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

◆ CableType

Enumerator
NoCableType 
InASD 
ASDToPP 
InPP 
PPToSLB 
InSLB 
SLBToHPB 
HPBToSL 
SLBToSSW 
SSWToROD 
MaxCableType 

Definition at line 18 of file TGCCable.h.

Constructor & Destructor Documentation

◆ TGCCableSLBToSSW() [1/2]

MuonTGC_Cabling::TGCCableSLBToSSW::TGCCableSLBToSSW ( const std::string & filename)

Definition at line 13 of file TGCCableSLBToSSW.cxx.

15 m_database{{{nullptr}}}
16{
17 m_database[TGCId::Endcap][TGCId::WT] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB EWT");
18 m_database[TGCId::Endcap][TGCId::WD] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB EWD");
19 m_database[TGCId::Endcap][TGCId::ST] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB EST");
20 m_database[TGCId::Endcap][TGCId::SD] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB ESD");
21 m_database[TGCId::Endcap][TGCId::WI] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB EWI");
22 m_database[TGCId::Endcap][TGCId::SI] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB ESI");
23 m_database[TGCId::Endcap][SL] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB ESL");
24
25 m_database[TGCId::Forward][TGCId::WT] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB FWT");
26 m_database[TGCId::Forward][TGCId::WD] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB FWD");
27 m_database[TGCId::Forward][TGCId::ST] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB FST");
28 m_database[TGCId::Forward][TGCId::SD] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB FSD");
29 m_database[TGCId::Forward][TGCId::WI] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB FWI");
30 m_database[TGCId::Forward][TGCId::SI] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB FSI");
31 m_database[TGCId::Forward][SL] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB FSL");
32}
std::array< std::array< std::unique_ptr< TGCDatabase >, MaxModuleType >, TGCId::MaxRegionType > m_database
TGCCable(CableType type=NoCableType)
Definition TGCCable.h:24

◆ ~TGCCableSLBToSSW()

virtual MuonTGC_Cabling::TGCCableSLBToSSW::~TGCCableSLBToSSW ( )
virtualdefault

◆ TGCCableSLBToSSW() [2/2]

MuonTGC_Cabling::TGCCableSLBToSSW::TGCCableSLBToSSW ( )
privatedelete

Member Function Documentation

◆ getCableType()

CableType MuonTGC_Cabling::TGCCable::getCableType ( void ) const
inlineinherited

Definition at line 30 of file TGCCable.h.

30{ return m_type; }

◆ getChannelIn()

virtual TGCChannelId * MuonTGC_Cabling::TGCCable::getChannelIn ( const TGCChannelId * ,
bool  ) const
inlineprotectedvirtualinherited

◆ getChannelOut()

virtual TGCChannelId * MuonTGC_Cabling::TGCCable::getChannelOut ( const TGCChannelId * ,
bool  ) const
inlineprotectedvirtualinherited

◆ getModule()

TGCModuleMap * MuonTGC_Cabling::TGCCableSLBToSSW::getModule ( const TGCModuleId * moduleId) const
virtual

Definition at line 34 of file TGCCableSLBToSSW.cxx.

34 {
35 if(moduleId){
36 if(moduleId->getModuleIdType()==TGCModuleId::SLB)
37 return getModuleOut(moduleId);
38 if(moduleId->getModuleIdType()==TGCModuleId::SSW)
39 return getModuleIn(moduleId);
40 }
41 return nullptr;
42}
virtual TGCModuleMap * getModuleIn(const TGCModuleId *ssw) const
virtual TGCModuleMap * getModuleOut(const TGCModuleId *slb) const

◆ getModuleIn()

TGCModuleMap * MuonTGC_Cabling::TGCCableSLBToSSW::getModuleIn ( const TGCModuleId * ssw) const
privatevirtual

Reimplemented from MuonTGC_Cabling::TGCCable.

Definition at line 44 of file TGCCableSLBToSSW.cxx.

44 {
45 if(ssw->isValid()==false) return nullptr;
46
47 const int sswId = ssw->getId();
48
49 TGCDatabase* databaseP[TGCId::MaxRegionType * MaxModuleType];
52 for(int i=0; i<TGCId::MaxRegionType; i++){
53 for(int j=0; j< MaxModuleType; j++){
54 databaseP[i*MaxModuleType + j] = m_database[i][j].get();
55 region[i*MaxModuleType + j] = static_cast<TGCId::RegionType>(i);
56 module[i*MaxModuleType + j] = static_cast<TGCId::ModuleType>(j);
57 }
58 }
59
60 TGCModuleMap* mapId = nullptr;
61 for(int type=0; type<TGCId::MaxRegionType* MaxModuleType; type++){
62 const int MaxEntry = databaseP[type]->getMaxEntry();
63 for(int i=0; i<MaxEntry; i++){
64
65 if(databaseP[type]->getEntry(i,4) == sswId) {
66 int sector = databaseP[type]->getEntry(i,0);
67
68 // Inner
69 if(module[type]==TGCId::WI) {
70 // EI/FI
71 // wire(TGCId::WI) and strip(TGCId::SI) of a chamber
72 // use the same SLB chip
73
74 int sswSector = ssw->getReadoutSector();
75 // one ROD (rodId = 2,5,8,11) covers 6 Inner sectors
76 if(sswSector %3 != 1) continue;
77 sswSector -= 1;
78
79 sector += sswSector*2;
80 int id = databaseP[type]->getEntry(i,1);
81 int block = databaseP[type]->getEntry(i,5);
82 int sbLoc = databaseP[type]->getEntry(i,2);
83 int slbAddr = databaseP[type]->getEntry(i,3);
84 for(int ip= 0; ip<3 ; ip++){
85 int psector = sector + ip*2;
86 int pblock = block + ip*4;
87 int psbLoc = sbLoc + ip*4;
88 int pslbAddr = slbAddr + ip*2;
89 TGCModuleSLB* slb = new TGCModuleSLB(ssw->getSideType(),
90 module[type],
91 region[type],
92 psector,
93 id,
94 psbLoc,
95 pslbAddr);
96
97 if(mapId==nullptr) mapId = new TGCModuleMap();
98 mapId->insert(pblock,slb);
99 }
100
101 } else if(module[type]==TGCId::SI) {
102 // EI/FI
103 // wire(TGCId::WI) and strip(TGCId::SI) of a chamber
104 // use the same SLB chip
105
106 // do nothing
107
108 } else {
109 if(region[type]==TGCId::Endcap) {
110 sector += ssw->getReadoutSector() * (TGCId::NUM_ENDCAP_SECTOR/TGCId::N_RODS);
111 } else {
112 sector += ssw->getReadoutSector() * (TGCId::NUM_FORWARD_SECTOR/TGCId::N_RODS);
113 }
114 int id = databaseP[type]->getEntry(i,1);
115 int sbLoc = databaseP[type]->getEntry(i,2);
116 int slbAddr = databaseP[type]->getEntry(i,3);
117 int block = databaseP[type]->getEntry(i,5);
118 TGCModuleSLB* slb = new TGCModuleSLB(ssw->getSideType(),
119 module[type],
120 region[type],
121 sector,
122 id,
123 sbLoc,
124 slbAddr);
125
126 if(mapId==nullptr) mapId = new TGCModuleMap();
127 mapId->insert(block,slb);
128 }
129
130 }
131 }
132 }
133
134 return mapId;
135}
static constexpr int NUM_ENDCAP_SECTOR
Definition TGCId.h:40
static constexpr int N_RODS
Definition TGCId.h:43
static constexpr int NUM_FORWARD_SECTOR
Definition TGCId.h:41

◆ getModuleOut()

TGCModuleMap * MuonTGC_Cabling::TGCCableSLBToSSW::getModuleOut ( const TGCModuleId * slb) const
privatevirtual

Reimplemented from MuonTGC_Cabling::TGCCable.

Definition at line 138 of file TGCCableSLBToSSW.cxx.

138 {
139 if(slb->isValid()==false) return nullptr;
140
141 const int slbId = slb->getId();
142 const int sector = slb->getSectorInReadout();
143 int readoutSector = slb->getReadoutSector();
144
145 TGCModuleMap* mapId = nullptr;
146
147 TGCDatabase* databaseP =m_database[slb->getRegionType()][slb->getModuleType()].get();
148 const int MaxEntry = databaseP->getMaxEntry();
149 if(slb->getModuleType() == TGCId::WI ||
150 slb->getModuleType() == TGCId::SI) {
151 // inner
152 for(int i=0; i<MaxEntry; i++){
153 if(databaseP->getEntry(i,0)==sector &&
154 databaseP->getEntry(i,1)==slbId) {
155
156 int sswSectorRO = readoutSector - (readoutSector%3) + 1;
157 int id = databaseP->getEntry(i,4);
158 int block = databaseP->getEntry(i,5) + 4*(readoutSector%3);
159
160 TGCModuleSSW* ssw = new TGCModuleSSW(slb->getSideType(),
161 sswSectorRO,
162 id);
163 mapId = new TGCModuleMap();
164 mapId->insert(block,ssw);
165 break;
166 }
167 }
168
169 } else {
170 for(int i=0; i<MaxEntry; i++){
171 if(databaseP->getEntry(i,0)==sector&&
172 databaseP->getEntry(i,1)==slbId) {
173
174 int id = databaseP->getEntry(i,4);
175 int block = databaseP->getEntry(i,5);
176 TGCModuleSSW* ssw = new TGCModuleSSW(slb->getSideType(),
177 readoutSector,
178 id);
179 mapId = new TGCModuleMap();
180 mapId->insert(block,ssw);
181 break;
182 }
183 }
184
185 }
186 return mapId;
187}

Member Data Documentation

◆ m_database

std::array<std::array<std::unique_ptr<TGCDatabase>, MaxModuleType>, TGCId::MaxRegionType> MuonTGC_Cabling::TGCCableSLBToSSW::m_database
private

Definition at line 34 of file TGCCableSLBToSSW.h.

◆ m_type

CableType MuonTGC_Cabling::TGCCable::m_type
privateinherited

Definition at line 43 of file TGCCable.h.


The documentation for this class was generated from the following files: