1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
//
//
#include "DataFormats/EgammaReco/interface/PreshowerCluster.h"
using namespace reco;
PreshowerCluster::~PreshowerCluster() {}
PreshowerCluster::PreshowerCluster(const double E,
const Point &pos,
const std::vector<std::pair<DetId, float> > &hitsAndFractions,
const int plane)
: CaloCluster(E, pos) {
hitsAndFractions_ = hitsAndFractions;
plane_ = plane;
// std::cout << " PreshowerCluster::PreshowerCluster, E = " << energy() << std::endl;
// std::cout << " PreshowerCluster::PreshowerCluster, POS = " << "(" << x() <<","<< y() <<","<< z() <<")"<< std::endl;
// std::cout << " PreshowerCluster::PreshowerCluster, ETA = " << eta() << std::endl;
}
PreshowerCluster::PreshowerCluster(const PreshowerCluster &b) : CaloCluster(b.energy(), b.position()) {
hitsAndFractions_ = b.hitsAndFractions_;
plane_ = b.plane_;
bc_ref_ = b.bc_ref_;
}
// Comparisons
bool PreshowerCluster::operator==(const PreshowerCluster &b) const {
double EPS = 0.000001;
float Tdiff = fabs(b.position().theta() - position().theta());
float Pdiff = fabs(b.phi() - phi());
if ((Tdiff < EPS) && (Pdiff < EPS))
return true;
else
return false;
}
bool PreshowerCluster::operator<(const PreshowerCluster &b) const {
return energy() * sin(position().theta()) < b.energy() * sin(position().theta()) ? true : false;
}
|