Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "DataFormats/GEMDigi/interface/GEMDigi.h"
0002 #include <iostream>
0003 
0004 GEMDigi::GEMDigi(uint16_t strip, int16_t bx) : strip_(strip), bx_(bx) {}
0005 
0006 GEMDigi::GEMDigi() : strip_(65535), bx_(-99) {}
0007 
0008 // Comparison
0009 bool GEMDigi::operator==(const GEMDigi& digi) const { return strip_ == digi.strip() and bx_ == digi.bx(); }
0010 
0011 // Comparison
0012 bool GEMDigi::operator!=(const GEMDigi& digi) const { return strip_ != digi.strip() or bx_ != digi.bx(); }
0013 
0014 ///Precedence operator
0015 bool GEMDigi::operator<(const GEMDigi& digi) const {
0016   if (digi.bx() == bx_)
0017     return digi.strip() < strip_;
0018   else
0019     return digi.bx() < bx_;
0020 }
0021 
0022 bool GEMDigi::isValid() const { return bx_ != -99 and strip_ != 65535; }
0023 
0024 std::ostream& operator<<(std::ostream& o, const GEMDigi& digi) {
0025   return o << " GEMDigi strip = " << digi.strip() << " bx = " << digi.bx();
0026 }
0027 
0028 void GEMDigi::print() const { std::cout << "Strip " << strip() << " bx " << bx() << std::endl; }