Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
lgray committed Dec 20, 2016
1 parent cfeda61 commit f921ac6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
10 changes: 8 additions & 2 deletions RecoLocalCalo/HGCalRecAlgos/interface/HGCalImagingAlgo.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,14 @@ class HGCalImagingAlgo
//@@EM todo: the number of layers should be obtained programmatically - the range is 1-n instead of 0-n-1...

//these functions should be in a helper class.
double distance2(const Hexel &pt1, const Hexel &pt2); //distance squared
double distance(const Hexel &pt1, const Hexel &pt2); //2-d distance on the layer (x-y)
inline double distance2(const Hexel &pt1, const Hexel &pt2) { //distance squared
const double dx = pt1.x - pt2.x;
const double dy = pt1.y - pt2.y;
return (dx*dx + dy*dy);
} //distance squaredq
inline double distance(const Hexel &pt1, const Hexel &pt2) { //2-d distance on the layer (x-y)
return std::sqrt(distance2(pt1,pt2));
}
double calculateLocalDensity(std::vector<KDNode> &, KDTree &); //return max density
double calculateDistanceToHigher(std::vector<KDNode> &, KDTree &);
int findAndAssignClusters(std::vector<KDNode> &, KDTree &, double, KDTreeBox &);
Expand Down
11 changes: 0 additions & 11 deletions RecoLocalCalo/HGCalRecAlgos/src/HGCalImagingAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,17 +171,6 @@ math::XYZPoint HGCalImagingAlgo::calculatePosition(std::vector<KDNode> &v){
z/total_weight );
}

double HGCalImagingAlgo::distance(const Hexel &pt1, const Hexel &pt2){
return std::sqrt(distance2(pt1,pt2));
}

double HGCalImagingAlgo::distance2(const Hexel &pt1, const Hexel &pt2){
const double dx = pt1.x - pt2.x;
const double dy = pt1.y - pt2.y;
return (dx*dx + dy*dy);
}


double HGCalImagingAlgo::calculateLocalDensity(std::vector<KDNode> &nd, KDTree &lp){
double maxdensity = 0.;
for(unsigned int i = 0; i < nd.size(); ++i){
Expand Down

0 comments on commit f921ac6

Please sign in to comment.