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

#include <TGCCableInPP.h>

Inheritance diagram for MuonTGC_Cabling::TGCCableInPP:
Collaboration diagram for MuonTGC_Cabling::TGCCableInPP:

Public Types

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

Public Member Functions

 TGCCableInPP (const std::string &filename)
virtual ~TGCCableInPP ()
virtual TGCChannelIdgetChannel (const TGCChannelId *channelId, const bool orChannel=false) const
CableType getCableType (void) const

Protected Member Functions

virtual TGCModuleMapgetModuleIn (const TGCModuleId *) const
virtual TGCModuleMapgetModuleOut (const TGCModuleId *) const

Private Member Functions

 TGCCableInPP (void)=delete
virtual TGCChannelIdgetChannelIn (const TGCChannelId *ppout, const bool orChannel=false) const
virtual TGCChannelIdgetChannelOut (const TGCChannelId *ppin, const bool orChannel=false) const

Private Attributes

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

Detailed Description

Definition at line 21 of file TGCCableInPP.h.

Member Enumeration Documentation

◆ CableType

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

Definition at line 18 of file TGCCable.h.

Constructor & Destructor Documentation

◆ TGCCableInPP() [1/2]

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

Definition at line 15 of file TGCCableInPP.cxx.

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

◆ ~TGCCableInPP()

MuonTGC_Cabling::TGCCableInPP::~TGCCableInPP ( )
virtualdefault

◆ TGCCableInPP() [2/2]

MuonTGC_Cabling::TGCCableInPP::TGCCableInPP ( void )
privatedelete

Member Function Documentation

◆ getCableType()

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

Definition at line 30 of file TGCCable.h.

30{ return m_type; }

◆ getChannel()

TGCChannelId * MuonTGC_Cabling::TGCCableInPP::getChannel ( const TGCChannelId * channelId,
const bool orChannel = false ) const
virtual

Definition at line 37 of file TGCCableInPP.cxx.

38 {
39 if(channelId){
40 if(channelId->getChannelIdType()==TGCChannelId::ChannelIdType::PPIn)
41 return getChannelOut(channelId, orChannel);
42 if(channelId->getChannelIdType()==TGCChannelId::ChannelIdType::PPOut)
43 return getChannelIn(channelId, orChannel);
44 }
45 return nullptr;
46}
virtual TGCChannelId * getChannelOut(const TGCChannelId *ppin, const bool orChannel=false) const
virtual TGCChannelId * getChannelIn(const TGCChannelId *ppout, const bool orChannel=false) const

◆ getChannelIn()

TGCChannelId * MuonTGC_Cabling::TGCCableInPP::getChannelIn ( const TGCChannelId * ppout,
const bool orChannel = false ) const
privatevirtual

Reimplemented from MuonTGC_Cabling::TGCCable.

Definition at line 48 of file TGCCableInPP.cxx.

49 {
50 if(ppout->isValid()==false) return nullptr;
51
52 TGCId::ModuleType moduleType = ppout->getModuleType();
53
54 int ndatabaseP = 1;
55 TGCDatabase* databaseP[2];
56 databaseP[0] = m_database[ppout->getRegionType()][moduleType].get();
57 // EI/FI
58 // wire(TGCId::WI) and strip(TGCId::SI) of a chamber
59 // use the same SLB chip
60 // The SLB chip is treated as TGCId::WI in TGCCableSLBToSSW.cxx
61 if(moduleType==TGCId::WI) {
62 databaseP[1] = m_database[ppout->getRegionType()][TGCId::SI].get();
63 ndatabaseP = 2;
64 }
65
66 int id=-1, block=-1, channel=-1;
67 bool found = false;
68
69 for(int idatabaseP=0; idatabaseP<ndatabaseP; idatabaseP++) {
70 // EI/FI
71 // wire(TGCId::WI) and strip(TGCId::SI) of a chamber
72 // use the same SLB chip
73 // The SLB chip is treated as TGCId::WI in TGCCableSLBToSSW.cxx
74 if(idatabaseP==1) {
75 moduleType = TGCId::SI;
76 }
77
78 int indexIn[TGCDatabaseInPP::NIndexIn] =
79 {ppout->getId(), ppout->getBlock(), ppout->getChannel()};
80 int i = databaseP[idatabaseP]->getIndexDBIn(indexIn);
81 if(i<0) continue;
82
83 if(orChannel==false){
84 // first channel
85 id = databaseP[idatabaseP]->getEntry(i,3);
86 block = databaseP[idatabaseP]->getEntry(i,4);
87 channel = databaseP[idatabaseP]->getEntry(i,5);
88 if(id==-1 && block==-1 && channel==-1) continue;
89 found = true;
90 break;
91 } else {
92 // ored channel
93 if(databaseP[idatabaseP]->getEntrySize(i)==9) {
94 id = databaseP[idatabaseP]->getEntry(i,6);
95 block = databaseP[idatabaseP]->getEntry(i,7);
96 channel = databaseP[idatabaseP]->getEntry(i,8);
97 found = true;
98 }
99 }
100 }
101
102 if(!found) return nullptr;
103
104 TGCChannelPPIn* ppin =
105 new TGCChannelPPIn(ppout->getSideType(),
106 moduleType,
107 ppout->getRegionType(),
108 ppout->getSector(),
109 id,
110 block,
111 channel);
112
113 return ppin;
114}

