ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1TGCTrigger::TGCInnerSB Class Reference

#include <TGCInnerSB.h>

Inheritance diagram for LVL1TGCTrigger::TGCInnerSB:
Collaboration diagram for LVL1TGCTrigger::TGCInnerSB:

Public Member Functions

 TGCInnerSB ()
virtual ~TGCInnerSB ()
void clockIn (int bidIn)
TGCSlaveBoardOutgetOutput ()
void eraseOutput ()
int getId () const
void setId (int idIn)
void setPatchPanel (TGCPatchPanel *PPIn)
int getIdHighPtBoard () const
void setIdHighPtBoard (int m_id)
int getType () const
void setType (int typeIn)
TGCRegionType getRegion () const
void setRegion (TGCRegionType regionIn)
void showResult () const
std::string getTypeName (int typeIn) const
void setPatchPanelOut (TGCPatchPanelOut *PPOut)
void storeSlbIn ()
const std::bitset< 200 > & GetSlbIn (void) const

Protected Member Functions

virtual void doCoincidence ()
virtual void createSlaveBoardOut ()
void collectInput ()
void doMaskOperation ()
void doDecluster ()
void deletePatchPanelOut ()

Protected Attributes

int m_lengthOfCoincidenceOut
TGCHitPatternm_coincidenceOut
TGCSlaveBoardOutm_slaveBoardOut
int m_id
int m_bid
int m_idHighPtBoard
int m_type
TGCRegionType m_region
TGCPatchPanelm_patchPanel
TGCPatchPanelOutm_patchPanelOut
std::bitset< 200 > m_slbin

Static Private Attributes

static constexpr int s_pOffset [6] = {0,0,2,2,2,2}
static constexpr int s_iOffset [6] = {4,0,6,6,6,6}
static constexpr int s_pLength [6] = {36,36,32,32,32,32}
static constexpr int s_iLength [6] = {36,44,32,32,32,32}

Detailed Description

Definition at line 12 of file TGCInnerSB.h.

Constructor & Destructor Documentation

◆ TGCInnerSB()

LVL1TGCTrigger::TGCInnerSB::TGCInnerSB ( )

Definition at line 12 of file TGCInnerSB.cxx.

◆ ~TGCInnerSB()

virtual LVL1TGCTrigger::TGCInnerSB::~TGCInnerSB ( )
inlinevirtual

Definition at line 16 of file TGCInnerSB.h.

16{};

Member Function Documentation

◆ clockIn()

void LVL1TGCTrigger::TGCSlaveBoard::clockIn ( int bidIn)
inherited

Definition at line 37 of file TGCSlaveBoard.cxx.

38{
39 m_bid = bidIn;
41
42 m_slbin.reset();
43
44#ifdef TGCDEBUG
45 int i;
46 std::cout << "#SB: BID= " << m_bid;
47 std::cout << " Rgn= " << m_region;
48 std::cout << " Typ= " << getTypeName(m_type);
49 std::cout << " ID= " << m_id << std::endl;
50 if(m_patchPanelOut!=0){
51 for( i=0; i<NumberOfConnectorPerPPOut; i+=1)
52 if(m_patchPanelOut->getHitPattern(i)!=0){
53 std::cout<<"#SB I: BID= "<<m_bid;
54 if(m_patchPanelOut->getOrigin()!=0){
55 std::cout << " Typ= " <<m_patchPanelOut->getOrigin()->getType();
56 std::cout << " Rgn= " <<m_patchPanelOut->getOrigin()->getRegion();
57 std::cout << " PPID= "<<m_patchPanelOut->getOrigin()->getId()<<" ";
58 std::cout << " port= "<<i;
59 std::cout << "" <<m_id;
60 }
61 std::cout << ":";
62 m_patchPanelOut->getHitPattern(i)->print();
63 }
64 } else {
65 std::cout << "NO PP IN" << std::endl;
66 }
67#endif
68
69 // delete m_slaveBoardOut and m_coincidenceOut
71 if( m_slaveBoardOut!=0) delete m_slaveBoardOut;
74
75 if(m_patchPanelOut!=0){
77
78 storeSlbIn();
79
81 if(m_coincidenceOut!=0) {
82#ifdef TGCDEBUG_VISUAL
83 std::cout << "TGCSlaveBoard::clockIn: after doCoincidence()\n";
84 m_coincidenceOut->visual(m_coincidenceOut->getLength(), 1, 0);
85#endif
86#ifdef TGCDEBUG
87 std::cout << "#SB C: BID= " << m_bid << ":";
88 m_coincidenceOut->print();
89#endif
90 }
92#ifdef TGCDEBUG_VISUAL
93 if(m_coincidenceOut!=0) {
94 std::cout << "TGCSlaveBoard::clockIn: after doDecluster()\n";
95 m_coincidenceOut->visual(m_coincidenceOut->getLength(), 1, 0);
96 }
97#endif
99
100#ifdef TGCDEBUG
101 showResult();
102#endif
103
105 if(m_coincidenceOut!=0){
106 delete m_coincidenceOut;
108 }
109 }
110}
std::string getTypeName(int typeIn) const
TGCSlaveBoardOut * m_slaveBoardOut
virtual void doCoincidence()=0
TGCPatchPanelOut * m_patchPanelOut
virtual void createSlaveBoardOut()=0
const int NumberOfConnectorPerPPOut

