Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:49:33

0001 #ifndef CSCCFEBStatusDigi_CSCCFEBStatusDigi_h
0002 #define CSCCFEBStatusDigi_CSCCFEBStatusDigi_h
0003 
0004 /** \class CSCCFEBStatusDigi
0005  *
0006  * Digi for CSC CFEB status.
0007  *  
0008  *
0009  * \author N. Terentiev, CMU
0010  *
0011  */
0012 
0013 #include <vector>
0014 #include <iosfwd>
0015 #include <cstdint>
0016 
0017 class CSCCFEBStatusDigi {
0018 public:
0019   /// Construct from the CFEB number (1-5).
0020   CSCCFEBStatusDigi(int cfebnmb) { cfebnmb_ = cfebnmb; }
0021 
0022   /// Constructor for all variables
0023   CSCCFEBStatusDigi(int cfebnmb,
0024                     const std::vector<uint16_t>& crcWords,
0025                     const std::vector<uint16_t>& contrWords,
0026                     const std::vector<uint16_t>& bWords) {
0027     cfebnmb_ = cfebnmb;
0028     crcWords_ = crcWords;
0029     contrWords_ = contrWords;
0030     bWords_ = bWords;
0031   }
0032 
0033   /// Default construction.
0034   CSCCFEBStatusDigi() {}
0035 
0036   /// Set CRC vector
0037   void setCRC(const std::vector<uint16_t>& crc) { crcWords_ = crc; }
0038 
0039   /// Set SCAC (SCA Controller) vector
0040   void setSCAC(const std::vector<uint16_t>& scac) { contrWords_ = scac; }
0041 
0042   /// Get the  CFEB number
0043   int getCFEBNmb() const { return cfebnmb_; }
0044 
0045   /// Get SCA Full Condition
0046   std::vector<uint16_t> getSCAFullCond() const;
0047 
0048   /// Get CRC per each time sample
0049   std::vector<uint16_t> getCRC() const { return crcWords_; }
0050 
0051   /// Shift and select
0052   int ShiftSel(int nmb, int nshift, int nsel) const;
0053 
0054   /// Get TS_FLAG bit from SCA Controller data  per each time slice
0055   std::vector<int> getTS_FLAG() const;
0056 
0057   /// Get SCA_FULL bit from SCA Controller data  per each time slice
0058   std::vector<int> getSCA_FULL() const;
0059 
0060   /// Get LCT_PHASE bit from SCA Controller data  per each time slice
0061   std::vector<int> getLCT_PHASE() const;
0062 
0063   /// Get L1A_PHASE bit from SCA Controller data  per each time slice
0064   std::vector<int> getL1A_PHASE() const;
0065 
0066   /// Get SCA_BLK 4 bit word from SCA Controller data  per each time slice
0067   std::vector<int> getSCA_BLK() const;
0068 
0069   /// Get TRIG_TIME 8 bit word from SCA Controller data  per each time slice
0070   std::vector<int> getTRIG_TIME() const;
0071 
0072   /// Print content of digi
0073   void print() const;
0074 
0075 private:
0076   uint16_t cfebnmb_;
0077   std::vector<uint16_t> crcWords_;
0078   std::vector<uint16_t> contrWords_;
0079   std::vector<uint16_t> bWords_;
0080 };
0081 
0082 std::ostream& operator<<(std::ostream& o, const CSCCFEBStatusDigi& digi);
0083 
0084 #endif