Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:09

0001 #ifndef CSCDigi_CSCALCTPreTriggerDigi_h
0002 #define CSCDigi_CSCALCTPreTriggerDigi_h
0003 
0004 /**\class CSCALCTPreTriggerDigi
0005  *
0006  * Pre-trigger Digi for ALCT trigger primitives.
0007  *
0008  */
0009 
0010 #include <cstdint>
0011 #include <iosfwd>
0012 
0013 class CSCALCTPreTriggerDigi {
0014 public:
0015   /// Constructors
0016   CSCALCTPreTriggerDigi(const int valid,
0017                         const int quality,
0018                         const int accel,
0019                         const int patternb,
0020                         const int keywire,
0021                         const int bx,
0022                         const int trknmb = 0);
0023   /// default
0024   CSCALCTPreTriggerDigi();
0025 
0026   /// clear this ALCT
0027   void clear();
0028 
0029   /// check ALCT validity (1 - valid ALCT)
0030   bool isValid() const { return valid_; }
0031 
0032   /// set valid
0033   void setValid(const int valid) { valid_ = valid; }
0034 
0035   /// return quality of a pattern
0036   int getQuality() const { return quality_; }
0037 
0038   /// set quality
0039   void setQuality(const int quality) { quality_ = quality; }
0040 
0041   /// return Accelerator bit
0042   /// 1-Accelerator pattern, 0-CollisionA or CollisionB pattern
0043   int getAccelerator() const { return accel_; }
0044 
0045   /// set accelerator bit
0046   void setAccelerator(const int accelerator) { accel_ = accelerator; }
0047 
0048   /// return Collision Pattern B bit
0049   /// 1-CollisionB pattern (accel_ = 0),
0050   /// 0-CollisionA pattern (accel_ = 0)
0051   int getCollisionB() const { return patternb_; }
0052 
0053   /// set Collision Pattern B bit
0054   void setCollisionB(const int collision) { patternb_ = collision; }
0055 
0056   /// return key wire group
0057   int getKeyWG() const { return keywire_; }
0058 
0059   /// set key wire group
0060   void setKeyWG(const int keyWG) { keywire_ = keyWG; }
0061 
0062   /// return BX - five low bits of BXN counter tagged by the ALCT
0063   int getBX() const { return bx_; }
0064 
0065   /// set BX
0066   void setBX(const int BX) { bx_ = BX; }
0067 
0068   /// return track number (1,2)
0069   int getTrknmb() const { return trknmb_; }
0070 
0071   /// Set track number (1,2) after sorting ALCTs.
0072   void setTrknmb(const uint16_t number) { trknmb_ = number; }
0073 
0074   /// return 12-bit full BX.
0075   int getFullBX() const { return fullbx_; }
0076 
0077   /// Set 12-bit full BX.
0078   void setFullBX(const uint16_t fullbx) { fullbx_ = fullbx; }
0079 
0080   /// True if the first ALCT has a larger quality, or if it has the same
0081   /// quality but a larger wire group.
0082   bool operator>(const CSCALCTPreTriggerDigi&) const;
0083 
0084   /// True if all members (except the number) of both ALCTs are equal.
0085   bool operator==(const CSCALCTPreTriggerDigi&) const;
0086 
0087   /// True if the preceding one is false.
0088   bool operator!=(const CSCALCTPreTriggerDigi&) const;
0089 
0090   /// Print content of digi.
0091   void print() const;
0092 
0093   /// set wiregroup number
0094   void setWireGroup(unsigned int wiregroup) { keywire_ = wiregroup; }
0095 
0096 private:
0097   uint16_t valid_;
0098   uint16_t quality_;
0099   uint16_t accel_;
0100   uint16_t patternb_;  // not used since 2007
0101   uint16_t keywire_;
0102   uint16_t bx_;
0103   uint16_t trknmb_;
0104   uint16_t fullbx_;
0105 };
0106 
0107 std::ostream& operator<<(std::ostream& o, const CSCALCTPreTriggerDigi& digi);
0108 #endif