Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "DataFormats/GEMDigi/interface/GEMPadDigi.h"
0002 #include <iostream>
0003 
0004 GEMPadDigi::GEMPadDigi(uint16_t pad, int16_t bx, enum GEMSubDetId::Station station, unsigned nPart)
0005     : pad_(pad), bx_(bx), station_(station), part_(nPart) {}
0006 
0007 GEMPadDigi::GEMPadDigi()
0008     : pad_(GE11InValid), bx_(-99), station_(GEMSubDetId::Station::GE11), part_(NumberPartitions::GE11) {}
0009 
0010 // Comparison
0011 bool GEMPadDigi::operator==(const GEMPadDigi& digi) const {
0012   return pad_ == digi.pad() and bx_ == digi.bx() and station_ == digi.station();
0013 }
0014 
0015 // Comparison
0016 bool GEMPadDigi::operator!=(const GEMPadDigi& digi) const { return pad_ != digi.pad() or bx_ != digi.bx(); }
0017 
0018 ///Precedence operator
0019 bool GEMPadDigi::operator<(const GEMPadDigi& digi) const {
0020   if (digi.bx() == bx_)
0021     return digi.pad() < pad_;
0022   else
0023     return digi.bx() < bx_;
0024 }
0025 
0026 bool GEMPadDigi::isValid() const {
0027   uint16_t invalid = GE11InValid;
0028   if (station_ == GEMSubDetId::Station::ME0) {
0029     invalid = ME0InValid;
0030   } else if (station_ == GEMSubDetId::Station::GE21) {
0031     invalid = GE21InValid;
0032   }
0033   return pad_ != invalid;
0034 }
0035 
0036 std::ostream& operator<<(std::ostream& o, const GEMPadDigi& digi) {
0037   return o << " GEMPadDigi Pad = " << digi.pad() << " bx = " << digi.bx();
0038 }
0039 
0040 void GEMPadDigi::print() const { std::cout << "Pad " << pad() << " bx " << bx() << std::endl; }