Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-03-08 03:04:01

0001 #ifndef DataFormats_GEMDigi_ME0Stub_H
0002 #define DataFormats_GEMDigi_ME0Stub_H
0003 
0004 #include <vector>
0005 #include <cstdint>
0006 #include <string>
0007 #include <iostream>
0008 #include <iomanip>
0009 
0010 #include "DataFormats/MuonDetId/interface/GEMDetId.h"
0011 
0012 class ME0Stub final {
0013 public:
0014   ME0Stub()
0015       : detId_(), etaPartition_(0), padStrip_(0), bendingAngle_(0), layerCount_(0), quality_(0), patternId_(0), bx_(0) {}
0016   ME0Stub(const GEMDetId& id,
0017           int etaPartition,
0018           double padStrip,
0019           double bendingAngle,
0020           int layerCount,
0021           int quality,
0022           int patternId,
0023           double bx)
0024       : detId_(id),
0025         etaPartition_(etaPartition),
0026         padStrip_(padStrip),
0027         bendingAngle_(bendingAngle),
0028         layerCount_(layerCount),
0029         quality_(quality),
0030         patternId_(patternId),
0031         bx_(bx) {}
0032 
0033   // clone
0034   ME0Stub* clone() const { return new ME0Stub(*this); }
0035 
0036   // Get private variable
0037   GEMDetId detId() const { return detId_; }
0038   int etaPartition() const { return etaPartition_; }
0039   double strip() const { return padStrip_; }
0040   double bendingAngle() const { return bendingAngle_; }
0041   int layerCount() const { return layerCount_; }
0042   int quality() const { return quality_; }
0043   int patternId() const { return patternId_; }
0044   double bx() const { return bx_; }
0045 
0046   // operators
0047   bool operator==(const ME0Stub& other) {
0048     if (layerCount_ == 0 && other.layerCount_ == 0) {
0049       return true;
0050     }
0051     return (quality_ == other.quality_);
0052   }
0053   bool operator>(const ME0Stub& other) { return (quality_ > other.quality_); }
0054   bool operator<(const ME0Stub& other) { return (quality_ < other.quality_); }
0055   bool operator>=(const ME0Stub& other) { return (quality_ >= other.quality_); }
0056   bool operator<=(const ME0Stub& other) { return (quality_ <= other.quality_); }
0057   // ostream
0058   friend std::ostream& operator<<(std::ostream& os, const ME0Stub& stub) {
0059     os << "id=" << stub.patternId() << ", lc=" << stub.layerCount() << ", strip=" << std::fixed << std::setprecision(3)
0060        << stub.strip() << ", prt=" << stub.etaPartition() << ", quality=" << stub.quality();
0061     return os;
0062   }
0063 
0064 private:
0065   GEMDetId detId_;
0066   int etaPartition_;
0067   double padStrip_;
0068   double bendingAngle_;
0069   int layerCount_;
0070   int quality_;
0071   int patternId_;
0072   double bx_;
0073 };
0074 
0075 #endif