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

#include <TGCCabling.h>

Inheritance diagram for MuonTGC_Cabling::TGCCabling:

Classes

struct  Config

Public Types

enum  MAXMINREADOUTIDS {
  MAXRODID = 12 , MINRODID = 1 , MAXSRODID = 3 , MINSRODID = 1 ,
  MAXSSWID = 9 , MINSSWID = 0 , MAXSBLOC = 31 , MINSBLOC = 0 ,
  MINCHANNELID = 40 , MAXCHANNELID = 199
}

Public Member Functions

 TGCCabling (const TGCCabling &)=delete
TGCCablingoperator= (const TGCCabling &)=delete
 TGCCabling (const Config &cfg)
virtual ~TGCCabling ()
std::unique_ptr< TGCChannelIdgetASDOutChannel (const TGCChannelId &slb_in) const
const TGCModuleIdgetSLBFromReadout (TGCId::SideType side, int rodId, int sswId, int sbLoc) const
std::unique_ptr< TGCModuleIdgetSLBFromRxId (TGCId::SideType side, int rodId, int sswId, int rxId) const
bool getReadoutFromSLB (const TGCModuleSLB &slb, TGCId::SideType &side, int &rodId, int &sswId, int &sbLoc) const
std::unique_ptr< TGCChannelIdgetASDOutFromReadout (TGCId::SideType side, int rodId, int sswId, int sbLoc, int channel, bool orChannel=false) const
bool getReadoutFromASDOut (const TGCChannelASDOut &asdout, TGCId::SideType &side, int &rodId, int &sswId, int &sbLoc, int &channel, bool orChannel=false) const
bool getHighPtIDFromReadout (TGCId::SideType side, int rodId, int sswId, int sbLoc, int channel, TGCId::SignalType &signal, TGCId::RegionType &region, int &sectorInReadout, int &hpbId, int &block, int &hitId, int &pos) const
bool getReadoutFromHighPtID (TGCId::SideType side, int rodId, int &sswId, int &sbLoc, int &channel, TGCId::SignalType signal, TGCId::RegionType region, int sectorInReadout, int hpbId, int block, int hitId, int pos, TGCId::ModuleType moduleType, bool orChannel) const
bool getReadoutFromLowPtCoincidence (TGCId::SideType side, int rodId, int sswId, int sbLoc, int &channel, int block, int pos, bool middle=false) const
std::unique_ptr< TGCChannelIdgetChannel (const TGCChannelId &channelId, TGCChannelId::ChannelIdType type, bool orChannel=false) const
TGCModuleMap getModule (const TGCModuleId &moduleId, TGCModuleId::ModuleIdType type) const

Private Member Functions

int getIndexFromReadoutWithoutChannel (const TGCId::SideType side, const int rodId, const int sswId, const int sbLoc) const

Private Attributes

std::unique_ptr< TGCCableInASDm_cableInASD {}
std::unique_ptr< TGCCableASDToPPm_cableASDToPP {}
std::unique_ptr< TGCCableInPPm_cableInPP {}
std::unique_ptr< TGCCablePPToSLBm_cablePPToSLB {}
std::unique_ptr< TGCCableInSLBm_cableInSLB {}
std::unique_ptr< TGCCableSLBToHPBm_cableSLBToHPB {}
std::unique_ptr< TGCCableHPBToSLm_cableHPBToSL {}
std::unique_ptr< TGCCableSLBToSSWm_cableSLBToSSW {}
std::unique_ptr< TGCCableSSWToRODm_cableSSWToROD {}
std::map< int, std::unique_ptr< TGCModuleId > > m_slbModuleIdMap ATLAS_THREAD_SAFE
std::mutex m_mutex

Detailed Description

Definition at line 32 of file TGCCabling.h.

Member Enumeration Documentation

◆ MAXMINREADOUTIDS

Enumerator
MAXRODID 
MINRODID 
MAXSRODID 
MINSRODID 
MAXSSWID 
MINSSWID 
MAXSBLOC 
MINSBLOC 
MINCHANNELID 
MAXCHANNELID 

Definition at line 51 of file TGCCabling.h.

Constructor & Destructor Documentation

◆ TGCCabling() [1/2]

MuonTGC_Cabling::TGCCabling::TGCCabling ( const TGCCabling & )
delete

◆ TGCCabling() [2/2]

MuonTGC_Cabling::TGCCabling::TGCCabling ( const Config & cfg)

