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
virtual TGCModuleMapgetModule (const TGCModuleId *moduleId) const
CableType getCableType (void) const

Protected Member Functions

virtual TGCChannelIdgetChannelIn (const TGCChannelId *, bool) const
virtual TGCChannelIdgetChannelOut (const TGCChannelId *, bool) const

Private Member Functions

 TGCCableSLBToSSW ()
virtual TGCModuleMapgetModuleIn (const TGCModuleId *ssw) const
virtual TGCModuleMapgetModuleOut (const TGCModuleId *slb) const

Private Attributes

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

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 18 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.

15{
16 m_database[TGCId::Endcap][TGCId::WT] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB EWT");
17 m_database[TGCId::Endcap][TGCId::WD] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB EWD");
18 m_database[TGCId::Endcap][TGCId::ST] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB EST");
19 m_database[TGCId::Endcap][TGCId::SD] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB ESD");
20 m_database[TGCId::Endcap][TGCId::WI] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB EWI");
21 m_database[TGCId::Endcap][TGCId::SI] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB ESI");
22 m_database[TGCId::Endcap][SL] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB ESL");
23
24 m_database[TGCId::Forward][TGCId::WT] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB FWT");
25 m_database[TGCId::Forward][TGCId::WD] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB FWD");
26 m_database[TGCId::Forward][TGCId::ST] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB FST");
27 m_database[TGCId::Forward][TGCId::SD] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB FSD");
28 m_database[TGCId::Forward][TGCId::WI] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB FWI");
29 m_database[TGCId::Forward][TGCId::SI] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB FSI");
30 m_database[TGCId::Forward][SL] = std::make_unique<TGCDatabaseSLBToROD>(filename, "SLB FSL");
31}
std::array< std::array< std::unique_ptr< TGCDatabase >, MaxModuleType >, TGCId::MaxRegionType > m_database
TGCCable(CableType type=NoCableType)
Definition TGCCable.h:24

◆ ~TGCCableSLBToSSW()

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

◆ TGCCableSLBToSSW() [2/2]

MuonTGC_Cabling::TGCCableSLBToSSW::TGCCableSLBToSSW ( )
inlineprivate

Definition at line 31 of file TGCCableSLBToSSW.h.

31{}

Member Function Documentation

◆ getCableType()

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

Definition at line 30 of file TGCCable.h.

30{ return m_type; }

◆ getChannelIn()

virtual TGCChannelId * MuonTGC_Cabling::TGCCable::getChannelIn ( const TGCChannelId * ,
bool  ) const
inlineprotectedvirtualinherited

◆ getChannelOut()

virtual TGCChannelId * MuonTGC_Cabling::TGCCable::getChannelOut ( const TGCChannelId * ,
bool  ) const
inlineprotectedvirtualinherited

◆ getModule()

TGCModuleMap * MuonTGC_Cabling::TGCCableSLBToSSW::getModule ( const TGCModuleId * moduleId) const
virtual

Definition at line 33 of file TGCCableSLBToSSW.cxx.

33 {
34 if(moduleId){
35 if(moduleId->getModuleIdType()==TGCModuleId::SLB)
36 return getModuleOut(moduleId);
37 if(moduleId->getModuleIdType()==TGCModuleId::SSW)
38 return getModuleIn(moduleId);
39 }
40 return nullptr;
41}
virtual TGCModuleMap * getModuleIn(const TGCModuleId *ssw) const
virtual TGCModuleMap * getModuleOut(const TGCModuleId *slb) const

◆ getModuleIn()

TGCModuleMap * MuonTGC_Cabling::TGCCableSLBToSSW::getModuleIn ( const TGCModuleId * ssw) const
privatevirtual

Reimplemented from MuonTGC_Cabling::TGCCable.

Definition at line 43 of file TGCCableSLBToSSW.cxx.

