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::SignalType::MaxSignalType >,+TGCId::RegionType::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::SignalType::MaxSignalType >,+TGCId::RegionType::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.at(+sl.getRegionType()).at(+TGCId::SignalType::Wire).get();
43 TGCDatabase* stripP = m_database.at(+sl.getRegionType()).at(+TGCId::SignalType::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(),
52 sl.getRegionType(),
53 sl.getSector(), id);
54 mapId.insert(block, std::move(hpb));
55 }
56
57 const int stripMaxEntry = stripP->getMaxEntry();
58 for (int i = 0; i < stripMaxEntry; i++) {
59 int id = stripP->getEntry(i, 0);
60 int block = stripP->getEntry(i, 1);
61 auto hpb = std::make_unique<TGCModuleHPB>(
62 sl.getSideType(), TGCId::SignalType::Strip, sl.getRegionType(), sl.getSector(),
63 id);
64 mapId.insert(block, std::move(hpb));
65 }
66
67 return mapId;
68}

◆ getModuleOut()

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

Definition at line 70 of file TGCCableHPBToSL.cxx.

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

Member Data Documentation

◆ m_database

std::array<std::array<std::unique_ptr<TGCDatabase>, +TGCId::SignalType::MaxSignalType>, +TGCId::RegionType::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: