File indexing completed on 2023-10-25 09:54:18
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef DT_TRACO_TRIG_DATA_H
0014 #define DT_TRACO_TRIG_DATA_H
0015
0016
0017
0018
0019 #include "DataFormats/MuonDetId/interface/DTTracoId.h"
0020 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfig.h"
0021
0022
0023
0024
0025 #include "L1Trigger/DTUtilities/interface/DTTrigData.h"
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 typedef unsigned char myint8;
0036
0037 class DTTracoTrigData : public DTTrigData {
0038 public:
0039
0040
0041
0042 DTTracoTrigData() {}
0043
0044
0045 DTTracoTrigData(DTTracoId, int);
0046
0047
0048 ~DTTracoTrigData() override {}
0049
0050
0051
0052
0053 inline void setParent(DTTracoId tracoid) { _tracoid = tracoid; }
0054
0055
0056 inline void setStep(int step) { _step = step; }
0057
0058
0059 inline void setPV(int first, int code, int K, int ioflag) {
0060 _pvfirst = first;
0061 _pvcode = code;
0062 _pvKval = K;
0063 _pvIOflag = ioflag;
0064
0065
0066
0067
0068
0069
0070
0071 }
0072
0073
0074 inline void setPVCorr(int ic) { _pvCorr = ic; }
0075
0076
0077 inline void setCodeIn(int code) { _codeIn = code; }
0078
0079 inline void setCodeOut(int code) { _codeOut = code; }
0080
0081
0082 inline void setPosIn(int pos) { _posIn = pos; }
0083
0084
0085 inline void setPosOut(int pos) { _posOut = pos; }
0086
0087
0088 inline void setEqIn(int eq) { _eqIn = eq; }
0089
0090
0091 inline void setEqOut(int eq) { _eqOut = eq; }
0092
0093
0094 inline void setK(int k) { _Kval = k; }
0095
0096
0097 inline void setX(int x) { _Xval = x; }
0098
0099
0100 inline void setAngles(int psi, int psir, int dpsir) {
0101 if (psi & 0x200)
0102 psi |= 0xFFFFFC00;
0103 if (psir & 0x800)
0104 psir |= 0xFFFFF000;
0105 if (dpsir & 0x200)
0106 dpsir |= 0xFFFFFC00;
0107
0108 _psi = psi;
0109 _psiR = psir;
0110 _dPsiR = dpsir;
0111 }
0112
0113
0114 void resetVar() {
0115 _codeIn = 0;
0116 _codeOut = 0;
0117 _posIn = 0;
0118 _posOut = 0;
0119 _eqIn = 0;
0120 _eqOut = 0;
0121 _Kval = 255;
0122 _Xval = 0;
0123
0124
0125
0126
0127
0128
0129 _psi = 0x1FF;
0130 _psiR = 0xFFF;
0131 _dPsiR = 0x1FF;
0132 }
0133
0134
0135 void resetPV() {
0136 _pvfirst = 0;
0137 _pvcode = 0;
0138 _pvKval = 9999;
0139 _pvCorr = 0;
0140 _pvIOflag = 0;
0141 }
0142
0143
0144 void clear() {
0145 resetVar();
0146 resetPV();
0147 }
0148
0149
0150 DTChamberId ChamberId() const override { return _tracoid.ChamberId(); }
0151
0152
0153 void print() const override;
0154
0155
0156 inline DTTracoId parentId() const { return _tracoid; }
0157
0158
0159 inline int tracoNumber() const { return _tracoid.traco(); }
0160
0161
0162 inline int step() const { return _step; }
0163
0164
0165 inline int code() const { return _codeIn * 10 + _codeOut; }
0166
0167
0168 inline int posMask() const { return _posOut * 1000 + _posIn; }
0169
0170
0171 inline int posIn() const { return _posIn; }
0172
0173
0174 inline int posOut() const { return _posOut; }
0175
0176
0177 inline int eqIn() const { return _eqIn; }
0178
0179
0180 inline int eqOut() const { return _eqOut; }
0181
0182
0183 inline int isFirst() const { return _pvfirst; }
0184
0185
0186 inline int pvCode() const { return _pvcode; }
0187
0188
0189 inline int pvK() const { return _pvKval; }
0190
0191
0192 inline int pvCorr() const { return _pvCorr; }
0193
0194
0195 inline int pvIO() const { return _pvIOflag; }
0196
0197
0198 inline int K() const { return _Kval; }
0199
0200
0201 inline int X() const { return _Xval; }
0202
0203
0204 int psi() const { return _psi; }
0205
0206
0207 int psiR() const { return _psiR; }
0208
0209
0210 int DeltaPsiR() const { return _dPsiR; }
0211
0212
0213 int qdec() const;
0214
0215 private:
0216
0217 DTTracoId _tracoid;
0218
0219
0220 myint8 _step;
0221
0222
0223 myint8 _posIn;
0224
0225 myint8 _posOut;
0226
0227 myint8 _eqIn;
0228
0229 myint8 _eqOut;
0230
0231
0232 myint8 _codeIn;
0233
0234 myint8 _codeOut;
0235
0236
0237 myint8 _pvfirst;
0238
0239
0240 myint8 _pvcode;
0241
0242 int _pvKval;
0243
0244 myint8 _pvCorr;
0245
0246 myint8 _pvIOflag;
0247
0248
0249 int _Kval;
0250
0251 int _Xval;
0252
0253
0254 long int _psi;
0255
0256 long int _psiR;
0257
0258 long int _dPsiR;
0259 };
0260
0261 #endif