1 #ifndef RECOTOOL_CBALGOPOLYSHORTESTDIST_CXX 2 #define RECOTOOL_CBALGOPOLYSHORTESTDIST_CXX 56 const ::cluster::ClusterParamsAlg &cluster2)
59 if( (cluster1.GetHitVector().size() <
_min_hits) ||
60 (cluster2.GetHitVector().size() <
_min_hits) )
63 if( (cluster1.GetHitVector().size() >
_max_hits) ||
64 (cluster2.GetHitVector().size() >
_max_hits) )
68 if ( (cluster1.GetParams().PolyObject.Size() < 2) or
69 (cluster2.GetParams().PolyObject.Size() < 2) ){
78 unsigned int npoints1 = cluster1.GetParams().PolyObject.Size();
79 unsigned int npoints2 = cluster2.GetParams().PolyObject.Size();
81 for(
unsigned int i = 0; i < npoints1; ++i){
82 float pt1w = cluster1.GetParams().PolyObject.Point(i).first;
83 float pt1t = cluster1.GetParams().PolyObject.Point(i).second;
85 for(
unsigned int j = 0; j < npoints2; ++j){
86 float pt2w = cluster2.GetParams().PolyObject.Point(j).first;
87 float pt2t = cluster2.GetParams().PolyObject.Point(j).second;
88 double distsqrd = pow(pt2w-pt1w,2)+pow(pt2t-pt1t,2);
93 std::cout<<
"two polygon points dist2 is "<<distsqrd<<std::endl;
Class def header for a class CBAlgoPolyShortestDist.