11 #include "art_root_io/TFileDirectory.h" 12 #include "cetlib/cpu_timer.h" 101 int level = 0)
const;
110 const Eigen::Vector3f&,
111 const Eigen::Vector3f&,
112 const Eigen::Vector3f&,
114 Eigen::Vector3f&)
const;
116 using Point = std::tuple<float, float, const reco::ClusterHit3D*>;
157 std::unique_ptr<lar_cluster3d::IClusterAlg>
193 std::string dirName =
"VoronoiPath";
195 art::TFileDirectory
dir = histDir.mkdir(dirName.c_str());
199 fTopNum3DHits = dir.make<TH1F>(
"TopNum3DHits",
"Number 3D Hits", 200, 0., 200.);
200 fTopNumEdges = dir.make<TH1F>(
"TopNumEdges",
"Number Edges", 200, 0., 200.);
201 fTopEigen21Ratio = dir.make<TH1F>(
"TopEigen21Rat",
"Eigen 2/1 Ratio", 100, 0., 1.);
202 fTopEigen20Ratio = dir.make<TH1F>(
"TopEigen20Rat",
"Eigen 2/0 Ratio", 100, 0., 1.);
203 fTopEigen10Ratio = dir.make<TH1F>(
"TopEigen10Rat",
"Eigen 1/0 Ratio", 100, 0., 1.);
204 fTopPrimaryLength = dir.make<TH1F>(
"TopPrimaryLen",
"Primary Length", 200, 0., 200.);
206 fSubNum3DHits = dir.make<TH1F>(
"SubNum3DHits",
"Number 3D Hits", 200, 0., 200.);
207 fSubNumEdges = dir.make<TH1F>(
"SubNumEdges",
"Number Edges", 200, 0., 200.);
208 fSubEigen21Ratio = dir.make<TH1F>(
"SubEigen21Rat",
"Eigen 2/1 Ratio", 100, 0., 1.);
209 fSubEigen20Ratio = dir.make<TH1F>(
"SubEigen20Rat",
"Eigen 2/0 Ratio", 100, 0., 1.);
210 fSubEigen10Ratio = dir.make<TH1F>(
"SubEigen10Rat",
"Eigen 1/0 Ratio", 100, 0., 1.);
211 fSubPrimaryLength = dir.make<TH1F>(
"SubPrimaryLen",
"Primary Length", 200, 0., 200.);
212 fSubCosToPrevPCA = dir.make<TH1F>(
"SubCosToPrev",
"Cos(theta)", 101, 0., 1.01);
213 fSubCosExtToPCA = dir.make<TH1F>(
"SubCosExtPCA",
"Cos(theta)", 102, -1.01, 1.01);
214 fSubMaxDefect = dir.make<TH1F>(
"SubMaxDefect",
"Max Defect", 100, 0., 50.);
215 fSubUsedDefect = dir.make<TH1F>(
"SubUsedDefect",
"Used Defect", 100, 0., 50.);
230 cet::cpu_timer theClockBuildClusters;
235 int countClusters(0);
242 while (clusterParametersListItr != clusterParametersList.end()) {
246 std::cout <<
"**> Looking at Cluster " << countClusters++
262 reclusteredParameters.push_back(clusterParameters);
264 std::cout <<
">>>>>>>>>>> Reclustered to " << reclusteredParameters.size()
265 <<
" Clusters <<<<<<<<<<<<<<<" << std::endl;
268 if (!reclusteredParameters.empty()) {
270 for (
auto&
cluster : reclusteredParameters) {
271 std::cout <<
"****> Calling breakIntoTinyBits with " 272 <<
cluster.getHitPairListPtr().size() <<
" hits" << std::endl;
282 std::cout <<
"****> Broke Cluster with " <<
cluster.getHitPairListPtr().size()
283 <<
" into " <<
cluster.daughterList().size() <<
" sub clusters";
284 for (
auto& clus :
cluster.daughterList())
285 std::cout <<
", " << clus.getHitPairListPtr().size();
286 std::cout << std::endl;
295 std::vector<double> eigenValVec = {3. * std::sqrt(fullPCA.
getEigenValues()[0]),
298 double eigen2To1Ratio = eigenValVec[0] / eigenValVec[1];
299 double eigen1To0Ratio = eigenValVec[1] / eigenValVec[2];
300 double eigen2To0Ratio = eigenValVec[0] / eigenValVec[2];
301 int num3DHits =
cluster.getHitPairListPtr().size();
302 int numEdges =
cluster.getBestEdgeList().size();
316 clusterParametersListItr++;
320 theClockBuildClusters.stop();
325 mf::LogDebug(
"Cluster3D") <<
">>>>> Cluster Path finding done" << std::endl;
345 std::string pluses(level / 2,
'+');
346 std::string
indent(level / 2,
' ');
355 std::vector<double> eigenValVec = {3. * std::sqrt(fullPCA.
getEigenValues()[0]),
361 double cosNewToLast =
std::abs(fullPrimaryVec.dot(lastPrimaryVec));
362 double eigen2To1Ratio = eigenValVec[2] / eigenValVec[1];
363 double eigen1To0Ratio = eigenValVec[1] / eigenValVec[2];
364 double eigen2To0Ratio = eigenValVec[0] / eigenValVec[2];
365 double eigen2And1Ave = 0.5 * (eigenValVec[1] + eigenValVec[0]);
366 double eigenAveTo0Ratio = eigen2And1Ave / eigenValVec[2];
368 bool storeCurrentCluster(
true);
371 std::cout << indent <<
">>> breakIntoTinyBits with " 373 << clusterToBreak.
getBestEdgeList().size() <<
" edges, rat21: " << eigen2To1Ratio
374 <<
", rat20: " << eigen2To0Ratio <<
", rat10: " << eigen1To0Ratio
375 <<
", ave0: " << eigenAveTo0Ratio << std::endl;
376 std::cout << indent <<
" --> eigen 0/1/2: " << eigenValVec[0] <<
"/" << eigenValVec[1] <<
"/" 377 << eigenValVec[2] <<
", cos: " << cosNewToLast << std::endl;
380 if (clusterToBreak.
getBestEdgeList().size() > 5 && cosNewToLast > 0.25 &&
381 eigen2To1Ratio < 0.9 && eigen2To0Ratio > 0.001 &&
394 Eigen::Vector3f edgeVec(secondEdgeHit->getPosition()[0] - firstEdgeHit->
getPosition()[0],
395 secondEdgeHit->getPosition()[1] - firstEdgeHit->
getPosition()[1],
396 secondEdgeHit->getPosition()[2] - firstEdgeHit->
getPosition()[2]);
397 double edgeLen = edgeVec.norm();
410 clusHitPairVector.sort([](
const auto&
left,
const auto&
right) {
411 return left->getArclenToPoca() <
right->getArclenToPoca();
415 using DistEdgeTuple = std::tuple<float, const reco::EdgeTuple*>;
416 using DistEdgeTupleVec = std::vector<DistEdgeTuple>;
418 DistEdgeTupleVec distEdgeTupleVec;
431 float hitProjection = hitToEdgeVec.dot(edgeVec);
434 if (hitProjection > 0. && hitProjection < edgeLen) {
435 Eigen::Vector3f distToHitVec = hitToEdgeVec - hitProjection * edgeVec;
436 float distToHit = distToHitVec.norm();
438 distEdgeTupleVec.emplace_back(distToHit, &edge);
443 distEdgeTupleVec.begin(), distEdgeTupleVec.end(), [](
const auto&
left,
const auto&
right) {
444 return std::get<0>(
left) > std::get<0>(
right);
447 for (
const auto& distEdgeTuple : distEdgeTupleVec) {
453 std::find(clusHitPairVector.begin(), clusHitPairVector.end(), edgeHit);
456 if (vertexItr == clusHitPairVector.end() ||
457 std::distance(clusHitPairVector.begin(), vertexItr) < minimumClusterSize ||
458 std::distance(vertexItr, clusHitPairVector.end()) < minimumClusterSize)
463 std::pair<reco::HitPairListPtr::iterator, reco::HitPairListPtr::iterator>;
464 using VertexPairList = std::list<Hit3DItrPair>;
466 VertexPairList vertexPairList;
468 vertexPairList.emplace_back(Hit3DItrPair(clusHitPairVector.begin(), vertexItr));
469 vertexPairList.emplace_back(Hit3DItrPair(vertexItr, clusHitPairVector.end()));
471 storeCurrentCluster =
false;
474 for (
auto& hit3DItrPair : vertexPairList) {
478 std::cout << indent <<
"+> -- building new cluster, size: " 479 << std::distance(hit3DItrPair.first, hit3DItrPair.second) << std::endl;
482 hitPairListPtr.resize(std::distance(hit3DItrPair.first, hit3DItrPair.second));
485 std::copy(hit3DItrPair.first, hit3DItrPair.second, hitPairListPtr.begin());
495 std::cout << indent <<
"+> -- >> cluster has a valid Full PCA" << std::endl;
499 for (
size_t vecIdx = 0; vecIdx < 3; vecIdx++)
510 breakIntoTinyBits(clusterParams, fullPCA, positionItr, outputClusterList, level + 4);
521 if (storeCurrentCluster) {
525 std::set<const reco::ClusterHit2D*> hitSet;
529 for (
const auto& hit2D : hit3D->getHits()) {
530 if (hit2D) hitSet.insert(hit2D);
535 for (
const auto& hit2D : hitSet) {
540 std::cout << indent <<
"*********>>> storing new subcluster of size " 543 positionItr = outputClusterList.insert(positionItr, clusterToBreak);
551 float cosToLast = newPrimaryVec.dot(lastPrimaryVec);
565 else if (inputPositionItr != positionItr) {
566 std::cout << indent <<
"***** DID NOT STORE A CLUSTER *****" << std::endl;
586 std::string pluses(level / 2,
'+');
587 std::string
indent(level / 2,
' ');
594 std::vector<double> eigenValVec = {3. * std::sqrt(fullPCA.
getEigenValues()[0]),
610 Eigen::Vector3f edgeVec(secondEdgeHit->getPosition()[0] - firstEdgeHit->
getPosition()[0],
611 secondEdgeHit->getPosition()[1] - firstEdgeHit->
getPosition()[1],
612 secondEdgeHit->getPosition()[2] - firstEdgeHit->
getPosition()[2]);
613 double edgeLen = edgeVec.norm();
626 clusHitPairVector.sort([](
const auto&
left,
const auto&
right) {
627 return left->getArclenToPoca() <
right->getArclenToPoca();
631 using DistEdgeTuple = std::tuple<float, const reco::EdgeTuple*>;
632 using DistEdgeTupleVec = std::vector<DistEdgeTuple>;
634 DistEdgeTupleVec distEdgeTupleVec;
647 float hitProjection = hitToEdgeVec.dot(edgeVec);
650 if (hitProjection > 0. && hitProjection < edgeLen) {
651 Eigen::Vector3f distToHitVec = hitToEdgeVec - hitProjection * edgeVec;
652 float distToHit = distToHitVec.norm();
654 distEdgeTupleVec.emplace_back(distToHit, &edge);
659 distEdgeTupleVec.begin(), distEdgeTupleVec.end(), [](
const auto&
left,
const auto&
right) {
660 return std::get<0>(
left) > std::get<0>(
right);
665 float usedDefectDist(0.);
667 for (
const auto& distEdgeTuple : distEdgeTupleVec) {
671 usedDefectDist = std::get<0>(distEdgeTuple);
675 std::find(clusHitPairVector.begin(), clusHitPairVector.end(), edgeHit);
678 if (vertexItr == clusHitPairVector.end() ||
688 fullPrimaryVec, clusterParams1, clusHitPairVector.begin(), vertexItr, level)) {
694 fullPrimaryVec, clusterParams2, vertexItr, clusHitPairVector.end(), level))
699 tempClusterParametersList.clear();
703 if (tempClusterParametersList.empty()) {
704 std::cout << indent <<
"===> no cluster cands, edgeLen: " << edgeLen
705 <<
", # hits: " << clusHitPairVector.size()
706 <<
", max defect: " << std::get<0>(distEdgeTupleVec.front()) << std::endl;
713 std::advance(vertexItr, clusHitPairVector.size() / 2);
720 fullPrimaryVec, clusterParams1, clusHitPairVector.begin(), vertexItr, level)) {
726 fullPrimaryVec, clusterParams2, vertexItr, clusHitPairVector.end(), level))
727 tempClusterParametersList.clear();
733 for (
auto& clusterParams : tempClusterParametersList) {
734 size_t curOutputClusterListSize = outputClusterList.size();
736 positionItr =
subDivideCluster(clusterParams, positionItr, outputClusterList, level + 4);
738 std::cout << indent <<
"Output cluster list prev: " << curOutputClusterListSize
739 <<
", now: " << outputClusterList.size() << std::endl;
743 if (curOutputClusterListSize < outputClusterList.size())
continue;
748 std::set<const reco::ClusterHit2D*> hitSet;
751 for (
const auto& hit3D : clusterParams.getHitPairListPtr()) {
752 for (
const auto& hit2D : hit3D->getHits()) {
753 if (hit2D) hitSet.insert(hit2D);
758 for (
const auto& hit2D : hitSet) {
760 clusterParams.UpdateParameters(hit2D);
763 std::cout << indent <<
"*********>>> storing new subcluster of size " 764 << clusterParams.getHitPairListPtr().size() << std::endl;
766 positionItr = outputClusterList.insert(positionItr, clusterParams);
776 int num3DHits = clusterParams.getHitPairListPtr().size();
777 int numEdges = clusterParams.getBestEdgeList().size();
778 float cosToLast = newPrimaryVec.dot(lastPrimaryVec);
779 double eigen2To1Ratio = eigenValVec[0] / eigenValVec[1];
780 double eigen1To0Ratio = eigenValVec[1] / eigenValVec[2];
781 double eigen2To0Ratio = eigenValVec[2] / eigenValVec[2];
791 fSubMaxDefect->Fill(std::get<0>(distEdgeTupleVec.front()), 1.);
809 std::string
indent(level / 2,
' ');
814 <<
"+> -- building new cluster, size: " << std::distance(firstHitItr, lastHitItr)
818 hitPairListPtr.resize(std::distance(firstHitItr, lastHitItr));
821 std::copy(firstHitItr, lastHitItr, hitPairListPtr.begin());
830 bool keepThisCluster(
false);
834 std::cout << indent <<
"+> -- >> cluster has a valid Full PCA" << std::endl;
840 if (primaryPCA.dot(newPrimaryVec) < 0.) {
841 for (
size_t vecIdx = 0; vecIdx < 3; vecIdx++)
853 std::vector<double> eigenValVec = {3. * std::sqrt(newFullPCA.
getEigenValues()[0]),
856 double cosNewToLast =
std::abs(primaryPCA.dot(newPrimaryVec));
857 double eigen2To1Ratio = eigenValVec[2] / eigenValVec[1];
858 double eigen1To0Ratio = eigenValVec[1] / eigenValVec[2];
859 double eigen2To0Ratio = eigenValVec[0] / eigenValVec[2];
860 double eigen2And1Ave = 0.5 * (eigenValVec[1] + eigenValVec[0]);
861 double eigenAveTo0Ratio = eigen2And1Ave / eigenValVec[2];
863 std::cout << indent <<
">>> subDivideClusters with " << candCluster.
getHitPairListPtr().size()
865 <<
" edges, rat21: " << eigen2To1Ratio <<
", rat20: " << eigen2To0Ratio
866 <<
", rat10: " << eigen1To0Ratio <<
", ave0: " << eigenAveTo0Ratio << std::endl;
867 std::cout << indent <<
" --> eigen 0/1/2: " << eigenValVec[0] <<
"/" << eigenValVec[1]
868 <<
"/" << eigenValVec[2] <<
", cos: " << cosNewToLast << std::endl;
873 eigen2To1Ratio > 0.01 && eigen2To1Ratio < 0.99 && eigen1To0Ratio < 0.5) {
874 keepThisCluster =
true;
878 return keepThisCluster;
885 std::string minuses(level / 2,
'-');
886 std::string
indent(level / 2,
' ');
895 Eigen::Vector3f pcaCenter(
899 using Point = std::tuple<float, float, const reco::ClusterHit3D*>;
907 Eigen::Vector3f pcaToHitVec(hit3D->getPosition()[0] - pcaCenter(0),
908 hit3D->getPosition()[1] - pcaCenter(1),
909 hit3D->getPosition()[2] - pcaCenter(2));
912 pointList.emplace_back(
dcel2d::Point(pcaToHit(0), pcaToHit(1), hit3D));
916 pointList.sort([](
const auto&
left,
const auto&
right) {
918 std::numeric_limits<float>::epsilon()) ?
924 std::vector<ConvexHull> convexHullVec;
925 std::vector<PointList> rejectedListVec;
926 bool increaseDepth(pointList.size() > 5);
927 float lastArea(std::numeric_limits<float>::max());
929 while (increaseDepth) {
931 convexHullVec.push_back(
ConvexHull(pointList));
934 const ConvexHull& convexHull = convexHullVec.back();
935 PointList& rejectedList = rejectedListVec.back();
938 increaseDepth =
false;
941 std::cout << indent <<
"-> built convex hull, 3D hits: " << pointList.size() <<
" with " 942 << convexHullPoints.size() <<
" vertices" 944 std::cout << indent <<
"-> -Points:";
945 for (
const auto& point : convexHullPoints)
946 std::cout <<
" (" << std::get<0>(point) <<
"," << std::get<1>(point) <<
")";
947 std::cout << std::endl;
949 if (convexHullVec.size() < 2 || convexHull.
getConvexHullArea() < 0.8 * lastArea) {
950 for (
auto& point : convexHullPoints) {
951 pointList.remove(point);
952 rejectedList.emplace_back(point);
961 while (!convexHullVec.empty() && convexHullVec.back().getConvexHullArea() < 0.5) {
962 convexHullVec.pop_back();
963 rejectedListVec.pop_back();
967 if (!convexHullVec.empty()) {
968 size_t nRejectedTotal(0);
971 for (
const auto& rejectedList : rejectedListVec) {
972 nRejectedTotal += rejectedList.size();
974 for (
const auto& rejectedPoint : rejectedList) {
975 std::cout << indent <<
"-> -- Point is " 976 << convexHullVec.back().findNearestDistance(rejectedPoint)
977 <<
" from nearest edge" << std::endl;
979 if (convexHullVec.back().findNearestDistance(rejectedPoint) > 0.5)
980 hitPairListPtr.remove(std::get<2>(rejectedPoint));
984 std::cout << indent <<
"-> Removed " << nRejectedTotal <<
" leaving " << pointList.size()
985 <<
"/" << hitPairListPtr.size() <<
" points" << std::endl;
991 Point lastPoint = convexHullVec.back().getConvexHull().front();
993 for (
auto& curPoint : convexHullVec.back().getConvexHull()) {
994 if (curPoint == lastPoint)
continue;
999 float distBetweenPoints = (curPoint3D->getPosition()[0] - lastPoint3D->
getPosition()[0]) *
1000 (curPoint3D->getPosition()[0] - lastPoint3D->
getPosition()[0]) +
1001 (curPoint3D->getPosition()[1] - lastPoint3D->
getPosition()[1]) *
1002 (curPoint3D->getPosition()[1] - lastPoint3D->
getPosition()[1]) +
1003 (curPoint3D->getPosition()[2] - lastPoint3D->
getPosition()[2]) *
1004 (curPoint3D->getPosition()[2] - lastPoint3D->
getPosition()[2]);
1006 distBetweenPoints = std::sqrt(distBetweenPoints);
1010 edgeMap[lastPoint3D].push_back(edge);
1011 edgeMap[curPoint3D].push_back(edge);
1012 bestEdgeList.emplace_back(edge);
1014 lastPoint = curPoint;
1021 for (
const auto& point : extremePoints)
1022 extremePointList.push_back(point);
1035 Eigen::Vector3f pcaCenter(
1042 Eigen::Vector3f pcaToHitVec(hit3D->getPosition()[0] - pcaCenter(0),
1043 hit3D->getPosition()[1] - pcaCenter(1),
1044 hit3D->getPosition()[2] - pcaCenter(2));
1047 pointList.emplace_back(
dcel2d::Point(pcaToHit(1), pcaToHit(2), hit3D));
1051 pointList.sort([](
const auto&
left,
const auto&
right) {
1053 std::numeric_limits<float>::epsilon()) ?
1054 std::get<0>(
left) < std::get<0>(
right) :
1058 std::cout <<
" ==> Build V diagram, sorted point list contains " << pointList.size() <<
" hits" 1077 for (
auto&
vertex : vertexList) {
1078 Eigen::Vector3f coords = rotationMatrixInv *
vertex.getCoords();
1080 coords += pcaCenter;
1082 vertex.setCoords(coords);
1102 dcel2d::Point lastPoint = voronoiDiagram.getConvexHull().front();
1107 for (
auto& curPoint : voronoiDiagram.getConvexHull()) {
1108 if (curPoint == lastPoint)
continue;
1113 float distBetweenPoints = (curPoint3D->getPosition()[0] - lastPoint3D->
getPosition()[0]) *
1114 (curPoint3D->getPosition()[0] - lastPoint3D->
getPosition()[0]) +
1115 (curPoint3D->getPosition()[1] - lastPoint3D->
getPosition()[1]) *
1116 (curPoint3D->getPosition()[1] - lastPoint3D->
getPosition()[1]) +
1117 (curPoint3D->getPosition()[2] - lastPoint3D->
getPosition()[2]) *
1118 (curPoint3D->getPosition()[2] - lastPoint3D->
getPosition()[2]);
1120 distBetweenPoints = std::sqrt(distBetweenPoints);
1124 edgeMap[lastPoint3D].push_back(edge);
1125 edgeMap[curPoint3D].push_back(edge);
1126 bestEdgeList.emplace_back(edge);
1128 lastPoint = curPoint;
1131 std::cout <<
"****> vertexList containted " << vertexList.size() <<
" vertices for " 1138 const Eigen::Vector3f& u0,
1139 const Eigen::Vector3f& P1,
1140 const Eigen::Vector3f& u1,
1141 Eigen::Vector3f& poca0,
1142 Eigen::Vector3f& poca1)
const 1145 Eigen::Vector3f w0 = P0 - P1;
1147 float b(u0.dot(u1));
1149 float d(u0.dot(w0));
1150 float e(u1.dot(w0));
1151 float den(a * c - b * b);
1153 float arcLen0 = (b *
e - c *
d) / den;
1154 float arcLen1 = (a *
e - b *
d) / den;
1156 poca0 = P0 + arcLen0 * u0;
1157 poca1 = P1 + arcLen1 * u1;
1159 return (poca0 - poca1).norm();
std::tuple< float, float, const reco::ClusterHit3D * > Point
void PCAAnalysis_calc3DDocas(const reco::HitPairListPtr &hitPairVector, const reco::PrincipalComponents &pca) const
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
std::pair< MinMaxPoints, MinMaxPoints > MinMaxPointPair
void buildVoronoiDiagram(reco::ClusterParameters &clusterParameters) const
void PCAAnalysis_3D(const reco::HitPairListPtr &hitPairList, reco::PrincipalComponents &pca, bool skeletonOnly=false) const
float getTimeToExecute() const override
If monitoring, recover the time to execute a particular function.
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.
constexpr auto abs(T v)
Returns the absolute value of the argument.
reco::EdgeList & getBestEdgeList()
reco::Hit3DToEdgeMap & getHit3DToEdgeMap()
reco::HitPairListPtr & getHitPairListPtr()
Cluster finding and building.
~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.
reco::PrincipalComponents & getFullPCA()
reco::Hit3DToEdgeMap & getConvexHullEdgeMap()
std::pair< Point, Point > MinMaxPoints
std::unique_ptr< lar_cluster3d::IClusterAlg > fClusterAlg
Tools.
std::tuple< const reco::ClusterHit3D *, const reco::ClusterHit3D *, double > EdgeTuple
reco::ProjectedPointList & getConvexHullExtremePoints()
void buildVoronoiDiagram(const dcel2d::PointList &)
Given an input set of 2D points construct a 2D voronoi diagram.
void ModifyClusters(reco::ClusterParametersList &) const override
Scan an input collection of clusters and modify those according to the specific implementing algorith...
Define a container for working with the convex hull.
void initializeHistograms(art::TFileDirectory &) override
Interface for initializing histograms if they are desired Note that the idea is to put hisgtograms in...
T get(std::string const &key) const
std::string indent(std::size_t const i)
const Eigen::Vector3f & getAvePosition() const
void buildConvexHull(reco::ClusterParameters &clusterParameters, int level=0) const
PrincipalComponentsAlg fPCAAlg
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 ...
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
reco::ConvexHull & getConvexHull()
decltype(auto) get(T &&obj)
ADL-aware version of std::to_string.
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()
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
This provides an art tool interface definition for 3D Cluster algorithms.
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
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
reco::ClusterParametersList::iterator subDivideCluster(reco::ClusterParameters &cluster, reco::ClusterParametersList::iterator positionItr, reco::ClusterParametersList &outputClusterList, int level=0) const
Use PCA to try to find path in cluster.
reco::ProjectedPointList & getProjectedPointList()
reco::EdgeList & getConvexHullEdgeList()
dcel2d::HalfEdgeList & getHalfEdgeList()
std::list< Vertex > VertexList
bool fFillHistograms
Histogram definitions.
std::list< ClusterParameters > ClusterParametersList
VoronoiPathFinder(const fhicl::ParameterSet &)
Constructor.
const EigenVectors & getEigenVectors() const
dcel2d::VertexList & getVertexList()
void configure(fhicl::ParameterSet const &pset) override