ATLAS Offline Software
TGCWireTripletSB.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // ref. SOS051V07,S0S052V06
9 #include <iostream>
10 #include <cstdlib>
11 
12 namespace LVL1TGCTrigger {
13 
15  : TGCSlaveBoard()
16 {}
17 
19 {
20  if(m_coincidenceOut!=0){
21  if ( m_slaveBoardOut != 0 ) delete m_slaveBoardOut;
25 
26  // fill SlaveBoardOut.
27  // select largest R hit in each sections.
29  int i,j;
30  for( i=0; i<s_NumberOfWireTripletSBData; i+=1){ // i=0:a 1:b 2:c
33  m_slaveBoardOut->setHit(i,false);
34  for( j=0; j<lengthOfSection; j+=1) {
35  if(m_coincidenceOut->getChannel(s_NChAdjInWTSB + j + i*lengthOfSection)){
37  m_slaveBoardOut->setHit(i,true);
38  break;
39  }
40  }
41  if(m_slaveBoardOut->getHit(i)){
43  }
44  }
45  }
46 }
47 
49 {
50  const TGCHitPattern* pattern[2];
51  // pattern[0] has hit pattern of layer0[36-71].
52  // pattern[1] has hit pattern of layer1[0-35] and layer2[36-71] .
55 
56  if(pattern[1] != 0) { // necessary for 2/3 coincidence.
57  const int unitLength = pattern[1]->getLength() / 2;
58  const int totalLength = 3 * unitLength;
59 
61  if (m_coincidenceOut != 0) delete m_coincidenceOut;
63 
64  // rearrange bit pattern for coincidence.
65  std::vector<bool> b(totalLength);
66  for (int i=0; i < unitLength; i++) {
67  if (pattern[0] != 0) {
68  b[3*i] = pattern[0]->getChannel(i+unitLength); //layer0(smallest in eta)
69  } else {
70  b[3*i] = 0;
71  }
72  if (pattern[1] != 0) {
73  b[3*i+1] = pattern[1]->getChannel(i); // layer1
74  b[3*i+2] = pattern[1]->getChannel(i+unitLength); //layer2
75  } else {
76  b[3*i+1] = 0;
77  b[3*i+2] = 0;
78  }
79  }
80 
81  // perform 2/3 coincidence
82  std::vector<bool> output(totalLength);
83  for (int i=0; i < totalLength-8; i++) {
84  output[i] = (b[i+3] && b[i+5] && !b[i+1] && !b[i+7]) ||
85  (b[i+3] && b[i+4] && !b[i+2]) ||
86  (b[i+4] && b[i+5] && !b[i+6]) ||
87  (b[i+6] && b[i+2] && b[i+4] && !b[i+3] && !b[i+5] && !b[i+1] && !b[i+7]);
88  }
89 
90  int base = 0;
91  for (int i=0; i<m_lengthOfCoincidenceOut; i++) {
93  }
94  }
95 }
96 
98 {
99  if ( this != &right ) {
100  m_id = right.m_id;
101  m_bid = right.m_bid;
103  m_type = right.m_type;
106  *m_patchPanel = *right.m_patchPanel;
108 
109  if ( m_lengthOfCoincidenceOut > 0) {
110  if ( m_coincidenceOut ) delete m_coincidenceOut;
112  }
113  }
114  return *this;
115 }
116 
117 
118 
119 } //end of namespace bracket
mergePhysValFiles.pattern
pattern
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:26
base
std::string base
Definition: hcg.cxx:78
LVL1TGCTrigger::TGCWireTripletSB::s_NumberOfWireTripletSBData
static constexpr int s_NumberOfWireTripletSBData
Definition: TGCWireTripletSB.h:17
LVL1TGCTrigger::TGCSlaveBoard::m_bid
int m_bid
Definition: TGCSlaveBoard.h:77
LVL1TGCTrigger::TGCSlaveBoardOut::clear
void clear()
Definition: TGCSlaveBoardOut.cxx:181
TGCPatchPanelOut.h
LVL1TGCTrigger::TGCSlaveBoard::m_id
int m_id
Definition: TGCSlaveBoard.h:76
LVL1TGCTrigger::TGCHitPattern::getLength
int getLength() const
Definition: TGCHitPattern.h:49
LVL1TGCTrigger::TGCSlaveBoardOut::getPos
int getPos(int iData) const
Definition: TGCSlaveBoardOut.h:125
LVL1TGCTrigger::TGCWireTripletSB::createSlaveBoardOut
virtual void createSlaveBoardOut()
Definition: TGCWireTripletSB.cxx:18
LVL1TGCTrigger::TGCWireTripletSB::s_LengthOfWTSBCoincidenceOut
static constexpr int s_LengthOfWTSBCoincidenceOut
Definition: TGCWireTripletSB.h:15
LVL1TGCTrigger::TGCSlaveBoard
Definition: TGCSlaveBoard.h:22
LVL1TGCTrigger::TGCSlaveBoardOut::setPos
void setPos(int iData, int posIn)
Definition: TGCSlaveBoardOut.cxx:171
LVL1TGCTrigger::TGCWireTripletSB::doCoincidence
virtual void doCoincidence()
Definition: TGCWireTripletSB.cxx:48
LVL1TGCTrigger::TGCSlaveBoardOut::setHit
void setHit(int iData, bool hitIn)
Definition: TGCSlaveBoardOut.h:87
lumiFormat.i
int i
Definition: lumiFormat.py:85
LVL1TGCTrigger::TGCSlaveBoard::m_idHighPtBoard
int m_idHighPtBoard
Definition: TGCSlaveBoard.h:78
TGCWireTripletSB.h
LVL1TGCTrigger::TGCSlaveBoard::m_type
int m_type
Definition: TGCSlaveBoard.h:79
LVL1TGCTrigger::TGCSlaveBoardOut
Definition: TGCSlaveBoardOut.h:20
LVL1TGCTrigger::TGCHitPattern::getChannel
bool getChannel(int iChannel) const
Definition: TGCHitPattern.cxx:64
LVL1TGCTrigger::TGCSlaveBoard::m_slaveBoardOut
TGCSlaveBoardOut * m_slaveBoardOut
Definition: TGCSlaveBoard.h:74
LVL1TGCTrigger
Definition: LVL1TGCTrigger.cxx:47
LVL1TGCTrigger::TGCSlaveBoardOut::getHit
bool getHit(int iData) const
Definition: TGCSlaveBoardOut.h:131
LVL1TGCTrigger::TGCWireTripletSB::TGCWireTripletSB
TGCWireTripletSB()
Definition: TGCWireTripletSB.cxx:14
merge.output
output
Definition: merge.py:17
LVL1TGCTrigger::TGCHitPattern
Definition: TGCHitPattern.h:11
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
LVL1TGCTrigger::TGCHitPattern::setChannel
void setChannel(int iChannel, bool pattern)
Definition: TGCHitPattern.cxx:85
LVL1TGCTrigger::TGCSlaveBoardOut::setbPos
void setbPos(int block, int pos)
Definition: TGCSlaveBoardOut.h:74
LVL1TGCTrigger::TGCWireTripletSB
Definition: TGCWireTripletSB.h:13
LVL1TGCTrigger::TGCPatchPanelOut::getHitPattern
const TGCHitPattern * getHitPattern(int connector) const
Definition: TGCPatchPanelOut.h:46
LVL1TGCTrigger::TGCSlaveBoard::m_lengthOfCoincidenceOut
int m_lengthOfCoincidenceOut
Definition: TGCSlaveBoard.h:72
LVL1TGCTrigger::TGCSlaveBoard::m_patchPanel
TGCPatchPanel * m_patchPanel
Definition: TGCSlaveBoard.h:82
LVL1TGCTrigger::TGCSlaveBoard::m_patchPanelOut
TGCPatchPanelOut * m_patchPanelOut
Definition: TGCSlaveBoard.h:83
LVL1TGCTrigger::TGCWireTripletSB::s_NChAdjInWTSB
static constexpr int s_NChAdjInWTSB
Definition: TGCWireTripletSB.h:16
LVL1TGCTrigger::TGCSlaveBoardOut::setNumberOfData
void setNumberOfData(int nData)
Definition: TGCSlaveBoardOut.h:149
TGCPatchPanel.h
LVL1TGCTrigger::TGCWireTripletSB::operator=
TGCWireTripletSB & operator=(const TGCWireTripletSB &right)
Definition: TGCWireTripletSB.cxx:97
LVL1TGCTrigger::TGCSlaveBoard::m_coincidenceOut
TGCHitPattern * m_coincidenceOut
Definition: TGCSlaveBoard.h:73