◆ getChannelOut()

TGCChannelId * MuonTGC_Cabling::TGCCableInPP::getChannelOut ( const TGCChannelId * ppin,
const bool orChannel = false ) const
privatevirtual

Reimplemented from MuonTGC_Cabling::TGCCable.

Definition at line 116 of file TGCCableInPP.cxx.

117 {
118 if(ppin->isValid()==false) return nullptr;
119
120 const int ppinChannel = ppin->getChannel();
121 const int ppinBlock = ppin->getBlock();
122 const int ppinId = ppin->getId();
123
124 TGCDatabase* databaseP =
125 m_database[ppin->getRegionType()][ppin->getModuleType()].get();
126
127 TGCChannelPPOut* ppout = nullptr;
128 const int MaxEntry = databaseP->getMaxEntry();
129 for(int i=0; i<MaxEntry; i++){
130 bool cond1 = (databaseP->getEntry(i,5)==ppinChannel)&&
131 (databaseP->getEntry(i,4)==ppinBlock)&&
132 (databaseP->getEntry(i,3)==ppinId);
133
134 bool cond2 = (databaseP->getEntrySize(i)==9)&&
135 (databaseP->getEntry(i,8)==ppinChannel)&&
136 (databaseP->getEntry(i,7)==ppinBlock)&&
137 (databaseP->getEntry(i,6)==ppinId);
138
139 if(cond1 || cond2) {
140 int id = databaseP->getEntry(i,0);
141 int block = databaseP->getEntry(i,1);
142 int channel = databaseP->getEntry(i,2);
143
144 //TGCChannelSLBIn::CellType cellType = TGCChannelSLBIn::NoCellType;
145 int channelInSLB = -1;
146 bool adjacent = false;
147 TGCId::ModuleType moduleType = ppin->getModuleType();
148 if(block==0||block==2){//C,D
149 int lengthOfC = TGCChannelSLBIn::getLengthOfSLB(moduleType,
151 int lengthOfD = TGCChannelSLBIn::getLengthOfSLB(moduleType,
153 if(channel<lengthOfD){
154 int adjacentOfD = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,
156 //cellType = TGCChannelSLBIn::CellD;
157 channelInSLB = channel;
158 if(channelInSLB<adjacentOfD||channelInSLB>=lengthOfD-adjacentOfD)
159 adjacent = true;
160 } else {
161 int adjacentOfC = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,
163 //cellType = TGCChannelSLBIn::CellC;
164 channelInSLB = channel-lengthOfD;
165 if(channelInSLB<adjacentOfC||channelInSLB>=lengthOfC-adjacentOfC)
166 adjacent = true;
167 }
168 }
169 if(block==1||block==3){//A,B
170 int lengthOfA = TGCChannelSLBIn::getLengthOfSLB(moduleType,
172 int lengthOfB = TGCChannelSLBIn::getLengthOfSLB(moduleType,
174 if(channel<lengthOfB){
175 int adjacentOfB = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,
177 //cellType = TGCChannelSLBIn::CellB;
178 channelInSLB = channel;
179 if(channelInSLB<adjacentOfB||channelInSLB>=lengthOfB-adjacentOfB)
180 adjacent = true;
181 } else {
182 int adjacentOfA = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,
184 //cellType = TGCChannelSLBIn::CellA;
185 channelInSLB = channel-lengthOfB;
186 if(channelInSLB<adjacentOfA||channelInSLB>=lengthOfA-adjacentOfA)
187 adjacent = true;
188 }
189 }
190
191 if((moduleType == TGCId::SD) &&
192 (ppin->getRegionType() == TGCId::Endcap)){
193 // Strips of Middle doublets are ORed to the adjacent chamber
194 adjacent = cond2;
195 }
196
197 if(adjacent==orChannel){
198 ppout = new TGCChannelPPOut(ppin->getSideType(),
199 ppin->getModuleType(),
200 ppin->getRegionType(),
201 ppin->getSector(),
202 id,
203 block,
204 channel);
205 break;
206 }
207 }
208 }
209
210 return ppout;
211}
static int getAdjacentOfSLB(TGCId::ModuleType moduleType, CellType cellType)
static int getLengthOfSLB(TGCId::ModuleType moduleType, CellType cellType)
bool adjacent(unsigned int strip1, unsigned int strip2)

◆ getModuleIn()

virtual TGCModuleMap * MuonTGC_Cabling::TGCCable::getModuleIn ( const TGCModuleId * ) const
inlineprotectedvirtualinherited

◆ getModuleOut()

virtual TGCModuleMap * MuonTGC_Cabling::TGCCable::getModuleOut ( const TGCModuleId * ) const
inlineprotectedvirtualinherited

Member Data Documentation

◆ m_database

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

Definition at line 37 of file TGCCableInPP.h.

◆ 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: