Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:03:58

0001 #ifndef CSCDigi_CSCCLCTPreTriggerDigi_h
0002 #define CSCDigi_CSCCLCTPreTriggerDigi_h
0003 
0004 /**\class CSCCLCTPreTriggerDigi
0005  *
0006  * Digi for CLCT pre-trigger primitives.
0007  *
0008  *
0009  * \author Tao Huang (TAMU)
0010  */
0011 
0012 #include <cstdint>
0013 #include <iosfwd>
0014 
0015 class CSCCLCTPreTriggerDigi {
0016 public:
0017   /// Constructors
0018   CSCCLCTPreTriggerDigi(const int valid,
0019                         const int quality,
0020                         const int pattern,
0021                         const int striptype,
0022                         const int bend,
0023                         const int strip,
0024                         const int cfeb,
0025                         const int bx,
0026                         const int trknmb = 0,
0027                         const int fullbx = 0);
0028   /// default
0029   CSCCLCTPreTriggerDigi();
0030 
0031   /// clear this CLCT
0032   void clear();
0033 
0034   /// check CLCT validity (1 - valid CLCT)
0035   bool isValid() const { return valid_; }
0036 
0037   /// return quality of a pattern (number of layers hit!)
0038   int getQuality() const { return quality_; }
0039 
0040   /// return pattern
0041   int getPattern() const { return pattern_; }
0042 
0043   /// return striptype
0044   int getStripType() const { return striptype_; }
0045 
0046   /// return bend
0047   int getBend() const { return bend_; }
0048 
0049   /// return halfstrip that goes from 0 to 31
0050   int getStrip() const { return strip_; }
0051 
0052   /// return Key CFEB ID
0053   int getCFEB() const { return cfeb_; }
0054 
0055   /// return BX
0056   int getBX() const { return bx_; }
0057 
0058   /// return track number (1,2)
0059   int getTrknmb() const { return trknmb_; }
0060 
0061   /// Convert strip_ and cfeb_ to keyStrip. Each CFEB has up to 16 strips
0062   /// (32 halfstrips). There are 5 cfebs.  The "strip_" variable is one
0063   /// of 32 halfstrips on the keylayer of a single CFEB, so that
0064   /// Distrip   = (cfeb*32 + strip)/4.
0065   /// Halfstrip = (cfeb*32 + strip).
0066   /// Always return halfstrip number since this is what is stored in
0067   /// the correlated LCT digi.  For distrip patterns, the convention is
0068   /// the same as for persistent strip numbers: low halfstrip of a distrip.
0069   /// SV, June 15th, 2006.
0070   int getKeyStrip() const {
0071     int keyStrip = cfeb_ * 32 + strip_;
0072     return keyStrip;
0073   }
0074 
0075   /// Set track number (1,2) after sorting CLCTs.
0076   void setTrknmb(const uint16_t number) { trknmb_ = number; }
0077 
0078   /// return 12-bit full BX.
0079   int getFullBX() const { return fullbx_; }
0080 
0081   /// Set 12-bit full BX.
0082   void setFullBX(const uint16_t fullbx) { fullbx_ = fullbx; }
0083 
0084   /// True if the left-hand side has a larger "quality".  Full definition
0085   /// of "quality" depends on quality word itself, pattern type, and strip
0086   /// number.
0087   bool operator>(const CSCCLCTPreTriggerDigi&) const;
0088 
0089   /// True if the two LCTs have exactly the same members (except the number).
0090   bool operator==(const CSCCLCTPreTriggerDigi&) const;
0091 
0092   /// True if the preceding one is false.
0093   bool operator!=(const CSCCLCTPreTriggerDigi&) const;
0094 
0095   /// Print content of digi.
0096   void print() const;
0097 
0098 private:
0099   uint16_t valid_;
0100   uint16_t quality_;
0101   uint16_t pattern_;
0102   uint16_t striptype_;  // not used since mid-2008
0103   uint16_t bend_;
0104   uint16_t strip_;
0105   uint16_t cfeb_;
0106   uint16_t bx_;
0107   uint16_t trknmb_;
0108   uint16_t fullbx_;
0109 };
0110 
0111 std::ostream& operator<<(std::ostream& o, const CSCCLCTPreTriggerDigi& digi);
0112 
0113 #endif