File indexing completed on 2023-03-17 10:49:45
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
0018
0019
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
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 }