ATLAS Offline Software
TGCWireHighPtBoard.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // ref. SOS063V07,S0S061V04
8 
9 #include <iostream>
10 #include <cstdlib>
11 
12 namespace LVL1TGCTrigger {
13 
16 {
17  m_maxDev=15;
18  m_maxDevOred=20;
19  m_nChOfTSBOut = 96;
21  m_nChOfDSBOut = 64;
24 }
25 
27 {
31 
35 
36  if(m_adjacentHPB[0]){
38  }
42 
46  if(m_adjacentHPB[1]){
48  }
49 }
50 
52 {
53  int chip,j;
54  for( chip=0; chip<NumberOfChip; chip+=1){
55  for( j=0; j<NDecoderInTSB; j+=1) m_decoderInTSB[chip][j]=0;
56  for( j=0; j<NDecoderInDSB; j+=1) m_decoderInDSB[chip][j]=0;
57  }
58 }
59 
61  TGCHitPattern* tHit,
62  TGCHitPattern* dHit)
63 {
64  int block,j,ch;
65 
66  // for TripletSlaveBoard
67 #ifdef TGCCOUT
68  std::cout << "#--Wire decodeSlaveBoardOut()" << std::endl;
69  std::cout << "Triplet" << std::endl;
70 #endif
71  for( j=0; j<NDecoderInTSB; j+=1)
72  if(m_decoderInTSB[chip][j]!=0){
73 #ifdef TGCCOUT
74  std::cout << "index:" << j << "/" << NDecoderInTSB-1 << " in a chip ";
75  std::cout<<"WHPB:decoderInTSB["<<chip<<"]["<<j<<"]:";
76  m_decoderInTSB[chip][j]->print();
77 #endif
78  for( block=0; block<m_decoderInTSB[chip][j]->getNumberOfData(); block+=1)
79  if(m_decoderInTSB[chip][j]->getHit(block)){
81  +block*m_nChInTSBRegion+m_decoderInTSB[chip][j]->getPos(block);
82  if((ch>=0)&&(ch<m_nChOfTSBHit)) tHit->onChannel(ch);
83  }
84  }
85 
86  // for DoubletSlaveBoard
87 #ifdef TGCCOUT
88  std::cout << "Doublet" << std::endl;
89 #endif
90  for( j=0; j<NDecoderInDSB; j+=1)
91  if(m_decoderInDSB[chip][j]!=0){
92 #ifdef TGCCOUT
93  std::cout << "index:" << j << "/" << NDecoderInDSB-1 << " in a chip ";
94  std::cout<<"WHPB:decoderInDSB["<<chip<<"]["<<j<<"]:";
95  m_decoderInDSB[chip][j]->print();
96 #endif
97  for( block=0; block<m_decoderInDSB[chip][j]->getNumberOfData(); block+=1)
98  if(m_decoderInDSB[chip][j]->getHit(block)){
99  dHit->onChannel(j*m_nChOfDSBOut
100  +m_nChOfDSBOut/2*block+m_decoderInDSB[chip][j]->getPos(block));
101  }
102  }
103 }
104 
106  int block,
107  const TGCHitPattern* tHit,
108  const TGCHitPattern* dHit)
109 {
110  // ref. SOS062V05
111  int Oring;
112  int nChUnitOfDSBHit=m_nChOfDSBHit/NBlockOfDSBChannel; //ch in a AB CD
113  // int nChSubUnitOfDSBHit = nChUnitOfDSBHit / 2; //ch in a A B C D
114 
115 #ifdef TGCCOUT
116 std::cout << "# Wire doCoincidenceMatrix() chip:" << chip << " block:" << block << std::endl;
117 #endif
118  int dev, DevOrg, ich, DSBCh, TSBCh, ior;
119  for(dev=0; dev <= m_maxDev; dev++){
120  for(ich=0; ich < nChUnitOfDSBHit; ich++){
121  if(dev>2*m_maxDev-m_maxDevOred){
122  Oring = 1;
123  DevOrg = 2*m_maxDev-m_maxDevOred + (dev - (2*m_maxDev-m_maxDevOred))*2 - 1;
124  }else{
125  Oring = 0;
126  DevOrg = dev;
127  }
128  for(ior = 0; ior <= Oring; ior++){
129  DSBCh = nChUnitOfDSBHit*block + ich;
130  TSBCh = DSBCh + m_priorSign*(DevOrg + ior) + m_maxDevOred;
131  if(tHit->getChannel(TSBCh) && dHit->getChannel(DSBCh)){
132 #ifdef TGCDEBUG
133  std::cout << "HighPt" << std::endl
134  << " th&&dh==1 priorSign*dev:" << m_priorSign
135  << "*" << dev
136  << " DSBCh:" << DSBCh
137  << " TSBCh:" << TSBCh << std::endl;
138 #endif
139  // channel of dev>2*m_maxDev-m_maxDevOred is ored.
140  m_highPtBoardOut->setPt(chip,block,PtHigh);
141  m_highPtBoardOut->setHit(chip,block,true);
142  m_highPtBoardOut->setDev(chip,block,m_priorSign*dev);
143  m_highPtBoardOut->setPos(chip,block,ich/(m_nChOfDSBOut/4));
144  return;
145  }
146  }
147  }
148  // for dR of opposite sign
149  if(dev){
150  for(ich=0; ich < nChUnitOfDSBHit; ich++){
151  if(dev>2*m_maxDev-m_maxDevOred){
152  Oring = 1;
153  DevOrg = 2*m_maxDev-m_maxDevOred + (dev - (2*m_maxDev-m_maxDevOred))*2 - 1;
154  }else{
155  Oring = 0;
156  DevOrg = dev;
157  }
158  for(ior = 0; ior <= Oring; ior++){
159  DSBCh = nChUnitOfDSBHit*block + ich;
160  TSBCh = DSBCh - m_priorSign*(DevOrg + ior) + m_maxDevOred;
161  if(tHit->getChannel(TSBCh) && dHit->getChannel(DSBCh)){
162 #ifdef TGCDEBUG
163  std::cout << "HighPt" << std::endl
164  << " th&&dh==1 priorSign*dev:" << -m_priorSign
165  << "*" << dev
166  << " DSBCh:" << DSBCh
167  << " TSBCh:" << TSBCh << std::endl;
168 #endif
169  // channel of dev>2*m_maxDev-m_maxDevOred is ored.
170  m_highPtBoardOut->setPos(chip,block,ich/(m_nChOfDSBOut/4));
171  m_highPtBoardOut->setDev(chip,block,-m_priorSign*dev);
172  m_highPtBoardOut->setPt(chip,block,PtHigh);
173  m_highPtBoardOut->setHit(chip,block,true);
174  return;
175  }
176  }
177  }
178  }
179  }
180 }
181 
182 } //end of namespace bracket
LVL1TGCTrigger::TGCHighPtBoardOut::setDev
void setDev(int chip, int iData, int devIn)
Definition: TGCHighPtBoardOut.h:66
LVL1TGCTrigger::PtHigh
const int PtHigh
Definition: TGCHighPtBoard.h:17
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
LVL1TGCTrigger::TGCHighPtBoard::m_DSBOut
TGCSlaveBoardOut * m_DSBOut[NumberOfChip][s_NumberOfDSBOut]
Definition: TGCHighPtBoard.h:94
LVL1TGCTrigger::TGCHighPtBoard::m_nChOfTSBOut
int m_nChOfTSBOut
Definition: TGCHighPtBoard.h:110
LVL1TGCTrigger::TGCWireHighPtBoard::setDecoderIn
virtual void setDecoderIn()
Definition: TGCWireHighPtBoard.cxx:26
LVL1TGCTrigger::NDecoderInDSB
const int NDecoderInDSB
Definition: TGCHighPtBoard.h:23
LVL1TGCTrigger::TGCHighPtBoard::m_decoderInTSB
TGCSlaveBoardOut * m_decoderInTSB[NumberOfChip][NDecoderInTSB]
Definition: TGCHighPtBoard.h:97
LVL1TGCTrigger::TGCHighPtBoard::m_nChOfDSBOut
int m_nChOfDSBOut
Definition: TGCHighPtBoard.h:111
LVL1TGCTrigger::TGCSlaveBoardOut::getNumberOfData
int getNumberOfData() const
Definition: TGCSlaveBoardOut.h:155
LVL1TGCTrigger::TGCWireHighPtBoard::decodeSlaveBoardOut
virtual void decodeSlaveBoardOut(int chip, TGCHitPattern *tHit, TGCHitPattern *dHit)
Definition: TGCWireHighPtBoard.cxx:60
LVL1TGCTrigger::ChipB
@ ChipB
Definition: TGCHighPtBoard.h:26
TGCHighPtBoardOut.h
LVL1TGCTrigger::TGCHighPtBoard::m_nChOfDSBHit
int m_nChOfDSBHit
Definition: TGCHighPtBoard.h:112
LVL1TGCTrigger::TGCWireHighPtBoard::doCoincidenceMatrix
virtual void doCoincidenceMatrix(int chip, int block, const TGCHitPattern *tHit, const TGCHitPattern *dHit)
Definition: TGCWireHighPtBoard.cxx:105
LVL1TGCTrigger::TGCWireHighPtBoard::TGCWireHighPtBoard
TGCWireHighPtBoard()
Definition: TGCWireHighPtBoard.cxx:14
LVL1TGCTrigger::TGCHighPtBoard::m_nChInTSBRegion
int m_nChInTSBRegion
Definition: TGCHighPtBoard.h:114
LVL1TGCTrigger::TGCHitPattern::onChannel
void onChannel(int iChannel)
Definition: TGCHitPattern.h:55
LVL1TGCTrigger::NumberOfChip
const int NumberOfChip
Definition: TGCHighPtBoard.h:20
LVL1TGCTrigger::TGCHighPtBoard::m_adjacentHPB
TGCHighPtBoard * m_adjacentHPB[NumberOfAdjacentHPB]
Definition: TGCHighPtBoard.h:96
LVL1TGCTrigger::TGCHighPtBoard::m_priorSign
int m_priorSign
Definition: TGCHighPtBoard.h:106
LVL1TGCTrigger::TGCHighPtBoardOut::setPos
void setPos(int chip, int iData, int posIn)
Definition: TGCHighPtBoardOut.h:73
LVL1TGCTrigger::TGCHighPtBoard::m_nChOfTSBHit
int m_nChOfTSBHit
Definition: TGCHighPtBoard.h:113
TGCWireHighPtBoard.h
LVL1TGCTrigger::TGCHighPtBoard::m_decoderInDSB
TGCSlaveBoardOut * m_decoderInDSB[NumberOfChip][NDecoderInDSB]
Definition: TGCHighPtBoard.h:98
LVL1TGCTrigger::NDecoderInTSB
const int NDecoderInTSB
Definition: TGCHighPtBoard.h:22
LVL1TGCTrigger::TGCHitPattern::getChannel
bool getChannel(int iChannel) const
Definition: TGCHitPattern.cxx:64
LVL1TGCTrigger
Definition: LVL1TGCTrigger.cxx:47
LVL1TGCTrigger::TGCHitPattern
Definition: TGCHitPattern.h:11
LVL1TGCTrigger::TGCWireHighPtBoard::clearDecoderIn
virtual void clearDecoderIn()
Definition: TGCWireHighPtBoard.cxx:51
LVL1TGCTrigger::TGCHighPtBoard::m_maxDevOred
int m_maxDevOred
Definition: TGCHighPtBoard.h:109
LVL1TGCTrigger::TGCHighPtBoard
Definition: TGCHighPtBoard.h:34
LVL1TGCTrigger::NBlockOfDSBChannel
const int NBlockOfDSBChannel
Definition: TGCHighPtBoard.h:21
LVL1TGCTrigger::ChipA
@ ChipA
Definition: TGCHighPtBoard.h:26
LVL1TGCTrigger::TGCHighPtBoardOut::setPt
void setPt(int chip, int iData, int ptIn)
Definition: TGCHighPtBoardOut.h:80
LVL1TGCTrigger::TGCHighPtBoard::getTSBOut
TGCSlaveBoardOut * getTSBOut(int chip, int port)
Definition: TGCHighPtBoard.cxx:225
LVL1TGCTrigger::TGCHighPtBoard::m_TSBOut
TGCSlaveBoardOut * m_TSBOut[NumberOfChip][s_NumberOfTSBOut]
Definition: TGCHighPtBoard.h:95
LVL1TGCTrigger::TGCSlaveBoardOut::print
void print() const
Definition: TGCSlaveBoardOut.cxx:193
LVL1TGCTrigger::TGCHighPtBoard::m_highPtBoardOut
TGCHighPtBoardOut * m_highPtBoardOut
Definition: TGCHighPtBoard.h:89
LVL1TGCTrigger::TGCHighPtBoard::m_maxDev
int m_maxDev
Definition: TGCHighPtBoard.h:108
LVL1TGCTrigger::TGCHighPtBoardOut::setHit
void setHit(int chip, int iData, bool hitIn)
Definition: TGCHighPtBoardOut.h:123