Definition at line 26 of file TGCCabling.cxx.

27 : m_cableInASD{std::make_unique<TGCCableInASD>(cfg.fileNameASDtoPP)},
28 m_cableASDToPP{std::make_unique<TGCCableASDToPP>(
29 cfg.fileNameASDtoPP, cfg.fileNameASDtoPPdiff)},
30 m_cableInPP{std::make_unique<TGCCableInPP>(cfg.fileNameInPP)},
31 m_cablePPToSLB{std::make_unique<TGCCablePPToSLB>(cfg.fileNamePPtoSL)},
32 m_cableInSLB{std::make_unique<TGCCableInSLB>()},
33 m_cableSLBToHPB{std::make_unique<TGCCableSLBToHPB>(cfg.fileNamePPtoSL)},
34 m_cableHPBToSL{std::make_unique<TGCCableHPBToSL>(cfg.fileNamePPtoSL)},
35 m_cableSLBToSSW{std::make_unique<TGCCableSLBToSSW>(cfg.fileNameSLBtoROD)},
37 std::make_unique<TGCCableSSWToROD>(cfg.fileNameSLBtoROD)} {}
std::unique_ptr< TGCCableInPP > m_cableInPP
Definition TGCCabling.h:126
std::unique_ptr< TGCCableSSWToROD > m_cableSSWToROD
Definition TGCCabling.h:132
std::unique_ptr< TGCCablePPToSLB > m_cablePPToSLB
Definition TGCCabling.h:127
std::unique_ptr< TGCCableSLBToSSW > m_cableSLBToSSW
Definition TGCCabling.h:131
std::unique_ptr< TGCCableSLBToHPB > m_cableSLBToHPB
Definition TGCCabling.h:129
std::unique_ptr< TGCCableInSLB > m_cableInSLB
Definition TGCCabling.h:128
std::unique_ptr< TGCCableInASD > m_cableInASD
Definition TGCCabling.h:124
std::unique_ptr< TGCCableHPBToSL > m_cableHPBToSL
Definition TGCCabling.h:130
std::unique_ptr< TGCCableASDToPP > m_cableASDToPP
Definition TGCCabling.h:125

◆ ~TGCCabling()

MuonTGC_Cabling::TGCCabling::~TGCCabling ( )
virtualdefault

Member Function Documentation

◆ getASDOutChannel()

std::unique_ptr< TGCChannelId > MuonTGC_Cabling::TGCCabling::getASDOutChannel ( const TGCChannelId & slb_in) const

Definition at line 41 of file TGCCabling.cxx.

42 {
43 TGCChannelSLBIn slb_in(in.getSideType(), in.getModuleType(),
44 in.getRegionType(), in.getSector(), in.getId(),
45 in.getChannel());
47}
std::unique_ptr< TGCChannelId > getChannel(const TGCChannelId &channelId, TGCChannelId::ChannelIdType type, bool orChannel=false) const

◆ getASDOutFromReadout()

std::unique_ptr< TGCChannelId > MuonTGC_Cabling::TGCCabling::getASDOutFromReadout ( TGCId::SideType side,
int rodId,
int sswId,
int sbLoc,
int channel,
bool orChannel = false ) const

Definition at line 354 of file TGCCabling.cxx.

356 {
357 const TGCModuleId* slb = getSLBFromReadout(side, rodId, sswId, sbLoc);
358 if (!slb) {
359 return nullptr;
360 }
361
362 TGCChannelSLBIn slbin(slb->getSideType(), slb->getModuleType(),
363 slb->getRegionType(), slb->getSector(), slb->getId(),
364 channel);
365 if (!slbin.isValid()) {
366 return nullptr;
367 }
368
369 return getChannel(slbin, TGCChannelId::ChannelIdType::ASDOut, orChannel);
370}
const TGCModuleId * getSLBFromReadout(TGCId::SideType side, int rodId, int sswId, int sbLoc) const

◆ getChannel()

std::unique_ptr< TGCChannelId > MuonTGC_Cabling::TGCCabling::getChannel ( const TGCChannelId & channelId,
TGCChannelId::ChannelIdType type,
bool orChannel = false ) const

Definition at line 403 of file TGCCabling.cxx.

