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 
39 public:
40  // public methods
41 
44 
47 
49  ~DTTracoTrigData() override {}
50 
51  // Non-const methods
52 
54  inline void setParent(DTTracoId tracoid) { _tracoid = tracoid; }
55 
57  inline void setStep(int step) { _step = step; }
58 
60  inline void setPV(int first, int code, int K, int ioflag) {
61  _pvfirst = first;
62  _pvcode = code;
63  _pvKval = K;
64  _pvIOflag = ioflag;
65  /*
66  cout<<"setPV called, stored:"<<
67  " first=" << first <<
68  " code=" << code <<
69  " K=" << K <<
70  " ioflag=" << ioflag << endl;
71  */
72  }
73 
75  inline void setPVCorr(int ic) { _pvCorr = ic; }
76 
78  inline void setCodeIn(int code) { _codeIn = code; }
80  inline void setCodeOut(int code) { _codeOut = code; }
81 
83  inline void setPosIn(int pos) { _posIn = pos; }
84 
86  inline void setPosOut(int pos) { _posOut = pos; }
87 
89  inline void setEqIn(int eq) { _eqIn = eq; }
90 
92  inline void setEqOut(int eq) { _eqOut = eq; }
93 
95  inline void setK(int k) { _Kval = k; }
96 
98  inline void setX(int x) { _Xval = x; }
99 
101  inline void setAngles(int psi, int psir, int dpsir) {
102  if (psi & 0x200)
103  psi |= 0xFFFFFC00;
104  if (psir & 0x800)
105  psir |= 0xFFFFF000;
106  if (dpsir & 0x200)
107  dpsir |= 0xFFFFFC00;
108 
109  _psi = psi;
110  _psiR = psir;
111  _dPsiR = dpsir;
112  }
113 
115  void resetVar() {
116  _codeIn = 0;
117  _codeOut = 0;
118  _posIn = 0;
119  _posOut = 0;
120  _eqIn = 0;
121  _eqOut = 0;
122  _Kval = 255;
123  _Xval = 0;
124  /*
125  _psi = -DTConfig::RESOLPSI;
126  _psiR = -DTConfig::RESOLPSIR/2;
127  _dPsiR = -DTConfig::RESOLPSI;
128  */
129  // SV notazione complemento a due:
130  _psi = 0x1FF;
131  _psiR = 0xFFF;
132  _dPsiR = 0x1FF;
133  }
134 
136  void resetPV() {
137  _pvfirst = 0;
138  _pvcode = 0;
139  _pvKval = 9999;
140  _pvCorr = 0;
141  _pvIOflag = 0;
142  }
143 
145  void clear() {
146  resetVar();
147  resetPV();
148  }
149 
151  DTChamberId ChamberId() const override { return _tracoid.ChamberId(); }
152 
154  void print() const override;
155 
157  inline DTTracoId parentId() const { return _tracoid; }
158 
160  inline int tracoNumber() const { return _tracoid.traco(); }
161 
163  inline int step() const { return _step; }
164 
166  inline int code() const { return _codeIn * 10 + _codeOut; }
167 
169  inline int posMask() const { return _posOut * 1000 + _posIn; }
170 
172  inline int posIn() const { return _posIn; }
173 
175  inline int posOut() const { return _posOut; }
176 
178  inline int eqIn() const { return _eqIn; }
179 
181  inline int eqOut() const { return _eqOut; }
182 
184  inline int isFirst() const { return _pvfirst; }
185 
187  inline int pvCode() const { return _pvcode; }
188 
190  inline int pvK() const { return _pvKval; }
191 
193  inline int pvCorr() const { return _pvCorr; }
194 
196  inline int pvIO() const { return _pvIOflag; }
197 
199  inline int K() const { return _Kval; }
200 
202  inline int X() const { return _Xval; }
203 
205  int psi() const { return _psi; }
206 
208  int psiR() const { return _psiR; }
209 
211  int DeltaPsiR() const { return _dPsiR; }
212 
214  int qdec() const;
215 
216 private:
217  // parent TRACO
218  DTTracoId _tracoid; // this is 4 bytes
219 
220  // step number
222 
223  // inner segment position
225  // outer segment position
227  // inner segment bti trigger equation
229  // outer segment bti trigger equation
231 
232  // inner segment code
234  // outer segment code
236 
237  // preview first/second track
239 
240  // preview code for TS
242  // preview K variable for TS
243  int _pvKval;
244  // preview correlation bit
246  // preview io bit
248 
249  // K variable value
250  int _Kval;
251  // X variable value
252  int _Xval;
253 
254  // K converted to angle (psi)
255  long int _psi;
256  // X converted to angle (psi_r, phi)
257  long int _psiR;
258  // bending angle (delta(psi_r), phiB)
259  long int _dPsiR;
260 };
261 
262 #endif
void resetVar()
Reset all variables but preview.
void setParent(DTTracoId tracoid)
Set the parent TRACO Identifier.
DTChamberId ChamberId() const override
Return chamber identifier.
DTTracoTrigData()
Constructor.
unsigned char myint8
void setAngles(int psi, int psir, int dpsir)
Set trigger angles.
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.
std::map< std::string, int, std::less< std::string > > psi
void setK(int k)
Set trigger K parameter.
int traco() const
Returns the traco.
Definition: DTTracoId.h:70
void clear()
Clear.
void print() const override
print
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.
unsigned char myint8
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.
step
Definition: StallMonitor.cc:94
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.
~DTTracoTrigData() override
Destructor.