12 #include "cetlib/search_path.h" 13 #include "cetlib/cpu_timer.h" 29 #include <boost/range/adaptor/reversed.hpp> 32 #include <Eigen/Dense> 100 int level = 0)
const;
112 int level = 0)
const;
121 const Eigen::Vector3f&,
122 const Eigen::Vector3f&,
123 const Eigen::Vector3f&,
125 Eigen::Vector3f&)
const;
127 using Point = std::tuple<float,float,const reco::ClusterHit3D*>;
176 fPCAAlg(pset.get<
fhicl::ParameterSet>(
"PrincipalComponentsAlg"))
211 std::string dirName =
"VoronoiPath";
218 fTopNumEdges = dir.
make<TH1F>(
"TopNumEdges",
"Number Edges", 200, 0., 200.);
225 fSubNumEdges = dir.
make<TH1F>(
"SubNumEdges",
"Number Edges", 200, 0., 200.);
248 cet::cpu_timer theClockBuildClusters;
253 int countClusters(0);
260 while(clusterParametersListItr != clusterParametersList.end())
265 std::cout <<
"**> Looking at Cluster " << countClusters++ <<
", # hits: " << clusterParameters.
getHitPairListPtr().size() << std::endl;
281 reclusteredParameters.push_back(clusterParameters);
283 std::cout <<
">>>>>>>>>>> Reclustered to " << reclusteredParameters.size() <<
" Clusters <<<<<<<<<<<<<<<" << std::endl;
286 if (!reclusteredParameters.empty())
289 for (
auto&
cluster : reclusteredParameters)
291 std::cout <<
"****> Calling breakIntoTinyBits with " <<
cluster.getHitPairListPtr().size() <<
" hits" << std::endl;
301 std::cout <<
"****> Broke Cluster with " <<
cluster.getHitPairListPtr().size() <<
" into " <<
cluster.daughterList().size() <<
" sub clusters";
302 for(
auto& clus :
cluster.daughterList()) std::cout <<
", " << clus.getHitPairListPtr().size();
303 std::cout << std::endl;
312 std::vector<double> eigenValVec = {3. * std::sqrt(fullPCA.
getEigenValues()[0]),
315 double eigen2To1Ratio = eigenValVec[2] / eigenValVec[1];
316 double eigen1To0Ratio = eigenValVec[1] / eigenValVec[0];
317 double eigen2To0Ratio = eigenValVec[2] / eigenValVec[0];
318 int num3DHits =
cluster.getHitPairListPtr().size();
319 int numEdges =
cluster.getBestEdgeList().size();
333 clusterParametersListItr++;
338 theClockBuildClusters.stop();
343 mf::LogDebug(
"Cluster3D") <<
">>>>> Cluster Path finding done" << std::endl;
362 std::string pluses(level/2,
'+');
363 std::string
indent(level/2,
' ');
372 std::vector<double> eigenValVec = {3. * std::sqrt(fullPCA.
getEigenValues()[0]),
378 double cosNewToLast = std::abs(fullPrimaryVec.dot(lastPrimaryVec));
379 double eigen2To1Ratio = eigenValVec[2] / eigenValVec[1];
380 double eigen1To0Ratio = eigenValVec[1] / eigenValVec[0];
381 double eigen2To0Ratio = eigenValVec[2] / eigenValVec[0];
382 double eigen2And1Ave = 0.5 * (eigenValVec[1] + eigenValVec[2]);
383 double eigenAveTo0Ratio = eigen2And1Ave / eigenValVec[0];
385 bool storeCurrentCluster(
true);
388 std::cout << indent <<
">>> breakIntoTinyBits with " << clusterToBreak.
getHitPairListPtr().size() <<
" input hits, " << clusterToBreak.
getBestEdgeList().size() <<
" edges, rat21: " << eigen2To1Ratio <<
", rat20: " << eigen2To0Ratio <<
", rat10: " << eigen1To0Ratio <<
", ave0: " << eigenAveTo0Ratio << std::endl;
389 std::cout << indent <<
" --> eigen 0/1/2: " << eigenValVec[0] <<
"/" << eigenValVec[1] <<
"/" << eigenValVec[2] <<
", cos: " << cosNewToLast << std::endl;
392 if (clusterToBreak.
getBestEdgeList().size() > 5 && cosNewToLast > 0.25 && eigen2To1Ratio < 0.9 && eigen2To0Ratio > 0.001 &&
405 Eigen::Vector3f edgeVec(secondEdgeHit->getPosition()[0] - firstEdgeHit->
getPosition()[0],
406 secondEdgeHit->getPosition()[1] - firstEdgeHit->
getPosition()[1],
407 secondEdgeHit->getPosition()[2] - firstEdgeHit->
getPosition()[2]);
408 double edgeLen = edgeVec.norm();
421 clusHitPairVector.sort([](
const auto&
left,
const auto&
right){
return left->getArclenToPoca() <
right->getArclenToPoca();});
424 using DistEdgeTuple = std::tuple<float, const reco::EdgeTuple*>;
425 using DistEdgeTupleVec = std::vector<DistEdgeTuple>;
427 DistEdgeTupleVec distEdgeTupleVec;
440 float hitProjection = hitToEdgeVec.dot(edgeVec);
443 if (hitProjection > 0. && hitProjection < edgeLen)
445 Eigen::Vector3f distToHitVec = hitToEdgeVec - hitProjection * edgeVec;
446 float distToHit = distToHitVec.norm();
448 distEdgeTupleVec.emplace_back(distToHit,&edge);
452 std::sort(distEdgeTupleVec.begin(),distEdgeTupleVec.end(),[](
const auto&
left,
const auto&
right){
return std::get<0>(
left) > std::get<0>(
right);});
454 for(
const auto& distEdgeTuple : distEdgeTupleVec)
463 if (vertexItr == clusHitPairVector.end() || std::distance(clusHitPairVector.begin(),vertexItr) < minimumClusterSize || std::distance(vertexItr,clusHitPairVector.end()) < minimumClusterSize)
continue;
466 using Hit3DItrPair = std::pair<reco::HitPairListPtr::iterator,reco::HitPairListPtr::iterator>;
467 using VertexPairList = std::list<Hit3DItrPair>;
469 VertexPairList vertexPairList;
471 vertexPairList.emplace_back(Hit3DItrPair(clusHitPairVector.begin(),vertexItr));
472 vertexPairList.emplace_back(Hit3DItrPair(vertexItr,clusHitPairVector.end()));
474 storeCurrentCluster =
false;
477 for(
auto& hit3DItrPair : vertexPairList)
482 std::cout << indent <<
"+> -- building new cluster, size: " << std::distance(hit3DItrPair.first,hit3DItrPair.second) << std::endl;
485 hitPairListPtr.resize(std::distance(hit3DItrPair.first,hit3DItrPair.second));
488 std::copy(hit3DItrPair.first,hit3DItrPair.second,hitPairListPtr.begin());
499 std::cout << indent <<
"+> -- >> cluster has a valid Full PCA" << std::endl;
505 if (fullPrimaryVec.dot(newPrimaryVec) < 0.)
509 eigenVectors.resize(3);
511 for(
size_t vecIdx = 0; vecIdx < 3; vecIdx++)
513 eigenVectors[vecIdx].resize(3,0.);
534 positionItr =
breakIntoTinyBits(clusterParams, fullPCA, positionItr, outputClusterList, level+4);
545 if (storeCurrentCluster)
550 std::set<const reco::ClusterHit2D*> hitSet;
555 for(
const auto& hit2D : hit3D->getHits())
557 if (hit2D) hitSet.insert(hit2D);
562 for(
const auto& hit2D : hitSet)
568 std::cout << indent <<
"*********>>> storing new subcluster of size " << clusterToBreak.
getHitPairListPtr().size() << std::endl;
570 positionItr = outputClusterList.insert(positionItr,clusterToBreak);
579 float cosToLast = newPrimaryVec.dot(lastPrimaryVec);
593 else if (inputPositionItr != positionItr)
595 std::cout << indent <<
"***** DID NOT STORE A CLUSTER *****" << std::endl;
616 std::string pluses(level/2,
'+');
617 std::string
indent(level/2,
' ');
624 std::vector<double> eigenValVec = {3. * std::sqrt(fullPCA.
getEigenValues()[0]),
639 Eigen::Vector3f edgeVec(secondEdgeHit->getPosition()[0] - firstEdgeHit->
getPosition()[0],
640 secondEdgeHit->getPosition()[1] - firstEdgeHit->
getPosition()[1],
641 secondEdgeHit->getPosition()[2] - firstEdgeHit->
getPosition()[2]);
642 double edgeLen = edgeVec.norm();
655 clusHitPairVector.sort([](
const auto&
left,
const auto&
right){
return left->getArclenToPoca() <
right->getArclenToPoca();});
658 using DistEdgeTuple = std::tuple<float, const reco::EdgeTuple*>;
659 using DistEdgeTupleVec = std::vector<DistEdgeTuple>;
661 DistEdgeTupleVec distEdgeTupleVec;
674 float hitProjection = hitToEdgeVec.dot(edgeVec);
677 if (hitProjection > 0. && hitProjection < edgeLen)
679 Eigen::Vector3f distToHitVec = hitToEdgeVec - hitProjection * edgeVec;
680 float distToHit = distToHitVec.norm();
682 distEdgeTupleVec.emplace_back(distToHit,&edge);
686 std::sort(distEdgeTupleVec.begin(),distEdgeTupleVec.end(),[](
const auto&
left,
const auto&
right){
return std::get<0>(
left) > std::get<0>(
right);});
690 float usedDefectDist(0.);
692 for(
const auto& distEdgeTuple : distEdgeTupleVec)
697 usedDefectDist = std::get<0>(distEdgeTuple);
703 if (vertexItr == clusHitPairVector.end() || std::distance(clusHitPairVector.begin(),vertexItr) <
int(
fMinTinyClusterSize) || std::distance(vertexItr,clusHitPairVector.end()) <
int(
fMinTinyClusterSize))
continue;
709 if (
makeCandidateCluster(fullPrimaryVec, clusterParams1, clusHitPairVector.begin(), vertexItr, level))
715 if (
makeCandidateCluster(fullPrimaryVec, clusterParams2, vertexItr, clusHitPairVector.end(), level))
break;
719 tempClusterParametersList.clear();
723 if (tempClusterParametersList.empty())
725 std::cout << indent <<
"===> no cluster cands, edgeLen: " << edgeLen <<
", # hits: " << clusHitPairVector.size() <<
", max defect: " << std::get<0>(distEdgeTupleVec.front()) << std::endl;
733 std::advance(vertexItr, clusHitPairVector.size()/2);
739 if (
makeCandidateCluster(fullPrimaryVec, clusterParams1, clusHitPairVector.begin(), vertexItr, level))
745 if (!
makeCandidateCluster(fullPrimaryVec, clusterParams2, vertexItr, clusHitPairVector.end(), level))
746 tempClusterParametersList.clear();
752 for(
auto& clusterParams : tempClusterParametersList)
754 size_t curOutputClusterListSize = outputClusterList.size();
756 positionItr =
subDivideCluster(clusterParams, fullPCA, positionItr, outputClusterList, level+4);
758 std::cout << indent <<
"Output cluster list prev: " << curOutputClusterListSize <<
", now: " << outputClusterList.size() << std::endl;
762 if (curOutputClusterListSize < outputClusterList.size())
continue;
767 std::set<const reco::ClusterHit2D*> hitSet;
770 for(
const auto& hit3D : clusterParams.getHitPairListPtr())
772 for(
const auto& hit2D : hit3D->getHits())
774 if (hit2D) hitSet.insert(hit2D);
779 for(
const auto& hit2D : hitSet)
782 clusterParams.UpdateParameters(hit2D);
785 std::cout << indent <<
"*********>>> storing new subcluster of size " << clusterParams.getHitPairListPtr().size() << std::endl;
787 positionItr = outputClusterList.insert(positionItr,clusterParams);
798 int num3DHits = clusterParams.getHitPairListPtr().size();
799 int numEdges = clusterParams.getBestEdgeList().size();
800 float cosToLast = newPrimaryVec.dot(lastPrimaryVec);
801 double eigen2To1Ratio = eigenValVec[2] / eigenValVec[1];
802 double eigen1To0Ratio = eigenValVec[1] / eigenValVec[0];
803 double eigen2To0Ratio = eigenValVec[2] / eigenValVec[0];
813 fSubMaxDefect->Fill(std::get<0>(distEdgeTupleVec.front()), 1.);
831 std::string
indent(level/2,
' ');
835 std::cout << indent <<
"+> -- building new cluster, size: " << std::distance(firstHitItr,lastHitItr) << std::endl;
838 hitPairListPtr.resize(std::distance(firstHitItr,lastHitItr));
841 std::copy(firstHitItr,lastHitItr,hitPairListPtr.begin());
850 bool keepThisCluster(
false);
855 std::cout << indent <<
"+> -- >> cluster has a valid Full PCA" << std::endl;
861 if (primaryPCA.dot(newPrimaryVec) < 0.)
865 eigenVectors.resize(3);
867 for(
size_t vecIdx = 0; vecIdx < 3; vecIdx++)
869 eigenVectors[vecIdx].resize(3,0.);
892 std::vector<double> eigenValVec = {3. * std::sqrt(newFullPCA.
getEigenValues()[0]),
895 double cosNewToLast = std::abs(primaryPCA.dot(newPrimaryVec));
896 double eigen2To1Ratio = eigenValVec[2] / eigenValVec[1];
897 double eigen1To0Ratio = eigenValVec[1] / eigenValVec[0];
898 double eigen2To0Ratio = eigenValVec[2] / eigenValVec[0];
899 double eigen2And1Ave = 0.5 * (eigenValVec[1] + eigenValVec[2]);
900 double eigenAveTo0Ratio = eigen2And1Ave / eigenValVec[0];
902 std::cout << indent <<
">>> subDivideClusters with " << candCluster.
getHitPairListPtr().size() <<
" input hits, " << candCluster.
getBestEdgeList().size() <<
" edges, rat21: " << eigen2To1Ratio <<
", rat20: " << eigen2To0Ratio <<
", rat10: " << eigen1To0Ratio <<
", ave0: " << eigenAveTo0Ratio << std::endl;
903 std::cout << indent <<
" --> eigen 0/1/2: " << eigenValVec[0] <<
"/" << eigenValVec[1] <<
"/" << eigenValVec[2] <<
", cos: " << cosNewToLast << std::endl;
907 if (candCluster.
getBestEdgeList().size() > 4 && cosNewToLast > 0.25 && eigen2To1Ratio > 0.01 && eigen2To1Ratio < 0.99 && eigen1To0Ratio < 0.5)
909 keepThisCluster =
true;
913 return keepThisCluster;
920 std::string minuses(level/2,
'-');
921 std::string
indent(level/2,
' ');
936 Eigen::Matrix3f rotationMatrix;
938 rotationMatrix << planeVec0(0), planeVec0(1), planeVec0(2),
939 planeVec1(0), planeVec1(1), planeVec1(2),
940 pcaPlaneNrml(0), pcaPlaneNrml(1), pcaPlaneNrml(2);
943 using Point = std::tuple<float,float,const reco::ClusterHit3D*>;
952 Eigen::Vector3f pcaToHitVec(hit3D->getPosition()[0] - pcaCenter(0),
953 hit3D->getPosition()[1] - pcaCenter(1),
954 hit3D->getPosition()[2] - pcaCenter(2));
955 Eigen::Vector3f pcaToHit = rotationMatrix * pcaToHitVec;
957 pointList.emplace_back(
dcel2d::Point(pcaToHit(0),pcaToHit(1),hit3D));
961 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);});
964 std::vector<ConvexHull> convexHullVec;
965 std::vector<PointList> rejectedListVec;
966 bool increaseDepth(pointList.size() > 5);
972 convexHullVec.push_back(
ConvexHull(pointList));
975 const ConvexHull& convexHull = convexHullVec.back();
976 PointList& rejectedList = rejectedListVec.back();
979 increaseDepth =
false;
983 std::cout << indent <<
"-> built convex hull, 3D hits: " << pointList.size() <<
" with " << convexHullPoints.size() <<
" vertices" <<
", area: " << convexHull.
getConvexHullArea() << std::endl;
984 std::cout << indent <<
"-> -Points:";
985 for(
const auto& point : convexHullPoints)
986 std::cout <<
" (" << std::get<0>(point) <<
"," << std::get<1>(point) <<
")";
987 std::cout << std::endl;
991 for(
auto& point : convexHullPoints)
993 pointList.remove(point);
994 rejectedList.emplace_back(point);
1003 while(!convexHullVec.empty() && convexHullVec.back().getConvexHullArea() < 0.5)
1005 convexHullVec.pop_back();
1006 rejectedListVec.pop_back();
1010 if (!convexHullVec.empty())
1012 size_t nRejectedTotal(0);
1015 for(
const auto& rejectedList : rejectedListVec)
1017 nRejectedTotal += rejectedList.size();
1019 for(
const auto& rejectedPoint : rejectedList)
1021 std::cout << indent <<
"-> -- Point is " << convexHullVec.back().findNearestDistance(rejectedPoint) <<
" from nearest edge" << std::endl;
1023 if (convexHullVec.back().findNearestDistance(rejectedPoint) > 0.5)
1024 hitPairListPtr.remove(std::get<2>(rejectedPoint));
1028 std::cout << indent <<
"-> Removed " << nRejectedTotal <<
" leaving " << pointList.size() <<
"/" << hitPairListPtr.size() <<
" points" << std::endl;
1034 Point lastPoint = convexHullVec.back().getConvexHull().front();
1036 for(
auto& curPoint : convexHullVec.back().getConvexHull())
1038 if (curPoint == lastPoint)
continue;
1043 float distBetweenPoints = (curPoint3D->getPosition()[0] - lastPoint3D->
getPosition()[0]) * (curPoint3D->getPosition()[0] - lastPoint3D->
getPosition()[0])
1044 + (curPoint3D->getPosition()[1] - lastPoint3D->
getPosition()[1]) * (curPoint3D->getPosition()[1] - lastPoint3D->
getPosition()[1])
1045 + (curPoint3D->getPosition()[2] - lastPoint3D->
getPosition()[2]) * (curPoint3D->getPosition()[2] - lastPoint3D->
getPosition()[2]);
1047 distBetweenPoints = std::sqrt(distBetweenPoints);
1051 edgeMap[lastPoint3D].push_back(edge);
1052 edgeMap[curPoint3D].push_back(edge);
1053 bestEdgeList.emplace_back(edge);
1055 lastPoint = curPoint;
1062 for(
const auto& point : extremePoints) extremePointList.push_back(point);
1092 Eigen::Matrix3f rotationMatrix;
1094 rotationMatrix << planeVec0(0), planeVec0(1), planeVec0(2),
1095 planeVec1(0), planeVec1(1), planeVec1(2),
1096 pcaPlaneNrml(0), pcaPlaneNrml(1), pcaPlaneNrml(2);
1103 Eigen::Vector3f pcaToHitVec(hit3D->getPosition()[0] - pcaCenter(0),
1104 hit3D->getPosition()[1] - pcaCenter(1),
1105 hit3D->getPosition()[2] - pcaCenter(2));
1106 Eigen::Vector3f pcaToHit = rotationMatrix * pcaToHitVec;
1108 pointList.emplace_back(
dcel2d::Point(pcaToHit(0),pcaToHit(1),hit3D));
1112 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);});
1114 std::cout <<
" ==> Build V diagram, sorted point list contains " << pointList.size() <<
" hits" << std::endl;
1127 Eigen::Matrix3f rotationMatrixInv = rotationMatrix.inverse();
1130 for(
auto&
vertex : vertexList)
1132 Eigen::Vector3f coords = rotationMatrixInv *
vertex.getCoords();
1134 coords += pcaCenter;
1136 vertex.setCoords(coords);
1156 dcel2d::Point lastPoint = voronoiDiagram.getConvexHull().front();
1161 for(
auto& curPoint : voronoiDiagram.getConvexHull())
1163 if (curPoint == lastPoint)
continue;
1168 float distBetweenPoints = (curPoint3D->getPosition()[0] - lastPoint3D->
getPosition()[0]) * (curPoint3D->getPosition()[0] - lastPoint3D->
getPosition()[0])
1169 + (curPoint3D->getPosition()[1] - lastPoint3D->
getPosition()[1]) * (curPoint3D->getPosition()[1] - lastPoint3D->
getPosition()[1])
1170 + (curPoint3D->getPosition()[2] - lastPoint3D->
getPosition()[2]) * (curPoint3D->getPosition()[2] - lastPoint3D->
getPosition()[2]);
1172 distBetweenPoints = std::sqrt(distBetweenPoints);
1176 edgeMap[lastPoint3D].push_back(edge);
1177 edgeMap[curPoint3D].push_back(edge);
1178 bestEdgeList.emplace_back(edge);
1180 lastPoint = curPoint;
1183 std::cout <<
"****> vertexList containted " << vertexList.size() <<
" vertices for " << clusterParameters.
getHitPairListPtr().size() <<
" hits" << std::endl;
1190 const Eigen::Vector3f& u0,
1191 const Eigen::Vector3f& P1,
1192 const Eigen::Vector3f& u1,
1193 Eigen::Vector3f& poca0,
1194 Eigen::Vector3f& poca1)
const 1197 Eigen::Vector3f w0 = P0 - P1;
1199 float b(u0.dot(u1));
1201 float d(u0.dot(w0));
1202 float e(u1.dot(w0));
1203 float den(a * c - b * b);
1205 float arcLen0 = (b *
e - c *
d) / den;
1206 float arcLen1 = (a *
e - b *
d) / den;
1208 poca0 = P0 + arcLen0 * u0;
1209 poca1 = P1 + arcLen1 * u1;
1211 return (poca0 - poca1).norm();
1216 float largestDistance(0.);
1223 while(firstEdgeItr != convexHull.end())
1231 while(++nextEdgeItr != convexHull.end())
1237 return largestDistance;
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)
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.
std::list< ProjectedPoint > ProjectedPointList
Declaration of signal hit object.
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
const float * getAvePosition() const
int getNumHitsUsed() const
reco::Hit3DToEdgeMap & getHit3DToEdgeMap()
reco::HitPairListPtr & getHitPairListPtr()
Cluster finding and building.
~VoronoiPathFinder()
Destructor.
TFileDirectory mkdir(std::string const &dir, std::string const &descr="")
IClusterModAlg interface class definiton.
bool fEnableMonitoring
FHICL parameters.
ClusterParametersList & daughterList()
Implements a ConvexHull for use in clustering.
std::list< EdgeTuple > EdgeList
VoronoiDiagram class definiton.
reco::PrincipalComponents & getFullPCA()
reco::Hit3DToEdgeMap & getConvexHullEdgeMap()
std::unique_ptr< lar_cluster3d::IClusterAlg > fClusterAlg
Algorithm to do 3D space point clustering.
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.
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::tuple< float, float, const reco::ClusterHit3D * > Point
std::string indent(std::size_t const i)
geo::Geometry * fGeometry
Tools.
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
std::vector< std::vector< float > > EigenVectors
This provides an art tool interface definition for 3D Cluster algorithms.
The geometry of one entire detector, as served by art.
const PointList & getConvexHull() const
recover the list of convex hull vertices
const float * getPosition() const
ConvexHull class definiton.
This header file defines the interface to a principal components analysis designed to be used within ...
Encapsulate the geometry of a wire.
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
reco::ConvexHull & getConvexHull()
T * make(ARGS...args) const
Utility object to perform functions of association.
const float * getEigenValues() const
Encapsulate the construction of a single detector plane.
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.
const float getAveHitDoca() const
dcel2d::FaceList & getFaceList()
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
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
std::pair< MinMaxPoints, MinMaxPoints > MinMaxPointPair
reco::ProjectedPointList & getProjectedPointList()
reco::EdgeList & getConvexHullEdgeList()
dcel2d::HalfEdgeList & getHalfEdgeList()
std::list< Vertex > VertexList
bool fFillHistograms
Histogram definitions.
art framework interface to geometry description
std::list< ClusterParameters > ClusterParametersList
VoronoiPathFinder(const fhicl::ParameterSet &)
Constructor.
const EigenVectors & getEigenVectors() const
dcel2d::VertexList & getVertexList()
void configure(fhicl::ParameterSet const &pset) override
float findConvexHullEndPoints(const reco::EdgeList &, const reco::ClusterHit3D *, const reco::ClusterHit3D *) const