Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 //
0002 //
0003 #include "DataFormats/EgammaReco/interface/PreshowerCluster.h"
0004 
0005 using namespace reco;
0006 
0007 PreshowerCluster::~PreshowerCluster() {}
0008 
0009 PreshowerCluster::PreshowerCluster(const double E,
0010                                    const Point &pos,
0011                                    const std::vector<std::pair<DetId, float> > &hitsAndFractions,
0012                                    const int plane)
0013     : CaloCluster(E, pos) {
0014   hitsAndFractions_ = hitsAndFractions;
0015   plane_ = plane;
0016 
0017   //   std::cout << " PreshowerCluster::PreshowerCluster, E = " << energy() << std::endl;
0018   //   std::cout << " PreshowerCluster::PreshowerCluster, POS = " << "(" << x() <<","<< y() <<","<< z() <<")"<< std::endl;
0019   //   std::cout << " PreshowerCluster::PreshowerCluster, ETA = " << eta() << std::endl;
0020 }
0021 
0022 PreshowerCluster::PreshowerCluster(const PreshowerCluster &b) : CaloCluster(b.energy(), b.position()) {
0023   hitsAndFractions_ = b.hitsAndFractions_;
0024   plane_ = b.plane_;
0025   bc_ref_ = b.bc_ref_;
0026 }
0027 
0028 // Comparisons
0029 
0030 bool PreshowerCluster::operator==(const PreshowerCluster &b) const {
0031   double EPS = 0.000001;
0032   float Tdiff = fabs(b.position().theta() - position().theta());
0033   float Pdiff = fabs(b.phi() - phi());
0034   if ((Tdiff < EPS) && (Pdiff < EPS))
0035     return true;
0036   else
0037     return false;
0038 }
0039 
0040 bool PreshowerCluster::operator<(const PreshowerCluster &b) const {
0041   return energy() * sin(position().theta()) < b.energy() * sin(position().theta()) ? true : false;
0042 }