Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:40

0001 //-------------------------------------------------
0002 //
0003 /**   \Class DTSectCollPhCand.h
0004  *    A Trigger Server Phi Candidate
0005  *
0006  *  
0007  *
0008  *   \Authors D. Bonacorsi, S. Marcellini
0009  */
0010 //
0011 //--------------------------------------------------
0012 #ifndef DT_SECT_COLL_PH_CAND_H
0013 #define DT_SECT_COLL_PH_CAND_H
0014 
0015 //----------------------
0016 // Base Class Headers --
0017 //----------------------
0018 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigSectColl.h"
0019 #include "L1Trigger/DTSectorCollector/interface/DTSC.h"
0020 #include "L1Trigger/DTTriggerServerPhi/interface/DTChambPhSegm.h"
0021 #include "L1Trigger/DTTraco/interface/DTTracoTrigData.h"
0022 #include "L1TriggerConfig/DTTPGConfig/interface/BitArray.h"
0023 //---------------
0024 // C++ Headers --
0025 //---------------
0026 #include <string>
0027 
0028 //              ---------------------
0029 //              -- Class Interface --
0030 //              ---------------------
0031 
0032 class DTSectCollPhCand {
0033 public:
0034   //!  Constructor
0035   DTSectCollPhCand(DTSC*, const DTChambPhSegm*, int);
0036 
0037   //!  Constructor
0038   DTSectCollPhCand();
0039 
0040   //!  Constructor
0041   DTSectCollPhCand(const DTSectCollPhCand& tsccand);
0042 
0043   //! Assignment operator
0044   DTSectCollPhCand& operator=(const DTSectCollPhCand& tsccand);
0045 
0046   //!  Destructor
0047   ~DTSectCollPhCand();
0048 
0049   // Non-const methods
0050 
0051   //! Set the  bits for DTTSM analysis
0052   void setBitsSectColl();
0053 
0054   //! Clear (set to 1) the quality bits (but first/second track bit)
0055   void clearBits() { _dataword.assign(5, 3, 0x7); }
0056 
0057   //! Clear (set to 1) the quality bits for Sector Collector
0058   void clearBitsSectColl() { _dataword.assign(0, 13, 0x1fff); }
0059 
0060   //! Set the first track bit to second track (used for carry)
0061   void setSecondTrack() {
0062     _dataword.set(14);
0063     _isCarry = 1;
0064   }
0065 
0066   //! Reset the carry bit
0067   void resetCarry() { _isCarry = 0; }
0068 
0069   //! Set the SC Candidate step
0070 
0071   //! Clear the trigger
0072   inline void clear();
0073 
0074   // Const methods
0075 
0076   //! Configuration set
0077   inline const DTConfigSectColl* config() const { return _tsc->config(); }
0078 
0079   //! Return the DTTSS
0080   inline DTSC* tsc() const { return _tsc; }
0081 
0082   //! Return first/second track bit value
0083   inline int isFirst() const { return _dataword.element(14) == 0; }
0084 
0085   //! Return associated TSPhi trigger
0086   inline const DTChambPhSegm* tsTr() const { return _tsmsegm; }
0087 
0088   //! Return an uint16 with the content of the data word (for debugging)
0089   inline unsigned dataword() const { return _dataword.dataWord(0) & 0x1ff; }
0090 
0091   //! Operator < used for sorting
0092   bool operator<(const DTSectCollPhCand& c) const { return _dataword < c._dataword; }
0093 
0094   //! Operator <= used for sorting
0095   bool operator<=(const DTSectCollPhCand& c) const { return _dataword <= c._dataword; }
0096 
0097   //! Print the trigger
0098   void print() const;
0099 
0100   //! Return the Coarse Sync Parameter
0101   int CoarseSync() const;
0102 
0103 private:
0104   DTSC* _tsc;
0105   const DTChambPhSegm* _tsmsegm;
0106 
0107   // BitArray<9> _dataword;   // the word on which sorting is done
0108   BitArray<15> _dataword;  // the word on which sorting is done. reserve space enough for Preview and full data
0109 
0110   int _isCarry;
0111 };
0112 #endif