ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
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 (void)
 
virtual TGCChannelIdgetChannel (const TGCChannelId *channelId, 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)
 
virtual TGCChannelIdgetChannelIn (const TGCChannelId *ppout, bool orChannel=false) const
 
virtual TGCChannelIdgetChannelOut (const TGCChannelId *ppin, bool orChannel=false) const
 

Private Attributes

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

Detailed Description

Definition at line 19 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 {
18  m_database[TGCId::Endcap][TGCId::WD] = new TGCDatabaseInPP(filename,"EWD");
19  m_database[TGCId::Endcap][TGCId::WT] = new TGCDatabaseInPP(filename,"EWT");
20  m_database[TGCId::Endcap][TGCId::SD] = new TGCDatabaseInPP(filename,"ESD");
21  m_database[TGCId::Endcap][TGCId::ST] = new TGCDatabaseInPP(filename,"EST");
22  m_database[TGCId::Endcap][TGCId::WI] = new TGCDatabaseInPP(filename,"EWI");
23  m_database[TGCId::Endcap][TGCId::SI] = new TGCDatabaseInPP(filename,"ESI");
24  m_database[TGCId::Forward][TGCId::WD] = new TGCDatabaseInPP(filename,"FWD");
25  m_database[TGCId::Forward][TGCId::WT] = new TGCDatabaseInPP(filename,"FWT");
26  m_database[TGCId::Forward][TGCId::SD] = new TGCDatabaseInPP(filename,"FSD");
27  m_database[TGCId::Forward][TGCId::ST] = new TGCDatabaseInPP(filename,"FST");
28  m_database[TGCId::Forward][TGCId::WI] = new TGCDatabaseInPP(filename,"FWI");
29  m_database[TGCId::Forward][TGCId::SI] = new TGCDatabaseInPP(filename,"FSI");
30 }

◆ ~TGCCableInPP()

MuonTGC_Cabling::TGCCableInPP::~TGCCableInPP ( void  )
virtual

◆ TGCCableInPP() [2/2]

MuonTGC_Cabling::TGCCableInPP::TGCCableInPP ( void  )
inlineprivate

Definition at line 31 of file TGCCableInPP.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::TGCCableInPP::getChannel ( const TGCChannelId channelId,
bool  orChannel = false 
) const
virtual

Definition at line 50 of file TGCCableInPP.cxx.

51  {
52  if(channelId){
53  if(channelId->getChannelIdType()==TGCChannelId::ChannelIdType::PPIn)
54  return getChannelOut(channelId,orChannel);
55  if(channelId->getChannelIdType()==TGCChannelId::ChannelIdType::PPOut)
56  return getChannelIn(channelId,orChannel);
57  }
58  return nullptr;
59 }

◆ getChannelIn()

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

Reimplemented from MuonTGC_Cabling::TGCCable.

Definition at line 61 of file TGCCableInPP.cxx.

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

◆ getChannelOut()

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

Reimplemented from MuonTGC_Cabling::TGCCable.

Definition at line 129 of file TGCCableInPP.cxx.

130  {
131  if(ppin->isValid()==false) return nullptr;
132 
133  const int ppinChannel = ppin->getChannel();
134  const int ppinBlock = ppin->getBlock();
135  const int ppinId = ppin->getId();
136 
137  TGCDatabase* databaseP =
138  m_database[ppin->getRegionType()][ppin->getModuleType()];
139 
140  TGCChannelPPOut* ppout = nullptr;
141  const int MaxEntry = databaseP->getMaxEntry();
142  for(int i=0; i<MaxEntry; i++){
143  bool cond1 = (databaseP->getEntry(i,5)==ppinChannel)&&
144  (databaseP->getEntry(i,4)==ppinBlock)&&
145  (databaseP->getEntry(i,3)==ppinId);
146 
147  bool cond2 = (databaseP->getEntrySize(i)==9)&&
148  (databaseP->getEntry(i,8)==ppinChannel)&&
149  (databaseP->getEntry(i,7)==ppinBlock)&&
150  (databaseP->getEntry(i,6)==ppinId);
151 
152  if(cond1 || cond2) {
153  int id = databaseP->getEntry(i,0);
154  int block = databaseP->getEntry(i,1);
155  int channel = databaseP->getEntry(i,2);
156 
157  //TGCChannelSLBIn::CellType cellType = TGCChannelSLBIn::NoCellType;
158  int channelInSLB = -1;
159  bool adjacent = false;
160  TGCId::ModuleType moduleType = ppin->getModuleType();
161  if(block==0||block==2){//C,D
162  int lengthOfC = TGCChannelSLBIn::getLengthOfSLB(moduleType,
164  int lengthOfD = TGCChannelSLBIn::getLengthOfSLB(moduleType,
166  if(channel<lengthOfD){
167  int adjacentOfD = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,
169  //cellType = TGCChannelSLBIn::CellD;
170  channelInSLB = channel;
171  if(channelInSLB<adjacentOfD||channelInSLB>=lengthOfD-adjacentOfD)
172  adjacent = true;
173  } else {
174  int adjacentOfC = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,
176  //cellType = TGCChannelSLBIn::CellC;
177  channelInSLB = channel-lengthOfD;
178  if(channelInSLB<adjacentOfC||channelInSLB>=lengthOfC-adjacentOfC)
179  adjacent = true;
180  }
181  }
182  if(block==1||block==3){//A,B
183  int lengthOfA = TGCChannelSLBIn::getLengthOfSLB(moduleType,
185  int lengthOfB = TGCChannelSLBIn::getLengthOfSLB(moduleType,
187  if(channel<lengthOfB){
188  int adjacentOfB = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,
190  //cellType = TGCChannelSLBIn::CellB;
191  channelInSLB = channel;
192  if(channelInSLB<adjacentOfB||channelInSLB>=lengthOfB-adjacentOfB)
193  adjacent = true;
194  } else {
195  int adjacentOfA = TGCChannelSLBIn::getAdjacentOfSLB(moduleType,
197  //cellType = TGCChannelSLBIn::CellA;
198  channelInSLB = channel-lengthOfB;
199  if(channelInSLB<adjacentOfA||channelInSLB>=lengthOfA-adjacentOfA)
200  adjacent = true;
201  }
202  }
203 
204  if((moduleType == TGCId::SD) &&
205  (ppin->getRegionType() == TGCId::Endcap)){
206  // Strips of Middle doublets are ORed to the adjacent chamber
207  adjacent = cond2;
208  }
209 
210  if(adjacent==orChannel){
211  ppout = new TGCChannelPPOut(ppin->getSideType(),
212  ppin->getModuleType(),
213  ppin->getRegionType(),
214  ppin->getSector(),
215  id,
216  block,
217  channel);
218  break;
219  }
220  }
221  }
222 
223  return ppout;
224 }

◆ 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

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

Definition at line 36 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:
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::TGCCable::PPToSLB
@ PPToSLB
Definition: TGCCable.h:19
MuonTGC_Cabling::TGCCableInPP::m_database
TGCDatabase * m_database[TGCId::MaxRegionType][TGCId::MaxModuleType]
Definition: TGCCableInPP.h:36
InDet::adjacent
bool adjacent(unsigned int strip1, unsigned int strip2)
Definition: SCT_ClusteringTool.cxx:45
MuonTGC_Cabling::TGCCableInPP::getChannelIn
virtual TGCChannelId * getChannelIn(const TGCChannelId *ppout, bool orChannel=false) const
Definition: TGCCableInPP.cxx:61
MuonTGC_Cabling::TGCId::ModuleType
ModuleType
Definition: TGCId.h:47
MuonTGC_Cabling::TGCCable::TGCCable
TGCCable(CableType type=NoCableType)
Definition: TGCCable.h:24
MuonTGC_Cabling::TGCId::SD
@ SD
Definition: TGCId.h:47
MuonTGC_Cabling::TGCCableInPP::getChannelOut
virtual TGCChannelId * getChannelOut(const TGCChannelId *ppin, bool orChannel=false) const
Definition: TGCCableInPP.cxx:129
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::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::CellA
@ CellA
Definition: TGCChannelSLBIn.h:33
MuonTGC_Cabling::TGCCable::HPBToSL
@ HPBToSL
Definition: TGCCable.h:20
MuonTGC_Cabling::TGCChannelSLBIn::getAdjacentOfSLB
static int getAdjacentOfSLB(TGCId::ModuleType moduleType, CellType cellType)
Definition: TGCChannelSLBIn.cxx:121
MuonTGC_Cabling::TGCCable::SSWToROD
@ SSWToROD
Definition: TGCCable.h:20
MuonTGC_Cabling::TGCId::ST
@ ST
Definition: TGCId.h:47
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
MuonTGC_Cabling::TGCChannelId::ChannelIdType::PPOut
@ PPOut
MuonTGC_Cabling::TGCCable::SLBToHPB
@ SLBToHPB
Definition: TGCCable.h:20
MuonTGC_Cabling::TGCCable::InPP
@ InPP
Definition: TGCCable.h:19
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
MuonTGC_Cabling::TGCChannelId::ChannelIdType::PPIn
@ PPIn
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::TGCDatabaseInPP::NIndexIn
@ NIndexIn
Definition: TGCDatabaseInPP.h:31