405 {
406 switch (channelId.getChannelIdType()) {
409 return m_cableInASD->getChannel(channelId, orChannel);
410 }
412 std::unique_ptr<TGCChannelId> asdout =
413 m_cableInASD->getChannel(channelId, false);
414 if (!asdout || !asdout->isValid()) {
415
416 return nullptr;
417 }
418 std::unique_ptr<TGCChannelId> ppin =
419 m_cableASDToPP->getChannel(*asdout, false);
420 if (!ppin || !ppin->isValid()) {
421 return nullptr;
422 }
423 std::unique_ptr<TGCChannelId> ppout =
424 m_cableInPP->getChannel(*ppin, orChannel);
425 if (!ppout || !ppout->isValid()) {
426
427 return nullptr;
428 }
429 return m_cablePPToSLB->getChannel(*ppout, false);
430 }
431 break;
434 return m_cableInASD->getChannel(channelId, orChannel);
435 }
437 return m_cableASDToPP->getChannel(channelId, orChannel);
438 }
440 std::unique_ptr<TGCChannelId> ppin =
441 m_cableASDToPP->getChannel(channelId, false);
442 if (!ppin || !ppin->isValid()) {
443
444 return nullptr;
445 }
446 std::unique_ptr<TGCChannelId> ppout =
447 m_cableInPP->getChannel(*ppin, orChannel);
448 if (!ppout || !ppout->isValid()) {
449
450 return nullptr;
451 }
452 return m_cablePPToSLB->getChannel(*ppout, false);
453 }
454 break;
457 return m_cableASDToPP->getChannel(channelId, orChannel);
458 }
460 return m_cableInPP->getChannel(channelId, orChannel);
461 }
462 break;
465 return m_cableInPP->getChannel(channelId, orChannel);
466 }
468 return m_cablePPToSLB->getChannel(channelId, orChannel);
469 }
470 break;
473 return m_cableInSLB->getChannel(channelId, orChannel);
474 }
476 std::unique_ptr<TGCChannelId> slbout =
477 m_cableInSLB->getChannel(channelId, orChannel);
478 if (!slbout || !slbout->isValid()) {
479
480 return nullptr;
481 }
482 return m_cableSLBToHPB->getChannel(*slbout, false);
483 }
485 return m_cablePPToSLB->getChannel(channelId, orChannel);
486 }
488 std::unique_ptr<TGCChannelId> ppout =
489 m_cablePPToSLB->getChannel(channelId, false);
490 if (!ppout || !ppout->isValid()) {
491
492 return nullptr;
493 }
494 std::unique_ptr<TGCChannelId> ppin =
495 m_cableInPP->getChannel(*ppout, orChannel);
496 if (!ppin || !ppin->isValid()) {
497 return nullptr;
498 }
499 return m_cableASDToPP->getChannel(*ppin, false);
500 }
502 std::unique_ptr<TGCChannelId> ppout =
503 m_cablePPToSLB->getChannel(channelId, false);
504 if (!ppout || !ppout->isValid()) {
505 return nullptr;
506 }
507 std::unique_ptr<TGCChannelId> ppin =
508 m_cableInPP->getChannel(*ppout, orChannel);
509 if (!ppin || !ppin->isValid()) {
510 return nullptr;
511 }
512 std::unique_ptr<TGCChannelId> asdout =
513 m_cableASDToPP->getChannel(*ppin, false);
514 if (!asdout || !asdout->isValid()) {
515 return nullptr;
516 }
517 return m_cableInASD->getChannel(*asdout, false);
518 }
519 break;
522 return m_cableInSLB->getChannel(channelId, orChannel);
523 }
525 return m_cableSLBToHPB->getChannel(channelId, orChannel);
526 }
527 break;
530 std::unique_ptr<TGCChannelId> slbout =
531 m_cableSLBToHPB->getChannel(channelId, false);
532 if (!slbout || !slbout->isValid()) {
533 return nullptr;
534 }
535 return m_cableInSLB->getChannel(*slbout, orChannel);
536 }
538 return m_cableSLBToHPB->getChannel(channelId, orChannel);
539 }
540 break;
541 default:
542 break;
543 }
544 return nullptr;
545}

◆ getHighPtIDFromReadout()

bool MuonTGC_Cabling::TGCCabling::getHighPtIDFromReadout ( TGCId::SideType side,
int rodId,
int sswId,
int sbLoc,
int channel,
TGCId::SignalType & signal,
TGCId::RegionType & region,
int & sectorInReadout,
int & hpbId,
int & block,
int & hitId,
int & pos ) const

