Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 ()=default
 
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)
 
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 {{{nullptr}}}
 
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[TGCId::Endcap][TGCId::WD] = std::make_unique<TGCDatabaseInPP>(filename, "EWD");
18  m_database[TGCId::Endcap][TGCId::WT] = std::make_unique<TGCDatabaseInPP>(filename, "EWT");
19  m_database[TGCId::Endcap][TGCId::SD] = std::make_unique<TGCDatabaseInPP>(filename, "ESD");
20  m_database[TGCId::Endcap][TGCId::ST] = std::make_unique<TGCDatabaseInPP>(filename, "EST");
21  m_database[TGCId::Endcap][TGCId::WI] = std::make_unique<TGCDatabaseInPP>(filename, "EWI");
22  m_database[TGCId::Endcap][TGCId::SI] = std::make_unique<TGCDatabaseInPP>(filename, "ESI");
23  m_database[TGCId::Forward][TGCId::WD] = std::make_unique<TGCDatabaseInPP>(filename, "FWD");
24  m_database[TGCId::Forward][TGCId::WT] = std::make_unique<TGCDatabaseInPP>(filename, "FWT");
25  m_database[TGCId::Forward][TGCId::SD] = std::make_unique<TGCDatabaseInPP>(filename, "FSD");
26  m_database[TGCId::Forward][TGCId::ST] = std::make_unique<TGCDatabaseInPP>(filename, "FST");
27  m_database[TGCId::Forward][TGCId::WI] = std::make_unique<TGCDatabaseInPP>(filename, "FWI");
28  m_database[TGCId::Forward][TGCId::SI] = std::make_unique<TGCDatabaseInPP>(filename, "FSI");
29 }

◆ ~TGCCableInPP()

virtual MuonTGC_Cabling::TGCCableInPP::~TGCCableInPP ( )
virtualdefault

◆ 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,
const bool  orChannel = false 
) const
virtual

Definition at line 32 of file TGCCableInPP.cxx.

33  {
34  if(channelId){
35  if(channelId->getChannelIdType()==TGCChannelId::ChannelIdType::PPIn)
36  return getChannelOut(channelId, orChannel);
37  if(channelId->getChannelIdType()==TGCChannelId::ChannelIdType::PPOut)
38  return getChannelIn(channelId, orChannel);
39  }
40  return nullptr;
41 }

◆ getChannelIn()

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

Reimplemented from MuonTGC_Cabling::TGCCable.

Definition at line 43 of file TGCCableInPP.cxx.

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

◆ getChannelOut()

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

Reimplemented from MuonTGC_Cabling::TGCCable.

Definition at line 111 of file TGCCableInPP.cxx.

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

◆ 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 {{{nullptr}}}
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:
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
InDet::adjacent
bool adjacent(unsigned int strip1, unsigned int strip2)
Definition: SCT_ClusteringTool.cxx:45
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::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::TGCCableInPP::getChannelIn
virtual TGCChannelId * getChannelIn(const TGCChannelId *ppout, const bool orChannel=false) const
Definition: TGCCableInPP.cxx:43
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
checkTriggerxAOD.found
found
Definition: checkTriggerxAOD.py:328
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
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::TGCCableInPP::m_database
std::array< std::array< std::unique_ptr< TGCDatabase >, TGCId::MaxModuleType >, TGCId::MaxRegionType > m_database
Definition: TGCCableInPP.h:37
MuonTGC_Cabling::TGCChannelSLBIn::getLengthOfSLB
static int getLengthOfSLB(TGCId::ModuleType moduleType, CellType cellType)
Definition: TGCChannelSLBIn.cxx:94
MuonTGC_Cabling::TGCCableInPP::getChannelOut
virtual TGCChannelId * getChannelOut(const TGCChannelId *ppin, const bool orChannel=false) const
Definition: TGCCableInPP.cxx:111
MuonTGC_Cabling::TGCId::Forward
@ Forward
Definition: TGCId.h:53
MuonTGC_Cabling::TGCDatabaseInPP::NIndexIn
@ NIndexIn
Definition: TGCDatabaseInPP.h:31