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

#include <TGCCableSLBToSSW.h>

Inheritance diagram for MuonTGC_Cabling::TGCCableSLBToSSW:
Collaboration diagram for MuonTGC_Cabling::TGCCableSLBToSSW:

Public Types

enum  { SL = TGCId::MaxModuleType , MaxModuleType = TGCId::MaxModuleType + 1 }
enum  CableType {
  NoCableType = -1 , InASD , ASDToPP , InPP ,
  PPToSLB , InSLB , SLBToHPB , HPBToSL ,
  SLBToSSW , SSWToROD , MaxCableType
}

Public Member Functions

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

Private Member Functions

 TGCCableSLBToSSW ()=delete
TGCModuleMap getModuleIn (const TGCModuleId &ssw) const
TGCModuleMap getModuleOut (const TGCModuleId &slb) const

Private Attributes

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

Detailed Description

Definition at line 18 of file TGCCableSLBToSSW.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

◆ CableType

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

Definition at line 16 of file TGCCable.h.

Constructor & Destructor Documentation

◆ TGCCableSLBToSSW() [1/2]

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

Definition at line 13 of file TGCCableSLBToSSW.cxx.

14 : TGCCable(TGCCable::SLBToSSW), m_database{{{nullptr}}} {
16 std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB EWT");
18 std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB EWD");
20 std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB EST");
22 std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB ESD");
24 std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB EWI");
26 std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB ESI");
28 std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB ESL");
29
31 std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB FWT");
33 std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB FWD");
35 std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB FST");
37 std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB FSD");
39 std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB FWI");
41 std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB FSI");
43 std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB FSL");
44}
std::array< std::array< std::unique_ptr< TGCDatabase >, MaxModuleType >, TGCId::MaxRegionType > m_database
TGCCable(CableType type=NoCableType)
Definition TGCCable.h:31

◆ ~TGCCableSLBToSSW()

virtual MuonTGC_Cabling::TGCCableSLBToSSW::~TGCCableSLBToSSW ( )
virtualdefault

◆ TGCCableSLBToSSW() [2/2]

MuonTGC_Cabling::TGCCableSLBToSSW::TGCCableSLBToSSW ( )
privatedelete

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::TGCCableSLBToSSW::getModule ( const TGCModuleId & moduleId) const

Definition at line 46 of file TGCCableSLBToSSW.cxx.

46 {
47
48 if (moduleId.getModuleIdType() == TGCModuleId::SLB) {
49 return getModuleOut(moduleId);
50 }
51 if (moduleId.getModuleIdType() == TGCModuleId::SSW) {
52 return getModuleIn(moduleId);
53 }
54
55 return TGCModuleMap{};
56}
TGCModuleMap getModuleOut(const TGCModuleId &slb) const
TGCModuleMap getModuleIn(const TGCModuleId &ssw) const

◆ getModuleIn()

TGCModuleMap MuonTGC_Cabling::TGCCableSLBToSSW::getModuleIn ( const TGCModuleId & ssw) const
private

Definition at line 58 of file TGCCableSLBToSSW.cxx.

58 {
59 if (ssw.isValid() == false) {
60 return TGCModuleMap{};
61 }
62
63 const int sswId = ssw.getId();
64
65 TGCDatabase* databaseP[TGCId::MaxRegionType * MaxModuleType];
68 for (int i = 0; i < TGCId::MaxRegionType; i++) {
69 for (int j = 0; j < MaxModuleType; j++) {
70 databaseP[i * MaxModuleType + j] = m_database[i][j].get();
71 region[i * MaxModuleType + j] = static_cast<TGCId::RegionType>(i);
72 module[i * MaxModuleType + j] = static_cast<TGCId::ModuleType>(j);
73 }
74 }
75
76 TGCModuleMap mapId{};
77 for (int type = 0; type < TGCId::MaxRegionType * MaxModuleType; type++) {
78 const int MaxEntry = databaseP[type]->getMaxEntry();
79 for (int i = 0; i < MaxEntry; i++) {
80
81 if (databaseP[type]->getEntry(i, 4) == sswId) {
82 int sector = databaseP[type]->getEntry(i, 0);
83
84 // Inner
85 if (module[type] == TGCId::WI) {
86 // EI/FI
87 // wire(TGCId::WI) and strip(TGCId::SI) of a chamber
88 // use the same SLB chip
89
90 int sswSector = ssw.getReadoutSector();
91 // one ROD (rodId = 2,5,8,11) covers 6 Inner sectors
92 if (sswSector % 3 != 1) {
93 continue;
94 }
95 sswSector -= 1;
96
97 sector += sswSector * 2;
98 int id = databaseP[type]->getEntry(i, 1);
99 int block = databaseP[type]->getEntry(i, 5);
100 int sbLoc = databaseP[type]->getEntry(i, 2);
101 int slbAddr = databaseP[type]->getEntry(i, 3);
102 for (int ip = 0; ip < 3; ip++) {
103 int psector = sector + ip * 2;
104 int pblock = block + ip * 4;
105 int psbLoc = sbLoc + ip * 4;
106 int pslbAddr = slbAddr + ip * 2;
107 auto slb = std::make_unique<TGCModuleSLB>(
108 ssw.getSideType(), module[type], region[type],
109 psector, id, psbLoc, pslbAddr);
110
111 mapId.insert(pblock, std::move(slb));
112 }
113
114 } else if (module[type] == TGCId::SI) {
115 // EI/FI
116 // wire(TGCId::WI) and strip(TGCId::SI) of a chamber
117 // use the same SLB chip
118
119 // do nothing
120
121 } else {
122 if (region[type] == TGCId::Endcap) {
123 sector += ssw.getReadoutSector() *
125 } else {
126 sector += ssw.getReadoutSector() *
128 }
129 int id = databaseP[type]->getEntry(i, 1);
130 int sbLoc = databaseP[type]->getEntry(i, 2);
131 int slbAddr = databaseP[type]->getEntry(i, 3);
132 int block = databaseP[type]->getEntry(i, 5);
133 auto slb = std::make_unique<TGCModuleSLB>(
134 ssw.getSideType(), module[type], region[type], sector,
135 id, sbLoc, slbAddr);
136
137 mapId.insert(block, std::move(slb));
138 }
139 }
140 }
141 }
142
143 return mapId;
144}
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
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)

◆ getModuleOut()

TGCModuleMap MuonTGC_Cabling::TGCCableSLBToSSW::getModuleOut ( const TGCModuleId & slb) const
private

Definition at line 146 of file TGCCableSLBToSSW.cxx.

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();
160 if (slb.getModuleType() == TGCId::WI || slb.getModuleType() == TGCId::SI) {
161 // inner
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}

Member Data Documentation

◆ m_database

std::array<std::array<std::unique_ptr<TGCDatabase>, MaxModuleType>, TGCId::MaxRegionType> MuonTGC_Cabling::TGCCableSLBToSSW::m_database
private

Definition at line 36 of file TGCCableSLBToSSW.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: