Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DataFormats_GEMDigi_GEMPadDigi_h
0002 #define DataFormats_GEMDigi_GEMPadDigi_h
0003 
0004 /** \class GEMPadDigi
0005  *
0006  * Digi for GEM-CSC trigger pads
0007  *
0008  * \author Vadim Khotilovich
0009  *
0010  */
0011 
0012 #include "DataFormats/MuonDetId/interface/GEMSubDetId.h"
0013 
0014 #include <cstdint>
0015 #include <iosfwd>
0016 
0017 class GEMPadDigi {
0018 public:
0019   enum InValid { ME0InValid = 255, GE11InValid = 255, GE21InValid = 511 };
0020   // Newer GE2/1 geometries will have 16 eta partitions
0021   // instead of the usual 8.
0022   enum NumberPartitions { ME0 = 8, GE11 = 8, GE21 = 8, GE21SplitStrip = 16 };
0023 
0024   explicit GEMPadDigi(uint16_t pad,
0025                       int16_t bx,
0026                       enum GEMSubDetId::Station station = GEMSubDetId::Station::GE11,
0027                       unsigned nPart = NumberPartitions::GE11);
0028   GEMPadDigi();
0029 
0030   bool operator==(const GEMPadDigi& digi) const;
0031   bool operator!=(const GEMPadDigi& digi) const;
0032   bool operator<(const GEMPadDigi& digi) const;
0033   // only depends on the "InValid" enum so it also
0034   // works on unpacked data
0035   bool isValid() const;
0036 
0037   // return the pad number. counts from 0.
0038   uint16_t pad() const { return pad_; }
0039   int16_t bx() const { return bx_; }
0040   GEMSubDetId::Station station() const { return station_; }
0041 
0042   unsigned nPartitions() const { return part_; }
0043   void print() const;
0044 
0045 private:
0046   uint16_t pad_;
0047   int16_t bx_;
0048   GEMSubDetId::Station station_;
0049   // number of eta partitions
0050   unsigned part_;
0051 };
0052 
0053 std::ostream& operator<<(std::ostream& o, const GEMPadDigi& digi);
0054 
0055 #endif