9 #include "art/Utilities/ToolMacros.h"
10 #include "art/Utilities/make_tool.h"
11 #include "art_root_io/TFileDirectory.h"
12 #include "cetlib/cpu_timer.h"
13 #include "fhiclcpp/ParameterSet.h"
14 #include "messagefacility/MessageLogger/MessageLogger.h"
38 namespace lar_cluster3d {
55 void configure(fhicl::ParameterSet
const &pset)
override;
88 reco::ClusterParametersList::iterator positionItr,
100 reco::ClusterParametersList::iterator positionItr,
102 int level = 0)
const;
106 reco::HitPairListPtr::iterator,
107 reco::HitPairListPtr::iterator,
111 const Eigen::Vector3f&,
112 const Eigen::Vector3f&,
113 const Eigen::Vector3f&,
115 Eigen::Vector3f&)
const;
117 using Point = std::tuple<float,float,const reco::ClusterHit3D*>;
164 fPCAAlg(pset.
get<fhicl::ParameterSet>(
"PrincipalComponentsAlg"))
181 fClusterAlg = art::make_tool<lar_cluster3d::IClusterAlg>(pset.get<fhicl::ParameterSet>(
"ClusterAlg"));
195 std::string dirName =
"VoronoiPath";
197 art::TFileDirectory
dir = histDir.mkdir(dirName.c_str());
201 fTopNum3DHits = dir.make<TH1F>(
"TopNum3DHits",
"Number 3D Hits", 200, 0., 200.);
202 fTopNumEdges = dir.make<TH1F>(
"TopNumEdges",
"Number Edges", 200, 0., 200.);
203 fTopEigen21Ratio = dir.make<TH1F>(
"TopEigen21Rat",
"Eigen 2/1 Ratio", 100, 0., 1.);
204 fTopEigen20Ratio = dir.make<TH1F>(
"TopEigen20Rat",
"Eigen 2/0 Ratio", 100, 0., 1.);
205 fTopEigen10Ratio = dir.make<TH1F>(
"TopEigen10Rat",
"Eigen 1/0 Ratio", 100, 0., 1.);
206 fTopPrimaryLength = dir.make<TH1F>(
"TopPrimaryLen",
"Primary Length", 200, 0., 200.);
208 fSubNum3DHits = dir.make<TH1F>(
"SubNum3DHits",
"Number 3D Hits", 200, 0., 200.);
209 fSubNumEdges = dir.make<TH1F>(
"SubNumEdges",
"Number Edges", 200, 0., 200.);
210 fSubEigen21Ratio = dir.make<TH1F>(
"SubEigen21Rat",
"Eigen 2/1 Ratio", 100, 0., 1.);
211 fSubEigen20Ratio = dir.make<TH1F>(
"SubEigen20Rat",
"Eigen 2/0 Ratio", 100, 0., 1.);
212 fSubEigen10Ratio = dir.make<TH1F>(
"SubEigen10Rat",
"Eigen 1/0 Ratio", 100, 0., 1.);
213 fSubPrimaryLength = dir.make<TH1F>(
"SubPrimaryLen",
"Primary Length", 200, 0., 200.);
214 fSubCosToPrevPCA = dir.make<TH1F>(
"SubCosToPrev",
"Cos(theta)", 101, 0., 1.01);
215 fSubCosExtToPCA = dir.make<TH1F>(
"SubCosExtPCA",
"Cos(theta)", 102, -1.01, 1.01);
216 fSubMaxDefect = dir.make<TH1F>(
"SubMaxDefect",
"Max Defect", 100, 0., 50.);
217 fSubUsedDefect = dir.make<TH1F>(
"SubUsedDefect",
"Used Defect", 100, 0., 50.);
232 cet::cpu_timer theClockBuildClusters;
237 int countClusters(0);
242 reco::ClusterParametersList::iterator clusterParametersListItr = clusterParametersList.begin();
244 while(clusterParametersListItr != clusterParametersList.end())
249 std::cout <<
"**> Looking at Cluster " << countClusters++ <<
", # hits: " << clusterParameters.
getHitPairListPtr().size() << std::endl;
265 reclusteredParameters.push_back(clusterParameters);
267 std::cout <<
">>>>>>>>>>> Reclustered to " << reclusteredParameters.size() <<
" Clusters <<<<<<<<<<<<<<<" << std::endl;
270 if (!reclusteredParameters.empty())
273 for (
auto&
cluster : reclusteredParameters)
275 std::cout <<
"****> Calling breakIntoTinyBits with " <<
cluster.getHitPairListPtr().size() <<
" hits" << std::endl;
285 std::cout <<
"****> Broke Cluster with " <<
cluster.getHitPairListPtr().size() <<
" into " <<
cluster.daughterList().size() <<
" sub clusters";
286 for(
auto& clus :
cluster.daughterList())
std::cout <<
", " << clus.getHitPairListPtr().size();
296 std::vector<double> eigenValVec = {3. * std::sqrt(fullPCA.
getEigenValues()[0]),
299 double eigen2To1Ratio = eigenValVec[0] / eigenValVec[1];
300 double eigen1To0Ratio = eigenValVec[1] / eigenValVec[2];
301 double eigen2To0Ratio = eigenValVec[0] / eigenValVec[2];
302 int num3DHits =
cluster.getHitPairListPtr().size();
303 int numEdges =
cluster.getBestEdgeList().size();
317 clusterParametersListItr++;
322 theClockBuildClusters.stop();
327 mf::LogDebug(
"Cluster3D") <<
">>>>> Cluster Path finding done" << std::endl;
334 reco::ClusterParametersList::iterator positionItr,
346 std::string pluses(level/2,
'+');
347 std::string indent(level/2,
' ');
351 reco::ClusterParametersList::iterator inputPositionItr = positionItr;
356 std::vector<double> eigenValVec = {3. * std::sqrt(fullPCA.
getEigenValues()[0]),
362 double cosNewToLast =
std::abs(fullPrimaryVec.dot(lastPrimaryVec));
363 double eigen2To1Ratio = eigenValVec[2] / eigenValVec[1];
364 double eigen1To0Ratio = eigenValVec[1] / eigenValVec[2];
365 double eigen2To0Ratio = eigenValVec[0] / eigenValVec[2];
366 double eigen2And1Ave = 0.5 * (eigenValVec[1] + eigenValVec[0]);
367 double eigenAveTo0Ratio = eigen2And1Ave / eigenValVec[2];
369 bool storeCurrentCluster(
true);
372 std::cout << indent <<
">>> breakIntoTinyBits with " << clusterToBreak.
getHitPairListPtr().size() <<
" input hits, " << clusterToBreak.
getBestEdgeList().size() <<
" edges, rat21: " << eigen2To1Ratio <<
", rat20: " << eigen2To0Ratio <<
", rat10: " << eigen1To0Ratio <<
", ave0: " << eigenAveTo0Ratio << std::endl;
373 std::cout << indent <<
" --> eigen 0/1/2: " << eigenValVec[0] <<
"/" << eigenValVec[1] <<
"/" << eigenValVec[2] <<
", cos: " << cosNewToLast << std::endl;
376 if (clusterToBreak.
getBestEdgeList().size() > 5 && cosNewToLast > 0.25 && eigen2To1Ratio < 0.9 && eigen2To0Ratio > 0.001 &&
389 Eigen::Vector3f edgeVec(secondEdgeHit->getPosition()[0] - firstEdgeHit->
getPosition()[0],
390 secondEdgeHit->getPosition()[1] - firstEdgeHit->
getPosition()[1],
391 secondEdgeHit->getPosition()[2] - firstEdgeHit->
getPosition()[2]);
392 double edgeLen = edgeVec.norm();
405 clusHitPairVector.sort([](
const auto&
left,
const auto&
right){
return left->getArclenToPoca() <
right->getArclenToPoca();});
408 using DistEdgeTuple = std::tuple<float, const reco::EdgeTuple*>;
409 using DistEdgeTupleVec = std::vector<DistEdgeTuple>;
411 DistEdgeTupleVec distEdgeTupleVec;
424 float hitProjection = hitToEdgeVec.dot(edgeVec);
427 if (hitProjection > 0. && hitProjection < edgeLen)
429 Eigen::Vector3f distToHitVec = hitToEdgeVec - hitProjection * edgeVec;
430 float distToHit = distToHitVec.norm();
432 distEdgeTupleVec.emplace_back(distToHit,&edge);
436 std::sort(distEdgeTupleVec.begin(),distEdgeTupleVec.end(),[](
const auto&
left,
const auto&
right){
return std::get<0>(
left) > std::get<0>(
right);});
438 for(
const auto& distEdgeTuple : distEdgeTupleVec)
444 reco::HitPairListPtr::iterator vertexItr = std::find(clusHitPairVector.begin(),clusHitPairVector.end(),edgeHit);
447 if (vertexItr == clusHitPairVector.end() ||
std::distance(clusHitPairVector.begin(),vertexItr) < minimumClusterSize ||
std::distance(vertexItr,clusHitPairVector.end()) < minimumClusterSize)
continue;
450 using Hit3DItrPair = std::pair<reco::HitPairListPtr::iterator,reco::HitPairListPtr::iterator>;
451 using VertexPairList = std::list<Hit3DItrPair>;
453 VertexPairList vertexPairList;
455 vertexPairList.emplace_back(Hit3DItrPair(clusHitPairVector.begin(),vertexItr));
456 vertexPairList.emplace_back(Hit3DItrPair(vertexItr,clusHitPairVector.end()));
458 storeCurrentCluster =
false;
461 for(
auto& hit3DItrPair : vertexPairList)
466 std::cout << indent <<
"+> -- building new cluster, size: " <<
std::distance(hit3DItrPair.first,hit3DItrPair.second) << std::endl;
469 hitPairListPtr.resize(
std::distance(hit3DItrPair.first,hit3DItrPair.second));
472 std::copy(hit3DItrPair.first,hit3DItrPair.second,hitPairListPtr.begin());
483 std::cout << indent <<
"+> -- >> cluster has a valid Full PCA" << std::endl;
488 for(
size_t vecIdx = 0; vecIdx < 3; vecIdx++) newFullPCA.
flipAxis(vecIdx);
497 positionItr =
breakIntoTinyBits(clusterParams, fullPCA, positionItr, outputClusterList, level+4);
508 if (storeCurrentCluster)
513 std::set<const reco::ClusterHit2D*> hitSet;
518 for(
const auto& hit2D : hit3D->getHits())
520 if (hit2D) hitSet.insert(hit2D);
525 for(
const auto& hit2D : hitSet)
531 std::cout << indent <<
"*********>>> storing new subcluster of size " << clusterToBreak.
getHitPairListPtr().size() << std::endl;
533 positionItr = outputClusterList.insert(positionItr,clusterToBreak);
542 float cosToLast = newPrimaryVec.dot(lastPrimaryVec);
556 else if (inputPositionItr != positionItr)
558 std::cout << indent <<
"***** DID NOT STORE A CLUSTER *****" << std::endl;
566 reco::ClusterParametersList::iterator positionItr,
579 std::string pluses(level/2,
'+');
580 std::string indent(level/2,
' ');
587 std::vector<double> eigenValVec = {3. * std::sqrt(fullPCA.
getEigenValues()[0]),
602 Eigen::Vector3f edgeVec(secondEdgeHit->getPosition()[0] - firstEdgeHit->
getPosition()[0],
603 secondEdgeHit->getPosition()[1] - firstEdgeHit->
getPosition()[1],
604 secondEdgeHit->getPosition()[2] - firstEdgeHit->
getPosition()[2]);
605 double edgeLen = edgeVec.norm();
618 clusHitPairVector.sort([](
const auto&
left,
const auto&
right){
return left->getArclenToPoca() <
right->getArclenToPoca();});
621 using DistEdgeTuple = std::tuple<float, const reco::EdgeTuple*>;
622 using DistEdgeTupleVec = std::vector<DistEdgeTuple>;
624 DistEdgeTupleVec distEdgeTupleVec;
637 float hitProjection = hitToEdgeVec.dot(edgeVec);
640 if (hitProjection > 0. && hitProjection < edgeLen)
642 Eigen::Vector3f distToHitVec = hitToEdgeVec - hitProjection * edgeVec;
643 float distToHit = distToHitVec.norm();
645 distEdgeTupleVec.emplace_back(distToHit,&edge);
649 std::sort(distEdgeTupleVec.begin(),distEdgeTupleVec.end(),[](
const auto&
left,
const auto&
right){
return std::get<0>(
left) > std::get<0>(
right);});
653 float usedDefectDist(0.);
655 for(
const auto& distEdgeTuple : distEdgeTupleVec)
660 usedDefectDist = std::get<0>(distEdgeTuple);
663 reco::HitPairListPtr::iterator vertexItr = std::find(clusHitPairVector.begin(),clusHitPairVector.end(),edgeHit);
672 if (
makeCandidateCluster(fullPrimaryVec, clusterParams1, clusHitPairVector.begin(), vertexItr, level))
678 if (
makeCandidateCluster(fullPrimaryVec, clusterParams2, vertexItr, clusHitPairVector.end(), level))
break;
682 tempClusterParametersList.clear();
686 if (tempClusterParametersList.empty())
688 std::cout << indent <<
"===> no cluster cands, edgeLen: " << edgeLen <<
", # hits: " << clusHitPairVector.size() <<
", max defect: " << std::get<0>(distEdgeTupleVec.front()) << std::endl;
694 reco::HitPairListPtr::iterator vertexItr = clusHitPairVector.begin();
696 std::advance(vertexItr, clusHitPairVector.size()/2);
702 if (
makeCandidateCluster(fullPrimaryVec, clusterParams1, clusHitPairVector.begin(), vertexItr, level))
708 if (!
makeCandidateCluster(fullPrimaryVec, clusterParams2, vertexItr, clusHitPairVector.end(), level))
709 tempClusterParametersList.clear();
715 for(
auto& clusterParams : tempClusterParametersList)
717 size_t curOutputClusterListSize = outputClusterList.size();
719 positionItr =
subDivideCluster(clusterParams, fullPCA, positionItr, outputClusterList, level+4);
721 std::cout << indent <<
"Output cluster list prev: " << curOutputClusterListSize <<
", now: " << outputClusterList.size() << std::endl;
725 if (curOutputClusterListSize < outputClusterList.size())
continue;
730 std::set<const reco::ClusterHit2D*> hitSet;
733 for(
const auto& hit3D : clusterParams.getHitPairListPtr())
735 for(
const auto& hit2D : hit3D->getHits())
737 if (hit2D) hitSet.insert(hit2D);
742 for(
const auto& hit2D : hitSet)
745 clusterParams.UpdateParameters(hit2D);
748 std::cout << indent <<
"*********>>> storing new subcluster of size " << clusterParams.getHitPairListPtr().size() << std::endl;
750 positionItr = outputClusterList.insert(positionItr,clusterParams);
761 int num3DHits = clusterParams.getHitPairListPtr().size();
762 int numEdges = clusterParams.getBestEdgeList().size();
763 float cosToLast = newPrimaryVec.dot(lastPrimaryVec);
764 double eigen2To1Ratio = eigenValVec[0] / eigenValVec[1];
765 double eigen1To0Ratio = eigenValVec[1] / eigenValVec[2];
766 double eigen2To0Ratio = eigenValVec[2] / eigenValVec[2];
776 fSubMaxDefect->Fill(std::get<0>(distEdgeTupleVec.front()), 1.);
790 reco::HitPairListPtr::iterator firstHitItr,
791 reco::HitPairListPtr::iterator lastHitItr,
794 std::string indent(level/2,
' ');
798 std::cout << indent <<
"+> -- building new cluster, size: " <<
std::distance(firstHitItr,lastHitItr) << std::endl;
801 hitPairListPtr.resize(
std::distance(firstHitItr,lastHitItr));
804 std::copy(firstHitItr,lastHitItr,hitPairListPtr.begin());
813 bool keepThisCluster(
false);
818 std::cout << indent <<
"+> -- >> cluster has a valid Full PCA" << std::endl;
824 if (primaryPCA.dot(newPrimaryVec) < 0.)
826 for(
size_t vecIdx = 0; vecIdx < 3; vecIdx++) newFullPCA.
flipAxis(vecIdx);
837 std::vector<double> eigenValVec = {3. * std::sqrt(newFullPCA.
getEigenValues()[0]),
840 double cosNewToLast =
std::abs(primaryPCA.dot(newPrimaryVec));
841 double eigen2To1Ratio = eigenValVec[2] / eigenValVec[1];
842 double eigen1To0Ratio = eigenValVec[1] / eigenValVec[2];
843 double eigen2To0Ratio = eigenValVec[0] / eigenValVec[2];
844 double eigen2And1Ave = 0.5 * (eigenValVec[1] + eigenValVec[0]);
845 double eigenAveTo0Ratio = eigen2And1Ave / eigenValVec[2];
847 std::cout << indent <<
">>> subDivideClusters with " << candCluster.
getHitPairListPtr().size() <<
" input hits, " << candCluster.
getBestEdgeList().size() <<
" edges, rat21: " << eigen2To1Ratio <<
", rat20: " << eigen2To0Ratio <<
", rat10: " << eigen1To0Ratio <<
", ave0: " << eigenAveTo0Ratio << std::endl;
848 std::cout << indent <<
" --> eigen 0/1/2: " << eigenValVec[0] <<
"/" << eigenValVec[1] <<
"/" << eigenValVec[2] <<
", cos: " << cosNewToLast << std::endl;
852 if (candCluster.
getBestEdgeList().size() > 4 && cosNewToLast > 0.25 && eigen2To1Ratio > 0.01 && eigen2To1Ratio < 0.99 && eigen1To0Ratio < 0.5)
854 keepThisCluster =
true;
858 return keepThisCluster;
865 std::string minuses(level/2,
'-');
866 std::string indent(level/2,
' ');
878 using Point = std::tuple<float,float,const reco::ClusterHit3D*>;
887 Eigen::Vector3f pcaToHitVec(hit3D->getPosition()[0] - pcaCenter(0),
888 hit3D->getPosition()[1] - pcaCenter(1),
889 hit3D->getPosition()[2] - pcaCenter(2));
892 pointList.emplace_back(
dcel2d::Point(pcaToHit(0),pcaToHit(1),hit3D));
896 pointList.sort([](
const auto&
left,
const auto&
right){
return (
std::abs(std::get<0>(
left) - std::get<0>(
right)) > std::numeric_limits<float>::epsilon()) ? std::get<0>(
left) < std::get<0>(
right) : std::get<1>(
left) < std::get<1>(
right);});
899 std::vector<ConvexHull> convexHullVec;
900 std::vector<PointList> rejectedListVec;
901 bool increaseDepth(pointList.size() > 5);
902 float lastArea(std::numeric_limits<float>::max());
907 convexHullVec.push_back(
ConvexHull(pointList));
910 const ConvexHull& convexHull = convexHullVec.back();
911 PointList& rejectedList = rejectedListVec.back();
914 increaseDepth =
false;
918 std::cout << indent <<
"-> built convex hull, 3D hits: " << pointList.size() <<
" with " << convexHullPoints.size() <<
" vertices" <<
", area: " << convexHull.
getConvexHullArea() << std::endl;
920 for(
const auto& point : convexHullPoints)
921 std::cout <<
" (" << std::get<0>(point) <<
"," << std::get<1>(point) <<
")";
926 for(
auto& point : convexHullPoints)
928 pointList.remove(point);
929 rejectedList.emplace_back(point);
938 while(!convexHullVec.empty() && convexHullVec.back().getConvexHullArea() < 0.5)
940 convexHullVec.pop_back();
941 rejectedListVec.pop_back();
945 if (!convexHullVec.empty())
947 size_t nRejectedTotal(0);
950 for(
const auto& rejectedList : rejectedListVec)
952 nRejectedTotal += rejectedList.size();
954 for(
const auto& rejectedPoint : rejectedList)
956 std::cout << indent <<
"-> -- Point is " << convexHullVec.back().findNearestDistance(rejectedPoint) <<
" from nearest edge" << std::endl;
958 if (convexHullVec.back().findNearestDistance(rejectedPoint) > 0.5)
959 hitPairListPtr.remove(std::get<2>(rejectedPoint));
963 std::cout << indent <<
"-> Removed " << nRejectedTotal <<
" leaving " << pointList.size() <<
"/" << hitPairListPtr.size() <<
" points" << std::endl;
969 Point lastPoint = convexHullVec.back().getConvexHull().front();
971 for(
auto& curPoint : convexHullVec.back().getConvexHull())
973 if (curPoint == lastPoint)
continue;
978 float distBetweenPoints = (curPoint3D->getPosition()[0] - lastPoint3D->
getPosition()[0]) * (curPoint3D->getPosition()[0] - lastPoint3D->
getPosition()[0])
979 + (curPoint3D->getPosition()[1] - lastPoint3D->
getPosition()[1]) * (curPoint3D->getPosition()[1] - lastPoint3D->
getPosition()[1])
980 + (curPoint3D->getPosition()[2] - lastPoint3D->
getPosition()[2]) * (curPoint3D->getPosition()[2] - lastPoint3D->
getPosition()[2]);
982 distBetweenPoints = std::sqrt(distBetweenPoints);
986 edgeMap[lastPoint3D].push_back(edge);
987 edgeMap[curPoint3D].push_back(edge);
988 bestEdgeList.emplace_back(edge);
990 lastPoint = curPoint;
997 for(
const auto& point : extremePoints) extremePointList.push_back(point);
1018 Eigen::Vector3f pcaToHitVec(hit3D->getPosition()[0] - pcaCenter(0),
1019 hit3D->getPosition()[1] - pcaCenter(1),
1020 hit3D->getPosition()[2] - pcaCenter(2));
1023 pointList.emplace_back(
dcel2d::Point(pcaToHit(1),pcaToHit(2),hit3D));
1027 pointList.sort([](
const auto&
left,
const auto&
right){
return (
std::abs(std::get<0>(
left) - std::get<0>(
right)) > std::numeric_limits<float>::epsilon()) ? std::get<0>(
left) < std::get<0>(
right) : std::get<1>(
left) < std::get<1>(
right);});
1029 std::cout <<
" ==> Build V diagram, sorted point list contains " << pointList.size() <<
" hits" << std::endl;
1045 for(
auto&
vertex : vertexList)
1047 Eigen::Vector3f coords = rotationMatrixInv *
vertex.getCoords();
1049 coords += pcaCenter;
1051 vertex.setCoords(coords);
1071 dcel2d::Point lastPoint = voronoiDiagram.getConvexHull().front();
1076 for(
auto& curPoint : voronoiDiagram.getConvexHull())
1078 if (curPoint == lastPoint)
continue;
1083 float distBetweenPoints = (curPoint3D->getPosition()[0] - lastPoint3D->
getPosition()[0]) * (curPoint3D->getPosition()[0] - lastPoint3D->
getPosition()[0])
1084 + (curPoint3D->getPosition()[1] - lastPoint3D->
getPosition()[1]) * (curPoint3D->getPosition()[1] - lastPoint3D->
getPosition()[1])
1085 + (curPoint3D->getPosition()[2] - lastPoint3D->
getPosition()[2]) * (curPoint3D->getPosition()[2] - lastPoint3D->
getPosition()[2]);
1087 distBetweenPoints = std::sqrt(distBetweenPoints);
1091 edgeMap[lastPoint3D].push_back(edge);
1092 edgeMap[curPoint3D].push_back(edge);
1093 bestEdgeList.emplace_back(edge);
1095 lastPoint = curPoint;
1098 std::cout <<
"****> vertexList containted " << vertexList.size() <<
" vertices for " << clusterParameters.
getHitPairListPtr().size() <<
" hits" << std::endl;
1105 const Eigen::Vector3f& u0,
1106 const Eigen::Vector3f& P1,
1107 const Eigen::Vector3f& u1,
1108 Eigen::Vector3f& poca0,
1109 Eigen::Vector3f& poca1)
const
1112 Eigen::Vector3f w0 = P0 - P1;
1114 float b(u0.dot(u1));
1116 float d(u0.dot(w0));
1117 float e(u1.dot(w0));
1118 float den(a * c - b * b);
1120 float arcLen0 = (b *
e - c * d) / den;
1121 float arcLen1 = (a *
e - b * d) / den;
1123 poca0 = P0 + arcLen0 * u0;
1124 poca1 = P1 + arcLen1 * u1;
1126 return (poca0 - poca1).norm();
1131 float largestDistance(0.);
1136 reco::EdgeList::const_iterator firstEdgeItr = convexHull.begin();
1138 while(firstEdgeItr != convexHull.end())
1140 reco::EdgeList::const_iterator nextEdgeItr = firstEdgeItr;
1146 while(++nextEdgeItr != convexHull.end())
1152 return largestDistance;
void PCAAnalysis_calc3DDocas(const reco::HitPairListPtr &hitPairVector, const reco::PrincipalComponents &pca) const
void PCAAnalysis_3D(const reco::HitPairListPtr &hitPairList, reco::PrincipalComponents &pca, bool skeletonOnly=false) const
void flipAxis(size_t axis)
const Eigen::Vector3f getPosition() const
std::list< ProjectedPoint > ProjectedPointList
float closestApproach(const Eigen::Vector3f &, const Eigen::Vector3f &, const Eigen::Vector3f &, const Eigen::Vector3f &, Eigen::Vector3f &, Eigen::Vector3f &) const
reco::PrincipalComponents & getSkeletonPCA()
std::list< Point > PointList
The list of the projected points.
reco::EdgeList & getBestEdgeList()
std::pair< Point, Point > MinMaxPoints
reco::Hit3DToEdgeMap & getHit3DToEdgeMap()
reco::HitPairListPtr & getHitPairListPtr()
~VoronoiPathFinder()
Destructor.
IClusterModAlg interface class definiton.
bool fEnableMonitoring
FHICL parameters.
ClusterParametersList & daughterList()
Implements a ConvexHull for use in clustering.
std::list< EdgeTuple > EdgeList
const EigenValues & getEigenValues() const
VoronoiDiagram class definiton.
double distance(geo::Point_t const &point, CathodeDesc_t const &cathode)
Returns the distance of a point from the cathode.
reco::PrincipalComponents & getFullPCA()
reco::Hit3DToEdgeMap & getConvexHullEdgeMap()
std::unique_ptr< lar_cluster3d::IClusterAlg > fClusterAlg
Tools.
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
reco::ProjectedPointList & getConvexHullExtremePoints()
void buildVoronoiDiagram(const dcel2d::PointList &)
Given an input set of 2D points construct a 2D voronoi diagram.
Define a container for working with the convex hull.
void ModifyClusters(reco::ClusterParametersList &) const override
Scan an input collection of clusters and modify those according to the specific implementing algorith...
void initializeHistograms(art::TFileDirectory &) override
Interface for initializing histograms if they are desired Note that the idea is to put hisgtograms in...
std::tuple< float, float, const reco::ClusterHit3D * > Point
const Eigen::Vector3f & getAvePosition() const
void buildConvexHull(reco::ClusterParameters &clusterParameters, int level=0) const
PrincipalComponentsAlg fPCAAlg
reco::ClusterParametersList::iterator subDivideCluster(reco::ClusterParameters &cluster, reco::PrincipalComponents &lastPCA, reco::ClusterParametersList::iterator positionItr, reco::ClusterParametersList &outputClusterList, int level=0) const
Use PCA to try to find path in cluster.
std::tuple< const reco::ClusterHit3D *, const reco::ClusterHit3D *, double > EdgeTuple
std::list< const reco::ClusterHit3D * > HitPairListPtr
void UpdateParameters(const reco::ClusterHit2D *hit)
float getConvexHullArea() const
recover the area of the convex hull
This provides an art tool interface definition for 3D Cluster algorithms.
const PointList & getConvexHull() const
recover the list of convex hull vertices
ConvexHull class definiton.
This header file defines the interface to a principal components analysis designed to be used within ...
reco::ConvexHull & getConvexHull()
reco::ClusterParametersList::iterator breakIntoTinyBits(reco::ClusterParameters &cluster, reco::PrincipalComponents &lastPCA, reco::ClusterParametersList::iterator positionItr, reco::ClusterParametersList &outputClusterList, int level=0) const
Use PCA to try to find path in cluster.
dcel2d::FaceList & getFaceList()
This provides an art tool interface definition for 3D Cluster algorithms.
void buildVoronoiDiagram(reco::ClusterParameters &clusterParameters, int level=0) const
bool makeCandidateCluster(Eigen::Vector3f &, reco::ClusterParameters &, reco::HitPairListPtr::iterator, reco::HitPairListPtr::iterator, int) const
size_t fMinTinyClusterSize
Minimum size for a "tiny" cluster.
std::list< Point > PointList
std::list< Point > PointList
std::unordered_map< const reco::ClusterHit3D *, reco::EdgeList > Hit3DToEdgeMap
process_name physics producers generator hPHist_pi physics producers generator P0
std::pair< MinMaxPoints, MinMaxPoints > MinMaxPointPair
reco::ProjectedPointList & getProjectedPointList()
reco::EdgeList & getConvexHullEdgeList()
dcel2d::HalfEdgeList & getHalfEdgeList()
std::list< Vertex > VertexList
bool fFillHistograms
Histogram definitions.
BEGIN_PROLOG don t mess with this pandoraTrackGausCryoW true
BEGIN_PROLOG could also be cout
std::list< ClusterParameters > ClusterParametersList
VoronoiPathFinder(const fhicl::ParameterSet &)
Constructor.
const EigenVectors & getEigenVectors() const
dcel2d::VertexList & getVertexList()
float getTimeToExecute() const override
If monitoring, recover the time to execute a particular function.
void configure(fhicl::ParameterSet const &pset) override
Interface for configuring the particular algorithm tool.
float findConvexHullEndPoints(const reco::EdgeList &, const reco::ClusterHit3D *, const reco::ClusterHit3D *) const