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 ()
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()

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 48 of file TGCCableSLBToSSW.cxx.

48 {
49
50 if (moduleId.getModuleIdType() == TGCModuleId::SLB) {
51 return getModuleOut(moduleId);
52 }
53 if (moduleId.getModuleIdType() == TGCModuleId::SSW) {
54 return getModuleIn(moduleId);
55 }
56
57 return TGCModuleMap{};
58}
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 60 of file TGCCableSLBToSSW.cxx.

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

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

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: