Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 /** \file
0002  * 
0003  *  $Date: 2014/02/02 22:12:32 $
0004  *  $Revision: 1.0 $
0005  *
0006  * \author Marcello Maggi
0007  */
0008 
0009 #include "DataFormats/GEMDigi/interface/ME0DigiPreReco.h"
0010 #include <iostream>
0011 
0012 //ME0DigiPreReco::ME0DigiPreReco (float x, float y, float ex, float ey, float corr, float tof) :
0013 ME0DigiPreReco::ME0DigiPreReco(float x, float y, float ex, float ey, float corr, float tof, int pdgid, int prompt)
0014     : x_(x), y_(y), ex_(ex), ey_(ey), corr_(corr), tof_(tof), pdgid_(pdgid), prompt_(prompt) {}
0015 
0016 ME0DigiPreReco::ME0DigiPreReco() : x_(0.), y_(0.), ex_(0.), ey_(0.), corr_(0.), tof_(-1.), pdgid_(0), prompt_(0) {}
0017 
0018 // Comparison
0019 bool ME0DigiPreReco::operator==(const ME0DigiPreReco& digi) const {
0020   return x_ == digi.x() and y_ == digi.y() and tof_ == digi.tof();
0021 }
0022 
0023 // Comparison
0024 bool ME0DigiPreReco::operator!=(const ME0DigiPreReco& digi) const {
0025   return x_ != digi.x() or y_ != digi.y() or tof_ != digi.tof();
0026 }
0027 
0028 ///Precedence operator
0029 bool ME0DigiPreReco::operator<(const ME0DigiPreReco& digi) const {
0030   if (digi.tof() == tof_) {
0031     if (digi.x() == x_)
0032       return digi.y() < y_;
0033     else
0034       return digi.x() < x_;
0035   } else {
0036     return digi.tof() < tof_;
0037   }
0038 }
0039 
0040 std::ostream& operator<<(std::ostream& o, const ME0DigiPreReco& digi) {
0041   //  return o << "local x=" << digi.x() << " cm y=" << digi.y()<<" cm ex=" << digi.ex() << " cm ey=" << digi.ey()<< " cm tof="<<digi.tof()<<" ns";
0042   return o << "local x=" << digi.x() << " cm y=" << digi.y() << " cm ex=" << digi.ex() << " cm ey=" << digi.ey()
0043            << " cm tof=" << digi.tof() << " ns"
0044            << " pdgID " << digi.pdgid() << " prompt? " << digi.prompt();
0045 }
0046 
0047 void ME0DigiPreReco::print() const {
0048   //  std::cout << "local x=" << this->x() << " cm y=" << this->y() <<" cm tof="<<this->tof()<<" ns"<<std::endl;
0049   std::cout << "local x=" << this->x() << " cm y=" << this->y() << " cm tof=" << this->tof() << " ns"
0050             << " pdgID " << this->pdgid() << " prompt? " << this->prompt() << std::endl;
0051 }