Definition at line 288 of file TGCCabling.cxx.

291 {
293 region = TGCId::NoRegionType;
294 sectorInReadout = -1;
295 hpbId = -1;
296 block = -1;
297 hitId = -1;
298 pos = -1;
299
300 const TGCModuleId* slb = getSLBFromReadout(side, rodId, sswId, sbLoc);
301 if (!slb) {
302 return 0;
303 }
304
305 TGCChannelSLBIn slbin(slb->getSideType(), slb->getModuleType(),
306 slb->getRegionType(), slb->getSector(), slb->getId(),
307 channel);
308
309 std::unique_ptr<TGCChannelId> hpbin =
311 if (!hpbin || !hpbin->isValid()) {
312 return false;
313 }
314 signal = hpbin->getSignalType();
315 region = hpbin->getRegionType();
316 sectorInReadout = hpbin->getSectorInReadout();
317 hpbId = hpbin->getId();
318 block = hpbin->getBlock();
319 pos = hpbin->getChannel() % 2;
320 hitId = (hpbin->getChannel() - pos) / 2;
321
322 return true;
323}

◆ getIndexFromReadoutWithoutChannel()

int MuonTGC_Cabling::TGCCabling::getIndexFromReadoutWithoutChannel ( const TGCId::SideType side,
const int rodId,
const int sswId,
const int sbLoc ) const
private

Definition at line 598 of file TGCCabling.cxx.

601 {
602 return ((((side - TGCId::Aside) * (MAXRODID - MINRODID + 1) + rodId -
603 MINRODID) *
604 (MAXSSWID - MINSSWID + 1) +
605 sswId - MINSSWID) *
606 (MAXSBLOC - MINSBLOC + 1) +
607 sbLoc - MINSBLOC);
608}

◆ getModule()

TGCModuleMap MuonTGC_Cabling::TGCCabling::getModule ( const TGCModuleId & moduleId,
TGCModuleId::ModuleIdType type ) const

Definition at line 547 of file TGCCabling.cxx.

548 {
549 switch (moduleId.getModuleIdType()) {
550 case TGCModuleId::PP:
551 if (type == TGCModuleId::SLB) {
552 return m_cablePPToSLB->getModule(moduleId);
553 }
554 break;
555 case TGCModuleId::SLB:
556 if (type == TGCModuleId::PP) {
557 return m_cablePPToSLB->getModule(moduleId);
558 }
559 if (type == TGCModuleId::HPB) {
560 return m_cableSLBToHPB->getModule(moduleId);
561 }
562 if (type == TGCModuleId::SSW) {
563 return m_cableSLBToSSW->getModule(moduleId);
564 }
565 break;
566 case TGCModuleId::HPB:
567 if (type == TGCModuleId::SLB) {
568 return m_cableSLBToHPB->getModule(moduleId);
569 }
570 if (type == TGCModuleId::SL) {
571 return m_cableHPBToSL->getModule(moduleId);
572 }
573 break;
574 case TGCModuleId::SL:
575 if (type == TGCModuleId::HPB) {
576 return m_cableHPBToSL->getModule(moduleId);
577 }
578 break;
579 case TGCModuleId::SSW:
580 if (type == TGCModuleId::SLB) {
581 return m_cableSLBToSSW->getModule(moduleId);
582 }
583 if (type == TGCModuleId::ROD) {
584 return m_cableSSWToROD->getModule(moduleId);
585 }
586 break;
587 case TGCModuleId::ROD:
588 if (type == TGCModuleId::SSW) {
589 return m_cableSSWToROD->getModule(moduleId);
590 }
591 break;
592 default:
593 break;
594 }
595 return TGCModuleMap{};
596}

◆ getReadoutFromASDOut()

bool MuonTGC_Cabling::TGCCabling::getReadoutFromASDOut ( const TGCChannelASDOut & asdout,
TGCId::SideType & side,
int & rodId,
int & sswId,
int & sbLoc,
int & channel,
bool orChannel = false ) const

Definition at line 373 of file TGCCabling.cxx.

