ATLAS Offline Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
MuonTGC_Cabling::TGCCablePPToSLB Class Reference

#include <TGCCablePPToSLB.h>

Inheritance diagram for MuonTGC_Cabling::TGCCablePPToSLB:
Collaboration diagram for MuonTGC_Cabling::TGCCablePPToSLB:

Public Types

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

Public Member Functions

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

Private Member Functions

 TGCCablePPToSLB (void)
 
virtual TGCChannelIdgetChannelIn (const TGCChannelId *slbin, bool orChannel=false) const
 
virtual TGCChannelIdgetChannelOut (const TGCChannelId *ppout, bool orChannel=false) const
 
virtual TGCModuleMapgetModuleIn (const TGCModuleId *slb) const
 
virtual TGCModuleMapgetModuleOut (const TGCModuleId *pp) const
 

Private Attributes

TGCDatabasem_database [TGCId::MaxRegionType][TGCId::MaxModuleType] {}
 
CableType m_type
 

Detailed Description

Definition at line 18 of file TGCCablePPToSLB.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

◆ TGCCablePPToSLB() [1/2]

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

Definition at line 16 of file TGCCablePPToSLB.cxx.

18 {
20  new TGCDatabasePPToSL(filename,"PP EWT");
22  new TGCDatabasePPToSL(filename,"PP EWD");
24  new TGCDatabasePPToSL(filename,"PP EST");
26  new TGCDatabasePPToSL(filename,"PP ESD");
28  new TGCDatabasePPToSL(filename,"PP EWI");
30  new TGCDatabasePPToSL(filename,"PP ESI");
32  new TGCDatabasePPToSL(filename,"PP FWT");
34  new TGCDatabasePPToSL(filename,"PP FWD");
36  new TGCDatabasePPToSL(filename,"PP FST");
38  new TGCDatabasePPToSL(filename,"PP FSD");
40  new TGCDatabasePPToSL(filename,"PP FWI");
42  new TGCDatabasePPToSL(filename,"PP FSI");
43 }

◆ ~TGCCablePPToSLB()

MuonTGC_Cabling::TGCCablePPToSLB::~TGCCablePPToSLB ( void  )
virtual

◆ TGCCablePPToSLB() [2/2]

MuonTGC_Cabling::TGCCablePPToSLB::TGCCablePPToSLB ( void  )
inlineprivate

Definition at line 31 of file TGCCablePPToSLB.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; }

◆ getChannel()

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

Definition at line 62 of file TGCCablePPToSLB.cxx.

63  {
64  if(channelId){
65  if(channelId->getChannelIdType()==TGCChannelId::ChannelIdType::PPOut)
66  return getChannelOut(channelId,orChannel);
67  if(channelId->getChannelIdType()==TGCChannelId::ChannelIdType::SLBIn)
68  return getChannelIn(channelId,orChannel);
69  }
70  return nullptr;
71 }

◆ getChannelIn()

TGCChannelId * MuonTGC_Cabling::TGCCablePPToSLB::getChannelIn ( const TGCChannelId slbin,
bool  orChannel = false 
) const
privatevirtual

Reimplemented from MuonTGC_Cabling::TGCCable.

Definition at line 83 of file TGCCablePPToSLB.cxx.