◆ collectInput()

void LVL1TGCTrigger::TGCSlaveBoard::collectInput ( )
protectedinherited

Definition at line 240 of file TGCSlaveBoard.cxx.

241{
242#ifdef TGCDEBUG
243 std::cout << "#SB: BID= " << m_bid;
244 std::cout << " Rgn= " << m_region;
245 std::cout << " Typ= " << getTypeName(m_type);
246 std::cout << " ID= " << m_id << std::endl;
247 if (m_patchPanel!=0) m_patchPanel->showProperty();
248#endif
249
250 if(m_patchPanel!=0){
251 m_patchPanelOut = m_patchPanel->getOutput(m_id);
252#ifdef TGCDEBUG
253 if(m_patchPanelOut!=0) m_patchPanelOut->print();
254#endif
255 m_patchPanel->eraseOutput(m_id);
256
257 }
258}

◆ createSlaveBoardOut()

void LVL1TGCTrigger::TGCInnerSB::createSlaveBoardOut ( )
protectedvirtual

Implements LVL1TGCTrigger::TGCSlaveBoard.

Definition at line 16 of file TGCInnerSB.cxx.

17{
18 static constexpr int kNumberOfInnerSBData = 8;
19
20 if(m_coincidenceOut!=0){
21 if ( m_slaveBoardOut!=0 ) delete m_slaveBoardOut;
22 m_slaveBoardOut = new TGCSlaveBoardOut(this, m_bid);
23 m_slaveBoardOut->clear();
24 m_slaveBoardOut->setNumberOfData(kNumberOfInnerSBData);
25
26 // fill SlaveBoardOut.
27 // select largest R hit in each sections.
28 int lengthOfSection = m_lengthOfCoincidenceOut/kNumberOfInnerSBData;
29 int i,j;
30#ifdef TGCDEBUG
31 std::cout <<" Type :" << getType() << " id:" << getId()
32 <<" lengthOfCoincidenceOut= "<< m_lengthOfCoincidenceOut
33 <<" lengthOfSection= "<<lengthOfSection<<std::endl;
34#endif
35 for( i=0; i<kNumberOfInnerSBData; i+=1){// i=3:d 2:c 1:b 0:a, 7:d 6:c 5:b 4:a
36 m_slaveBoardOut->setHit(i,false);
37 for( j=0; j<lengthOfSection; j+=1) {
38 if(m_coincidenceOut->getChannel(j+i*lengthOfSection)){
39 m_slaveBoardOut->setPos(i,j);
40 m_slaveBoardOut->setHit(i,true);
41#ifdef TGCDEBUG
42 std::cout <<" Hit @"<< i << " section:" << j <<std::endl;
43#endif
44 break;
45 }
46 }
47 if(m_slaveBoardOut->getHit(i)){
48 m_slaveBoardOut->setbPos(i, m_slaveBoardOut->getPos(i));
49 }
50 }
51 }
52}

