CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DTTSCand Class Reference

#include <DTTSCand.h>

Public Member Functions

void clear ()
 Clear the trigger. More...
 
void clearBits ()
 Clear (set to 1) the quality bits (but first/second track bit) More...
 
void clearBitsBkmod ()
 Clear (set to 1) all the bits (back-up mode) More...
 
const DTConfigTSPhiconfig () const
 Configuration set. More...
 
unsigned dataword () const
 Return an uint16 with the content of the data word (for debugging) More...
 
 DTTSCand (DTTSS *, const DTTracoTrigData *, int, int)
 Constructor. More...
 
 DTTSCand ()
 Constructor. More...
 
 DTTSCand (const DTTSCand &tscand)
 Constructor. More...
 
int is0H () const
 Return if H outer. More...
 
int is0L () const
 Return if L outer. More...
 
int isCarry () const
 Return the carry bit. More...
 
int isCorr () const
 Return correlation bit. More...
 
int isFirst () const
 Return the first/second track bit. More...
 
int isH0 () const
 Return if H inner. More...
 
int isHHorHL () const
 Return if HH or HL. More...
 
int isHtrig () const
 Return HTRIG/LTRIG bit. More...
 
int isInner () const
 Return Inner/Outer bit. More...
 
int isL0 () const
 Return if L inner. More...
 
int isLH () const
 Return if LH. More...
 
int isLL () const
 Return if LL. More...
 
bool operator< (const DTTSCand &c) const
 Operator < used for sorting. More...
 
bool operator<= (const DTTSCand &c) const
 Operator <= used for sorting. More...
 
DTTSCandoperator= (const DTTSCand &tscand)
 Assignment operator. More...
 
void print () const
 Print the trigger. More...
 
void resetCarry ()
 Reset the carry bit. More...
 
void setBitsBkmod ()
 Set the bits for TSM back-up mode. More...
 
void setBitsTsm ()
 Set the quality bits for DTTSM analysis. More...
 
void setBitsTss ()
 Set the quality bits for DTTSS analysis. More...
 
void setSecondTrack ()
 Set the first track bit to second track (used for carry) More...
 
int TcPos () const
 Retrun the TRACO position inside the TSS. More...
 
int tracoNumber () const
 Return the TRACO number. More...
 
const DTTracoTrigDatatracoTr () const
 Return associated TRACO trigger. More...
 
DTTSStss () const
 Return the DTTSS. More...
 
int tssNumber () const
 Return the DTTSS number. More...
 
 ~DTTSCand ()
 Destructor. More...
 

Private Attributes

BitArray< 15 > _dataword
 
int _isCarry
 
int _tcPos
 
const DTTracoTrigData_tctrig
 
DTTSS_tss
 

Detailed Description

A Trigger Server Candidate

Author
C. Grandi, D. Bonacorsi, S. Marcellini

Definition at line 35 of file DTTSCand.h.

Constructor & Destructor Documentation

DTTSCand::DTTSCand ( DTTSS tss,
const DTTracoTrigData tctrig,
int  ifs,
int  pos 
)

Constructor.

Definition at line 36 of file DTTSCand.cc.

References _dataword, BitArray< N >::one(), and BitArray< N >::unset().

37  : _tss(tss), _tctrig(tctrig), _tcPos(pos), _isCarry(0) {
38 
39  _dataword.one(); // reset dataword to 0x1ff
40 
41  // SM sector collector Set bit 14 instead of 8, for 1st/2nd track to allow
42  // extra space
43  // if(ifs==1)_dataword.unset(8); // set bit 8 (0=first, 1=second tracks)
44  if (ifs == 1)
45  _dataword.unset(14); // set bit 14 (0=first, 1=second tracks)
46 }
int _isCarry
Definition: DTTSCand.h:175
int _tcPos
Definition: DTTSCand.h:173
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:168
void one()
Definition: BitArray.h:223
DTTSS * _tss
Definition: DTTSCand.h:167
void unset(const int i)
Definition: BitArray.h:231
BitArray< 15 > _dataword
Definition: DTTSCand.h:169
DTTSCand::DTTSCand ( )

