146 {
147 if (slb.isValid() == false) {
148 return TGCModuleMap{};
149 }
150
151 const int slbId = slb.getId();
152 const int sector = slb.getSectorInReadout();
153 int readoutSector = slb.getReadoutSector();
154
155 TGCModuleMap mapId{};
156
157 TGCDatabase* databaseP =
158 m_database[slb.getRegionType()][slb.getModuleType()].get();
159 const int MaxEntry = databaseP->getMaxEntry();
161
162 for (
int i = 0;
i < MaxEntry;
i++) {
163 if (databaseP->getEntry(i, 0) == sector &&
164 databaseP->getEntry(i, 1) == slbId) {
165
166 int sswSectorRO = readoutSector - (readoutSector % 3) + 1;
167 int id = databaseP->getEntry(i, 4);
168 int block = databaseP->getEntry(i, 5) + 4 * (readoutSector % 3);
169
170 auto ssw = std::make_unique<TGCModuleSSW>(slb.getSideType(),
171 sswSectorRO, id);
172
173 mapId.insert(block, std::move(ssw));
174 break;
175 }
176 }
177
178 } else {
179 for (
int i = 0;
i < MaxEntry;
i++) {
180 if (databaseP->getEntry(i, 0) == sector &&
181 databaseP->getEntry(i, 1) == slbId) {
182
183 int id = databaseP->getEntry(i, 4);
184 int block = databaseP->getEntry(i, 5);
185 auto ssw = std::make_unique<TGCModuleSSW>(slb.getSideType(),
186 readoutSector, id);
187
188 mapId.insert(block, std::move(ssw));
189 break;
190 }
191 }
192 }
193 return mapId;
194}