◆ deletePatchPanelOut()

void LVL1TGCTrigger::TGCSlaveBoard::deletePatchPanelOut ( )
protectedinherited

Definition at line 184 of file TGCSlaveBoard.cxx.

185{
186 if( m_patchPanelOut!=0 ) delete m_patchPanelOut;
188}

◆ doCoincidence()

void LVL1TGCTrigger::TGCInnerSB::doCoincidence ( )
protectedvirtual

Implements LVL1TGCTrigger::TGCSlaveBoard.

Definition at line 54 of file TGCInnerSB.cxx.

55{
56 const TGCHitPattern* pattern[2];
57 pattern[0] = m_patchPanelOut->getHitPattern(0);
58 pattern[1] = m_patchPanelOut->getHitPattern(1);
59
60 int length;
61 if(pattern[0]!=0){
62 length = pattern[0]->getLength();
63 }else if(pattern[1]!=0){
64 length = pattern[1]->getLength();
65 }else
66 length = -1;
67
68 if(length>0){
71 m_coincidenceOut = new TGCHitPattern(m_lengthOfCoincidenceOut);
72
73 // rearrange bit pattern for coincidence.
74 bool* b = new bool [m_lengthOfCoincidenceOut];
75
76 int j;
77 for( j=0; j<m_lengthOfCoincidenceOut; j+=1){
78 b[j]=false;
79 }
80
81 // rearrange signal pattern for 2layer for 1/2 coincidence.
82 // ! the order to rearrange is chosen by Daniel table P.
83 int i;
84 for( i=0; i<length/2; i+=1){
85 if(pattern[1]!=0){
86 b[2*i+1] = pattern[1]->getChannel(i+length/2);// smaller in phi
87 b[2*i] = pattern[1]->getChannel(i);
88 }
89 if(pattern[0]!=0){
90 b[length+2*i+1] = pattern[0]->getChannel(i+length/2);// smaller in phi
91 b[length+2*i] = pattern[0]->getChannel(i);
92 }
93 }
94
95#ifdef TGCDEBUG
96 std::cout <<" Type :" << getType() << " id:" << getId() << std::endl;
97 for( j=0; j<m_lengthOfCoincidenceOut; j+=1){
98 if (b[j]) std::cout << "*";
99 else std::cout << "-";
100 }
101 std::cout <<std::endl;
102#endif
103 // perform 1/2 coincidence
104 int block;
105 for( block=0; block<2; block+=1){
106 int base=block*length;
107/*
108 b & c
109 +b & !a & !c
110 +a & c & !b
111 +c & !b & !d
112 +b & d & !c
113*/
114
115 i=base;
116 m_coincidenceOut->setChannel(i,( b[i] & !b[i+1] ));
117
118 i=base+1;
119 m_coincidenceOut->setChannel(i,(( b[i-1] & b[i] )|
120 ( b[i-1] & !b[i] )|
121 ( b[i] & !b[i-1] & !b[i+1] )|
122 ( b[i-1] & b[i+1] & !b[i] )));
123
124 for( i=base+2; i<base+length-1; i+=1){
125 m_coincidenceOut->setChannel(i,(( b[i-1] & b[i] )|
126 ( b[i-1] & !b[i-2] & !b[i] )|
127 ( b[i-2] & b[i] & !b[i-1] )|
128 ( b[i] & !b[i-1] & !b[i+1] )|
129 ( b[i-1] & b[i+1] & !b[i] )));
130 }
131 i=base+length-1;
132 m_coincidenceOut->setChannel(i,(( b[i-1] & b[i] )|
133 ( b[i-1] & !b[i-2] & !b[i] )|
134 ( b[i-2] & b[i] & !b[i-1] )|
135 ( b[i] & !b[i-1] )));
136
137#ifdef TGCCOUT
138 std::cout << "InnerCoincidence OUT ";
139 m_coincidenceOut->printb();
140 std::cout << std::endl;
141#endif
142
143 }
144
145 delete [] b;
146 }
147}
double length(const pvec &v)
std::string base
Definition hcg.cxx:81

◆ doDecluster()

void LVL1TGCTrigger::TGCSlaveBoard::doDecluster ( )
protectedinherited

