CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/DataFormats/EgammaReco/src/PreshowerCluster.cc

Go to the documentation of this file.
00001 //
00002 // $Id: PreshowerCluster.cc,v 1.16 2009/01/27 09:53:06 ferriff Exp $
00003 //
00004 #include "DataFormats/EgammaReco/interface/PreshowerCluster.h"
00005 
00006 using namespace reco;
00007 
00008 PreshowerCluster::~PreshowerCluster() { }
00009 
00010 
00011 PreshowerCluster::PreshowerCluster(const double E, const Point& pos,
00012                                    const std::vector< std::pair<DetId, float> > hitsAndFractions,
00013                                    const int plane) : CaloCluster(E, pos)
00014 {
00015   hitsAndFractions_ = hitsAndFractions;
00016   plane_ = plane;
00017 
00018 //   std::cout << " PreshowerCluster::PreshowerCluster, E = " << energy() << std::endl;
00019 //   std::cout << " PreshowerCluster::PreshowerCluster, POS = " << "(" << x() <<","<< y() <<","<< z() <<")"<< std::endl;
00020 //   std::cout << " PreshowerCluster::PreshowerCluster, ETA = " << eta() << std::endl; 
00021 
00022 }
00023 
00024 
00025 PreshowerCluster::PreshowerCluster(const PreshowerCluster &b) : CaloCluster( b.energy(), b.position() ) 
00026 {
00027   hitsAndFractions_ = b.hitsAndFractions_;
00028   plane_ = b.plane_; 
00029   bc_ref_=b.bc_ref_;
00030 }
00031 
00032 
00033 // Comparisons
00034 
00035 bool PreshowerCluster::operator==(const PreshowerCluster &b) const {
00036   double EPS = 0.000001;
00037   float Tdiff = fabs(b.position().theta() - position().theta());
00038   float Pdiff = fabs(b.phi() - phi());
00039   if ( (Tdiff < EPS) && (Pdiff < EPS) ) return true;
00040   else return false;
00041 }
00042 
00043 bool PreshowerCluster::operator<(const PreshowerCluster &b) const {
00044   return energy()*sin(position().theta()) < b.energy()*sin(position().theta()) ? true : false;
00045 }