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

#include <TGCCableInASD.h>

Inheritance diagram for MuonTGC_Cabling::TGCCableInASD:
Collaboration diagram for MuonTGC_Cabling::TGCCableInASD:

Public Types

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

Public Member Functions

 TGCCableInASD (const std::string &filename)
 
virtual ~TGCCableInASD (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

 TGCCableInASD (void)
 
virtual TGCChannelIdgetChannelIn (const TGCChannelId *asdout, bool orChannel=false) const
 
virtual TGCChannelIdgetChannelOut (const TGCChannelId *asdin, bool orChannel=false) const
 

Private Attributes

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

Detailed Description

Definition at line 19 of file TGCCableInASD.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

◆ TGCCableInASD() [1/2]

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

Definition at line 14 of file TGCCableInASD.cxx.

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

◆ ~TGCCableInASD()

MuonTGC_Cabling::TGCCableInASD::~TGCCableInASD ( void  )
virtual

◆ TGCCableInASD() [2/2]

MuonTGC_Cabling::TGCCableInASD::TGCCableInASD ( void  )
inlineprivate

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

Definition at line 59 of file TGCCableInASD.cxx.

60  {
61  if(channelId){
62  if(channelId->getChannelIdType()==TGCChannelId::ChannelIdType::ASDIn)
63  return getChannelOut(channelId,orChannel);
64  if(channelId->getChannelIdType()==TGCChannelId::ChannelIdType::ASDOut)
65  return getChannelIn(channelId,orChannel);
66  }
67  return nullptr;
68 }

◆ getChannelIn()

TGCChannelId * MuonTGC_Cabling::TGCCableInASD::getChannelIn ( const TGCChannelId asdout,
bool  orChannel = false 
) const
privatevirtual

Reimplemented from MuonTGC_Cabling::TGCCable.

Definition at line 70 of file TGCCableInASD.cxx.

71  {
72  if(orChannel) return nullptr;
73  if(asdout->isValid()==false) return nullptr;
74 
75  TGCDatabase* databaseP =
76  m_database[asdout->getRegionType()][asdout->getModuleType()];
77 
78  TGCChannelASDIn* asdin = nullptr;
79 
80  // sector ASDIn [1..48, 1..24], ASDOut [0..47, 0..23]
81  int sector;
82  if(asdout->isEndcap() && !asdout->isInner()){
83  sector = asdout->getSector()-1;
84  if(sector<=0) sector += TGCId::NUM_ENDCAP_SECTOR;
85  } else {
86  sector = asdout->getSector();
87  if(sector<=0) sector += TGCId::NUM_FORWARD_SECTOR;
88  }
89 
90  // chamber ASDIn [1(F),1,2,3,4,5(E)], ASDOut [0(F),4,3,2,1,0(E)]
91  int chamber;
92  if(asdout->isEndcap() && !asdout->isInner()){
93  chamber = 5-asdout->getChamber();
94  } else {
95  chamber = asdout->getChamber()+1;
96  }
97 
98  int channel=-1;
99  // channel ASDIn [1..32(S),1..n(W chamber)], ASDOut [0..31(S),n..0(W sector)]
100  if(asdout->isWire()){
101  // Endcap Triplet chamberId start from 1 in ASDOut
102  int dbChamber = asdout->getChamber();
103  if(asdout->isEndcap() && asdout->isTriplet()) dbChamber = dbChamber-1;
104  int indexIn[TGCDatabaseASDToPP::NIndexIn] =
105  {asdout->getLayer(), dbChamber, asdout->getChannel()};
106  int i = databaseP->getIndexDBIn(indexIn);
107  if(i<0) return nullptr;
108  channel = databaseP->getEntry(i,7)+1;
109  } else {
110  if(( asdout->isBackward() && asdout->isAside()) ||
111  (!asdout->isBackward() && asdout->isCside()))
112  channel = 32-asdout->getChannel();
113  else
114  channel = asdout->getChannel()+1;
115  }
116  if(channel==-1) return nullptr;
117 
118  asdin = new TGCChannelASDIn(asdout->getSideType(),
119  asdout->getSignalType(),
120  asdout->getRegionType(),
121  sector,
122  asdout->getLayer(),
123  chamber,
124  channel);
125 
126  return asdin;
127 }

◆ getChannelOut()

TGCChannelId * MuonTGC_Cabling::TGCCableInASD::getChannelOut ( const TGCChannelId asdin,
bool  orChannel = false 
) const
privatevirtual

Reimplemented from MuonTGC_Cabling::TGCCable.

Definition at line 129 of file TGCCableInASD.cxx.

130  {
131  if(orChannel) return nullptr;
132  if(asdin->isValid()==false) return nullptr;
133 
134  const bool asdinisEndcap = asdin->isEndcap();
135  const bool asdinisTriplet = asdin->isTriplet();
136  const int asdinLayer = asdin->getLayer();
137  const int asdinChannel = asdin->getChannel();
138 
139  TGCDatabase* databaseP =
140  m_database[asdin->getRegionType()][asdin->getModuleType()];
141 
142  TGCChannelASDOut* asdout = nullptr;
143 
144  // sector ASDIn [1..48, 1..24], ASDOut [2..47.0.1, 1..23.0]
145  int sector;
146  if(asdin->isEndcap()) {
147  if(!asdin->isInner()){
148  // Endcap
149  sector = (asdin->getSector()+1) % TGCId::NUM_ENDCAP_SECTOR;
150  } else {
151  // EI
152  sector = (asdin->getSector()) % TGCId::NUM_INNER_SECTOR;
153  }
154  } else {
155  if(!asdin->isInner()){
156  // Forward
157  sector = (asdin->getSector()) % TGCId::NUM_FORWARD_SECTOR;
158  } else {
159  // FI
160  sector = (asdin->getSector()) % TGCId::NUM_INNER_SECTOR;
161  }
162  }
163 
164  // chamber ASDIn [1(F),1,2,3,4,5(E)], ASDOut [0(F),4,3,2,1,0(E)]
165  int chamber;
166  if(asdin->isEndcap()&&!asdin->isInner()){
167  chamber = 5-asdin->getChamber();
168  } else {
169  chamber = asdin->getChamber()-1;
170  }
171 
172  int channel=-1;
173  // channel ASDIn [1..32(S),1..n(W chamber)], ASDOut [0..31(S),n..0(W sector)]
174  if(asdin->isWire()){
175  const int MaxEntry = databaseP->getMaxEntry();
176  for(int i=0; i<MaxEntry; i++){
177  // Endcap Triplet chamberId start from 1 in ASDOut
178  int dbChamber = chamber;
179  if(asdinisEndcap&&asdinisTriplet)
180  dbChamber = dbChamber-1;
181 
182  int dbChannel = asdinChannel-1;
183  if(databaseP->getEntry(i,7)==dbChannel&&
184  databaseP->getEntry(i,1)==dbChamber&&
185  databaseP->getEntry(i,0)==asdinLayer)
186  {
187  channel = databaseP->getEntry(i,6);
188  break;
189  }
190  }
191  } else {
192  // asdin->isBackward() can not be used because this method rely on sector number for asdout
193  bool is_Backward = false;
194  if(asdin->isEndcap()){
195  if(!asdin->isInner()) {
196  if(asdin->isAside()) is_Backward = (sector%2==1);
197  else is_Backward = (sector%2==0);
198  } else {
199  // EI
200  // Special case of EI11
201  if(sector == 15) {
202  if(asdin->isAside()) is_Backward = false;
203  else is_Backward = true;
204  } else if(sector == 16) {
205  if(asdin->isAside()) is_Backward = true;
206  else is_Backward = false;
207  } else {
208  // A-side phi0 F: phi1 F: phi2 B
209  // C-side phi0 B: phi1 B: phi2 F
210  if(asdin->isAside()) is_Backward = (sector%3==2);
211  else is_Backward = (sector%3!=2);
212  }
213  }
214  } else {
215  if(asdin->isAside()) is_Backward = true; //All Backward for A-side
216  }
217  if(( is_Backward && asdin->isAside()) ||
218  (!is_Backward && asdin->isCside()))
219  channel = 32-asdin->getChannel();
220  else
221  channel = asdin->getChannel()-1;
222  }
223  if(channel==-1) return nullptr;
224 
225  asdout = new TGCChannelASDOut(asdin->getSideType(),
226  asdin->getSignalType(),
227  asdin->getRegionType(),
228  sector,
229  asdin->getLayer(),
230  chamber,
231  channel);
232 
233  return asdout;
234 }

◆ 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::TGCCableInASD::m_database[TGCId::MaxRegionType][TGCId::MaxModuleType] {}
private

Definition at line 36 of file TGCCableInASD.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::TGCCableInASD::getChannelOut
virtual TGCChannelId * getChannelOut(const TGCChannelId *asdin, bool orChannel=false) const
Definition: TGCCableInASD.cxx:129
calibdata.chamber
chamber
Definition: calibdata.py:32
MuonTGC_Cabling::TGCCable::PPToSLB
@ PPToSLB
Definition: TGCCable.h:19
MuonTGC_Cabling::TGCChannelId::ChannelIdType::ASDOut
@ ASDOut
MuonTGC_Cabling::TGCDatabaseASDToPP::NIndexIn
@ NIndexIn
Definition: TGCDatabaseASDToPP.h:31
MuonTGC_Cabling::TGCChannelId::ChannelIdType::ASDIn
@ ASDIn
MuonTGC_Cabling::TGCId::NUM_INNER_SECTOR
static constexpr int NUM_INNER_SECTOR
Definition: TGCId.h:42
MuonTGC_Cabling::TGCCable::TGCCable
TGCCable(CableType type=NoCableType)
Definition: TGCCable.h:24
MuonTGC_Cabling::TGCCableInASD::getChannelIn
virtual TGCChannelId * getChannelIn(const TGCChannelId *asdout, bool orChannel=false) const
Definition: TGCCableInASD.cxx:70
MuonTGC_Cabling::TGCId::SD
@ SD
Definition: TGCId.h:47
MuonTGC_Cabling::TGCId::NUM_FORWARD_SECTOR
static constexpr int NUM_FORWARD_SECTOR
Definition: TGCId.h:41
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::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::TGCCable::HPBToSL
@ HPBToSL
Definition: TGCCable.h:20
MuonTGC_Cabling::TGCCable::SSWToROD
@ SSWToROD
Definition: TGCCable.h:20
MuonTGC_Cabling::TGCId::ST
@ ST
Definition: TGCId.h:47
MuonTGC_Cabling::TGCCableInASD::m_database
TGCDatabase * m_database[TGCId::MaxRegionType][TGCId::MaxModuleType]
Definition: TGCCableInASD.h:36
MuonTGC_Cabling::TGCCable::SLBToHPB
@ SLBToHPB
Definition: TGCCable.h:20
MuonTGC_Cabling::TGCId::NUM_ENDCAP_SECTOR
static constexpr int NUM_ENDCAP_SECTOR
Definition: TGCId.h:40
MuonTGC_Cabling::TGCCable::InPP
@ InPP
Definition: TGCCable.h:19
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
MuonTGC_Cabling::TGCId::Forward
@ Forward
Definition: TGCId.h:53