Definition at line 190 of file TGCSlaveBoard.cxx.

191{
192 int i;
193 bool A, B, C, D;
194
195 if(m_coincidenceOut!=0){
196 TGCHitPattern* out = new TGCHitPattern (m_coincidenceOut->getLength());
197 int length = out->getLength();
198 for( i=2; i<length-1; i+=1) {
199 A = m_coincidenceOut->getChannel(i-2);
200 B = m_coincidenceOut->getChannel(i-1);
201 C = m_coincidenceOut->getChannel(i);
202 D = m_coincidenceOut->getChannel(i+1);
203 out->setChannel(i,( !B & C & !D )|( !A & B & C ));
204 }
205
206 A = false;
207 B = false;
208 C = m_coincidenceOut->getChannel(0);
209 D = m_coincidenceOut->getChannel(1);
210 out->setChannel(0,( !B & C & !D )|( !A & B & C ));
211
212 A = false;
213 B = m_coincidenceOut->getChannel(0);
214 C = m_coincidenceOut->getChannel(1);
215 D = m_coincidenceOut->getChannel(2);
216 out->setChannel(1,( !B & C & !D )|( !A & B & C ));
217
218 A = m_coincidenceOut->getChannel(length-3);
219 B = m_coincidenceOut->getChannel(length-2);
220 C = m_coincidenceOut->getChannel(length-1);
221 D = false;
222 out->setChannel(length-1,( !B & C & !D )|( !A & B & C ));
223
224 delete m_coincidenceOut;
226 out=0;
227 }
228}
struct color C

◆ doMaskOperation()

void LVL1TGCTrigger::TGCSlaveBoard::doMaskOperation ( )
inlineprotectedinherited

Definition at line 65 of file TGCSlaveBoard.h.

65{};

◆ eraseOutput()

void LVL1TGCTrigger::TGCSlaveBoard::eraseOutput ( )
inherited

Definition at line 230 of file TGCSlaveBoard.cxx.

231{
233}

◆ getId()

int LVL1TGCTrigger::TGCSlaveBoard::getId ( ) const
inlineinherited

Definition at line 41 of file TGCSlaveBoard.h.

41{ return m_id;};

◆ getIdHighPtBoard()

int LVL1TGCTrigger::TGCSlaveBoard::getIdHighPtBoard ( ) const
inherited

Definition at line 260 of file TGCSlaveBoard.cxx.

261{
262 return m_idHighPtBoard;
263}

◆ getOutput()

TGCSlaveBoardOut * LVL1TGCTrigger::TGCSlaveBoard::getOutput ( )
inlineinherited

Definition at line 38 of file TGCSlaveBoard.h.

38{ return m_slaveBoardOut; }

◆ getRegion()

TGCRegionType LVL1TGCTrigger::TGCSlaveBoard::getRegion ( ) const
inlineinherited

Definition at line 52 of file TGCSlaveBoard.h.

52{ return m_region;};

◆ GetSlbIn()

const std::bitset< 200 > & LVL1TGCTrigger::TGCSlaveBoard::GetSlbIn ( void ) const
inlineinherited

Definition at line 61 of file TGCSlaveBoard.h.

61{ return m_slbin; } // for readout

◆ getType()

int LVL1TGCTrigger::TGCSlaveBoard::getType ( ) const
inlineinherited

Definition at line 49 of file TGCSlaveBoard.h.

49{ return m_type;};

◆ getTypeName()

std::string LVL1TGCTrigger::TGCSlaveBoard::getTypeName ( int typeIn) const
inherited

Definition at line 173 of file TGCSlaveBoard.cxx.

174{
175 if(m_type==WTSB) return "WT";//0
176 if(m_type==WDSB) return "WD";//1
177 if(m_type==STSB) return "ST";//2
178 if(m_type==SDSB) return "SD";//3
179 if(m_type==WISB) return "WI";//4
180 if(m_type==SISB) return "SI";//5
181 return "";
182}

◆ setId()

void LVL1TGCTrigger::TGCSlaveBoard::setId ( int idIn)
inlineinherited

Definition at line 42 of file TGCSlaveBoard.h.

