CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch1/src/L1Trigger/DTTraco/interface/DTTracoTrigData.h

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00013 //
00014 //--------------------------------------------------
00015 #ifndef DT_TRACO_TRIG_DATA_H
00016 #define DT_TRACO_TRIG_DATA_H
00017 
00018 //------------------------------------
00019 // Collaborating Class Declarations --
00020 //------------------------------------
00021 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfig.h"
00022 #include "DataFormats/MuonDetId/interface/DTTracoId.h"
00023 
00024 //----------------------
00025 // Base Class Headers --
00026 //----------------------
00027 #include "L1Trigger/DTUtilities/interface/DTTrigData.h"
00028 
00029 //---------------
00030 // C++ Headers --
00031 //---------------
00032 
00033 //              ---------------------
00034 //              -- Class Interface --
00035 //              ---------------------
00036 
00037 typedef unsigned char myint8;
00038 
00039 class DTTracoTrigData : public DTTrigData {
00040 
00041  public:
00042 
00043   // public methods
00044 
00046   DTTracoTrigData() {}
00047 
00049   DTTracoTrigData(DTTracoId, int);
00050   
00052   ~DTTracoTrigData() {}
00053 
00054   // Non-const methods
00055   
00057   inline void setParent(DTTracoId tracoid) { 
00058     _tracoid = tracoid; 
00059   }
00060 
00062   inline void setStep(int step) {
00063     _step = step;
00064   }
00065 
00067   inline void setPV(int first, int code, int K, int ioflag) {
00068     _pvfirst = first; 
00069     _pvcode = code;
00070     _pvKval = K; 
00071     _pvIOflag = ioflag;
00072 /*
00073     cout<<"setPV called, stored:"<<
00074     "  first=" << first <<
00075     "  code=" << code <<
00076     "  K=" << K <<
00077     " ioflag=" << ioflag << endl;
00078 */
00079    }
00080 
00082   inline void setPVCorr(int ic) {
00083     _pvCorr = ic; 
00084   }
00085 
00087   inline void setCodeIn(int code) {
00088     _codeIn = code;
00089   }
00091   inline void setCodeOut(int code) {
00092     _codeOut = code;
00093   }
00094 
00096   inline void setPosIn(int pos) {
00097     _posIn = pos;
00098   }
00099 
00101   inline void setPosOut(int pos) {
00102     _posOut = pos;
00103   }
00104 
00106   inline void setEqIn(int eq) {
00107     _eqIn = eq;
00108   }
00109 
00111   inline void setEqOut(int eq) {
00112     _eqOut = eq;
00113   }
00114 
00115 
00117   inline void setK(int k) {
00118     _Kval = k;
00119   }
00120 
00122   inline void setX(int x) {
00123     _Xval = x;
00124   }
00125 
00127   inline void setAngles(int psi, int psir, int dpsir) { 
00128     if(psi & 0x200)
00129       psi |= 0xFFFFFC00;
00130     if(psir & 0x800)
00131       psir |= 0xFFFFF000;
00132     if(dpsir & 0x200)
00133       dpsir |= 0xFFFFFC00;
00134 
00135     _psi = psi;
00136     _psiR = psir;
00137     _dPsiR = dpsir; 
00138   }
00139 
00141   void resetVar() {
00142     _codeIn = 0; 
00143     _codeOut = 0; 
00144     _posIn = 0;
00145     _posOut = 0;
00146     _eqIn = 0;
00147     _eqOut = 0;
00148     _Kval = 255; 
00149     _Xval = 0;
00150     /*
00151     _psi = -DTConfig::RESOLPSI;
00152     _psiR = -DTConfig::RESOLPSIR/2;
00153     _dPsiR = -DTConfig::RESOLPSI;
00154     */
00155     //SV notazione complemento a due:
00156     _psi = 0x1FF;
00157     _psiR = 0xFFF;
00158     _dPsiR = 0x1FF;
00159 
00160   }
00161   
00163   void resetPV() {
00164     _pvfirst = 0;
00165     _pvcode = 0;
00166     _pvKval = 9999;
00167     _pvCorr = 0;
00168     _pvIOflag = 0;
00169   }
00170   
00172   void clear() {
00173     resetVar();
00174     resetPV();
00175   }
00176   
00178   DTChamberId ChamberId() const {
00179     return _tracoid.ChamberId(); 
00180   }
00181 
00183   void print() const;
00184 
00186   inline DTTracoId parentId() const {
00187     return _tracoid; 
00188   }
00189 
00191   inline int tracoNumber() const { 
00192     return _tracoid.traco(); 
00193   }
00194 
00196   inline int step() const { 
00197     return _step; 
00198   }
00199 
00201   inline int code() const { 
00202     return _codeIn*10 + _codeOut; 
00203   }
00204   
00206   inline int posMask() const { 
00207     return _posOut*1000 + _posIn; 
00208   }
00209   
00211   inline int posIn() const { 
00212     return _posIn; 
00213   }
00214 
00216   inline int posOut() const { 
00217     return _posOut; 
00218   }
00219 
00221   inline int eqIn() const { 
00222     return _eqIn; 
00223   }
00224 
00226   inline int eqOut() const { 
00227     return _eqOut; 
00228   }
00229 
00230 
00232   inline int isFirst() const {
00233     return _pvfirst;
00234   }
00235 
00237   inline int pvCode() const { 
00238     return _pvcode; 
00239   }
00240 
00242   inline int pvK() const { 
00243     return _pvKval; 
00244   }
00245 
00247   inline int pvCorr() const { 
00248     return _pvCorr; 
00249   }
00250 
00252   inline int pvIO() const { 
00253     return _pvIOflag; 
00254   }
00255 
00256 
00258   inline int K() const { 
00259     return _Kval; 
00260   }
00261 
00263   inline int X() const { 
00264     return _Xval; 
00265   }
00266 
00268   int psi() const {
00269     return _psi; 
00270   }
00271 
00273   int psiR() const {
00274     return _psiR; 
00275   }
00276 
00278   int DeltaPsiR() const {
00279     return _dPsiR; 
00280   }
00281 
00283   int qdec() const;
00284 
00285   private:
00286 
00287   // parent TRACO
00288   DTTracoId _tracoid; // this is 4 bytes
00289 
00290   // step number
00291   myint8 _step;
00292 
00293   // inner segment position
00294   myint8 _posIn;
00295   // outer segment position
00296   myint8 _posOut;
00297   // inner segment bti trigger equation
00298   myint8 _eqIn;
00299   // outer segment bti trigger equation
00300   myint8 _eqOut;
00301 
00302   // inner segment code
00303   myint8 _codeIn;
00304   // outer segment code
00305   myint8 _codeOut;
00306 
00307   // preview first/second track
00308   myint8 _pvfirst;
00309 
00310   // preview code for TS
00311   myint8 _pvcode;
00312   // preview K variable for TS
00313   int _pvKval;
00314   // preview correlation bit
00315   myint8 _pvCorr;
00316   // preview io bit
00317   myint8 _pvIOflag;
00318 
00319 
00320   // K variable value
00321   int _Kval;
00322   // X variable value
00323   int _Xval;
00324 
00325   // K converted to angle (psi)
00326   long int _psi;
00327   // X converted to angle (psi_r, phi)
00328   long int _psiR;
00329   // bending angle (delta(psi_r), phiB)
00330   long int _dPsiR;
00331 
00332 };
00333 
00334 #endif