84  {
85  if(orChannel) return nullptr;
86  if(slbin->isValid()==false) return nullptr;
87  TGCChannelPPOut* ppout = nullptr;
88 
89  // SLB channel
90  const TGCChannelSLBIn* slbIn = nullptr;
91  if(slbin->getChannelIdType()==TGCChannelId::ChannelIdType::SLBIn){
92  slbIn = dynamic_cast<const TGCChannelSLBIn*>(slbin);
93  }
94  if(!slbIn) {
95  return nullptr;
96  }
97 
98  // SLB module
99  TGCModuleId* slb = slbIn->getModule();
100  if(!slb) return nullptr;
101 
102  // SLB -> PP module connection
103  TGCModuleMap* mapId = getModule(slb);
104  delete slb;
105  if(!mapId) return nullptr;
106 
107  // PP module
108  int port = mapId->connector(0);
109  TGCModuleId* pp = mapId->popModuleId(0);
110  delete mapId;
111  if(!pp) return nullptr;
112 
113  // SLB ->PP channel connection
114  int block = -1;
115  int channel = -1;
116  TGCChannelSLBIn::CellType cellType = slbIn->getCellType();
117  if(cellType==TGCChannelSLBIn::NoCellType){
118  delete pp;
119  return nullptr;
120  }
121 
122  if(cellType==TGCChannelSLBIn::CellA) {
123  block = 1+2*port;
124  int lengthOfSLB = TGCChannelSLBIn::getLengthOfSLB(slbIn->getModuleType(),
126  channel = lengthOfSLB+slbIn->getChannelInSLB();
127  }
128  if(cellType==TGCChannelSLBIn::CellB) {
129  block = 1+2*port;
130  channel = slbIn->getChannelInSLB();
131  }
132  if(cellType==TGCChannelSLBIn::CellC) {
133  block = 0+2*port;
134  int lengthOfSLB = TGCChannelSLBIn::getLengthOfSLB(slbIn->getModuleType(),
136  channel = lengthOfSLB+slbIn->getChannelInSLB();
137  }
138  if(cellType==TGCChannelSLBIn::CellD) {
139  block = 0+2*port;
140  channel = slbIn->getChannelInSLB();
141  }
142  ppout = new TGCChannelPPOut(pp->getSideType(),
143  pp->getModuleType(),
144  pp->getRegionType(),
145  pp->getSector(),
146  pp->getId(),
147  block,
148  channel);
149 
150  delete pp;
151  return ppout;
152 }

◆ getChannelOut()

TGCChannelId * MuonTGC_Cabling::TGCCablePPToSLB::getChannelOut ( const TGCChannelId ppout,
bool  orChannel = false 
) const
privatevirtual

Reimplemented from MuonTGC_Cabling::TGCCable.

Definition at line 155 of file TGCCablePPToSLB.cxx.

156  {
157  if(orChannel) return nullptr;
158  if(ppout->isValid()==false) return nullptr;
159 
160  const int ppoutBlock = ppout->getBlock();
161 
162  TGCChannelSLBIn* slbin = nullptr;
163 
164  // PP module
165  TGCModuleId* pp = ppout->getModule();
166  if(!pp) return nullptr;
167 
168  // PP -> SLB module connection
169  TGCModuleMap* mapId = getModule(pp);
170  delete pp;
171  if(!mapId) return nullptr;
172 
173  // SLB module
174  TGCModuleId* slb = nullptr;
175  const int size = mapId->size();
176  for(int i=0;i<size;i++){
177  if(mapId->connector(i)==ppoutBlock/2){
178  slb = mapId->popModuleId(i);
179  break;
180  }
181  }
182  delete mapId;
183  if(!slb) return nullptr;
184 
185  // PP ->SLB channel connection
187  int channelInSLB = -1;
188  if(ppoutBlock%2==0){//D,C
189  int lengthOfSLB = TGCChannelSLBIn::getLengthOfSLB(slb->getModuleType(),
191  if(ppout->getChannel()<lengthOfSLB){
192  cellType = TGCChannelSLBIn::CellD;
193  channelInSLB = ppout->getChannel();
194  } else {
195  cellType = TGCChannelSLBIn::CellC;
196  channelInSLB = ppout->getChannel()-lengthOfSLB;
197  }
198  } else {//B,A
199  int lengthOfSLB = TGCChannelSLBIn::getLengthOfSLB(slb->getModuleType(),
201  if(ppout->getChannel()<lengthOfSLB){
202  cellType = TGCChannelSLBIn::CellB;
203  channelInSLB = ppout->getChannel();
204  } else {
205  cellType = TGCChannelSLBIn::CellA;
206  channelInSLB = ppout->getChannel()-lengthOfSLB;
207  }
208  }
209 
210  int channel = TGCChannelSLBIn::convertChannel(slb->getModuleType(),
211  cellType,channelInSLB);
212  slbin = new TGCChannelSLBIn(slb->getSideType(),
213  slb->getModuleType(),
214  slb->getRegionType(),
215  slb->getSector(),
216  slb->getId(),
217  channel);
218  delete slb;
219 
220  return slbin;
221 }

◆ getModule()

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

Definition at line 73 of file TGCCablePPToSLB.cxx.

73  {
74  if(moduleId){
75  if(moduleId->getModuleIdType()==TGCModuleId::PP)
76  return getModuleOut(moduleId);
77  if(moduleId->getModuleIdType()==TGCModuleId::SLB)
78  return getModuleIn(moduleId);
79  }
80  return nullptr;
81 }

◆ getModuleIn()

TGCModuleMap * MuonTGC_Cabling::TGCCablePPToSLB::getModuleIn ( const TGCModuleId slb) const
privatevirtual

Reimplemented from MuonTGC_Cabling::TGCCable.

Definition at line 223 of file TGCCablePPToSLB.cxx.

223  {
224  if(slb->isValid()==false) return nullptr;
225 
226  const int slbId = slb->getId();
227 
228  TGCDatabase* databaseP =m_database[slb->getRegionType()][slb->getModuleType()];
229  TGCModuleMap* mapId = nullptr;
230  const int MaxEntry = databaseP->getMaxEntry();
231  for(int i=0; i<MaxEntry; i++){
232  if(databaseP->getEntry(i,1)==slbId){
233  int id = databaseP->getEntry(i,0);
234  TGCModulePP* pp = new TGCModulePP(slb->getSideType(),
235  slb->getModuleType(),
236  slb->getRegionType(),
237  slb->getSector(),
238  id);
239 
240  mapId = new TGCModuleMap();
241  mapId->insert(0,pp);
242  break;
243  }
244  if(databaseP->getEntry(i,2)==slbId) {
245  int id = databaseP->getEntry(i,0);
246  TGCModulePP* pp = new TGCModulePP(slb->getSideType(),
247  slb->getModuleType(),
248  slb->getRegionType(),
249  slb->getSector(),
250  id);
251 
252  mapId = new TGCModuleMap();
253  mapId->insert(1,pp);
254  break;
255  }
256  }
257 
258  return mapId;
259 }

◆ getModuleOut()

TGCModuleMap * MuonTGC_Cabling::TGCCablePPToSLB::getModuleOut ( const TGCModuleId pp) const
privatevirtual

Reimplemented from MuonTGC_Cabling::TGCCable.

Definition at line 261 of file TGCCablePPToSLB.cxx.

261  {
262  if(pp->isValid()==false) return nullptr;
263 
264  const int ppId = pp->getId();
265 
266  TGCDatabase* databaseP = m_database[pp->getRegionType()][pp->getModuleType()];
267  TGCModuleMap* mapId = nullptr;
268  const int MaxEntry = databaseP->getMaxEntry();
269  for(int i=0; i<MaxEntry; i++){
270  if(databaseP->getEntry(i,0)==ppId)
271  {
272  int id=-1;
273  TGCModuleSLB* slb=nullptr;
274  mapId = new TGCModuleMap();
275 
276  id = databaseP->getEntry(i,1);
277  if(id!=-1){
278  slb = new TGCModuleSLB(pp->getSideType(),
279  pp->getModuleType(),
280  pp->getRegionType(),
281  pp->getSector(),
282  id);
283 
284  mapId->insert(0,slb);
285  }
286 
287  id = databaseP->getEntry(i,2);
288  if(id!=-1){
289  slb = new TGCModuleSLB(pp->getSideType(),
290  pp->getModuleType(),
291  pp->getRegionType(),
292  pp->getSector(),
293  id);
294 
295  mapId->insert(1,slb);
296  }
297  break;
298  }
299  }
300 
301  return mapId;
302 }

Member Data Documentation

◆ m_database

TGCDatabase* MuonTGC_Cabling::TGCCablePPToSLB::m_database[TGCId::MaxRegionType][TGCId::MaxModuleType] {}
private

Definition at line 38 of file TGCCablePPToSLB.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:
MuonTGC_Cabling::TGCCable::NoCableType
@ NoCableType
Definition: TGCCable.h:18
MuonTGC_Cabling::TGCId::SI
@ SI
Definition: TGCId.h:47
MuonTGC_Cabling::TGCCable::InASD
@ InASD
Definition: TGCCable.h:19
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
MuonTGC_Cabling::TGCChannelSLBIn::CellB
@ CellB
Definition: TGCChannelSLBIn.h:33
MuonTGC_Cabling::TGCChannelSLBIn::CellC
@ CellC
Definition: TGCChannelSLBIn.h:33
MuonTGC_Cabling::TGCCablePPToSLB::getModule
virtual TGCModuleMap * getModule(const TGCModuleId *moduleId) const
Definition: TGCCablePPToSLB.cxx:73
MuonTGC_Cabling::TGCCable::PPToSLB
@ PPToSLB
Definition: TGCCable.h:19
MuonTGC_Cabling::TGCModuleId::SLB
@ SLB
Definition: TGCModuleId.h:16
MuonTGC_Cabling::TGCCablePPToSLB::getChannelOut
virtual TGCChannelId * getChannelOut(const TGCChannelId *ppout, bool orChannel=false) const
Definition: TGCCablePPToSLB.cxx:155
MuonTGC_Cabling::TGCCable::TGCCable
TGCCable(CableType type=NoCableType)
Definition: TGCCable.h:24
MuonTGC_Cabling::TGCId::SD
@ SD
Definition: TGCId.h:47
MuonTGC_Cabling::TGCModuleId::PP
@ PP
Definition: TGCModuleId.h:16
MuonTGC_Cabling::TGCChannelId::ChannelIdType::SLBIn
@ SLBIn
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
MuonTGC_Cabling::TGCCable::ASDToPP
@ ASDToPP
Definition: TGCCable.h:19
MuonTGC_Cabling::TGCCable::InSLB
@ InSLB
Definition: TGCCable.h:19
lumiFormat.i
int i
Definition: lumiFormat.py:85
MuonTGC_Cabling::TGCCable::MaxCableType
@ MaxCableType
Definition: TGCCable.h:21
MuonTGC_Cabling::TGCId::WT
@ WT
Definition: TGCId.h:47
MuonTGC_Cabling::TGCCable::m_type
CableType m_type
Definition: TGCCable.h:43
MuonTGC_Cabling::TGCDatabase::getMaxEntry
virtual int getMaxEntry(void) const
Definition: TGCDatabase.cxx:36
MuonTGC_Cabling::TGCCablePPToSLB::getChannelIn
virtual TGCChannelId * getChannelIn(const TGCChannelId *slbin, bool orChannel=false) const
Definition: TGCCablePPToSLB.cxx:83
MuonTGC_Cabling::TGCChannelSLBIn::NoCellType
@ NoCellType
Definition: TGCChannelSLBIn.h:32
MuonTGC_Cabling::TGCCable::SLBToSSW
@ SLBToSSW
Definition: TGCCable.h:20
MuonTGC_Cabling::TGCId::WD
@ WD
Definition: TGCId.h:47
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
MuonTGC_Cabling::TGCId::Endcap
@ Endcap
Definition: TGCId.h:53
MuonTGC_Cabling::TGCId::WI
@ WI
Definition: TGCId.h:47
MuonTGC_Cabling::TGCChannelSLBIn::convertChannel
static int convertChannel(TGCId::ModuleType moduleType, CellType cellType, int channelInSLB)
Definition: TGCChannelSLBIn.cxx:202
MuonTGC_Cabling::TGCChannelSLBIn::CellA
@ CellA
Definition: TGCChannelSLBIn.h:33
MuonTGC_Cabling::TGCCablePPToSLB::getModuleIn
virtual TGCModuleMap * getModuleIn(const TGCModuleId *slb) const
Definition: TGCCablePPToSLB.cxx:223
MuonTGC_Cabling::TGCCable::HPBToSL
@ HPBToSL
Definition: TGCCable.h:20
MuonTGC_Cabling::TGCCablePPToSLB::getModuleOut
virtual TGCModuleMap * getModuleOut(const TGCModuleId *pp) const
Definition: TGCCablePPToSLB.cxx:261
MuonTGC_Cabling::TGCCable::SSWToROD
@ SSWToROD
Definition: TGCCable.h:20
MuonTGC_Cabling::TGCId::ST
@ ST
Definition: TGCId.h:47
MuonTGC_Cabling::TGCChannelId::ChannelIdType::PPOut
@ PPOut
MuonTGC_Cabling::TGCCable::SLBToHPB
@ SLBToHPB
Definition: TGCCable.h:20
MuonTGC_Cabling::TGCCable::InPP
@ InPP
Definition: TGCCable.h:19
MuonTGC_Cabling::TGCChannelSLBIn::CellType
CellType
Definition: TGCChannelSLBIn.h:32
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
MuonTGC_Cabling::TGCChannelSLBIn::CellD
@ CellD
Definition: TGCChannelSLBIn.h:33
MuonTGC_Cabling::TGCChannelSLBIn::getLengthOfSLB
static int getLengthOfSLB(TGCId::ModuleType moduleType, CellType cellType)
Definition: TGCChannelSLBIn.cxx:94
MuonTGC_Cabling::TGCId::Forward
@ Forward
Definition: TGCId.h:53
MuonTGC_Cabling::TGCCablePPToSLB::m_database
TGCDatabase * m_database[TGCId::MaxRegionType][TGCId::MaxModuleType]
Definition: TGCCablePPToSLB.h:38