42{ m_id=idIn;};

◆ setIdHighPtBoard()

void LVL1TGCTrigger::TGCSlaveBoard::setIdHighPtBoard ( int m_id)
inherited

Definition at line 265 of file TGCSlaveBoard.cxx.

266{
267 m_idHighPtBoard = idIn;
268}

◆ setPatchPanel()

void LVL1TGCTrigger::TGCSlaveBoard::setPatchPanel ( TGCPatchPanel * PPIn)
inherited

Definition at line 235 of file TGCSlaveBoard.cxx.

236{
237 m_patchPanel = PPIn;
238}

◆ setPatchPanelOut()

void LVL1TGCTrigger::TGCSlaveBoard::setPatchPanelOut ( TGCPatchPanelOut * PPOut)
inlineinherited

Definition at line 58 of file TGCSlaveBoard.h.

58{ m_patchPanelOut=PPOut;};

◆ setRegion()

void LVL1TGCTrigger::TGCSlaveBoard::setRegion ( TGCRegionType regionIn)
inlineinherited

Definition at line 53 of file TGCSlaveBoard.h.

53{ m_region=regionIn;};

◆ setType()

void LVL1TGCTrigger::TGCSlaveBoard::setType ( int typeIn)
inlineinherited

Definition at line 50 of file TGCSlaveBoard.h.

50{ m_type=typeIn;};

◆ showResult()

void LVL1TGCTrigger::TGCSlaveBoard::showResult ( ) const
inherited

Definition at line 133 of file TGCSlaveBoard.cxx.

134{
135
136 int i;
137 if(m_patchPanelOut!=0){
138 for( i=0; i<NumberOfConnectorPerPPOut; i+=1)
139 if(std::as_const(m_patchPanelOut)->getHitPattern(i)!=0){
140 std::cout<<"#SB I: BID= "<<m_bid;
141 if(m_patchPanelOut->getOrigin()!=0){
142 std::cout << " Typ= " << m_patchPanelOut->getOrigin()->getType();
143 std::cout << " Rgn= " << (m_patchPanelOut->getOrigin()->getRegion() == TGCRegionType::FORWARD ? "FORWARD" : "ENDCAP");
144 std::cout << " PPID= "<< m_patchPanelOut->getOrigin()->getId()<<" ";
145 std::cout << " port= "<< i;
146 std::cout << "" << m_id;
147 }
148 std::cout << ":";
149 std::as_const(m_patchPanelOut)->getHitPattern(i)->print();
150 }
151 }
152
153 if(m_slaveBoardOut!=0){
154 if(m_coincidenceOut!=0){
155 std::cout << "#SB O: BID= " << m_bid;
156 std::cout << " Rgn= " << (m_region == TGCRegionType::FORWARD ? "FORWARD" : "ENDCAP");
157 std::cout << " Typ= " << getTypeName(m_type);
158 std::cout << " ID= " << m_id << ":";
159 for( i=0; i<m_slaveBoardOut->getNumberOfData(); i++){
160 if(m_slaveBoardOut->getHit(i)){
161 std::cout << " i= " << i;
162 std::cout << " x= " << m_slaveBoardOut->getPos(i);
163 if((m_type==1)||(m_type==3))// doublet
164 std::cout << " d= " << m_slaveBoardOut->getDev(i);
165 }
166 }
167 std::cout<<std::endl;
168 std::cout<<"Destination HPBID= "<<m_idHighPtBoard<<std::endl;
169 }
170 }
171}
TGCRegionType getRegion() const

◆ storeSlbIn()

void LVL1TGCTrigger::TGCSlaveBoard::storeSlbIn ( )
inherited

Definition at line 112 of file TGCSlaveBoard.cxx.