376 {
377 // initialize
379 rodId = -1;
380 sswId = -1;
381 sbLoc = -1;
382 channel = -1;
383
384 // SLBIn channel
385 std::unique_ptr<TGCChannelId> slbin{
387
388 if (!slbin) {
389 return false;
390 }
391 channel = slbin->getChannel();
392
393 auto slb = slbin->getModule();
394 if (!slb) {
395 return false;
396 }
397
398 // SLB Module -> readout ID
399 return getReadoutFromSLB(*static_cast<TGCModuleSLB*>(slb.get()), side,
400 rodId, sswId, sbLoc);
401}
bool getReadoutFromSLB(const TGCModuleSLB &slb, TGCId::SideType &side, int &rodId, int &sswId, int &sbLoc) const

◆ getReadoutFromHighPtID()

bool MuonTGC_Cabling::TGCCabling::getReadoutFromHighPtID ( TGCId::SideType side,
int rodId,
int & sswId,
int & sbLoc,
int & channel,
TGCId::SignalType signal,
TGCId::RegionType region,
int sectorInReadout,
int hpbId,
int block,
int hitId,
int pos,
TGCId::ModuleType moduleType,
bool orChannel ) const

Definition at line 221 of file TGCCabling.cxx.

225 {
226 // initialize
227 sswId = -1;
228 sbLoc = -1;
229 channel = -1;
230
231 // get sector number
232
233 int readoutSector = (rodId - 1);
234 int sector = sectorInReadout;
235 if (rodId < 13) {
236 if (region == TGCId::Forward) {
237 sector +=
238 readoutSector * (TGCId::NUM_FORWARD_SECTOR / TGCId::N_RODS);
239 } else {
240 sector +=
241 readoutSector * (TGCId::NUM_ENDCAP_SECTOR / TGCId::N_RODS);
242 }
243 } else if (rodId < 20) {
244 readoutSector -= 16;
245 if (region == TGCId::Forward) {
246 sector += readoutSector * (TGCId::NUM_FORWARD_SECTOR /
248 } else {
249 sector += readoutSector * (TGCId::NUM_ENDCAP_SECTOR /
251 }
252 }
253
254 TGCChannelHPBIn hpbin(side, signal, region, sector, hpbId, block,
255 hitId * 2 + pos);
256 if (!hpbin.isValid()) {
257 return false;
258 }
259
260 std::unique_ptr<TGCChannelId> slbout =
261 m_cableSLBToHPB->getChannelInforHPB(hpbin, moduleType, false);
262 if (!slbout || !slbout->isValid()) {
263 return 0;
264 }
265 std::unique_ptr<TGCChannelId> slbin =
266 m_cableInSLB->getChannel(*slbout, orChannel);
267
268 if (!slbin) {
269 return false;
270 }
271 channel = slbin->getChannel();
272
273 auto slb = slbin->getModule();
274 if (!slb) {
275 return false;
276 }
277
278 // SLB Module -> readout ID
279 TGCId::SideType sideType;
280 int rodid; // dummy
281 bool status = getReadoutFromSLB(*dynamic_cast<TGCModuleSLB*>(slb.get()),
282 sideType, rodid, sswId, sbLoc);
283
284 return status;
285}
static constexpr int NUM_ENDCAP_SECTOR
Definition TGCId.h:41
static constexpr int N_RODS
Definition TGCId.h:44
static constexpr int NUM_FORWARD_SECTOR
Definition TGCId.h:42
status
Definition merge.py:16

◆ getReadoutFromLowPtCoincidence()

bool MuonTGC_Cabling::TGCCabling::getReadoutFromLowPtCoincidence ( TGCId::SideType side,
int rodId,
int sswId,
int sbLoc,
int & channel,
int block,
int pos,
bool middle = false ) const

Definition at line 326 of file TGCCabling.cxx.

329 {
330 bool orChannel = flag;
331
332 const TGCModuleId* slb = getSLBFromReadout(side, rodId, sswId, sbLoc);
333 if (!slb) {
334 return 0;
335 }
336
337 TGCChannelSLBOut slbout(slb->getSideType(), slb->getModuleType(),
338 slb->getRegionType(), slb->getSector(),
339 slb->getId(), block, pos);
340
341 std::unique_ptr<TGCChannelId> slbin =
343
344 if (!slbin) {
345 return false;
346 }
347
348 channel = slbin->getChannel();
349
350 return true;
351}
bool flag
Definition master.py:29

◆ getReadoutFromSLB()

bool MuonTGC_Cabling::TGCCabling::getReadoutFromSLB ( const TGCModuleSLB & slb,
TGCId::SideType & side,
int & rodId,
int & sswId,
int & sbLoc ) const

Definition at line 145 of file TGCCabling.cxx.

147 {
148 // initialize
150 rodId = -1;
151 sswId = -1;
152 sbLoc = -1;
153
154 // Fill side
155 side = slb.getSideType();
156
157 TGCModuleMap sswMap = getModule(slb, TGCModuleId::SSW);
158
159 if (sswMap.empty()) {
160 return false;
161 }
162
163 // SSW Module
164 std::unique_ptr<TGCModuleId>& ssw = sswMap.begin()->second;
165 if (!ssw) {
166 return false;
167 }
168
169 // Fill SSW ID
170 sswId = ssw->getId();
171
172 // Fill SBLoc
173 sbLoc = slb.getSBLoc();
174
175 if (sbLoc < 0) {
176 TGCModuleMap slbMap = getModule(*ssw, TGCModuleId::SLB);
177 if (slbMap.empty()) {
178 return false;
179 }
180
181 TGCModuleSLB* pSlb = nullptr;
182
183 for (auto& [id, module] : slbMap) {
184 pSlb = dynamic_cast<TGCModuleSLB*>(module.get());
185
186 if (pSlb && slb.getRegionType() == pSlb->getRegionType() &&
187 slb.getSector() == pSlb->getSector() &&
188 slb.getId() == pSlb->getId()) {
189 if (slb.getModuleType() == pSlb->getModuleType()) {
190 sbLoc = pSlb->getSBLoc();
191 break;
192 }
193 // SI is connected to the SLB corrsponding WI
194 if (slb.getModuleType() == TGCId::SI &&
195 pSlb->getModuleType() == TGCId::WI) {
196 sbLoc = pSlb->getSBLoc();
197
198 break;
199 }
200 }
201 }
202 if (sbLoc < 0) {
203 return false;
204 }
205 }
206
207 TGCModuleMap rodMap = getModule(*ssw, TGCModuleId::ROD);
208 if (rodMap.empty()) {
209 return false;
210 }
211
212 // ROD Module
213 std::unique_ptr<TGCModuleId>& rod = rodMap.begin()->second;
214
215 // Fill ROD ID
216 rodId = rod->getId();
217 return true;
218}
if(pathvar)
TGCModuleMap getModule(const TGCModuleId &moduleId, TGCModuleId::ModuleIdType type) const

◆ getSLBFromReadout()

const TGCModuleId * MuonTGC_Cabling::TGCCabling::getSLBFromReadout ( TGCId::SideType side,
int rodId,
int sswId,
int sbLoc ) const

Definition at line 50 of file TGCCabling.cxx.

52 {
53 std::scoped_lock lock(m_mutex);
54
55 int indexFromReadoutWithoutChannel =
56 getIndexFromReadoutWithoutChannel(side, rodId, sswId, sbLoc);
57 const auto it = m_slbModuleIdMap.find(indexFromReadoutWithoutChannel);
58 if (it != m_slbModuleIdMap.end()) {
59 // Already seen this ReadoutID without channel.
60 // Stored pointer is returned.
61 return it->second.get();
62 }
63
64 // ROD Module
65 int readoutSector = rodId - 1; // rodID = 1..12
66 TGCModuleROD rod(side, readoutSector);
67
68 // SSW Module
69 TGCModuleMap sswMap = getModule(rod, TGCModuleId::SSW);
70 if (sswMap.empty()) {
71 m_slbModuleIdMap.insert(
72 std::make_pair(indexFromReadoutWithoutChannel, nullptr));
73 return nullptr;
74 }
75
76 std::unique_ptr<TGCModuleId> ssw = sswMap.popModule(sswId);
77 if (!ssw) {
78 m_slbModuleIdMap.insert(
79 std::make_pair(indexFromReadoutWithoutChannel, nullptr));
80 return nullptr; // Do not need to delete ssw here.
81 // We can delete ssw but nothing will be done.
82 }
83
84 // SLB Module
85 TGCModuleMap slbMap = getModule(*ssw, TGCModuleId::SLB);
86
87 if (slbMap.empty()) {
88 m_slbModuleIdMap.insert(
89 std::make_pair(indexFromReadoutWithoutChannel, nullptr));
90 return nullptr;
91 }
92
93 std::unique_ptr<TGCModuleId> slb{};
94 for (auto& [id, module] : slbMap) {
95 const auto* SLB = dynamic_cast<TGCModuleSLB*>(module.get());
96 if (SLB && SLB->getSBLoc() == sbLoc) {
97 slb = std::move(module);
98 break;
99 }
100 }
101
102 if (!slb) {
103 m_slbModuleIdMap.insert(
104 std::make_pair(indexFromReadoutWithoutChannel, nullptr));
105 return nullptr; // Do not delete slb here.
106 }
107
108 return m_slbModuleIdMap
109 .insert(std::make_pair(indexFromReadoutWithoutChannel, std::move(slb)))
110 .first->second.get();
111}
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
int getIndexFromReadoutWithoutChannel(const TGCId::SideType side, const int rodId, const int sswId, const int sbLoc) const
bool first
Definition DeMoScan.py:534

◆ getSLBFromRxId()

std::unique_ptr< TGCModuleId > MuonTGC_Cabling::TGCCabling::getSLBFromRxId ( TGCId::SideType side,
int rodId,
int sswId,
int rxId ) const

Definition at line 114 of file TGCCabling.cxx.

116 {
117
118 // ROD Module
119 int readoutSector = rodId - 1; // rodID = 1..12
120 TGCModuleROD rod(side, readoutSector);
121
122 // SSW Module
123 TGCModuleMap sswMap = getModule(rod, TGCModuleId::SSW);
124 if (sswMap.empty()) {
125 return nullptr;
126 }
127
128 std::unique_ptr<TGCModuleId> ssw = sswMap.popModule(sswId);
129
130 if (!ssw) {
131 return nullptr; // Do not need to delete ssw here.
132 // We can delete ssw but nothing will be done.
133 }
134
135 // SLB Module
136 TGCModuleMap slbMap = getModule(*ssw, TGCModuleId::SLB);
137 if (slbMap.empty()) {
138 return nullptr;
139 }
140
141 return slbMap.popModule(rxId);
142}

◆ operator=()

TGCCabling & MuonTGC_Cabling::TGCCabling::operator= ( const TGCCabling & )
delete

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::map<int, std::unique_ptr<TGCModuleId> > m_slbModuleIdMap MuonTGC_Cabling::TGCCabling::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 136 of file TGCCabling.h.

◆ m_cableASDToPP

std::unique_ptr<TGCCableASDToPP> MuonTGC_Cabling::TGCCabling::m_cableASDToPP {}
private

Definition at line 125 of file TGCCabling.h.

125{};

◆ m_cableHPBToSL

std::unique_ptr<TGCCableHPBToSL> MuonTGC_Cabling::TGCCabling::m_cableHPBToSL {}
private

Definition at line 130 of file TGCCabling.h.

130{};

◆ m_cableInASD

std::unique_ptr<TGCCableInASD> MuonTGC_Cabling::TGCCabling::m_cableInASD {}
private

Definition at line 124 of file TGCCabling.h.

124{};

◆ m_cableInPP

std::unique_ptr<TGCCableInPP> MuonTGC_Cabling::TGCCabling::m_cableInPP {}
private

Definition at line 126 of file TGCCabling.h.

126{};

◆ m_cableInSLB

std::unique_ptr<TGCCableInSLB> MuonTGC_Cabling::TGCCabling::m_cableInSLB {}
private

Definition at line 128 of file TGCCabling.h.

128{};

◆ m_cablePPToSLB

std::unique_ptr<TGCCablePPToSLB> MuonTGC_Cabling::TGCCabling::m_cablePPToSLB {}
private

Definition at line 127 of file TGCCabling.h.

127{};

◆ m_cableSLBToHPB

std::unique_ptr<TGCCableSLBToHPB> MuonTGC_Cabling::TGCCabling::m_cableSLBToHPB {}
private

Definition at line 129 of file TGCCabling.h.

129{};

◆ m_cableSLBToSSW

std::unique_ptr<TGCCableSLBToSSW> MuonTGC_Cabling::TGCCabling::m_cableSLBToSSW {}
private

Definition at line 131 of file TGCCabling.h.

131{};

◆ m_cableSSWToROD

std::unique_ptr<TGCCableSSWToROD> MuonTGC_Cabling::TGCCabling::m_cableSSWToROD {}
private

Definition at line 132 of file TGCCabling.h.

132{};

◆ m_mutex

std::mutex MuonTGC_Cabling::TGCCabling::m_mutex
mutableprivate

Definition at line 137 of file TGCCabling.h.


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