43 {
44 if(ssw->isValid()==false) return nullptr;
45
46 const int sswId = ssw->getId();
47
48 TGCDatabase* databaseP[TGCId::MaxRegionType * MaxModuleType];
51 for(int i=0; i<TGCId::MaxRegionType; i++){
52 for(int j=0; j< MaxModuleType; j++){
53 databaseP[i*MaxModuleType + j] = m_database[i][j].get();
54 region[i*MaxModuleType + j] = static_cast<TGCId::RegionType>(i);
55 module[i*MaxModuleType + j] = static_cast<TGCId::ModuleType>(j);
56 }
57 }
58
59 TGCModuleMap* mapId = nullptr;
60 for(int type=0; type<TGCId::MaxRegionType* MaxModuleType; type++){
61 const int MaxEntry = databaseP[type]->getMaxEntry();
62 for(int i=0; i<MaxEntry; i++){
63
64 if(databaseP[type]->getEntry(i,4) == sswId) {
65 int sector = databaseP[type]->getEntry(i,0);
66
67 // Inner
68 if(module[type]==TGCId::WI) {
69 // EI/FI
70 // wire(TGCId::WI) and strip(TGCId::SI) of a chamber
71 // use the same SLB chip
72
73 int sswSector = ssw->getReadoutSector();
74 // one ROD (rodId = 2,5,8,11) covers 6 Inner sectors
75 if(sswSector %3 != 1) continue;
76 sswSector -= 1;
77
78 sector += sswSector*2;
79 int id = databaseP[type]->getEntry(i,1);
80 int block = databaseP[type]->getEntry(i,5);
81 int sbLoc = databaseP[type]->getEntry(i,2);
82 int slbAddr = databaseP[type]->getEntry(i,3);
83 for(int ip= 0; ip<3 ; ip++){
84 int psector = sector + ip*2;
85 int pblock = block + ip*4;
86 int psbLoc = sbLoc + ip*4;
87 int pslbAddr = slbAddr + ip*2;
88 TGCModuleSLB* slb = new TGCModuleSLB(ssw->getSideType(),
89 module[type],
90 region[type],
91 psector,
92 id,
93 psbLoc,
94 pslbAddr);
95
96 if(mapId==nullptr) mapId = new TGCModuleMap();
97 mapId->insert(pblock,slb);
98 }
99
100 } else if(module[type]==TGCId::SI) {
101 // EI/FI
102 // wire(TGCId::WI) and strip(TGCId::SI) of a chamber
103 // use the same SLB chip
104
105 // do nothing
106
107 } else {
108 if(region[type]==TGCId::Endcap) {
109 sector += ssw->getReadoutSector() * (TGCId::NUM_ENDCAP_SECTOR/TGCId::N_RODS);
110 } else {
111 sector += ssw->getReadoutSector() * (TGCId::NUM_FORWARD_SECTOR/TGCId::N_RODS);
112 }
113 int id = databaseP[type]->getEntry(i,1);
114 int sbLoc = databaseP[type]->getEntry(i,2);
115 int slbAddr = databaseP[type]->getEntry(i,3);
116 int block = databaseP[type]->getEntry(i,5);
117 TGCModuleSLB* slb = new TGCModuleSLB(ssw->getSideType(),
118 module[type],
119 region[type],
120 sector,
121 id,
122 sbLoc,
123 slbAddr);
124
125 if(mapId==nullptr) mapId = new TGCModuleMap();
126 mapId->insert(block,slb);
127 }
128
129 }
130 }
131 }
132
133 return mapId;
134}
static constexpr int NUM_ENDCAP_SECTOR
Definition TGCId.h:40
static constexpr int N_RODS
Definition TGCId.h:43
static constexpr int NUM_FORWARD_SECTOR
Definition TGCId.h:41

◆ getModuleOut()

TGCModuleMap * MuonTGC_Cabling::TGCCableSLBToSSW::getModuleOut ( const TGCModuleId * slb) const
privatevirtual

Reimplemented from MuonTGC_Cabling::TGCCable.

Definition at line 137 of file TGCCableSLBToSSW.cxx.

137 {
138 if(slb->isValid()==false) return nullptr;
139
140 const int slbId = slb->getId();
141 const int sector = slb->getSectorInReadout();
142 int readoutSector = slb->getReadoutSector();
143
144 TGCModuleMap* mapId = nullptr;
145
146 TGCDatabase* databaseP =m_database[slb->getRegionType()][slb->getModuleType()].get();
147 const int MaxEntry = databaseP->getMaxEntry();
148 if(slb->getModuleType() == TGCId::WI ||
149 slb->getModuleType() == TGCId::SI) {
150 // inner
151 for(int i=0; i<MaxEntry; i++){
152 if(databaseP->getEntry(i,0)==sector &&
153 databaseP->getEntry(i,1)==slbId) {
154
155 int sswSectorRO = readoutSector - (readoutSector%3) + 1;
156 int id = databaseP->getEntry(i,4);
157 int block = databaseP->getEntry(i,5) + 4*(readoutSector%3);
158
159 TGCModuleSSW* ssw = new TGCModuleSSW(slb->getSideType(),
160 sswSectorRO,
161 id);
162 mapId = new TGCModuleMap();
163 mapId->insert(block,ssw);
164 break;
165 }
166 }
167
168 } else {
169 for(int i=0; i<MaxEntry; i++){
170 if(databaseP->getEntry(i,0)==sector&&
171 databaseP->getEntry(i,1)==slbId) {
172
173 int id = databaseP->getEntry(i,4);
174 int block = databaseP->getEntry(i,5);
175 TGCModuleSSW* ssw = new TGCModuleSSW(slb->getSideType(),
176 readoutSector,
177 id);
178 mapId = new TGCModuleMap();
179 mapId->insert(block,ssw);
180 break;
181 }
182 }
183
184 }
185 return mapId;
186}

Member Data Documentation

◆ m_database

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

Definition at line 34 of file TGCCableSLBToSSW.h.

34{{{nullptr}}};

◆ m_type

CableType MuonTGC_Cabling::TGCCable::m_type
privateinherited

Definition at line 43 of file TGCCable.h.


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