test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
39  public:
40 
41  // public methods
42 
45 
48 
51 
52  // Non-const methods
53 
55  inline void setParent(DTTracoId tracoid) {
56  _tracoid = tracoid;
57  }
58 
60  inline void setStep(int step) {
61  _step = step;
62  }
63 
65  inline void setPV(int first, int code, int K, int ioflag) {
66  _pvfirst = first;
67  _pvcode = code;
68  _pvKval = K;
69  _pvIOflag = ioflag;
70 /*
71  cout<<"setPV called, stored:"<<
72  " first=" << first <<
73  " code=" << code <<
74  " K=" << K <<
75  " ioflag=" << ioflag << endl;
76 */
77  }
78 
80  inline void setPVCorr(int ic) {
81  _pvCorr = ic;
82  }
83 
85  inline void setCodeIn(int code) {
86  _codeIn = code;
87  }
89  inline void setCodeOut(int code) {
90  _codeOut = code;
91  }
92 
94  inline void setPosIn(int pos) {
95  _posIn = pos;
96  }
97 
99  inline void setPosOut(int pos) {
100  _posOut = pos;
101  }
102 
104  inline void setEqIn(int eq) {
105  _eqIn = eq;
106  }
107 
109  inline void setEqOut(int eq) {
110  _eqOut = eq;
111  }
112 
113 
115  inline void setK(int k) {
116  _Kval = k;
117  }
118 
120  inline void setX(int x) {
121  _Xval = x;
122  }
123 
125  inline void setAngles(int psi, int psir, int dpsir) {
126  if(psi & 0x200)
127  psi |= 0xFFFFFC00;
128  if(psir & 0x800)
129  psir |= 0xFFFFF000;
130  if(dpsir & 0x200)
131  dpsir |= 0xFFFFFC00;
132 
133  _psi = psi;
134  _psiR = psir;
135  _dPsiR = dpsir;
136  }
137 
139  void resetVar() {
140  _codeIn = 0;
141  _codeOut = 0;
142  _posIn = 0;
143  _posOut = 0;
144  _eqIn = 0;
145  _eqOut = 0;
146  _Kval = 255;
147  _Xval = 0;
148  /*
149  _psi = -DTConfig::RESOLPSI;
150  _psiR = -DTConfig::RESOLPSIR/2;
151  _dPsiR = -DTConfig::RESOLPSI;
152  */
153  //SV notazione complemento a due:
154  _psi = 0x1FF;
155  _psiR = 0xFFF;
156  _dPsiR = 0x1FF;
157 
158  }
159 
161  void resetPV() {
162  _pvfirst = 0;
163  _pvcode = 0;
164  _pvKval = 9999;
165  _pvCorr = 0;
166  _pvIOflag = 0;
167  }
168 
170  void clear() {
171  resetVar();
172  resetPV();
173  }
174 
177  return _tracoid.ChamberId();
178  }
179 
181  void print() const;
182 
184  inline DTTracoId parentId() const {
185  return _tracoid;
186  }
187 
189  inline int tracoNumber() const {
190  return _tracoid.traco();
191  }
192 
194  inline int step() const {
195  return _step;
196  }
197 
199  inline int code() const {
200  return _codeIn*10 + _codeOut;
201  }
202 
204  inline int posMask() const {
205  return _posOut*1000 + _posIn;
206  }
207 
209  inline int posIn() const {
210  return _posIn;
211  }
212 
214  inline int posOut() const {
215  return _posOut;
216  }
217 
219  inline int eqIn() const {
220  return _eqIn;
221  }
222 
224  inline int eqOut() const {
225  return _eqOut;
226  }
227 
228 
230  inline int isFirst() const {
231  return _pvfirst;
232  }
233 
235  inline int pvCode() const {
236  return _pvcode;
237  }
238 
240  inline int pvK() const {
241  return _pvKval;
242  }
243 
245  inline int pvCorr() const {
246  return _pvCorr;
247  }
248 
250  inline int pvIO() const {
251  return _pvIOflag;
252  }
253 
254 
256  inline int K() const {
257  return _Kval;
258  }
259 
261  inline int X() const {
262  return _Xval;
263  }
264 
266  int psi() const {
267  return _psi;
268  }
269 
271  int psiR() const {
272  return _psiR;
273  }
274 
276  int DeltaPsiR() const {
277  return _dPsiR;
278  }
279 
281  int qdec() const;
282 
283  private:
284 
285  // parent TRACO
286  DTTracoId _tracoid; // this is 4 bytes
287 
288  // step number
290 
291  // inner segment position
293  // outer segment position
295  // inner segment bti trigger equation
297  // outer segment bti trigger equation
299 
300  // inner segment code
302  // outer segment code
304 
305  // preview first/second track
307 
308  // preview code for TS
310  // preview K variable for TS
311  int _pvKval;
312  // preview correlation bit
314  // preview io bit
316 
317 
318  // K variable value
319  int _Kval;
320  // X variable value
321  int _Xval;
322 
323  // K converted to angle (psi)
324  long int _psi;
325  // X converted to angle (psi_r, phi)
326  long int _psiR;
327  // bending angle (delta(psi_r), phiB)
328  long int _dPsiR;
329 
330 };
331 
332 #endif
void resetVar()
Reset all variables but preview.
void setParent(DTTracoId tracoid)
Set the parent TRACO Identifier.
DTTracoTrigData()
Constructor.
void setAngles(int psi, int psir, int dpsir)
Set trigger angles.
void print() const
print
int posIn() const
Return the position of inner segment.
int posOut() const
Return the position of outer segment.
void setEqOut(int eq)
Set bti trigger equation of segment, outer layer.
int psiR() const
Return trigger X parameter converted to angle.
int step() const
Return step.
void setPosOut(int pos)
Set position of segment, outer layer.
int posMask() const
Return correlator output code (position of segments)
int tracoNumber() const
Return parent TRACO number.
void setX(int x)
Set trigger X parameter.
int pvCorr() const
Return the preview correaltion bit.
int X() const
Return trigger X parameter.
void setPosIn(int pos)
Set position of segment, inner layer.
void setK(int k)
Set trigger K parameter.
std::map< std::string, int, std::less< std::string > > psi
int traco() const
Returns the traco.
Definition: DTTracoId.h:70
void clear()
Clear.
DTChamberId ChamberId() const
Return chamber identifier.
void setCodeOut(int code)
Set trigger code outer layer.
DTChamberId ChamberId() const
Returns the chamber id.
Definition: DTTracoId.h:72
int psi() const
Return trigger K parameter converted to angle.
int isFirst() const
Return non 0 if the track is a first track.
DTTracoId parentId() const
Return parent TRACO identifier.
int pvK() const
Return the preview K.
void setPVCorr(int ic)
Set trigger preview correlation bit.
int DeltaPsiR() const
Return DeltaPsiR.
~DTTracoTrigData()
Destructor.
unsigned char myint8
void setStep(int step)
Set trigger step.
int eqOut() const
Return bti trigger equation of outer segment.
int pvCode() const
Return the preview code.
void setCodeIn(int code)
Set trigger code inner layer.
void setPV(int first, int code, int K, int ioflag)
Set trigger preview parameters.
int qdec() const
Return the trigger code in new format.
int code() const
Return trigger code.
int K() const
Return trigger K parameter.
step
void setEqIn(int eq)
Set bti trigger equation of segment, inner layer.
int pvIO() const
Return the preview i/o bit.
int eqIn() const
Return bti trigger equation of inner segment.
void resetPV()
Reset preview variables.