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