ATLAS Offline Software
TGCSlaveBoardOut.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TGCSlaveBoardOut_hh
6 #define TGCSlaveBoardOut_hh
8 #include <fstream>
9 #include <iostream>
10 
11 namespace LVL1TGCTrigger {
12 
13 class TGCSlaveBoard;
14 
15 const int posSize[6] = {5,5,4,5,4,4};//type = 0,1,2,3 : WT,WD,ST,SD,WI,SI
16 const int devSize[6] = {0,3,0,3,0,0};
17 const int devSign[6] = {0,1,0,1,0,0};
18 const int TotalNumberOfOutputData[6] = {3,2,8,2,8,8};
19 
21 
22 public:
23  TGCSlaveBoardOut(const TGCSlaveBoard* sb, int bidIn);
28 
29  int getDev(int iData) const;
30  int getPos(int iData) const;
31  TGCHitPattern* getbPos(int iData);
32  bool getHit(int iData) const;
33 
34  void setDev(int iData, int devIn);
35  void setPos(int iData, int posIn);
36  void setHit(int iData, bool hitIn);
37  void setbDev(int block, int sign, int dr);
38  void setbPos(int block, int pos);
39 
40  void setNumberOfData(int nData);
41  int getNumberOfData() const;
42  int getBid() const;
43  int getOrgBoardType() const;
44 
45  void clear();
46  void print() const;
47  void print(int OutPutBlock) const ;
48  void print(std::ofstream* ofs) const ;
49  void print(std::ofstream* ofs, int OutPutBlock) const;
50  void printpattern(std::ofstream* ofs) const ;
51  void printpattern(std::ofstream* ofs, int OutPutBlock) const;
52 
53  const TGCSlaveBoard* getOrigin() const;
54 
55  private:
56  static constexpr int s_MaxNumberOfSBData = 8;
57 
59  int m_bid;
61  int m_orgSBid;
62 
63  int m_numberOfData; // number of block A board have OutPutBlock:a,b ,m_numberOfData is 2.
64  int m_dev[s_MaxNumberOfSBData]; // a b c [d [a b c d]]
67 
68  TGCHitPattern* m_bpos[s_MaxNumberOfSBData]; // a b c d [StripTriplet]a b c d
69  TGCHitPattern* m_bdev[2];// 2=TotalNumberOfOutputData[1]
70 
71 };
72 
73 inline
74 void TGCSlaveBoardOut::setbPos(int block, int pos)
75 {
77  m_bpos[block]->dec2bin(pos);
78  } else {
79  std::cerr << "TGCSlaveBoardOut::setbPos : illegal block "
80  << " Type=" << m_orgBoardType
81  << " #block=" << TotalNumberOfOutputData[m_orgBoardType]
82  << " block=" << block << std::endl;
83  }
84 }
85 
86 inline
87 void TGCSlaveBoardOut::setHit(int iData, bool hitIn)
88 {
89  if (s_MaxNumberOfSBData <= iData) {
90  std::cerr << "internal error TGCSlaveBoardOut::setHit()" << std::endl;
91  } else {
92  m_hit[iData] = hitIn;
93  }
94 }
95 
96 inline
97 void TGCSlaveBoardOut::setDev(int iData, int devIn)
98 {
99  if(s_MaxNumberOfSBData <= iData) {
100  std::cerr << "Internal error TGCSlaveBoardOut::setDev()" << std::endl;
101  } else {
102  m_dev[iData] = devIn;
103  }
104 }
105 
106 inline
108 {
109  return m_bpos[iData];
110 }
111 
112 inline
114 {
115  return m_origin;
116 }
117 
118 inline
119 int TGCSlaveBoardOut::getDev(int iData) const
120 {
121  return m_dev[iData];
122 }
123 
124 inline
125 int TGCSlaveBoardOut::getPos(int iData) const
126 {
127  return m_pos[iData];
128 }
129 
130 inline
131 bool TGCSlaveBoardOut::getHit(int iData) const
132 {
133  return m_hit[iData];
134 }
135 
136 inline
138 {
139  return m_bid;
140 }
141 
142 inline
144 {
145  return m_orgBoardType;
146 }
147 
148 inline
150 {
151  m_numberOfData = nData;
152 }
153 
154 inline
156 {
157  return m_numberOfData;
158 }
159 
160 
161 } //end of namespace bracket
162 
163 #endif
LVL1TGCTrigger::TotalNumberOfOutputData
const int TotalNumberOfOutputData[6]
Definition: TGCSlaveBoardOut.h:18
LVL1TGCTrigger::TGCSlaveBoardOut::printpattern
void printpattern(std::ofstream *ofs) const
Definition: TGCSlaveBoardOut.cxx:376
LVL1TGCTrigger::TGCSlaveBoardOut::clear
void clear()
Definition: TGCSlaveBoardOut.cxx:181
LVL1TGCTrigger::TGCSlaveBoardOut::getDev
int getDev(int iData) const
Definition: TGCSlaveBoardOut.h:119
LVL1TGCTrigger::TGCSlaveBoardOut::m_bdev
TGCHitPattern * m_bdev[2]
Definition: TGCSlaveBoardOut.h:69
LVL1TGCTrigger::TGCSlaveBoardOut::getBid
int getBid() const
Definition: TGCSlaveBoardOut.h:137
LVL1TGCTrigger::TGCSlaveBoardOut::m_orgBoardType
int m_orgBoardType
Definition: TGCSlaveBoardOut.h:60
LVL1TGCTrigger::posSize
const int posSize[6]
Definition: TGCSlaveBoardOut.h:15
LVL1TGCTrigger::TGCSlaveBoardOut::getNumberOfData
int getNumberOfData() const
Definition: TGCSlaveBoardOut.h:155
LVL1TGCTrigger::TGCSlaveBoardOut::setDev
void setDev(int iData, int devIn)
Definition: TGCSlaveBoardOut.h:97
LVL1TGCTrigger::TGCSlaveBoardOut::getOrgBoardType
int getOrgBoardType() const
Definition: TGCSlaveBoardOut.h:143
LVL1TGCTrigger::TGCSlaveBoardOut::setbDev
void setbDev(int block, int sign, int dr)
Definition: TGCSlaveBoardOut.cxx:138
LVL1TGCTrigger::TGCSlaveBoardOut::getbPos
TGCHitPattern * getbPos(int iData)
Definition: TGCSlaveBoardOut.h:107
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
LVL1TGCTrigger::TGCSlaveBoardOut::getPos
int getPos(int iData) const
Definition: TGCSlaveBoardOut.h:125
LVL1TGCTrigger::TGCSlaveBoardOut::~TGCSlaveBoardOut
~TGCSlaveBoardOut()
Definition: TGCSlaveBoardOut.cxx:120
LVL1TGCTrigger::TGCSlaveBoard
Definition: TGCSlaveBoard.h:22
LVL1TGCTrigger::devSize
const int devSize[6]
Definition: TGCSlaveBoardOut.h:16
TGCHitPattern.h
LVL1TGCTrigger::TGCSlaveBoardOut::setPos
void setPos(int iData, int posIn)
Definition: TGCSlaveBoardOut.cxx:171
LVL1TGCTrigger::TGCSlaveBoardOut::m_numberOfData
int m_numberOfData
Definition: TGCSlaveBoardOut.h:63
LVL1TGCTrigger::TGCSlaveBoardOut::setHit
void setHit(int iData, bool hitIn)
Definition: TGCSlaveBoardOut.h:87
LVL1TGCTrigger::TGCSlaveBoardOut::m_orgSBid
int m_orgSBid
Definition: TGCSlaveBoardOut.h:61
LVL1TGCTrigger::TGCSlaveBoardOut::m_bpos
TGCHitPattern * m_bpos[s_MaxNumberOfSBData]
Definition: TGCSlaveBoardOut.h:68
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:107
LVL1TGCTrigger::TGCSlaveBoardOut
Definition: TGCSlaveBoardOut.h:20
LVL1TGCTrigger::TGCSlaveBoardOut::TGCSlaveBoardOut
TGCSlaveBoardOut()
Definition: TGCSlaveBoardOut.cxx:106
LVL1TGCTrigger
Definition: LVL1TGCTrigger.cxx:47
LVL1TGCTrigger::TGCSlaveBoardOut::getHit
bool getHit(int iData) const
Definition: TGCSlaveBoardOut.h:131
LVL1TGCTrigger::TGCHitPattern
Definition: TGCHitPattern.h:11
LVL1TGCTrigger::TGCSlaveBoardOut::s_MaxNumberOfSBData
static constexpr int s_MaxNumberOfSBData
Definition: TGCSlaveBoardOut.h:56
keylayer_zslicemap.sb
sb
Definition: keylayer_zslicemap.py:192
LVL1TGCTrigger::TGCSlaveBoardOut::m_origin
const TGCSlaveBoard * m_origin
Definition: TGCSlaveBoardOut.h:58
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
LVL1TGCTrigger::TGCSlaveBoardOut::m_bid
int m_bid
Definition: TGCSlaveBoardOut.h:59
LVL1TGCTrigger::TGCHitPattern::dec2bin
void dec2bin(int dec)
Definition: TGCHitPattern.cxx:175
LVL1TGCTrigger::TGCSlaveBoardOut::m_hit
bool m_hit[s_MaxNumberOfSBData]
Definition: TGCSlaveBoardOut.h:66
LVL1TGCTrigger::TGCSlaveBoardOut::getOrigin
const TGCSlaveBoard * getOrigin() const
Definition: TGCSlaveBoardOut.h:113
LVL1TGCTrigger::TGCSlaveBoardOut::setbPos
void setbPos(int block, int pos)
Definition: TGCSlaveBoardOut.h:74
LVL1TGCTrigger::TGCSlaveBoardOut::operator=
TGCSlaveBoardOut & operator=(const TGCSlaveBoardOut &)
Definition: TGCSlaveBoardOut.cxx:37
LVL1TGCTrigger::devSign
const int devSign[6]
Definition: TGCSlaveBoardOut.h:17
LVL1TGCTrigger::TGCSlaveBoardOut::m_pos
int m_pos[s_MaxNumberOfSBData]
Definition: TGCSlaveBoardOut.h:65
LVL1TGCTrigger::TGCSlaveBoardOut::setNumberOfData
void setNumberOfData(int nData)
Definition: TGCSlaveBoardOut.h:149
LVL1TGCTrigger::TGCSlaveBoardOut::print
void print() const
Definition: TGCSlaveBoardOut.cxx:193
LVL1TGCTrigger::TGCSlaveBoardOut::m_dev
int m_dev[s_MaxNumberOfSBData]
Definition: TGCSlaveBoardOut.h:64