Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 //-------------------------------------------------
0002 //
0003 /**  \class L1MuDTAddressArray
0004  *
0005  *   Array of relative addresses
0006  *
0007  *   Array of 4 relative addresses (one per station);<BR>
0008  *   the valid range of a relative address is 0 - 11
0009  *   thus a relative address is a 4 bit word;<BR>
0010  *   address = 15 indicates a negative extrapolation result
0011  *
0012  *   \verbatim
0013  *         ------------------------
0014  *         |   4    5  |   6   7  |
0015  *      P  ------------+-----------
0016  *      H  |   0    1  |   2   3  |
0017  *      I  ------------+-----------
0018  *         |   8    9  |  10  11  |
0019  *         ------------+-----------
0020  *            my Wheel  next Wheel
0021  *   \endverbatim
0022  *
0023  *
0024  *
0025  *   N. Neumeister            CERN EP
0026  */
0027 //
0028 //--------------------------------------------------
0029 #ifndef L1MUDT_ADDRESS_ARRAY_H
0030 #define L1MUDT_ADDRESS_ARRAY_H
0031 
0032 //---------------
0033 // C++ Headers --
0034 //---------------
0035 
0036 #include <iosfwd>
0037 
0038 //----------------------
0039 // Base Class Headers --
0040 //----------------------
0041 
0042 //------------------------------------
0043 // Collaborating Class Declarations --
0044 //------------------------------------
0045 
0046 //              ---------------------
0047 //              -- Class Interface --
0048 //              ---------------------
0049 
0050 class L1MuDTAddressArray {
0051 public:
0052   /// default constructor
0053   L1MuDTAddressArray();
0054 
0055   /// copy constructor
0056   L1MuDTAddressArray(const L1MuDTAddressArray&);
0057 
0058   /// destructor
0059   virtual ~L1MuDTAddressArray();
0060 
0061   /// assignment operator
0062   L1MuDTAddressArray& operator=(const L1MuDTAddressArray&);
0063 
0064   /// equal operator
0065   bool operator==(const L1MuDTAddressArray&) const;
0066 
0067   /// unequal operator
0068   bool operator!=(const L1MuDTAddressArray&) const;
0069 
0070   /// reset address array
0071   void reset();
0072 
0073   /// set address of a given station [1-4]
0074   void setStation(int stat, int adr);
0075 
0076   /// set addresses of all four stations
0077   void setStations(int adr1, int adr2, int adr3, int adr4);
0078 
0079   /// get address of a given station [1-4]
0080   inline unsigned short station(int stat) const { return m_station[stat - 1]; }
0081 
0082   /// get track address code (for eta track finder)
0083   int trackAddressCode() const;
0084 
0085   /// get converted Addresses
0086   L1MuDTAddressArray converted() const;
0087 
0088   /// output stream operator for address array
0089   friend std::ostream& operator<<(std::ostream&, const L1MuDTAddressArray&);
0090 
0091   /// convert address to corresponding VHDL addresse
0092   static unsigned short int convert(unsigned short int adr);
0093 
0094   /// is it a same wheel address?
0095   static bool sameWheel(unsigned short int adr);
0096 
0097   /// is it a next wheel address?
0098   static bool nextWheel(unsigned short int adr);
0099 
0100 private:
0101   unsigned short int m_station[4];
0102 };
0103 
0104 #endif