CMS 3D CMS Logo

DTTracoTrigData.h
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
11 //
12 //--------------------------------------------------
13 #ifndef DT_TRACO_TRIG_DATA_H
14 #define DT_TRACO_TRIG_DATA_H
15 
16 //------------------------------------
17 // Collaborating Class Declarations --
18 //------------------------------------
21 
22 //----------------------
23 // Base Class Headers --
24 //----------------------
26 
27 //---------------
28 // C++ Headers --
29 //---------------
30 
31 // ---------------------
32 // -- Class Interface --
33 // ---------------------
34 
35 typedef unsigned char myint8;
36 
37 class DTTracoTrigData : public DTTrigData {
38 public:
39  // public methods
40 
43 
46 
48  ~DTTracoTrigData() override {}
49 
50  // Non-const methods
51 
53  inline void setParent(DTTracoId tracoid) { _tracoid = tracoid; }
54 
56  inline void setStep(int step) { _step = step; }
57 
59  inline void setPV(int first, int code, int K, int ioflag) {
60  _pvfirst = first;
61  _pvcode = code;
62  _pvKval = K;
63  _pvIOflag = ioflag;
64  /*
65  cout<<"setPV called, stored:"<<
66  " first=" << first <<
67  " code=" << code <<
68  " K=" << K <<
69  " ioflag=" << ioflag << endl;
70  */
71  }
72 
74  inline void setPVCorr(int ic) { _pvCorr = ic; }
75 
77  inline void setCodeIn(int code) { _codeIn = code; }
79  inline void setCodeOut(int code) { _codeOut = code; }
80 
82  inline void setPosIn(int pos) { _posIn = pos; }
83 
85  inline void setPosOut(int pos) { _posOut = pos; }
86 
88  inline void setEqIn(int eq) { _eqIn = eq; }
89 
91  inline void setEqOut(int eq) { _eqOut = eq; }
92 
94  inline void setK(int k) { _Kval = k; }
95 
97  inline void setX(int x) { _Xval = x; }
98 
100  inline void setAngles(int psi, int psir, int dpsir) {
101  if (psi & 0x200)
102  psi |= 0xFFFFFC00;
103  if (psir & 0x800)
104  psir |= 0xFFFFF000;
105  if (dpsir & 0x200)
106  dpsir |= 0xFFFFFC00;
107 
108  _psi = psi;
109  _psiR = psir;
110  _dPsiR = dpsir;
111  }
112 
114  void resetVar() {
115  _codeIn = 0;
116  _codeOut = 0;
117  _posIn = 0;
118  _posOut = 0;
119  _eqIn = 0;
120  _eqOut = 0;
121  _Kval = 255;
122  _Xval = 0;
123  /*
124  _psi = -DTConfig::RESOLPSI;
125  _psiR = -DTConfig::RESOLPSIR/2;
126  _dPsiR = -DTConfig::RESOLPSI;
127  */
128  // SV notazione complemento a due:
129  _psi = 0x1FF;
130  _psiR = 0xFFF;
131  _dPsiR = 0x1FF;
132  }
133 
135  void resetPV() {
136  _pvfirst = 0;
137  _pvcode = 0;
138  _pvKval = 9999;
139  _pvCorr = 0;
140  _pvIOflag = 0;
141  }
142 
144  void clear() {
145  resetVar();
146  resetPV();
147  }
148 
150  DTChamberId ChamberId() const override { return _tracoid.ChamberId(); }
151 
153  void print() const override;
154 
156  inline DTTracoId parentId() const { return _tracoid; }
157 
159  inline int tracoNumber() const { return _tracoid.traco(); }
160 
162  inline int step() const { return _step; }
163 
165  inline int code() const { return _codeIn * 10 + _codeOut; }
166 
168  inline int posMask() const { return _posOut * 1000 + _posIn; }
169 
171  inline int posIn() const { return _posIn; }
172 
174  inline int posOut() const { return _posOut; }
175 
177  inline int eqIn() const { return _eqIn; }
178 
180  inline int eqOut() const { return _eqOut; }
181 
183  inline int isFirst() const { return _pvfirst; }
184 
186  inline int pvCode() const { return _pvcode; }
187 
189  inline int pvK() const { return _pvKval; }
190 
192  inline int pvCorr() const { return _pvCorr; }
193 
195  inline int pvIO() const { return _pvIOflag; }
196 
198  inline int K() const { return _Kval; }
199 
201  inline int X() const { return _Xval; }
202 
204  int psi() const { return _psi; }
205 
207  int psiR() const { return _psiR; }
208 
210  int DeltaPsiR() const { return _dPsiR; }
211 
213  int qdec() const;
214 
215 private:
216  // parent TRACO
217  DTTracoId _tracoid; // this is 4 bytes
218 
219  // step number
221 
222  // inner segment position
224  // outer segment position
226  // inner segment bti trigger equation
228  // outer segment bti trigger equation
230 
231  // inner segment code
233  // outer segment code
235 
236  // preview first/second track
238 
239  // preview code for TS
241  // preview K variable for TS
242  int _pvKval;
243  // preview correlation bit
245  // preview io bit
247 
248  // K variable value
249  int _Kval;
250  // X variable value
251  int _Xval;
252 
253  // K converted to angle (psi)
254  long int _psi;
255  // X converted to angle (psi_r, phi)
256  long int _psiR;
257  // bending angle (delta(psi_r), phiB)
258  long int _dPsiR;
259 };
260 
261 #endif
DTTracoTrigData::pvCorr
int pvCorr() const
Return the preview correaltion bit.
Definition: DTTracoTrigData.h:192
DTTracoTrigData::tracoNumber
int tracoNumber() const
Return parent TRACO number.
Definition: DTTracoTrigData.h:159
DTTracoTrigData::setK
void setK(int k)
Set trigger K parameter.
Definition: DTTracoTrigData.h:94
DTTracoId
Definition: DTTracoId.h:34
DTTracoTrigData::setCodeIn
void setCodeIn(int code)
Set trigger code inner layer.
Definition: DTTracoTrigData.h:77
DTTracoTrigData::_Xval
int _Xval
Definition: DTTracoTrigData.h:251
step
step
Definition: StallMonitor.cc:94
DTTracoTrigData::setStep
void setStep(int step)
Set trigger step.
Definition: DTTracoTrigData.h:56
DTTracoTrigData::_pvcode
myint8 _pvcode
Definition: DTTracoTrigData.h:240
pos
Definition: PixelAliasList.h:18
DTTracoTrigData::pvCode
int pvCode() const
Return the preview code.
Definition: DTTracoTrigData.h:186
DTTracoTrigData::setParent
void setParent(DTTracoId tracoid)
Set the parent TRACO Identifier.
Definition: DTTracoTrigData.h:53
DTTracoTrigData::isFirst
int isFirst() const
Return non 0 if the track is a first track.
Definition: DTTracoTrigData.h:183
DTTracoId.h
DTTracoTrigData::_posOut
myint8 _posOut
Definition: DTTracoTrigData.h:225
DDAxes::x
DTTracoTrigData::setCodeOut
void setCodeOut(int code)
Set trigger code outer layer.
Definition: DTTracoTrigData.h:79
dqmdumpme.first
first
Definition: dqmdumpme.py:55
DTTracoTrigData::resetVar
void resetVar()
Reset all variables but preview.
Definition: DTTracoTrigData.h:114
DTTracoTrigData::eqIn
int eqIn() const
Return bti trigger equation of inner segment.
Definition: DTTracoTrigData.h:177
DTTracoTrigData::_codeIn
myint8 _codeIn
Definition: DTTracoTrigData.h:232
DTTracoTrigData::pvK
int pvK() const
Return the preview K.
Definition: DTTracoTrigData.h:189
DTTracoTrigData::psi
int psi() const
Return trigger K parameter converted to angle.
Definition: DTTracoTrigData.h:204
myint8
unsigned char myint8
Definition: L1MuDTChambThDigi.h:31
DTTracoTrigData::pvIO
int pvIO() const
Return the preview i/o bit.
Definition: DTTracoTrigData.h:195
DTTracoTrigData::parentId
DTTracoId parentId() const
Return parent TRACO identifier.
Definition: DTTracoTrigData.h:156
DTTracoTrigData::eqOut
int eqOut() const
Return bti trigger equation of outer segment.
Definition: DTTracoTrigData.h:180
DTTracoTrigData::~DTTracoTrigData
~DTTracoTrigData() override
Destructor.
Definition: DTTracoTrigData.h:48
DTTracoTrigData::setPosIn
void setPosIn(int pos)
Set position of segment, inner layer.
Definition: DTTracoTrigData.h:82
DTTracoTrigData::psiR
int psiR() const
Return trigger X parameter converted to angle.
Definition: DTTracoTrigData.h:207
DTTracoTrigData::_codeOut
myint8 _codeOut
Definition: DTTracoTrigData.h:234
dqmdumpme.k
k
Definition: dqmdumpme.py:60
DTTracoTrigData::_eqIn
myint8 _eqIn
Definition: DTTracoTrigData.h:227
DTTracoTrigData::_pvCorr
myint8 _pvCorr
Definition: DTTracoTrigData.h:244
DTTracoTrigData::setX
void setX(int x)
Set trigger X parameter.
Definition: DTTracoTrigData.h:97
DTTracoTrigData::_pvIOflag
myint8 _pvIOflag
Definition: DTTracoTrigData.h:246
DTTracoTrigData::K
int K() const
Return trigger K parameter.
Definition: DTTracoTrigData.h:198
DTTracoTrigData::qdec
int qdec() const
Return the trigger code in new format.
Definition: DTTracoTrigData.cc:41
DTTracoTrigData::setPosOut
void setPosOut(int pos)
Set position of segment, outer layer.
Definition: DTTracoTrigData.h:85
DTTracoTrigData::X
int X() const
Return trigger X parameter.
Definition: DTTracoTrigData.h:201
DTTrigData
Definition: DTTrigData.h:35
DTTracoTrigData::_eqOut
myint8 _eqOut
Definition: DTTracoTrigData.h:229
DTConfig.h
DTTracoTrigData::_tracoid
DTTracoId _tracoid
Definition: DTTracoTrigData.h:217
DTTracoTrigData::print
void print() const override
print
Definition: DTTracoTrigData.cc:62
DTTracoTrigData::_pvfirst
myint8 _pvfirst
Definition: DTTracoTrigData.h:237
DTTracoTrigData::_dPsiR
long int _dPsiR
Definition: DTTracoTrigData.h:258
DTTracoTrigData::setPV
void setPV(int first, int code, int K, int ioflag)
Set trigger preview parameters.
Definition: DTTracoTrigData.h:59
DTTracoTrigData::ChamberId
DTChamberId ChamberId() const override
Return chamber identifier.
Definition: DTTracoTrigData.h:150
DTTracoTrigData::code
int code() const
Return trigger code.
Definition: DTTracoTrigData.h:165
psi
std::map< std::string, int, std::less< std::string > > psi
Definition: CountProcessesAction.h:15
myint8
unsigned char myint8
Definition: DTTracoTrigData.h:35
DTTracoTrigData::posMask
int posMask() const
Return correlator output code (position of segments)
Definition: DTTracoTrigData.h:168
DTTracoTrigData::setAngles
void setAngles(int psi, int psir, int dpsir)
Set trigger angles.
Definition: DTTracoTrigData.h:100
DTTracoTrigData::posIn
int posIn() const
Return the position of inner segment.
Definition: DTTracoTrigData.h:171
DTTracoTrigData::resetPV
void resetPV()
Reset preview variables.
Definition: DTTracoTrigData.h:135
DTTracoId::ChamberId
DTChamberId ChamberId() const
Returns the chamber id.
Definition: DTTracoId.h:61
DTTracoId::traco
int traco() const
Returns the traco.
Definition: DTTracoId.h:59
DTTracoTrigData::_step
myint8 _step
Definition: DTTracoTrigData.h:220
DTTracoTrigData::setPVCorr
void setPVCorr(int ic)
Set trigger preview correlation bit.
Definition: DTTracoTrigData.h:74
DTTracoTrigData::_psiR
long int _psiR
Definition: DTTracoTrigData.h:256
DTTracoTrigData
Definition: DTTracoTrigData.h:37
DTTracoTrigData::_posIn
myint8 _posIn
Definition: DTTracoTrigData.h:223
DTTracoTrigData::step
int step() const
Return step.
Definition: DTTracoTrigData.h:162
DTTracoTrigData::setEqOut
void setEqOut(int eq)
Set bti trigger equation of segment, outer layer.
Definition: DTTracoTrigData.h:91
DTTracoTrigData::clear
void clear()
Clear.
Definition: DTTracoTrigData.h:144
DTTrigData.h
DTChamberId
Definition: DTChamberId.h:14
DTTracoTrigData::DeltaPsiR
int DeltaPsiR() const
Return DeltaPsiR.
Definition: DTTracoTrigData.h:210
DTTracoTrigData::DTTracoTrigData
DTTracoTrigData()
Constructor.
Definition: DTTracoTrigData.h:42
DTTracoTrigData::_psi
long int _psi
Definition: DTTracoTrigData.h:254
DTTracoTrigData::setEqIn
void setEqIn(int eq)
Set bti trigger equation of segment, inner layer.
Definition: DTTracoTrigData.h:88
DTTracoTrigData::_pvKval
int _pvKval
Definition: DTTracoTrigData.h:242
DTTracoTrigData::_Kval
int _Kval
Definition: DTTracoTrigData.h:249
DTTracoTrigData::posOut
int posOut() const
Return the position of outer segment.
Definition: DTTracoTrigData.h:174