Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef GEMDigi_ME0TriggerDigi_h
0002 #define GEMDigi_ME0TriggerDigi_h
0003 
0004 /**\class ME0TriggerDigi
0005  *
0006  * Digi for local ME0 trigger system
0007  * ME0 data format: 32bits in total
0008  * eta position:  4bits, 0-15
0009  * phi positoin:  10bits, halfstrip resolution
0010  * deltaPhi: 9bits,  phi difference between layer1 and layer6
0011  * bend: 1bits, left(+)=0 or right(-)=1
0012  * quality: 4bits, quality0 means invalid 
0013  * chamber id: 1bits, 2 chamber in CTP7
0014  * 30 bits used now and 2 bits reserved for future
0015  *
0016  * Other properties for MC
0017  * bx: center at BX8, similar to CSC
0018  * discussion: https://indico.cern.ch/event/780696/
0019  * first version of ME0 trigger is built from offline ME0 segment
0020  * added ME0 reference in trigger digi temporarily
0021  * \author Sven Dildick (TAMU), Tao Huang (TAMU)
0022  */
0023 
0024 #include <cstdint>
0025 #include <iosfwd>
0026 #include "DataFormats/GEMRecHit/interface/ME0Segment.h"
0027 
0028 class ME0TriggerDigi {
0029 public:
0030   /// Constructors
0031   ME0TriggerDigi(const int chamberid,
0032                  const int quality,
0033                  const int phiposition,
0034                  const int partition,
0035                  const int deltaphi,
0036                  const int bend,
0037                  const int bx);
0038 
0039   /// default
0040   ME0TriggerDigi();
0041 
0042   /// clear this Trigger
0043   void clear();
0044 
0045   ///Comparison
0046   bool operator==(const ME0TriggerDigi &) const;
0047   bool operator!=(const ME0TriggerDigi &rhs) const { return !(this->operator==(rhs)); }
0048 
0049   /// return chamber number in one CTP7
0050   int getChamberid() const { return chamberid_; }
0051 
0052   /// return the Quality
0053   int getQuality() const { return quality_; }
0054 
0055   /// return the key strip
0056   int getStrip() const { return strip_; }
0057 
0058   /// return the phi position, resolution: half strip level
0059   int getPhiposition() const { return phiposition_; }
0060 
0061   /// return the key "partition"
0062   int getPartition() const { return partition_; }
0063 
0064   /// return bending angle
0065   int getDeltaphi() const { return deltaphi_; }
0066 
0067   /// return bend
0068   int getBend() const { return bend_; }
0069 
0070   /// return BX
0071   int getBX() const { return bx_; }
0072 
0073   /// is valid?
0074   bool isValid() const { return quality_ != 0; }
0075 
0076   /// Set track number.
0077   void setChamberid(const uint16_t number) { chamberid_ = number; }
0078 
0079   /// set quality code
0080   void setQuality(unsigned int q) { quality_ = q; }
0081 
0082   /// set strip
0083   void setStrip(unsigned int s) { strip_ = s; }
0084 
0085   /// set phi position
0086   void setPhiposition(unsigned int phi) { phiposition_ = phi; }
0087 
0088   /// set partition
0089   void setPartition(unsigned int p) { partition_ = p; }
0090 
0091   /// set bending angle
0092   void setDeltaphi(unsigned int dphi) { deltaphi_ = dphi; }
0093 
0094   /// set bend
0095   void setBend(unsigned int b) { bend_ = b; }
0096 
0097   /// set bx
0098   void setBX(unsigned int b) { bx_ = b; }
0099 
0100   /*
0101   /// return ME0 segment 
0102   const ME0Segment& getME0Segment () const {return segment_;}
0103 
0104   /// set ME0 segment 
0105   void setME0Segment(const ME0Segment &seg) {segment_ = seg;}
0106   */
0107 
0108 private:
0109   uint16_t chamberid_;
0110   uint16_t quality_;
0111   uint16_t strip_;
0112   uint16_t phiposition_;
0113   uint16_t partition_;
0114   uint16_t deltaphi_;
0115   uint16_t bend_;
0116   uint16_t bx_;
0117 
0118 private:
0119   ME0Segment segment_;
0120 };
0121 
0122 std::ostream &operator<<(std::ostream &o, const ME0TriggerDigi &digi);
0123 
0124 #endif