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
void resetVar()
Reset all variables but preview.
void setParent(DTTracoId tracoid)
Set the parent TRACO Identifier.
int posMask() const
Return correlator output code (position of segments)
DTTracoTrigData()
Constructor.
unsigned char myint8
void setAngles(int psi, int psir, int dpsir)
Set trigger angles.
int pvCode() const
Return the preview code.
void setEqOut(int eq)
Set bti trigger equation of segment, outer layer.
void setPosOut(int pos)
Set position of segment, outer layer.
DTChamberId ChamberId() const
Returns the chamber id.
Definition: DTTracoId.h:61
void setX(int x)
Set trigger X parameter.
int pvIO() const
Return the preview i/o bit.
int K() const
Return trigger K parameter.
int qdec() const
Return the trigger code in new format.
int posIn() const
Return the position of inner segment.
void setPosIn(int pos)
Set position of segment, inner layer.
std::map< std::string, int, std::less< std::string > > psi
int X() const
Return trigger X parameter.
void setK(int k)
Set trigger K parameter.
int isFirst() const
Return non 0 if the track is a first track.
int step() const
Return step.
void clear()
Clear.
DTChamberId ChamberId() const override
Return chamber identifier.
int psiR() const
Return trigger X parameter converted to angle.
void setCodeOut(int code)
Set trigger code outer layer.
void setPVCorr(int ic)
Set trigger preview correlation bit.
int pvCorr() const
Return the preview correaltion bit.
int traco() const
Returns the traco.
Definition: DTTracoId.h:59
DTTracoId parentId() const
Return parent TRACO identifier.
int tracoNumber() const
Return parent TRACO number.
unsigned char myint8
void setStep(int step)
Set trigger step.
void setCodeIn(int code)
Set trigger code inner layer.
void print() const override
print
void setPV(int first, int code, int K, int ioflag)
Set trigger preview parameters.
int DeltaPsiR() const
Return DeltaPsiR.
int pvK() const
Return the preview K.
step
Definition: StallMonitor.cc:83
void setEqIn(int eq)
Set bti trigger equation of segment, inner layer.
int psi() const
Return trigger K parameter converted to angle.
void resetPV()
Reset preview variables.
int posOut() const
Return the position of outer segment.
~DTTracoTrigData() override
Destructor.
int eqOut() const
Return bti trigger equation of outer segment.
int eqIn() const
Return bti trigger equation of inner segment.
int code() const
Return trigger code.