Constructor.

Definition at line 52 of file DTTSCand.cc.

52 {}
DTTSCand::DTTSCand ( const DTTSCand tscand)

Constructor.

Definition at line 48 of file DTTSCand.cc.

49  : _tss(tscand._tss), _tctrig(tscand._tctrig), _tcPos(tscand._tcPos),
50  _isCarry(tscand._isCarry) {}
int _isCarry
Definition: DTTSCand.h:175
int _tcPos
Definition: DTTSCand.h:173
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:168
DTTSS * _tss
Definition: DTTSCand.h:167
DTTSCand::~DTTSCand ( )

Destructor.

Definition at line 57 of file DTTSCand.cc.

57 {}

Member Function Documentation

void DTTSCand::clear ( void  )
inline

Clear the trigger.

Definition at line 73 of file DTTSCand.cc.

References _dataword, _isCarry, _tctrig, and BitArray< N >::one().

Referenced by clearBitsBkmod().

73  {
74  _tctrig = nullptr;
75  _dataword.one();
76 
77  _isCarry = 0;
78 }
int _isCarry
Definition: DTTSCand.h:175
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:168
void one()
Definition: BitArray.h:223
BitArray< 15 > _dataword
Definition: DTTSCand.h:169
void DTTSCand::clearBits ( )
inline

Clear (set to 1) the quality bits (but first/second track bit)

Definition at line 73 of file DTTSCand.h.

References _dataword, and BitArray< N >::assign().

Referenced by setBitsTsm(), and setBitsTss().

73 { _dataword.assign(5, 3, 0x7); }
void assign(const int p, const int n, const int val)
Definition: BitArray.h:239
BitArray< 15 > _dataword
Definition: DTTSCand.h:169
void DTTSCand::clearBitsBkmod ( )
inline

Clear (set to 1) all the bits (back-up mode)

Definition at line 76 of file DTTSCand.h.

References _dataword, BitArray< N >::assign(), and clear().

Referenced by setBitsBkmod().

76 { _dataword.assign(0, 7, 0xff); }
void assign(const int p, const int n, const int val)
Definition: BitArray.h:239
BitArray< 15 > _dataword
Definition: DTTSCand.h:169
const DTConfigTSPhi* DTTSCand::config ( void  ) const
inline

Configuration set.

Definition at line 82 of file DTTSCand.h.

References _tss, and DTTSS::config().

Referenced by setBitsTsm(), and setBitsTss().

82 { return _tss->config(); }
const DTConfigTSPhi * config() const
Configuration set.
Definition: DTTSS.h:70
DTTSS * _tss
Definition: DTTSCand.h:167
unsigned DTTSCand::dataword ( ) const
inline

Return an uint16 with the content of the data word (for debugging)

Definition at line 151 of file DTTSCand.h.

References _dataword, and BitArray< N >::dataWord().

Referenced by DTTSS::sortTSS1(), and DTTSS::sortTSS2().

151 { return _dataword.dataWord(0) & 0x1ff; }
unsigned dataWord(const int i) const
Definition: BitArray.h:128
BitArray< 15 > _dataword
Definition: DTTSCand.h:169
int DTTSCand::is0H ( ) const
inline

Return if H outer.

Definition at line 136 of file DTTSCand.h.

References _tctrig, DTTracoTrigData::pvCode(), and DTTracoTrigData::pvCorr().

136  {
137  return !_tctrig->pvCorr() && _tctrig->pvCode() == 8;
138  }
int pvCorr() const
Return the preview correaltion bit.
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:168
int pvCode() const
Return the preview code.
int DTTSCand::is0L ( ) const
inline

Return if L outer.

Definition at line 146 of file DTTSCand.h.

References _tctrig, DTTracoTrigData::pvCode(), and DTTracoTrigData::pvCorr().

146  {
147  return !_tctrig->pvCorr() && _tctrig->pvCode() < 8;
148  }
int pvCorr() const
Return the preview correaltion bit.
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:168
int pvCode() const
Return the preview code.
int DTTSCand::isCarry ( ) const
inline

Return the carry bit.

Definition at line 113 of file DTTSCand.h.

References _isCarry.

Referenced by setBitsTsm(), setBitsTss(), and DTTSS::sortTSS2().

113 { return _isCarry; }
int _isCarry
Definition: DTTSCand.h:175
int DTTSCand::isCorr ( ) const
inline

Return correlation bit.

Definition at line 110 of file DTTSCand.h.

References _tctrig, and DTTracoTrigData::pvCorr().

Referenced by print(), DTTSPhi::runTSPhi(), setBitsTsm(), setBitsTss(), DTTSM::sortTSM1(), DTTSM::sortTSM2(), DTTSS::sortTSS1(), and DTTSS::sortTSS2().

110 { return _tctrig->pvCorr(); }
int pvCorr() const
Return the preview correaltion bit.
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:168
int DTTSCand::isFirst ( ) const
inline

Return the first/second track bit.

Definition at line 100 of file DTTSCand.h.

References _dataword, and BitArray< N >::element().

Referenced by DTTSM::addCand(), DTTSS::addDTTSCand(), print(), DTTSS::sortTSS1(), and DTTSS::sortTSS2().

100 { return _dataword.element(14) == 0; }
int element(const int pos) const
Definition: BitArray.h:210
BitArray< 15 > _dataword
Definition: DTTSCand.h:169
int DTTSCand::isH0 ( ) const
inline

Return if H inner.

Definition at line 131 of file DTTSCand.h.

References _tctrig, DTTracoTrigData::pvCode(), and DTTracoTrigData::pvCorr().

131  {
132  return !_tctrig->pvCorr() && _tctrig->pvCode() == 80;
133  }
int pvCorr() const
Return the preview correaltion bit.
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:168
int pvCode() const
Return the preview code.
int DTTSCand::isHHorHL ( ) const
inline

Return if HH or HL.

Definition at line 116 of file DTTSCand.h.

References _tctrig, DTTracoTrigData::pvCode(), and DTTracoTrigData::pvCorr().

116  {
117  return _tctrig->pvCorr() && _tctrig->pvCode() == 80;
118  }
int pvCorr() const
Return the preview correaltion bit.
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:168
int pvCode() const
Return the preview code.
int DTTSCand::isHtrig ( ) const
inline

Return HTRIG/LTRIG bit.

Definition at line 103 of file DTTSCand.h.

References _tctrig, and DTTracoTrigData::pvCode().

Referenced by print(), DTTSPhi::runTSPhi(), setBitsTsm(), and setBitsTss().

103  {
104  return _tctrig->pvCode() == 8 || _tctrig->pvCode() == 80;
105  }
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:168
int pvCode() const
Return the preview code.
int DTTSCand::isInner ( ) const
inline

Return Inner/Outer bit.

Definition at line 107 of file DTTSCand.h.

References _tctrig, and DTTracoTrigData::pvCode().

Referenced by print(), DTTSPhi::runTSPhi(), setBitsTsm(), setBitsTss(), DTTSM::sortTSM1(), DTTSM::sortTSM2(), DTTSS::sortTSS1(), and DTTSS::sortTSS2().

107 { return _tctrig->pvCode() > 8; }
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:168
int pvCode() const
Return the preview code.
int DTTSCand::isL0 ( ) const
inline

Return if L inner.

Definition at line 141 of file DTTSCand.h.

References _tctrig, DTTracoTrigData::pvCode(), and DTTracoTrigData::pvCorr().

141  {
142  return !_tctrig->pvCorr() && _tctrig->pvCode() < 80 &&
143  _tctrig->pvCode() > 8;
144  }
int pvCorr() const
Return the preview correaltion bit.
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:168
int pvCode() const
Return the preview code.
int DTTSCand::isLH ( ) const
inline

