CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/L1Trigger/DTTriggerServerPhi/interface/DTTSCand.h

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00011 //
00012 //--------------------------------------------------
00013 #ifndef DT_TS_CAND_H
00014 #define DT_TS_CAND_H
00015 
00016 //------------------------------------
00017 // Collaborating Class Declarations --
00018 //------------------------------------
00019 class DTConfigTSPhi;
00020 
00021 //----------------------
00022 // Base Class Headers --
00023 //----------------------
00024 #include "L1Trigger/DTTriggerServerPhi/interface/DTTSS.h"
00025 #include "L1Trigger/DTTraco/interface/DTTracoTrigData.h"
00026 #include "L1TriggerConfig/DTTPGConfig/interface/BitArray.h"
00027 
00028 //---------------
00029 // C++ Headers --
00030 //---------------
00031 #include <string>
00032 
00033 //              ---------------------
00034 //              -- Class Interface --
00035 //              ---------------------
00036 
00037 class DTTSCand {
00038 
00039   public:
00040 
00042     DTTSCand(DTTSS*, const DTTracoTrigData*, int, int);
00043 
00045     DTTSCand();
00046 
00048     DTTSCand(const DTTSCand& tscand);
00049   
00051     DTTSCand& operator=(const DTTSCand& tscand);
00052 
00054     ~DTTSCand();
00055 
00057     void setBitsTss();
00058 
00060     void setBitsBkmod();
00061 
00063     void setBitsTsm();
00064 
00066     // SM sector collector: it becomes bit 14
00067     void setSecondTrack() { _dataword.set(14); _isCarry=1; }
00068 
00070     void resetCarry() { _isCarry=0; }
00071 
00073     void clearBits(){ _dataword.assign(5,3,0x7); }
00074 
00076     void clearBitsBkmod(){ _dataword.assign(0,7,0xff); }
00077 
00079     inline void clear();
00080 
00082     inline DTConfigTSPhi* config() const { return _tss->config(); }
00083 
00085     inline const DTTracoTrigData* tracoTr() const { return _tctrig; }
00086 
00088     inline int TcPos() const { return _tcPos; }
00089 
00091     inline DTTSS* tss() const { return _tss; }
00092 
00094     inline int tssNumber() const { return _tss->number(); }
00095 
00097     inline int tracoNumber() const { return _tctrig->tracoNumber(); }
00098 
00100     inline int isFirst() const { return _dataword.element(14)==0; }
00101 
00103     inline int isHtrig() const { return _tctrig->pvCode()==8 || 
00104                                         _tctrig->pvCode()==80; }
00106     inline int isInner() const { return _tctrig->pvCode()>8; }
00107 
00109     inline int isCorr() const { return _tctrig->pvCorr(); }
00110 
00112     inline int isCarry() const { return _isCarry; }
00113 
00115     inline int isHHorHL() const { return _tctrig->pvCorr() && _tctrig->pvCode()==80; }
00116  
00118     inline int isLH() const { return _tctrig->pvCorr() && _tctrig->pvCode()==8; }
00119  
00121     inline int isLL() const { return _tctrig->pvCorr() && !_tctrig->pvCode()==8 &&
00122                                                           !_tctrig->pvCode()==80; }  
00124     inline int isH0() const { return !_tctrig->pvCorr() && _tctrig->pvCode()==80; }
00125  
00127     inline int is0H() const { return !_tctrig->pvCorr() && _tctrig->pvCode()==8; }
00128  
00130     inline int isL0() const {  return !_tctrig->pvCorr() && _tctrig->pvCode()<80 &&
00131                                                             _tctrig->pvCode()>8; }
00133     inline int is0L() const {  return !_tctrig->pvCorr() && _tctrig->pvCode()<8; }
00134 
00136     inline unsigned dataword() const { return _dataword.dataWord(0)&0x1ff; }
00137 
00139     bool operator < (const DTTSCand& c) const { return _dataword<c._dataword; }
00140 
00142     bool operator <= (const DTTSCand& c) const { return _dataword<=c._dataword; }
00143 
00144     // Operator <<= used for sorting in TSM back-up mode
00145     // SM double TSM  bool operator <<= (const DTTSCand& c) const { return _datawordbk<c._datawordbk; }
00146 
00148     void print() const;
00149 
00150   private:
00151   DTTSS* _tss;
00152   const DTTracoTrigData* _tctrig;
00153     BitArray<15> _dataword;   // the word on which sorting is done. reserve space enough for Preview and full data
00154   // SM double TSM  BitArray<9> _datawordbk; // the word on which sorting is done (back-up mode)
00155   int _tcPos;            // TRACO position in TSS
00156   // SM double TSM   int _bkmod;            // TSM back-up mode flag
00157   int _isCarry;          // info for TSM
00158 
00159 };
00160 
00161 #endif