Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-07-22 22:43:39

0001 #ifndef DataFormats_GEMDigi_GEMPadDigiCluster_h
0002 #define DataFormats_GEMDigi_GEMPadDigiCluster_h
0003 
0004 /** \class GEMPadDigiCluster
0005  *
0006  * Cluster of maximal 8 adjacent GEM pad digis
0007  * with the same BX
0008  *
0009  * \author Sven Dildick
0010  *
0011  */
0012 
0013 #include "DataFormats/MuonDetId/interface/GEMSubDetId.h"
0014 
0015 #include <cstdint>
0016 #include <iosfwd>
0017 #include <vector>
0018 
0019 class GEMPadDigiCluster {
0020 public:
0021   enum InValid { GE11InValid = 255, GE21InValid = 511 };
0022   // Newer GE2/1 geometries will have 16 eta partitions
0023   // instead of the usual 8.
0024   enum NumberPartitions { ME0 = 8, GE11 = 8, GE21 = 8, GE21SplitStrip = 16 };
0025 
0026   explicit GEMPadDigiCluster(std::vector<uint16_t> pads,
0027                              int16_t bx,
0028                              enum GEMSubDetId::Station station = GEMSubDetId::Station::GE11,
0029                              unsigned nPart = NumberPartitions::GE11);
0030   GEMPadDigiCluster();
0031 
0032   bool operator==(const GEMPadDigiCluster& digi) const;
0033   bool operator!=(const GEMPadDigiCluster& digi) const;
0034   bool operator<(const GEMPadDigiCluster& digi) const;
0035   // only depends on the "InValid" enum so it also
0036   // works on unpacked data
0037   bool isValid() const;
0038 
0039   const std::vector<uint16_t>& pads() const { return v_; }
0040   int bx() const { return bx_; }
0041 
0042   GEMSubDetId::Station station() const { return station_; }
0043 
0044   unsigned nPartitions() const { return part_; }
0045   void print() const;
0046 
0047   int alctMatchTime() const { return alctMatchTime_; }
0048   void setAlctMatchTime(int matchWin) { alctMatchTime_ = matchWin; }
0049 
0050 private:
0051   std::vector<uint16_t> v_;
0052   int32_t bx_;
0053   int alctMatchTime_ = -1;
0054   GEMSubDetId::Station station_;
0055   // number of eta partitions
0056   unsigned part_;
0057 };
0058 
0059 std::ostream& operator<<(std::ostream& o, const GEMPadDigiCluster& digi);
0060 
0061 #endif