Return if LH.

Definition at line 121 of file DTTSCand.h.

References _tctrig, DTTracoTrigData::pvCode(), and DTTracoTrigData::pvCorr().

121  {
122  return _tctrig->pvCorr() && _tctrig->pvCode() == 8;
123  }
int pvCorr() const
Return the preview correaltion bit.
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:168
int pvCode() const
Return the preview code.
int DTTSCand::isLL ( ) const
inline

Return if LL.

Definition at line 126 of file DTTSCand.h.

References _tctrig, DTTracoTrigData::pvCode(), and DTTracoTrigData::pvCorr().

126  {
127  return _tctrig->pvCorr() && !(_tctrig->pvCode() == 8) &&
128  !(_tctrig->pvCode() == 80);
129  }
int pvCorr() const
Return the preview correaltion bit.
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:168
int pvCode() const
Return the preview code.
bool DTTSCand::operator< ( const DTTSCand c) const
inline

Operator < used for sorting.

Definition at line 154 of file DTTSCand.h.

References _dataword.

154 { return _dataword < c._dataword; }
BitArray< 15 > _dataword
Definition: DTTSCand.h:169
bool DTTSCand::operator<= ( const DTTSCand c) const
inline

Operator <= used for sorting.

Definition at line 157 of file DTTSCand.h.

References _dataword, and print().

157 { return _dataword <= c._dataword; }
BitArray< 15 > _dataword
Definition: DTTSCand.h:169
DTTSCand & DTTSCand::operator= ( const DTTSCand tscand)

Assignment operator.

Definition at line 63 of file DTTSCand.cc.

References _isCarry, _tcPos, _tctrig, and _tss.

63  {
64  if (this != &tscand) {
65  _tss = tscand._tss;
66  _tctrig = tscand._tctrig;
67  _tcPos = tscand._tcPos;
68  _isCarry = tscand._isCarry;
69  }
70  return *this;
71 }
int _isCarry
Definition: DTTSCand.h:175
int _tcPos
Definition: DTTSCand.h:173
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:168
DTTSS * _tss
Definition: DTTSCand.h:167
void DTTSCand::print ( void  ) const

Print the trigger.

Definition at line 271 of file DTTSCand.cc.

References _dataword, gather_cfg::cout, isCorr(), isFirst(), isHtrig(), isInner(), BitArray< N >::print(), DTTracoTrigData::pvK(), and tracoTr().

Referenced by operator<=().

271  {
272  std::cout << " First=" << isFirst();
273  std::cout << " HTRIG=" << isHtrig();
274  std::cout << " Inner=" << isInner();
275  std::cout << " Corr=" << isCorr();
276  std::cout << " Kpv=" << tracoTr()->pvK();
277  std::cout << " dataword=";
278  _dataword.print();
279  std::cout << std::endl;
280 }
int isHtrig() const
Return HTRIG/LTRIG bit.
Definition: DTTSCand.h:103
int isFirst() const
Return the first/second track bit.
Definition: DTTSCand.h:100
int pvK() const
Return the preview K.
const DTTracoTrigData * tracoTr() const
Return associated TRACO trigger.
Definition: DTTSCand.h:85
int isInner() const
Return Inner/Outer bit.
Definition: DTTSCand.h:107
BitArray< 15 > _dataword
Definition: DTTSCand.h:169
std::ostream & print(std::ostream &o=std::cout) const
Definition: BitArray.h:345
int isCorr() const
Return correlation bit.
Definition: DTTSCand.h:110
void DTTSCand::resetCarry ( )
inline

Reset the carry bit.

Definition at line 70 of file DTTSCand.h.

References _isCarry.

70 { _isCarry = 0; }
int _isCarry
Definition: DTTSCand.h:175
void DTTSCand::setBitsBkmod ( )

Set the bits for TSM back-up mode.

Definition at line 154 of file DTTSCand.cc.

References _dataword, _tctrig, clearBitsBkmod(), DTTracoTrigData::qdec(), and BitArray< N >::unset().

Referenced by DTTSM::sortTSM1(), and DTTSM::sortTSM2().

154  {
155  // first/second track already set. Set other 4 bits (1 for null, 3 for a2, a1,
156  // a0)
157  clearBitsBkmod();
158  // std::cout << " clearbits in TSM bk mode " << _dataword.print() <<
159  // std::endl;
160 
161  int a2 = 6;
162  int a1 = 5;
163  int a0 = 4;
164  //
165  // std::cout << " _tctrig->qdec(): " << _tctrig->qdec() << std::endl;
166  if (_tctrig->qdec() == 6) {
167  _dataword.unset(a2);
168  _dataword.unset(a1);
169  _dataword.unset(a0);
170  } // 1-000
171  if (_tctrig->qdec() == 5) {
172  _dataword.unset(a2);
173  _dataword.unset(a1);
174  } // 1-001
175  if (_tctrig->qdec() == 4) {
176  _dataword.unset(a2);
177  _dataword.unset(a0);
178  } // 1-010
179  if (_tctrig->qdec() == 3) {
180  _dataword.unset(a1);
181  } // 1-101
182  if (_tctrig->qdec() == 2) {
183  _dataword.unset(a1);
184  _dataword.unset(a0);
185  } // 1-100
186 
187  if (_tctrig->qdec() == 0) {
188  _dataword.unset(a0);
189  } // 1-110
190 
191  // std::cout << " set Bits TSM back up " << _dataword.print() << std::endl;
192 }
void clearBitsBkmod()
Clear (set to 1) all the bits (back-up mode)
Definition: DTTSCand.h:76
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:168
void unset(const int i)
Definition: BitArray.h:231
int qdec() const
Return the trigger code in new format.
BitArray< 15 > _dataword
Definition: DTTSCand.h:169
void DTTSCand::setBitsTsm ( )

Set the quality bits for DTTSM analysis.

Definition at line 194 of file DTTSCand.cc.

References _dataword, _tctrig, BitArray< N >::assign(), clearBits(), config(), gather_cfg::cout, BitArray< N >::element(), isCarry(), isCorr(), isHtrig(), isInner(), DTTracoTrigData::pvK(), DTConfigTSPhi::TsmCorrEna(), DTConfigTSPhi::TsmCorrEnaCarry(), DTConfigTSPhi::TsmHtrigEna(), DTConfigTSPhi::TsmHtrigEnaCarry(), DTConfigTSPhi::TsmInOutEna(), DTConfigTSPhi::TsmInOutEnaCarry(), DTConfigTSPhi::TsmMasking(), DTConfigTSPhi::TssMasking(), and BitArray< N >::unset().

194  {
195  // first/second track already set. Set other 3 bits
196  int itk = _dataword.element(14); // first tracks 0, second tracks 1
197 
198  clearBits();
199 
200  if (_tctrig->pvK() > 31 ||
201  _tctrig->pvK() < 0) { // Check K within 5 bits range
202  std::cout << "DTTSCand::setBitsTsm pvK outside valid range: "
203  << _tctrig->pvK();
204  std::cout << " deltaPsiR set to 31" << std::endl;
205  } else {
206  // SM double TSM
207  // assign preview in dataword (common to any other assignment)
208  _dataword.assign(0, 5, _tctrig->pvK());
209  // _dataword.assign(0,5,0);
210  //
211 
212  int posH = -1;
213  int posI = -1;
214  int posC = -1;
215  switch (config()->TsmMasking(itk)) {
216  case 123: // H/L, In/Out, Corr/NotC
217  posH = 7;
218  posI = 6;
219  posC = 5;
220  break;
221  case 132: // H/L, Corr/NotC, In/Out
222  posH = 7;
223  posI = 5;
224  posC = 6;
225  break;
226  case 213: // In/Out, H/L, Corr/NotC
227  posH = 6;
228  posI = 7;
229  posC = 5;
230  break;
231  case 231: // In/Out, Corr/NotC, H/L
232  posH = 5;
233  posI = 7;
234  posC = 6;
235  break;
236  case 312: // Corr/NotC, H/L, In/Out
237  posH = 6;
238  posI = 5;
239  posC = 7;
240  break;
241  case 321: // Corr/NotC, In/Out, H/L
242  posH = 5;
243  posI = 6;
244  posC = 7;
245  break;
246  default:
247  std::cout << "DTTSCand::DTTSCand(): masking not correct: ";
248  std::cout << config()->TssMasking(itk);
249  std::cout << " All bits set to 1" << std::endl;
250 
251  // Masking:
252  bool enaH = config()->TsmHtrigEna(itk);
253  bool enaI = config()->TsmInOutEna(itk);
254  bool enaC = config()->TsmCorrEna(itk);
255  if (isCarry()) {
256  // Special setting for carry
257  enaH = config()->TsmHtrigEnaCarry();
258  enaI = config()->TsmInOutEnaCarry();
259  enaC = config()->TsmCorrEnaCarry();
260  }
261  // Bits set to 0 give higher priority:
262  if (isHtrig() && enaH && posH > 0)
263  _dataword.unset(posH);
264  if (isInner() && enaI && posI > 0)
265  _dataword.unset(posI);
266  if (isCorr() && enaC && posC > 0)
267  _dataword.unset(posC);
268  }
269  }
270 }
bool TsmInOutEna(int i) const
Enable Inner SL checking in TSM for sort1/2.
Definition: DTConfigTSPhi.h:96
bool TsmHtrigEna(int i) const
Enable Htrig checking in TSM for sort1/2.
Definition: DTConfigTSPhi.h:90
int isHtrig() const
Return HTRIG/LTRIG bit.
Definition: DTTSCand.h:103
int TsmMasking(int i) const
Order of quality bits in TSM for sort1/2.
Definition: DTConfigTSPhi.h:87
int TssMasking(int i) const
Order of quality bits in TSS for sort1/2.
Definition: DTConfigTSPhi.h:66
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:168
const DTConfigTSPhi * config() const
Configuration set.
Definition: DTTSCand.h:82
int pvK() const
Return the preview K.
bool TsmHtrigEnaCarry() const
Enable Htrig checking in TSM for carry.
Definition: DTConfigTSPhi.h:93
int isCarry() const
Return the carry bit.
Definition: DTTSCand.h:113
void unset(const int i)
Definition: BitArray.h:231
int element(const int pos) const
Definition: BitArray.h:210
bool TsmCorrEnaCarry() const
Enable Correlation checking in TSM for carry.
void clearBits()
Clear (set to 1) the quality bits (but first/second track bit)
Definition: DTTSCand.h:73
bool TsmCorrEna(int i) const
Enable Correlation checking in TSM for sort1/2.
int isInner() const
Return Inner/Outer bit.
Definition: DTTSCand.h:107
void assign(const int p, const int n, const int val)
Definition: BitArray.h:239
bool TsmInOutEnaCarry() const
Enable Inner SL checking in TSM for carry.
Definition: DTConfigTSPhi.h:99
BitArray< 15 > _dataword
Definition: DTTSCand.h:169
int isCorr() const
Return correlation bit.
Definition: DTTSCand.h:110
void DTTSCand::setBitsTss ( )

Set the quality bits for DTTSS analysis.

Definition at line 80 of file DTTSCand.cc.

References _dataword, _tctrig, BitArray< N >::assign(), clearBits(), config(), gather_cfg::cout, BitArray< N >::element(), isCarry(), isCorr(), isHtrig(), isInner(), DTTracoTrigData::pvK(), DTConfigTSPhi::TssCorrEna(), DTConfigTSPhi::TssCorrEnaCarry(), DTConfigTSPhi::TssHtrigEna(), DTConfigTSPhi::TssHtrigEnaCarry(), DTConfigTSPhi::TssInOutEna(), DTConfigTSPhi::TssInOutEnaCarry(), DTConfigTSPhi::TssMasking(), and BitArray< N >::unset().

Referenced by DTTSM::sortTSM1(), DTTSM::sortTSM2(), DTTSS::sortTSS1(), and DTTSS::sortTSS2().

80  {
81  // first/second track already set. Set other 3 bits
82  int itk = _dataword.element(14); // first tracks 0, second tracks 1
83 
84  clearBits();
85  if (_tctrig->pvK() > 32 ||
86  _tctrig->pvK() < 0) { // Check K within 5 bits range
87  std::cout << "DTTSCand::setBitsTss() pvK outside valid range: "
88  << _tctrig->pvK();
89  std::cout << " deltaPsiR set to 31" << std::endl;
90  } else {
91  // assign preview in dataword (common to any other assignment)
92  _dataword.assign(0, 5, _tctrig->pvK());
93  // _dataword.assign(0,5,0);
94 
95  int posH = -1;
96  int posI = -1;
97  int posC = -1;
98  switch (config()->TssMasking(itk)) {
99  case 123: // H/L, In/Out, Corr/NotC
100  posH = 7;
101  posI = 6;
102  posC = 5;
103  break;
104  case 132: // H/L, Corr/NotC, In/Out
105  posH = 7;
106  posI = 5;
107  posC = 6;
108  break;
109  case 213: // In/Out, H/L, Corr/NotC
110  posH = 6;
111  posI = 7;
112  posC = 5;
113  break;
114  case 231: // In/Out, Corr/NotC, H/L
115  posH = 5;
116  posI = 7;
117  posC = 6;
118  break;
119  case 312: // Corr/NotC, H/L, In/Out
120  posH = 6;
121  posI = 5;
122  posC = 7;
123  break;
124  case 321: // Corr/NotC, In/Out, H/L
125  posH = 5;
126  posI = 6;
127  posC = 7;
128  break;
129  default:
130  std::cout << "DTTSCand::DTTSCand(): masking not correct: ";
131  std::cout << config()->TssMasking(itk);
132  std::cout << " All bits set to 1" << std::endl;
133  }
134  // Masking:
135  bool enaH = config()->TssHtrigEna(itk);
136  bool enaI = config()->TssInOutEna(itk);
137  bool enaC = config()->TssCorrEna(itk);
138  if (isCarry()) {
139  // Special setting for carry
140  enaH = config()->TssHtrigEnaCarry();
141  enaI = config()->TssInOutEnaCarry();
142  enaC = config()->TssCorrEnaCarry();
143  }
144  // Bits set to 0 give higher priority:
145  if (isHtrig() && enaH && posH > 0)
146  _dataword.unset(posH);
147  if (isInner() && enaI && posI > 0)
148  _dataword.unset(posI);
149  if (isCorr() && enaC && posC > 0)
150  _dataword.unset(posC);
151  }
152 }
bool TssInOutEnaCarry() const
Enable Inner SL checking in TSS for carry.
Definition: DTConfigTSPhi.h:78
int isHtrig() const
Return HTRIG/LTRIG bit.
Definition: DTTSCand.h:103
int TssMasking(int i) const
Order of quality bits in TSS for sort1/2.
Definition: DTConfigTSPhi.h:66
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:168
const DTConfigTSPhi * config() const
Configuration set.
Definition: DTTSCand.h:82
bool TssCorrEnaCarry() const
Enable Correlation checking in TSS for carry.
Definition: DTConfigTSPhi.h:84
int pvK() const
Return the preview K.
int isCarry() const
Return the carry bit.
Definition: DTTSCand.h:113
void unset(const int i)
Definition: BitArray.h:231
bool TssHtrigEnaCarry() const
Enable Htrig checking in TSS for carry.
Definition: DTConfigTSPhi.h:72
int element(const int pos) const
Definition: BitArray.h:210
void clearBits()
Clear (set to 1) the quality bits (but first/second track bit)
Definition: DTTSCand.h:73
int isInner() const
Return Inner/Outer bit.
Definition: DTTSCand.h:107
void assign(const int p, const int n, const int val)
Definition: BitArray.h:239
bool TssInOutEna(int i) const
Enable Inner SL checking in TSS for sort1/2.
Definition: DTConfigTSPhi.h:75
BitArray< 15 > _dataword
Definition: DTTSCand.h:169
bool TssCorrEna(int i) const
Enable Correlation checking in TSS for sort1/2.
Definition: DTConfigTSPhi.h:81
int isCorr() const
Return correlation bit.
Definition: DTTSCand.h:110
bool TssHtrigEna(int i) const
Enable Htrig checking in TSS for sort1/2.
Definition: DTConfigTSPhi.h:69
void DTTSCand::setSecondTrack ( )
inline

Set the first track bit to second track (used for carry)

Definition at line 64 of file DTTSCand.h.

References _dataword, _isCarry, and BitArray< N >::set().

Referenced by DTTSM::sortTSM1(), and DTTSS::sortTSS1().

64  {
65  _dataword.set(14);
66  _isCarry = 1;
67  }
int _isCarry
Definition: DTTSCand.h:175
BitArray< 15 > _dataword
Definition: DTTSCand.h:169
void set(const int i)
Definition: BitArray.h:230
int DTTSCand::TcPos ( ) const
inline

Retrun the TRACO position inside the TSS.

Definition at line 88 of file DTTSCand.h.

References _tcPos.

Referenced by DTTSM::sortTSM1(), DTTSM::sortTSM2(), DTTSS::sortTSS1(), and DTTSS::sortTSS2().

88 { return _tcPos; }
int _tcPos
Definition: DTTSCand.h:173
int DTTSCand::tracoNumber ( ) const
inline

Return the TRACO number.

Definition at line 97 of file DTTSCand.h.

References _tctrig, and DTTracoTrigData::tracoNumber().

97 { return _tctrig->tracoNumber(); }
int tracoNumber() const
Return parent TRACO number.
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:168
const DTTracoTrigData* DTTSCand::tracoTr ( ) const
inline

Return associated TRACO trigger.

Definition at line 85 of file DTTSCand.h.

References _tctrig.

Referenced by DTTSS::getTracoT(), DTTSM::getTracoT(), print(), and DTTSPhi::runTSPhi().

85 { return _tctrig; }
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:168
DTTSS* DTTSCand::tss ( ) const
inline

Return the DTTSS.

Definition at line 91 of file DTTSCand.h.

References _tss.

91 { return _tss; }
DTTSS * _tss
Definition: DTTSCand.h:167
int DTTSCand::tssNumber ( ) const
inline

Return the DTTSS number.

Definition at line 94 of file DTTSCand.h.

References _tss, and DTTSS::number().

Referenced by DTTSM::sortTSM1(), and DTTSM::sortTSM2().

94 { return _tss->number(); }
DTTSS * _tss
Definition: DTTSCand.h:167
int number() const
Return identifier.
Definition: DTTSS.h:67

Member Data Documentation

BitArray<15> DTTSCand::_dataword
private
int DTTSCand::_isCarry
private

Definition at line 175 of file DTTSCand.h.

Referenced by clear(), isCarry(), operator=(), resetCarry(), and setSecondTrack().

int DTTSCand::_tcPos
private

Definition at line 173 of file DTTSCand.h.

Referenced by operator=(), and TcPos().

const DTTracoTrigData* DTTSCand::_tctrig
private
DTTSS* DTTSCand::_tss
private

Definition at line 167 of file DTTSCand.h.

Referenced by config(), operator=(), tss(), and tssNumber().