File indexing completed on 2024-04-06 12:19:50
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef DT_TS_CAND_H
0012 #define DT_TS_CAND_H
0013
0014
0015
0016
0017 class DTConfigTSPhi;
0018
0019
0020
0021
0022 #include "L1Trigger/DTTraco/interface/DTTracoTrigData.h"
0023 #include "L1Trigger/DTTriggerServerPhi/interface/DTTSS.h"
0024 #include "L1TriggerConfig/DTTPGConfig/interface/BitArray.h"
0025
0026
0027
0028
0029 #include <string>
0030
0031
0032
0033
0034
0035 class DTTSCand {
0036 public:
0037
0038 DTTSCand(DTTSS *, const DTTracoTrigData *, int, int);
0039
0040
0041 DTTSCand();
0042
0043
0044 DTTSCand(const DTTSCand &tscand);
0045
0046
0047 DTTSCand &operator=(const DTTSCand &tscand);
0048
0049
0050 ~DTTSCand();
0051
0052
0053 void setBitsTss();
0054
0055
0056 void setBitsBkmod();
0057
0058
0059 void setBitsTsm();
0060
0061
0062
0063 void setSecondTrack() {
0064 _dataword.set(14);
0065 _isCarry = 1;
0066 }
0067
0068
0069 void resetCarry() { _isCarry = 0; }
0070
0071
0072 void clearBits() { _dataword.assign(5, 3, 0x7); }
0073
0074
0075 void clearBitsBkmod() { _dataword.assign(0, 7, 0xff); }
0076
0077
0078 inline void clear();
0079
0080
0081 inline const DTConfigTSPhi *config() const { return _tss->config(); }
0082
0083
0084 inline const DTTracoTrigData *tracoTr() const { return _tctrig; }
0085
0086
0087 inline int TcPos() const { return _tcPos; }
0088
0089
0090 inline DTTSS *tss() const { return _tss; }
0091
0092
0093 inline int tssNumber() const { return _tss->number(); }
0094
0095
0096 inline int tracoNumber() const { return _tctrig->tracoNumber(); }
0097
0098
0099 inline int isFirst() const { return _dataword.element(14) == 0; }
0100
0101
0102 inline int isHtrig() const { return _tctrig->pvCode() == 8 || _tctrig->pvCode() == 80; }
0103
0104 inline int isInner() const { return _tctrig->pvCode() > 8; }
0105
0106
0107 inline int isCorr() const { return _tctrig->pvCorr(); }
0108
0109
0110 inline int isCarry() const { return _isCarry; }
0111
0112
0113 inline int isHHorHL() const { return _tctrig->pvCorr() && _tctrig->pvCode() == 80; }
0114
0115
0116 inline int isLH() const { return _tctrig->pvCorr() && _tctrig->pvCode() == 8; }
0117
0118
0119 inline int isLL() const { return _tctrig->pvCorr() && !(_tctrig->pvCode() == 8) && !(_tctrig->pvCode() == 80); }
0120
0121 inline int isH0() const { return !_tctrig->pvCorr() && _tctrig->pvCode() == 80; }
0122
0123
0124 inline int is0H() const { return !_tctrig->pvCorr() && _tctrig->pvCode() == 8; }
0125
0126
0127 inline int isL0() const { return !_tctrig->pvCorr() && _tctrig->pvCode() < 80 && _tctrig->pvCode() > 8; }
0128
0129 inline int is0L() const { return !_tctrig->pvCorr() && _tctrig->pvCode() < 8; }
0130
0131
0132 inline unsigned dataword() const { return _dataword.dataWord(0) & 0x1ff; }
0133
0134
0135 bool operator<(const DTTSCand &c) const { return _dataword < c._dataword; }
0136
0137
0138 bool operator<=(const DTTSCand &c) const { return _dataword <= c._dataword; }
0139
0140
0141
0142
0143
0144
0145 void print() const;
0146
0147 private:
0148 DTTSS *_tss;
0149 const DTTracoTrigData *_tctrig;
0150 BitArray<15> _dataword;
0151
0152
0153
0154 int _tcPos;
0155
0156 int _isCarry;
0157 };
0158
0159 #endif