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 //
13 //
14 //--------------------------------------------------
15 #ifndef DT_TRACO_TRIG_DATA_H
16 #define DT_TRACO_TRIG_DATA_H
17 
18 //------------------------------------
19 // Collaborating Class Declarations --
20 //------------------------------------
23 
24 //----------------------
25 // Base Class Headers --
26 //----------------------
28 
29 //---------------
30 // C++ Headers --
31 //---------------
32 
33 // ---------------------
34 // -- Class Interface --
35 // ---------------------
36 
37 typedef unsigned char myint8;
38 
39 class DTTracoTrigData : public DTTrigData {
40 
41  public:
42 
43  // public methods
44 
47 
50 
53 
54  // Non-const methods
55 
57  inline void setParent(DTTracoId tracoid) {
58  _tracoid = tracoid;
59  }
60 
62  inline void setStep(int step) {
63  _step = step;
64  }
65 
67  inline void setPV(int first, int code, int K, int ioflag) {
68  _pvfirst = first;
69  _pvcode = code;
70  _pvKval = K;
71  _pvIOflag = ioflag;
72 /*
73  cout<<"setPV called, stored:"<<
74  " first=" << first <<
75  " code=" << code <<
76  " K=" << K <<
77  " ioflag=" << ioflag << endl;
78 */
79  }
80 
82  inline void setPVCorr(int ic) {
83  _pvCorr = ic;
84  }
85 
87  inline void setCodeIn(int code) {
88  _codeIn = code;
89  }
91  inline void setCodeOut(int code) {
92  _codeOut = code;
93  }
94 
96  inline void setPosIn(int pos) {
97  _posIn = pos;
98  }
99 
101  inline void setPosOut(int pos) {
102  _posOut = pos;
103  }
104 
106  inline void setEqIn(int eq) {
107  _eqIn = eq;
108  }
109 
111  inline void setEqOut(int eq) {
112  _eqOut = eq;
113  }
114 
115 
117  inline void setK(int k) {
118  _Kval = k;
119  }
120 
122  inline void setX(int x) {
123  _Xval = x;
124  }
125 
127  inline void setAngles(int psi, int psir, int dpsir) {
128  if(psi & 0x200)
129  psi |= 0xFFFFFC00;
130  if(psir & 0x800)
131  psir |= 0xFFFFF000;
132  if(dpsir & 0x200)
133  dpsir |= 0xFFFFFC00;
134 
135  _psi = psi;
136  _psiR = psir;
137  _dPsiR = dpsir;
138  }
139 
141  void resetVar() {
142  _codeIn = 0;
143  _codeOut = 0;
144  _posIn = 0;
145  _posOut = 0;
146  _eqIn = 0;
147  _eqOut = 0;
148  _Kval = 255;
149  _Xval = 0;
150  /*
151  _psi = -DTConfig::RESOLPSI;
152  _psiR = -DTConfig::RESOLPSIR/2;
153  _dPsiR = -DTConfig::RESOLPSI;
154  */
155  //SV notazione complemento a due:
156  _psi = 0x1FF;
157  _psiR = 0xFFF;
158  _dPsiR = 0x1FF;
159 
160  }
161 
163  void resetPV() {
164  _pvfirst = 0;
165  _pvcode = 0;
166  _pvKval = 9999;
167  _pvCorr = 0;
168  _pvIOflag = 0;
169  }
170 
172  void clear() {
173  resetVar();
174  resetPV();
175  }
176 
179  return _tracoid.ChamberId();
180  }
181 
183  void print() const;
184 
186  inline DTTracoId parentId() const {
187  return _tracoid;
188  }
189 
191  inline int tracoNumber() const {
192  return _tracoid.traco();
193  }
194 
196  inline int step() const {
197  return _step;
198  }
199 
201  inline int code() const {
202  return _codeIn*10 + _codeOut;
203  }
204 
206  inline int posMask() const {
207  return _posOut*1000 + _posIn;
208  }
209 
211  inline int posIn() const {
212  return _posIn;
213  }
214 
216  inline int posOut() const {
217  return _posOut;
218  }
219 
221  inline int eqIn() const {
222  return _eqIn;
223  }
224 
226  inline int eqOut() const {
227  return _eqOut;
228  }
229 
230 
232  inline int isFirst() const {
233  return _pvfirst;
234  }
235 
237  inline int pvCode() const {
238  return _pvcode;
239  }
240 
242  inline int pvK() const {
243  return _pvKval;
244  }
245 
247  inline int pvCorr() const {
248  return _pvCorr;
249  }
250 
252  inline int pvIO() const {
253  return _pvIOflag;
254  }
255 
256 
258  inline int K() const {
259  return _Kval;
260  }
261 
263  inline int X() const {
264  return _Xval;
265  }
266 
268  int psi() const {
269  return _psi;
270  }
271 
273  int psiR() const {
274  return _psiR;
275  }
276 
278  int DeltaPsiR() const {
279  return _dPsiR;
280  }
281 
283  int qdec() const;
284 
285  private:
286 
287  // parent TRACO
288  DTTracoId _tracoid; // this is 4 bytes
289 
290  // step number
292 
293  // inner segment position
295  // outer segment position
297  // inner segment bti trigger equation
299  // outer segment bti trigger equation
301 
302  // inner segment code
304  // outer segment code
306 
307  // preview first/second track
309 
310  // preview code for TS
312  // preview K variable for TS
313  int _pvKval;
314  // preview correlation bit
316  // preview io bit
318 
319 
320  // K variable value
321  int _Kval;
322  // X variable value
323  int _Xval;
324 
325  // K converted to angle (psi)
326  long int _psi;
327  // X converted to angle (psi_r, phi)
328  long int _psiR;
329  // bending angle (delta(psi_r), phiB)
330  long int _dPsiR;
331 
332 };
333 
334 #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
bool first
Definition: L1TdeRCT.cc:94
int k[5][pyjets_maxn]
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.
void setEqIn(int eq)
Set bti trigger equation of segment, inner layer.
int pvIO() const
Return the preview i/o bit.
Definition: DDAxes.h:10
int eqIn() const
Return bti trigger equation of inner segment.
void resetPV()
Reset preview variables.