113{
114 // store SlaveBoard input for readout
115 const TGCHitPattern* inner = m_patchPanelOut->getHitPattern(0);
116 const TGCHitPattern* pivot = m_patchPanelOut->getHitPattern(1);
117 int i;
118 if(pivot!=0){
119 for(i=0; i<s_pLength[m_type]; i++){
120 m_slbin.set(40+i+s_pOffset[m_type], pivot->getChannel(i+s_pLength[m_type]));
121 m_slbin.set(40+36+i+s_pOffset[m_type], pivot->getChannel(i));
122 }
123 }
124 if(inner!=0){
125 for(i=0; i<s_iLength[m_type]; i++){
126 if(inner->getLength()>s_iLength[m_type])//WTSB
127 m_slbin.set(40+36+36+i+s_iOffset[m_type], inner->getChannel(i+s_iLength[m_type]));
128 m_slbin.set(40+36+36+44+i+s_iOffset[m_type], inner->getChannel(i));
129 }
130 }
131}
static constexpr int s_pOffset[6]
static constexpr int s_pLength[6]
static constexpr int s_iLength[6]
static constexpr int s_iOffset[6]

Member Data Documentation

◆ m_bid

int LVL1TGCTrigger::TGCSlaveBoard::m_bid
protectedinherited

Definition at line 77 of file TGCSlaveBoard.h.

◆ m_coincidenceOut

TGCHitPattern* LVL1TGCTrigger::TGCSlaveBoard::m_coincidenceOut
protectedinherited

Definition at line 73 of file TGCSlaveBoard.h.

◆ m_id

int LVL1TGCTrigger::TGCSlaveBoard::m_id
protectedinherited

Definition at line 76 of file TGCSlaveBoard.h.

◆ m_idHighPtBoard

int LVL1TGCTrigger::TGCSlaveBoard::m_idHighPtBoard
protectedinherited

Definition at line 78 of file TGCSlaveBoard.h.

◆ m_lengthOfCoincidenceOut

int LVL1TGCTrigger::TGCSlaveBoard::m_lengthOfCoincidenceOut
protectedinherited

Definition at line 72 of file TGCSlaveBoard.h.

◆ m_patchPanel

TGCPatchPanel* LVL1TGCTrigger::TGCSlaveBoard::m_patchPanel
protectedinherited

Definition at line 82 of file TGCSlaveBoard.h.

◆ m_patchPanelOut

TGCPatchPanelOut* LVL1TGCTrigger::TGCSlaveBoard::m_patchPanelOut
protectedinherited

Definition at line 83 of file TGCSlaveBoard.h.

◆ m_region

TGCRegionType LVL1TGCTrigger::TGCSlaveBoard::m_region
protectedinherited

Definition at line 80 of file TGCSlaveBoard.h.

◆ m_slaveBoardOut

TGCSlaveBoardOut* LVL1TGCTrigger::TGCSlaveBoard::m_slaveBoardOut
protectedinherited

Definition at line 74 of file TGCSlaveBoard.h.

◆ m_slbin

std::bitset<200> LVL1TGCTrigger::TGCSlaveBoard::m_slbin
protectedinherited

Definition at line 84 of file TGCSlaveBoard.h.

◆ m_type

int LVL1TGCTrigger::TGCSlaveBoard::m_type
protectedinherited

Definition at line 79 of file TGCSlaveBoard.h.

◆ s_iLength

int LVL1TGCTrigger::TGCSlaveBoard::s_iLength[6] = {36,44,32,32,32,32}
staticconstexprprivateinherited

Definition at line 28 of file TGCSlaveBoard.h.

28{36,44,32,32,32,32};

◆ s_iOffset

int LVL1TGCTrigger::TGCSlaveBoard::s_iOffset[6] = {4,0,6,6,6,6}
staticconstexprprivateinherited

Definition at line 26 of file TGCSlaveBoard.h.

26{4,0,6,6,6,6};

◆ s_pLength

int LVL1TGCTrigger::TGCSlaveBoard::s_pLength[6] = {36,36,32,32,32,32}
staticconstexprprivateinherited

Definition at line 27 of file TGCSlaveBoard.h.

27{36,36,32,32,32,32};

◆ s_pOffset

int LVL1TGCTrigger::TGCSlaveBoard::s_pOffset[6] = {0,0,2,2,2,2}
staticconstexprprivateinherited

Definition at line 25 of file TGCSlaveBoard.h.

25{0,0,2,2,2,2};// WT,WD,ST,SD,WI,SI

The documentation for this class was generated from the following files: