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

#include <TGCCableHPBToSL.h>

Inheritance diagram for MuonTGC_Cabling::TGCCableHPBToSL:
Collaboration diagram for MuonTGC_Cabling::TGCCableHPBToSL:

Public Types

enum  CableType {
  NoCableType = -1 , InASD , ASDToPP , InPP ,
  PPToSLB , InSLB , SLBToHPB , HPBToSL ,
  SLBToSSW , SSWToROD , MaxCableType
}

Public Member Functions

 TGCCableHPBToSL (const std::string &filename)
virtual ~TGCCableHPBToSL ()
TGCModuleMap getModule (const TGCModuleId &moduleId) const
CableType getCableType () const

Private Member Functions

TGCModuleMap getModuleIn (const TGCModuleId &sl) const
TGCModuleMap getModuleOut (const TGCModuleId &hpt) const

Private Attributes

std::array< std::array< std::unique_ptr< TGCDatabase >, TGCId::MaxSignalType >, TGCId::MaxRegionTypem_database
CableType m_type {CableType::NoCableType}

Detailed Description

Definition at line 19 of file TGCCableHPBToSL.h.

Member Enumeration Documentation

◆ CableType

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

Definition at line 16 of file TGCCable.h.

Constructor & Destructor Documentation

◆ TGCCableHPBToSL()

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

Definition at line 13 of file TGCCableHPBToSL.cxx.

14 : TGCCable(TGCCable::HPBToSL), m_database{{{nullptr}}} {
16 std::make_unique<TGCDatabasePPToSL>(filename, "HPB EW");
18 std::make_unique<TGCDatabasePPToSL>(filename, "HPB ES");
20 std::make_unique<TGCDatabasePPToSL>(filename, "HPB FW");
22 std::make_unique<TGCDatabasePPToSL>(filename, "HPB FS");
23}
std::array< std::array< std::unique_ptr< TGCDatabase >, TGCId::MaxSignalType >, TGCId::MaxRegionType > m_database
TGCCable(CableType type=NoCableType)
Definition TGCCable.h:31

◆ ~TGCCableHPBToSL()

MuonTGC_Cabling::TGCCableHPBToSL::~TGCCableHPBToSL ( )
virtualdefault

Member Function Documentation

◆ getCableType()

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

Definition at line 34 of file TGCCable.h.

34{ return m_type; }

◆ getModule()

TGCModuleMap MuonTGC_Cabling::TGCCableHPBToSL::getModule ( const TGCModuleId & moduleId) const

Definition at line 27 of file TGCCableHPBToSL.cxx.

27 {
28 if (moduleId.getModuleIdType() == TGCModuleId::HPB) {
29 return getModuleOut(moduleId);
30 }
31 if (moduleId.getModuleIdType() == TGCModuleId::SL) {
32 return getModuleIn(moduleId);
33 }
34 return TGCModuleMap{};
35}
TGCModuleMap getModuleIn(const TGCModuleId &sl) const
TGCModuleMap getModuleOut(const TGCModuleId &hpt) const

◆ getModuleIn()

TGCModuleMap MuonTGC_Cabling::TGCCableHPBToSL::getModuleIn ( const TGCModuleId & sl) const
private

Definition at line 37 of file TGCCableHPBToSL.cxx.

37 {
38 if (sl.isValid() == false) {
39 return TGCModuleMap{};
40 }
41
42 TGCDatabase* wireP = m_database[sl.getRegionType()][TGCId::Wire].get();
43 TGCDatabase* stripP = m_database[sl.getRegionType()][TGCId::Strip].get();
44
45 TGCModuleMap mapId{};
46 const int wireMaxEntry = wireP->getMaxEntry();
47 for (int i = 0; i < wireMaxEntry; i++) {
48 int id = wireP->getEntry(i, 0);
49 int block = wireP->getEntry(i, 1);
50 auto hpb = std::make_unique<TGCModuleHPB>(sl.getSideType(), TGCId::Wire,
51 sl.getRegionType(),
52 sl.getSector(), id);
53 mapId.insert(block, std::move(hpb));
54 }
55
56 const int stripMaxEntry = stripP->getMaxEntry();
57 for (int i = 0; i < stripMaxEntry; i++) {
58 int id = stripP->getEntry(i, 0);
59 int block = stripP->getEntry(i, 1);
60 auto hpb = std::make_unique<TGCModuleHPB>(
61 sl.getSideType(), TGCId::Strip, sl.getRegionType(), sl.getSector(),
62 id);
63 mapId.insert(block, std::move(hpb));
64 }
65
66 return mapId;
67}

◆ getModuleOut()

TGCModuleMap MuonTGC_Cabling::TGCCableHPBToSL::getModuleOut ( const TGCModuleId & hpt) const
private

Definition at line 69 of file TGCCableHPBToSL.cxx.

69 {
70 if (hpb.isValid() == false) {
71 return TGCModuleMap{};
72 }
73
74 const int hpbId = hpb.getId();
75
76 TGCDatabase* databaseP =
77 m_database[hpb.getRegionType()][hpb.getSignalType()].get();
78
79 TGCModuleMap mapId{};
80 const int MaxEntry = databaseP->getMaxEntry();
81 for (int i = 0; i < MaxEntry; i++) {
82 if (databaseP->getEntry(i, 0) == hpbId) {
83 int block = databaseP->getEntry(i, 1);
84 auto sl = std::make_unique<TGCModuleSL>(
85 hpb.getSideType(), hpb.getRegionType(), hpb.getSector());
86
87 mapId.insert(block, std::move(sl));
88 break;
89 }
90 }
91
92 return mapId;
93}

Member Data Documentation

◆ m_database

std::array<std::array<std::unique_ptr<TGCDatabase>, TGCId::MaxSignalType>, TGCId::MaxRegionType> MuonTGC_Cabling::TGCCableHPBToSL::m_database
private

Definition at line 31 of file TGCCableHPBToSL.h.

◆ m_type

CableType MuonTGC_Cabling::TGCCable::m_type {CableType::NoCableType}
privateinherited

Definition at line 37 of file TGCCable.h.


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