51 #include "art_root_io/TFileService.h" 97 std::unordered_map<const reco::ClusterHit3D*, art::Ptr<recob::SpacePoint>>;
167 for (
auto&
hit : recobHits)
206 std::vector<recob::SpacePoint>& spacePointVector,
208 size_t spacePointStart,
211 for (
size_t idx = spacePointStart; idx < spacePointVector.size(); idx++) {
223 for (
size_t idx = edgeStart; idx < edgeVector.size(); idx++) {
236 for (
auto& spacePoint : spacePointVector)
344 std::vector<recob::Seed>& seedVec,
374 std::vector<recob::SpacePoint>& spacePointVec,
407 using IdxToPCAMap = std::map<size_t, const reco::PrincipalComponents*>;
425 size_t pfParticleParent,
455 size_t pfParticleParent,
509 std::unique_ptr<lar_cluster3d::IHit3DBuilder>
511 std::unique_ptr<lar_cluster3d::IClusterAlg>
513 std::unique_ptr<lar_cluster3d::IClusterModAlg>
515 std::unique_ptr<lar_cluster3d::IClusterModAlg>
517 std::unique_ptr<lar_cluster3d::IClusterParametersBuilder>
559 m_clusterBuilder = art::make_tool<lar_cluster3d::IClusterParametersBuilder>(
565 produces<std::vector<recob::PCAxis>>();
566 produces<std::vector<recob::PFParticle>>();
567 produces<std::vector<recob::Cluster>>();
568 produces<std::vector<recob::Seed>>();
569 produces<std::vector<recob::Edge>>();
571 produces<art::Assns<recob::PFParticle, recob::PCAxis>>();
572 produces<art::Assns<recob::PFParticle, recob::Cluster>>();
573 produces<art::Assns<recob::PFParticle, recob::Seed>>();
574 produces<art::Assns<recob::Edge, recob::PFParticle>>();
575 produces<art::Assns<recob::Seed, recob::Hit>>();
576 produces<art::Assns<recob::Cluster, recob::Hit>>();
578 produces<std::vector<recob::SpacePoint>>();
579 produces<art::Assns<recob::SpacePoint, recob::PFParticle>>();
580 produces<art::Assns<recob::Hit, recob::SpacePoint>>();
581 produces<art::Assns<recob::SpacePoint, recob::Edge>>();
585 produces<art::Assns<recob::SpacePoint, recob::PFParticle>>(
m_pathInstance);
586 produces<art::Assns<recob::Edge, recob::PFParticle>>(
m_pathInstance);
587 produces<art::Assns<recob::Hit, recob::SpacePoint>>(
m_pathInstance);
588 produces<art::Assns<recob::SpacePoint, recob::Edge>>(
m_pathInstance);
613 mf::LogInfo(
"Cluster3D") <<
" *** Cluster3D::produce(...) [Run=" << evt.
run()
614 <<
", Event=" << evt.
id().
event() <<
"] Starting Now! *** " 630 std::unique_ptr<reco::HitPairList> hitPairList(
639 m_clusterAlg->Cluster3DHits(*hitPairList, clusterParametersList);
659 ProduceArtClusters(gser, output, *hitPairList, clusterParametersList, clusterHitToArtPtrMap);
666 theClockFinish.
stop();
667 theClockTotal.
stop();
680 m_hits =
static_cast<int>(clusterHitToArtPtrMap.size());
681 m_hits3D =
static_cast<int>(hitPairList->size());
703 m_pRecoTree = tfs->make<TTree>(
"monitoring",
"LAr Reco");
744 std::vector<recob::Seed>& seedVec,
773 float transRMS =
std::hypot(eigenVal0, eigenVal1);
775 bool foundGoodSeed(
false);
786 else if (eigenVal2 > 40. && transRMS < 5.) {
796 if (!foundGoodSeed) {
803 for (
const auto& seedHitPair : seedHitPairVec) {
804 seedVec.push_back(seedHitPair.first);
808 std::set<art::Ptr<recob::Hit>> seedHitSet;
809 for (
const auto& hit3D : seedHitPair.second) {
810 for (
const auto& hit2D : hit3D->getHits()) {
811 if (!hit2D)
continue;
814 seedHitSet.insert(hitToPtrMap[recobHit]);
819 for (
const auto& hit2D : seedHitSet)
829 const std::pair<float, const reco::ClusterHit3D*>&
right)
831 return left.first < right.first;
851 typedef std::pair<float, const reco::ClusterHit3D*> DistanceHit3DPair;
852 typedef std::list<DistanceHit3DPair> DistanceHit3DPairList;
853 typedef std::map<const reco::ClusterHit3D*, DistanceHit3DPairList> Hit3DToDistanceMap;
856 typedef std::list<const reco::ClusterHit3D*> Hit3DList;
857 typedef std::pair<Hit3DList::iterator, Hit3DList::iterator> Hit3DEdgePair;
858 typedef std::pair<float, Hit3DEdgePair> DistanceEdgePair;
859 typedef std::list<DistanceEdgePair> DistanceEdgePairList;
861 struct DistanceEdgePairOrder {
863 operator()(
const DistanceEdgePair&
left,
const DistanceEdgePair&
right)
const 865 return left.first > right.first;
883 Hit3DToDistanceMap hit3DToDistanceMap;
886 hit3DOuterItr != skeletonListPtr.end();) {
888 DistanceHit3DPairList& outerHitList = hit3DToDistanceMap[hit3DOuter];
893 hit3DInnerItr != skeletonListPtr.end();
898 TVector3 deltaPos = innerPos - outerPos;
899 float hitDistance(
float(deltaPos.Mag()));
901 if (hitDistance > 20.)
continue;
903 hit3DToDistanceMap[hit3DInner].emplace_back(hitDistance, hit3DOuter);
904 outerHitList.emplace_back(hitDistance, hit3DInner);
912 for (
auto& mapPair : hit3DToDistanceMap) {
918 DistanceEdgePairList distanceEdgePairList;
921 hit3DList.emplace_back(skeletonListPtr.front());
922 distanceEdgePairList.emplace_back(
923 DistanceEdgePair(0., Hit3DEdgePair(hit3DList.begin(), hit3DList.begin())));
927 float largestDistance(0.);
928 float averageDistance(0.);
932 while (hit3DList.size() < skeletonListPtr.size()) {
934 float bestDist = 10000000.;
942 DistanceHit3DPairList& nearestList = hit3DToDistanceMap[hit3D];
944 while (!nearestList.empty()) {
948 if (nearestList.front().first < bestDist) {
949 bestHit3DIter = hit3DIter;
950 bestDist = nearestList.front().first;
955 nearestList.pop_front();
959 if (bestDist > largestDistance) largestDistance = bestDist;
961 averageDistance += bestDist;
967 hit3DToDistanceMap[bestHit3D].front().second;
971 distanceEdgePairList.emplace_back(bestDist, Hit3DEdgePair(bestHit3DIter, nextHit3DIter));
976 averageDistance /=
float(hit3DList.size());
981 distanceEdgePairList.sort(DistanceEdgePairOrder());
986 edgeIter != distanceEdgePairList.end();
988 if (edgeIter->first < thirdDist)
break;
990 largestDistIter = edgeIter;
996 bestList.resize(
std::distance(hit3DList.begin(), breakIter));
998 std::copy(hit3DList.begin(), breakIter, bestList.begin());
1002 hitPairListPtr.sort();
1006 hitPairListPtr.end(),
1009 hitPairListPtr.begin());
1011 hitPairListPtr.erase(newListEnd, hitPairListPtr.end());
1058 skeletonListPtr, clusterParameters.
getSkeletonPCA(), hitPairListPtrList);
1061 if (hitPairListPtrList.size() < 2)
return;
1081 for (
const auto& hit3D : hitPairListPtr) {
1082 for (
const auto& hit2D : hit3D->getHits())
1083 if (hit2D) hit2D->clearStatusBits(0
x1);
1090 float allowedHitRange = 6. * firstHitListPCA.
getAveHitDoca();
1103 newClusterHitList.resize(hitPairListPtr.size());
1107 hitPairListPtr.end(),
1108 newClusterHitList.begin(),
1112 newClusterHitList.resize(
std::distance(newClusterHitList.begin(), newListEnd));
1121 m_clusterBuilder->FillClusterParams(newClusterParams, hit2DToClusterMap, 0., 1.);
1141 float newAllowedHitRange = 6. * secondHitListPCA.
getAveHitDoca();
1151 std::copy_if(newClusterHitList.begin(),
1152 newClusterHitList.end(),
1153 tempHitList.begin(),
1156 hitPairListPtr.insert(hitPairListPtr.end(), tempHitList.begin(), tempListEnd);
1163 m_clusterBuilder->FillClusterParams(originalParams, hit2DToClusterMap, 0., 1.);
1186 if (!clusterParametersList.empty()) {
1190 for (
auto& clusterParameters : clusterParametersList) {
1196 if (!clusterParameters.getFullPCA().getSvdOK()) {
1198 <<
"--> no feature extraction done on this cluster!!" <<
std::endl;
1214 if (clusterParameters.daughterList().empty()) {
1225 clusterParameters.getConvexHull().getConvexHullKinkPoints());
1244 std::vector<size_t> daughterVec;
1246 for (
auto& idxToPCA : idxToPCAMap)
1247 daughterVec.emplace_back(idxToPCA.first);
1255 double eigenVals[] = {0., 0., 0.};
1256 double avePosition[] = {0., 0., 0.};
1258 eigenVecs.resize(3);
1262 for (
size_t outerIdx = 0; outerIdx < 3; outerIdx++) {
1266 eigenVecs[outerIdx].resize(3);
1269 for (
size_t innerIdx = 0; innerIdx < 3; innerIdx++)
1270 eigenVecs[outerIdx][innerIdx] = skeletonPCA.
getEigenVectors().row(outerIdx)[innerIdx];
1285 for (
size_t outerIdx = 0; outerIdx < 3; outerIdx++) {
1289 for (
size_t innerIdx = 0; innerIdx < 3; innerIdx++)
1290 eigenVecs[outerIdx][innerIdx] = fullPCA.
getEigenVectors().row(outerIdx)(innerIdx);
1310 clusterParameters.getHitPairListPtr(),
1316 clusterParameters.getConvexHull().getConvexHullKinkPoints());
1321 for (
const auto& edge : clusterParameters.getConvexHull().getConvexHullEdgeList()) {
1325 spacePointVec.
push_back(hit3DToSPPtrMap.at(std::get<0>(edge)));
1326 spacePointVec.
push_back(hit3DToSPPtrMap.at(std::get<1>(edge)));
1329 std::cout <<
"Caught exception in looking up space point ptr... " << std::get<0>(edge)
1330 <<
", " << std::get<1>(edge) <<
std::endl;
1335 spacePointVec[0].
key(),
1336 spacePointVec[1].
key(),
1353 for (
auto& hitPair : hitPairVector) {
1356 double spacePointPos[] = {
1357 hitPair.getPosition()[0], hitPair.getPosition()[1], hitPair.getPosition()[2]};
1358 double spacePointErr[] = {1., 0., 0., 1., 0., 1.};
1359 double chisq = hitPair.getHitChiSquare();
1363 for (
const auto hit : hitPair.getHits()) {
1375 spacePointErr[1] = hitPair.getTotalCharge();
1376 spacePointErr[3] = hitPair.getChargeAsymmetry();
1381 if (!recobHits.
empty())
1386 std::cout <<
"++++>>>> total num hits: " << hitPairVector.size()
1387 <<
", num free: " << nFreePoints <<
std::endl;
1393 size_t localCount(0);
1396 for (
auto& clusterParams : clusterParameters.
daughterList())
1409 size_t pfParticleParent,
1417 for (
auto& clusterParams : clusterParameters.
daughterList())
1437 idxToPCAMap[daughterIdx] = &clusterParameters.
getFullPCA();
1440 return idxToPCAMap.size();
1447 size_t pfParticleParent,
1457 using OverriddenClusterParamsAlg_t =
1475 for (
const auto& clusParametersPair : clusterParameters.
getClusterParams()) {
1482 std::vector<const recob::Hit*> recobHitVec(clusParams.
m_hitVector.size());
1486 recobHitVec.begin(),
1487 [](
const auto& hit2D) {
return hit2D->getHit(); });
1496 ClusterParamAlgo.
ImportHits(gser, recobHitVec);
1520 for (
const auto& hit2D : clusParams.
m_hitVector) {
1521 if (hit2D ==
nullptr || hit2D->getHit() ==
nullptr)
continue;
1535 std::vector<size_t> nullVector;
1555 int spacePointStart = spVector->size();
1558 output, *spVector, *spHitAssns, *hit3DListPtr, hitToPtrMap, *hit3DToPtrMap);
1567 hit3DToPtrMap = &best3DToSPPtrMap;
1576 spacePointStart = spVector->size();
1579 output, *spVector, *spHitAssns, *hit3DListPtr, hitToPtrMap, *hit3DToPtrMap, instance);
1587 size_t edgeStart = edgeVector->size();
1593 spacePointVec.
push_back(hit3DToPtrMap->at(std::get<0>(edge)));
1594 spacePointVec.
push_back(hit3DToPtrMap->at(std::get<1>(edge)));
1597 std::cout <<
"Caught exception in looking up space point ptr... " << std::get<0>(edge)
1598 <<
", " << std::get<1>(edge) <<
std::endl;
1602 edgeVector->emplace_back(
1603 std::get<2>(edge), spacePointVec[0].
key(), spacePointVec[1].
key(), edgeVector->size());
1614 double eigenVals[] = {0., 0., 0.};
1615 double avePosition[] = {0., 0., 0.};
1617 eigenVecs.resize(3);
1619 for (
size_t outerIdx = 0; outerIdx < 3; outerIdx++) {
1623 eigenVecs[outerIdx].resize(3);
1625 for (
size_t innerIdx = 0; innerIdx < 3; innerIdx++)
1626 eigenVecs[outerIdx][innerIdx] = skeletonPCA.
getEigenVectors().row(outerIdx)(innerIdx);
1639 for (
size_t outerIdx = 0; outerIdx < 3; outerIdx++) {
1643 for (
size_t innerIdx = 0; innerIdx < 3; innerIdx++)
1644 eigenVecs[outerIdx][innerIdx] = fullPCA.
getEigenVectors().row(outerIdx)(innerIdx);
1662 return pfParticleIdx;
1667 std::vector<recob::SpacePoint>& spacePointVec,
1675 spacePointVec.reserve(spacePointVec.size() + clusHitPairVector.size());
1678 double spError[] = {1., 0., 1., 0., 0., 1.};
1681 for (
auto& hitPair : clusHitPairVector) {
1683 if (hit3DToSPPtrMap.find(hitPair) != hit3DToSPPtrMap.end())
continue;
1688 double chisq = hitPair->getHitChiSquare();
1694 size_t spacePointID = spacePointVec.size();
1695 double spacePointPos[] = {
1696 hitPair->getPosition()[0], hitPair->getPosition()[1], hitPair->getPosition()[2]};
1698 spError[1] = hitPair->getTotalCharge();
1699 spError[3] = hitPair->getChargeAsymmetry();
1701 spacePointVec.emplace_back(spacePointPos, spError, chisq, spacePointID);
1709 for (
const auto&
hit : hitPair->getHits()) {
1716 if (!recobHits.
empty())
1728 double spError[] = {1., 0., 1., 0., 0., 1.};
1731 for (
auto& kinkTuple : kinkTupleVec) {
1737 double spacePointPos[] = {
1761 double spError[] = {1., 0., 1., 0., 0., 1.};
1765 std::map<const dcel2d::Vertex*, size_t> vertexToSpacePointMap;
1768 for (
auto&
vertex : vertexList) {
1772 double spacePointPos[] = {coords[0], coords[1], coords[2]};
1781 std::set<const dcel2d::HalfEdge*> halfEdgeSet;
1784 for (
const auto& halfEdge : halfEdgeList) {
1789 if (twin && halfEdgeSet.find(twin) == halfEdgeSet.end()) {
1795 if (!toVertex || !fromVertex)
continue;
1797 if (vertexToSpacePointMap.find(fromVertex) == vertexToSpacePointMap.end() ||
1798 vertexToSpacePointMap.find(toVertex) == vertexToSpacePointMap.end())
1805 vertexToSpacePointMap[fromVertex],
1806 vertexToSpacePointMap[toVertex],
1809 halfEdgeSet.insert(&halfEdge);
1829 Eigen::Vector3f avePosition(
1833 using DocaToPCAPair = std::pair<float, const reco::PrincipalComponents*>;
1834 using DocaToPCAVec = std::vector<DocaToPCAPair>;
1836 DocaToPCAVec docaToPCAVec;
1839 for (
const auto& idxToPCA : idxToPCAMap) {
1844 Eigen::Vector3f pcaPos(
1848 Eigen::Vector3f pcaToAveVec = pcaPos - avePosition;
1851 float arclenToPoca = pcaToAveVec.dot(axisDirVec);
1853 docaToPCAVec.emplace_back(arclenToPoca, pca);
1856 std::sort(docaToPCAVec.begin(), docaToPCAVec.end(), [](
const auto&
left,
const auto&
right) {
1862 double spError[] = {1., 0., 1., 0., 0., 1.};
1868 for (
const auto& docaToPCAPair : docaToPCAVec) {
1873 double lastPointPos[] = {
1876 double curPointPos[] = {
1878 size_t curPointBin = lastPointBin + 1;
1883 Eigen::Vector3f distVec(curPointPos[0] - lastPointPos[0],
1884 curPointPos[1] - lastPointPos[1],
1885 curPointPos[2] - lastPointPos[2]);
1888 distVec.norm(), lastPointBin, curPointBin, output.
artEdgeVector->size());
reco::HitPairListPtr & getBestHitPairListPtr()
std::unique_ptr< std::vector< recob::Edge > > artPathEdgeVector
float m_buildNeighborhoodTime
Keeps track of time to build epsilon neighborhood.
std::unique_ptr< art::Assns< recob::SpacePoint, recob::PFParticle > > artPFPartSPAssociations
void PCAAnalysis_calc3DDocas(const reco::HitPairListPtr &hitPairVector, const reco::PrincipalComponents &pca) const
std::list< reco::ClusterHit3D > HitPairList
std::unique_ptr< std::vector< recob::SpacePoint > > artVertexPointVector
std::unique_ptr< lar_cluster3d::IClusterModAlg > m_clusterPathAlg
Algorithm to do cluster path finding.
void makeEdgeSpacePointAssns(std::vector< recob::Edge > &edgeVector, RecobSpacePointVector &spacePointVector, art::Assns< recob::SpacePoint, recob::Edge > &edgeSPAssociations, const std::string &path="")
An object to define a "edge" which is used to connect space points in a triangulation algorithm...
void PCAAnalysis_3D(const reco::HitPairListPtr &hitPairList, reco::PrincipalComponents &pca, bool skeletonOnly=false) const
Class managing the creation of a new recob::Cluster object.
std::unique_ptr< std::vector< recob::Seed > > artSeedVector
Reconstruction base classes.
std::string m_vertexInstance
Special instance name for vertex points.
static constexpr size_t kPFParticlePrimary
Define index to signify primary particle.
std::list< HalfEdge > HalfEdgeList
void makePFPartSpacePointAssns(std::vector< recob::SpacePoint > &spacePointVector, art::Assns< recob::SpacePoint, recob::PFParticle > &pfPartSPAssociations, size_t spacePointStart, const std::string &instance="")
const Eigen::Vector3f getPosition() const
std::unique_ptr< art::Assns< recob::Seed, recob::Hit > > artSeedHitAssociations
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
float m_parallelHitsTransWid
Cut on transverse width of cluster (PCA 2nd eigenvalue)
HalfEdge * getTwinHalfEdge() const
float m_parallelHitsCosAng
Cut for PCA 3rd axis angle to X axis.
bool aParallelHitsCluster(const reco::PrincipalComponents &pca) const
There are several places we will want to know if a candidate cluster is a "parallel hits" type of clu...
std::string & fVertexName
reco::PrincipalComponents & getSkeletonPCA()
EDProducer(fhicl::ParameterSet const &pset)
void clearStatusBits(unsigned bits) const
void findTrackSeeds(art::Event &evt, reco::ClusterParameters &cluster, IHit3DBuilder::RecobHitToPtrMap &hitToPtrMap, std::vector< recob::Seed > &seedVec, art::Assns< recob::Seed, recob::Hit > &seedHitAssns) const
An interface to the seed finding algorithm.
void makeClusterHitAssns(RecobHitVector &recobHits)
SkeletonAlg m_skeletonAlg
Skeleton point finder.
CopyIfInRange(float maxRange)
void makePFPartEdgeAssns(std::vector< recob::Edge > &edgeVector, art::Assns< recob::Edge, recob::PFParticle > &pfPartEdgeAssociations, size_t edgeStart, const std::string &instance="")
virtual bool findTrackSeeds(reco::HitPairListPtr &hitPairListPtr, reco::PrincipalComponents &inputPCA, SeedHitPairListPairVec &seedHitMap) const
Given the list of hits this will search for candidate Seed objects and return them.
std::unique_ptr< std::vector< recob::Edge > > artVertexEdgeVector
const std::string instance
int m_hits3D
Keeps track of the number of 3D hits made.
float getTotalCharge() const
Hit has been rejected for any reason.
reco::EdgeList & getBestEdgeList()
int getNumHitsUsed() const
HoughSeedFinderAlg class.
boost::graph_traits< ModuleGraph >::edge_descriptor Edge
std::list< HitPairListPtr > HitPairListPtrList
A utility class used in construction of 3D clusters.
reco::HitPairListPtr & getHitPairListPtr()
void ProduceArtClusters(util::GeometryUtilities const &gser, ArtOutputHandler &output, reco::HitPairList &hitPairList, reco::ClusterParametersList &clusterParametersList, IHit3DBuilder::RecobHitToPtrMap &hitToPtrMap) const
Top level output routine, allows checking cluster status.
bool m_onlyMakSpacePoints
If true we don't do the full cluster 3D processing.
void makePFPartSeedAssns(size_t numSeedsStart)
Cluster finding and building.
reco::PlaneToClusterParamsMap & getClusterParams()
HoughSeedFinderAlg m_seedFinderAlg
Seed finder.
std::unique_ptr< lar_cluster3d::IClusterAlg > m_clusterAlg
Algorithm to do 3D space point clustering.
std::unique_ptr< art::Assns< recob::PFParticle, recob::Seed > > artPFPartSeedAssociations
float m_makeHitsTime
Keeps track of time to build 3D hits.
std::unique_ptr< std::vector< recob::PFParticle > > artPFParticleVector
void makeSpacePointHitAssns(std::vector< recob::SpacePoint > &spacePointVector, RecobHitVector &recobHits, art::Assns< recob::Hit, recob::SpacePoint > &spHitAssns, const std::string &path="")
void GetSkeletonHits(const reco::HitPairListPtr &inputHitList, reco::HitPairListPtr &skeletonHitList) const
Return the skeleton hits from the input list.
art::Ptr< recob::Edge > makeEdgePtr(size_t index, const std::string &instance="")
float getDocaToAxis() const
art framework interface to geometry description
std::enable_if_t< std::is_arithmetic_v< T >, T > hypot(T x, T y)
static const SentryArgument_t Sentry
An instance of the sentry object.
float m_dbscanTime
Keeps track of time to run DBScan.
Hit has been used in Cluster Splitting MST.
void ImportHits(util::GeometryUtilities const &gser, Iter begin, Iter end)
Calls SetHits() with the hits in the sequence.
ClusterParametersList & daughterList()
std::unique_ptr< art::Assns< recob::Hit, recob::SpacePoint > > artPPHitAssociations
Overrides another ClusterParamsAlgBase class with selected constants.
const EigenValues & getEigenValues() const
art::PtrMaker< recob::Edge > fEdgePtrMaker
std::string m_extremeInstance
Instance name for the extreme points.
#define DEFINE_ART_MODULE(klass)
reco::PrincipalComponents & getFullPCA()
size_t countUltimateDaughters(reco::ClusterParameters &clusterParameters) const
Count number of end of line daughters.
float getChargeAsymmetry() const
art::PtrMaker< recob::SpacePoint > fSPPtrMakerPath
void push_back(Ptr< U > const &p)
void splitClustersWithMST(reco::ClusterParameters &clusterParameters, reco::ClusterParametersList &clusterParametersList) const
Attempt to split clusters by using a minimum spanning tree.
std::unique_ptr< std::vector< recob::SpacePoint > > artPathPointVector
void InitializeMonitoring()
Initialize the internal monitoring.
float m_finishTime
Keeps track of time to run output module.
Helper functions to create a cluster.
Wrapper for ClusterParamsAlgBase objects to accept diverse input.
std::unique_ptr< std::vector< recob::SpacePoint > > artSpacePointVector
float m_clusterMergeTime
Keeps track of the time to merge clusters.
const Eigen::Vector3f & getAvePosition() const
std::unique_ptr< art::Assns< recob::PFParticle, recob::PCAxis > > artPFPartAxisAssociations
std::unique_ptr< art::Assns< recob::Cluster, recob::Hit > > artClusterAssociations
PCASeedFinderAlg m_pcaSeedFinderAlg
Use PCA axis to find seeds.
ArtOutputHandler(art::Event &evt, std::string &pathName, std::string &vertexName, std::string &extremeName)
std::list< ConvexHullKinkTuple > ConvexHullKinkTupleList
void AverageSkeletonPositions(reco::HitPairListPtr &skeletonHitList) const
Modifies the position of input skeleton hits by averaging along the "best" wire direction.
Wrapper for ClusterParamsAlgBase objects to accept arbitrary input.
ParallelHitsSeedFinderAlg m_parallelHitsAlg
Deal with parallel hits clusters.
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
std::unique_ptr< std::vector< recob::Edge > > artEdgeVector
void MakeAndSavePCAPoints(ArtOutputHandler &, const reco::PrincipalComponents &, IdxToPCAMap &) const
std::list< const reco::ClusterHit3D * > HitPairListPtr
bool CreateAssn(PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX)
Creates a single one-to-one association.
std::unique_ptr< art::Assns< recob::Hit, recob::SpacePoint > > artSPHitAssociations
This provides an art tool interface definition for 3D Cluster algorithms.
double distance(double x1, double y1, double z1, double x2, double y2, double z2)
std::unique_ptr< art::Assns< recob::SpacePoint, recob::Edge > > artEdgePPAssociations
int m_hits
Keeps track of the number of hits seen.
void produce(art::Event &evt) override
size_t FindAndStoreDaughters(util::GeometryUtilities const &gser, ArtOutputHandler &output, reco::ClusterParameters &clusterParameters, size_t pfParticleParent, IdxToPCAMap &idxToPCAMap, IHit3DBuilder::RecobHitToPtrMap &hitToPtrMap, Hit3DToSPPtrMap &hit3DToSPPtrMap, Hit3DToSPPtrMap &best3DToSPPtrMap) const
This will produce art output for daughters noting that it needs to be done recursively.
Detector simulation of raw signals on wires.
bool operator()(const std::pair< float, const reco::ClusterHit3D * > &left, const std::pair< float, const reco::ClusterHit3D * > &right)
void MakeAndSaveSpacePoints(ArtOutputHandler &output, std::vector< recob::SpacePoint > &spacePointVec, art::Assns< recob::Hit, recob::SpacePoint > &spHitAssns, reco::HitPairListPtr &clusHitPairVector, IHit3DBuilder::RecobHitToPtrMap &hitToPtrMap, Hit3DToSPPtrMap &hit3DToSPPtrMap, const std::string &path="") const
Special routine to handle creating and saving space points.
This provides an art tool interface definition for tools which construct 3D hits used in 3D clusterin...
std::unique_ptr< art::Assns< recob::SpacePoint, recob::PFParticle > > artPFPartPPAssociations
std::unique_ptr< art::Assns< recob::PFParticle, recob::Cluster > > artPFPartClusAssociations
ProducesCollector & producesCollector() noexcept
float m_pathFindingTime
Keeps track of the path finding time.
virtual bool findTrackHits(reco::HitPairListPtr &hitPairListPtr, reco::PrincipalComponents &inputPCA, reco::HitPairListPtrList &hitPairListPtrList) const
Given the list of hits this will return the sets of hits which belong on the same line...
bool operator()(const reco::ClusterHit3D *hit3D) const
art::Ptr< recob::SpacePoint > makeSpacePointPtr(size_t index, const std::string &instance="")
std::unique_ptr< lar_cluster3d::IClusterParametersBuilder > m_clusterBuilder
Common cluster builder tool.
Cluster3D(fhicl::ParameterSet const &pset)
art::PtrMaker< recob::SpacePoint > fSPPtrMaker
Declaration of signal hit object.
std::unique_ptr< std::vector< recob::SpacePoint > > artExtremePointVector
Hierarchical representation of particle flow.
bool bitsAreSet(const unsigned int &bitsToCheck) const
void makePFPartPCAAssns()
const float getAveHitDoca() const
void makePFPartClusterAssns(size_t clusterStart)
Hit has been made into Space Point.
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
This provides an art tool interface definition for 3D Cluster algorithms.
void MakeAndSaveVertexPoints(ArtOutputHandler &, dcel2d::VertexList &, dcel2d::HalfEdgeList &) const
Special routine to handle creating and saving space points & edges associated to voronoi diagrams...
std::unique_ptr< std::vector< recob::Cluster > > artClusterVector
std::unique_ptr< lar_cluster3d::IClusterModAlg > m_clusterMergeAlg
Algorithm to do cluster merging.
size_t ConvertToArtOutput(util::GeometryUtilities const &gser, ArtOutputHandler &output, reco::ClusterParameters &clusterParameters, size_t pfParticleParent, IHit3DBuilder::RecobHitToPtrMap &hitToPtrMap, Hit3DToSPPtrMap &hit3DToSPPtrMap, Hit3DToSPPtrMap &best3DToSPPtrMap) const
Produces the art output from all the work done in this producer module.
std::unique_ptr< lar_cluster3d::IHit3DBuilder > m_hit3DBuilderAlg
Builds the 3D hits to operate on.
PrincipalComponentsAlg m_pcaAlg
Principal Components algorithm.
EventNumber_t event() const
std::unordered_map< const reco::ClusterHit2D *, ClusterToHitPairSetMap > Hit2DToClusterMap
art::PtrMaker< recob::Edge > fEdgePtrMakerPath
virtual bool findTrackSeeds(reco::HitPairListPtr &hitPairListPtr, reco::PrincipalComponents &inputPCA, SeedHitPairListPairVec &seedHitPairVec) const
Given the list of hits this will search for candidate Seed objects and return them.
std::vector< SeedHitPairListPair > SeedHitPairListPairVec
ClusterHit2DVec m_hitVector
2D representation of charge deposited in the TDC/wire plane
Algorithm collection class computing cluster parameters.
float getHitChiSquare() const
Definition of the Cluster3D class.
float m_artHitsTime
Keeps track of time to recover hits.
Interface to class computing cluster parameters.
std::string & fExtremeName
double accumulated_real_time() const
std::unique_ptr< std::vector< recob::PCAxis > > artPCAxisVector
Vertex * getTargetVertex() const
std::unique_ptr< art::Assns< recob::SpacePoint, recob::Edge > > artEdgeSPAssociations
std::unordered_map< const reco::ClusterHit3D *, art::Ptr< recob::SpacePoint >> Hit3DToSPPtrMap
void MakeAndSaveKinkPoints(ArtOutputHandler &output, reco::ConvexHullKinkTupleList &clusHitPairVector) const
Special routine to handle creating and saving space points.
std::vector< std::vector< double > > EigenVectors
std::unordered_map< const recob::Hit *, art::Ptr< recob::Hit >> RecobHitToPtrMap
Defines a structure mapping art representation to internal.
void PrepareEvent(const art::Event &evt)
Event Preparation.
const Coords & getCoords() const
std::list< Vertex > VertexList
virtual bool findTrackSeeds(reco::HitPairListPtr &hitPairListPtr, reco::PrincipalComponents &inputPCA, SeedHitPairListPairVec &seedHitMap) const
Given the list of hits this will search for candidate Seed objects and return them.
ParallelHitsSeedFinderAlg class.
void splitClustersWithHough(reco::ClusterParameters &clusterParameters, reco::ClusterParametersList &clusterParametersList) const
Attempt to split clusters using the output of the Hough Filter.
std::string m_pathInstance
Special instance for path points.
float m_totalTime
Keeps track of total execution time.
std::list< ClusterParameters > ClusterParametersList
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
const EigenVectors & getEigenVectors() const
QTextStream & endl(QTextStream &s)
std::unique_ptr< art::Assns< recob::Edge, recob::PFParticle > > artPFPartEdgeAssociations
std::unique_ptr< art::Assns< recob::Edge, recob::PFParticle > > artPFPartPathEdgeAssociations
void setStatusBit(unsigned bits) const
std::map< size_t, const reco::PrincipalComponents * > IdxToPCAMap
Special routine to handle creating and saving space points & edges PCA points.
bool m_enableMonitoring
Turn on monitoring of this algorithm.