Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:49:54

0001 #include "DataFormats/GEMDigi/interface/ME0PadDigiCluster.h"
0002 #include <iostream>
0003 
0004 ME0PadDigiCluster::ME0PadDigiCluster(std::vector<uint16_t> pads, int bx) : v_(pads), bx_(bx) {}
0005 
0006 ME0PadDigiCluster::ME0PadDigiCluster() : v_(std::vector<uint16_t>()), bx_(0) {}
0007 
0008 // Comparison
0009 bool ME0PadDigiCluster::operator==(const ME0PadDigiCluster& digi) const {
0010   return v_ == digi.pads() and bx_ == digi.bx();
0011 }
0012 
0013 // Comparison
0014 bool ME0PadDigiCluster::operator!=(const ME0PadDigiCluster& digi) const {
0015   return v_ != digi.pads() or bx_ != digi.bx();
0016 }
0017 
0018 ///Precedence operator
0019 bool ME0PadDigiCluster::operator<(const ME0PadDigiCluster& digi) const {
0020   if (digi.bx() == bx_)
0021     return digi.pads().front() < v_.front();
0022   else
0023     return digi.bx() < bx_;
0024 }
0025 
0026 std::ostream& operator<<(std::ostream& o, const ME0PadDigiCluster& digi) {
0027   o << " bx: " << digi.bx() << " pads: ";
0028   for (auto p : digi.pads())
0029     o << " " << p;
0030   o << std::endl;
0031   return o;
0032 }
0033 
0034 void ME0PadDigiCluster::print() const {
0035   std::cout << " bx: " << bx() << " pads: ";
0036   for (auto p : pads())
0037     std::cout << " " << p;
0038   std::cout << std::endl;
0039 }