ATLAS Offline Software
TGCBoardConnection.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TrigT1TGC_BoardConnection_H_
6 #define TrigT1TGC_BoardConnection_H_
7 
8 #include <vector>
9 #include <iostream>
10 
11 namespace LVL1TGCTrigger {
12 
14  public:
16  virtual ~TGCBoardConnection();
17 
20 
21  inline int getNumberOfType() const { return m_id.size(); }
22  int getNumber(const unsigned int type) const;
23  int getId(const unsigned int type, const unsigned int board) const;
24 
25  void setNumberOfType(int ntype);
26  void setNumber(const unsigned int type, int nBoard);
27  void setId(const unsigned int type, const unsigned int board, int idIn);
28 
29  protected:
30  std::vector<std::vector<int>> m_id; // [type][board]
31 };
32 
33 inline int TGCBoardConnection::getNumber(const unsigned int type) const {
34  if (m_id.size() <= type) {
35  std::cerr << "TGCBoardConnection::getNumber : No defined type provided" << std::endl;
36  return -1;
37  }
38  return m_id.at(type).size();
39 }
40 
41 inline int TGCBoardConnection::getId(const unsigned int type, const unsigned int board) const {
42  if (m_id.size() <= type ||
43  m_id.at(type).size() <= board) {
44  std::cerr << "TGCBoardConnection::getId : Undefined board is provided" << std::endl;
45  return -1;
46  }
47  return m_id.at(type).at(board);
48 }
49 
50 
51 } //end of namespace bracket
52 
53 #endif // TrigT1TGC_BoardConnection_H_
LVL1TGCTrigger::TGCBoardConnection::setNumberOfType
void setNumberOfType(int ntype)
Definition: TGCBoardConnection.cxx:20
LVL1TGCTrigger::TGCBoardConnection::setNumber
void setNumber(const unsigned int type, int nBoard)
Definition: TGCBoardConnection.cxx:27
LVL1TGCTrigger::TGCBoardConnection::operator=
TGCBoardConnection & operator=(const TGCBoardConnection &right)
Definition: TGCBoardConnection.cxx:61
LVL1TGCTrigger::TGCBoardConnection
Definition: TGCBoardConnection.h:13
LVL1TGCTrigger::TGCBoardConnection::getNumberOfType
int getNumberOfType() const
Definition: TGCBoardConnection.h:21
LVL1TGCTrigger::TGCBoardConnection::TGCBoardConnection
TGCBoardConnection()
Definition: TGCBoardConnection.cxx:9
LVL1TGCTrigger::TGCBoardConnection::m_id
std::vector< std::vector< int > > m_id
Definition: TGCBoardConnection.h:30
LVL1TGCTrigger::TGCBoardConnection::getNumber
int getNumber(const unsigned int type) const
Definition: TGCBoardConnection.h:33
LVL1TGCTrigger::TGCBoardConnection::setId
void setId(const unsigned int type, const unsigned int board, int idIn)
Definition: TGCBoardConnection.cxx:36
LVL1TGCTrigger::TGCBoardConnection::getId
int getId(const unsigned int type, const unsigned int board) const
Definition: TGCBoardConnection.h:41
LVL1TGCTrigger
Definition: LVL1TGCTrigger.cxx:47
LVL1TGCTrigger::TGCBoardConnection::~TGCBoardConnection
virtual ~TGCBoardConnection()
Definition: TGCBoardConnection.cxx:13
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78