14 #ifndef RECO_CLUSTER3D_H 15 #define RECO_CLUSTER3D_H 22 #include <unordered_map> 30 #include <Eigen/Dense> 93 SKELETONHIT = 0x10000000,
96 MADESPACEPOINT = 0x08000000,
97 CONVEXHULLVTX = 0x04000000,
98 EXTREMEPOINT = 0x02000000,
99 SKELETONPOSAVE = 0x00100000,
100 CLUSTERVISITED = 0x00008000,
101 CLUSTERNOISE = 0x00004000,
102 CLUSTERATTACHED = 0x00002000,
103 CLUSTERSHARED = 0x00001000,
104 PATHCHECKED = 0x00000800,
105 SELECTEDBYMST = 0x00000100,
106 PCAOUTLIER = 0x00000080,
107 HITINVIEW0 = 0x00000001,
108 HITINVIEW1 = 0x00000002,
109 HITINVIEW2 = 0x00000004
116 unsigned int statusBits,
117 const float* position,
126 const std::vector<float>& hitDelTSigVec,
127 const std::vector<geo::WireID>& wireIDVec);
131 void initialize(
size_t id,
132 unsigned int statusBits,
133 const float* position,
142 const std::vector<float>& hitDelTSigVec,
143 const std::vector<geo::WireID>& wireIDVec);
148 float getX()
const {
return m_position[0];}
149 float getY()
const {
return m_position[1];}
150 float getZ()
const {
return m_position[2];}
160 const std::vector<geo::WireID>&
getWireIDs()
const {
return m_wireIDVector;}
164 void setID(
const size_t&
id)
const {m_id = id;}
171 void setPosition(
const float* pos)
const {m_position[0] = pos[0]; m_position[1] = pos[1]; m_position[2] = pos[2];}
176 else return m_position[0] < other.
m_position[0];
181 return m_id == other.
m_id;
191 mutable float m_position[3];
217 float m_eigenValues[3];
219 float m_avePosition[3];
224 PrincipalComponents(
bool ok,
int nHits,
const float* eigenValues,
const EigenVectors& eigenVecs,
const float* avePos,
const float aveHitDoca = 9999.);
233 void flipAxis(
size_t axis);
252 float m_startPosition[3];
253 float m_endPosition[3];
260 const float* startPosition,
261 const float* endPosition,
286 m_sigmaStartTime(1.),
290 m_startWire(9999999),
321 using HitPairList = std::list<std::unique_ptr<reco::ClusterHit3D>>;
325 using EdgeTuple = std::tuple<const reco::ClusterHit3D*,const reco::ClusterHit3D*,double>;
328 using Hit3DToEdgeMap = std::unordered_map<const reco::ClusterHit3D*, reco::EdgeList>;
346 fProjectedPointList.clear(),
347 fConvexHullEdgeMap.clear(),
348 fConvexHullEdgeList.clear(),
349 fConvexHullExtremePoints.clear(),
350 fConvexHullKinkPoints.clear();
355 fProjectedPointList.clear(),
356 fConvexHullEdgeMap.clear(),
357 fConvexHullEdgeList.clear(),
358 fConvexHullExtremePoints.clear(),
359 fConvexHullKinkPoints.clear();
388 fClusterParams.clear();
389 fHitPairListPtr.clear();
390 fHit2DToHit3DListMap.clear();
391 fHit3DToEdgeMap.clear();
392 fBestHitPairListPtr.clear();
393 fBestEdgeList.clear();
397 fHalfEdgeList.clear();
398 fClusterParameters.clear();
403 fClusterParams.clear();
404 fHit2DToHit3DListMap.clear();
405 fHit3DToEdgeMap.clear();
406 fBestHitPairListPtr.clear();
407 fBestEdgeList.clear();
411 fHalfEdgeList.clear();
416 fClusterParams.clear();
417 fHit2DToHit3DListMap.clear();
418 fHit3DToEdgeMap.clear();
419 fBestHitPairListPtr.clear();
420 fBestEdgeList.clear();
424 fHalfEdgeList.clear();
436 fHitPairListPtr.emplace_back(hit3D);
438 for(
const auto& hit2D : hit3D->
getHits())
439 if (hit2D) fHit2DToHit3DListMap[hit2D].emplace_back(hit3D);
444 for(
const auto& hit3D : fHitPairListPtr)
446 for(
const auto& hit2D : hit3D->getHits())
447 if (hit2D) fHit2DToHit3DListMap[hit2D].emplace_back(hit3D);
492 #endif //RECO_CLUSTER3D_H reco::HitPairListPtr & getBestHitPairListPtr()
std::map< int, HitPairListPtr > HitPairClusterMap
PrincipalComponents m_pcaResults
Output of the prinicipal componenets analysis.
reco::ConvexHullKinkTupleList fConvexHullKinkPoints
The points with large kinks along the convex hull.
void setAveHitDoca(double doca) const
reco::HitPairListPtr fBestHitPairListPtr
std::list< const reco::ClusterHit2D * > Hit2DListPtr
export some data structure definitions
bool m_svdOK
SVD Decomposition was successful.
size_t m_id
"id" of this hit (useful for indexing)
dcel2d::HalfEdgeList fHalfEdgeList
unsigned m_statusBits
Default constructor.
reco::PrincipalComponents fSkeletonPCA
float getTotalCharge() const
void clearStatusBits(unsigned bits) const
float getTimeTicks() const
float m_hitChiSquare
Hit ChiSquare relative to the average time.
float m_arclenToPoca
arc length along axis to DOCA point
std::list< HalfEdge > HalfEdgeList
double m_aveHitDoca
Average doca of hits used in PCA.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
std::list< ProjectedPoint > ProjectedPointList
geo::WireID WireID() const
Initial tdc tick for hit.
void setArcLenToPoca(float poca) const
const bool operator<(const reco::ClusterHit3D &other) const
Declaration of signal hit object.
float m_deltaPeakTime
Largest delta peak time of associated recob::Hits.
reco::PrincipalComponents & getSkeletonPCA()
void clearStatusBits(unsigned bits) const
void setArclenToPoca(double poca) const
void setDocaToAxis(double doca) const
reco::Hit2DToHit3DListMap & getHit2DToHit3DListMap()
const float * getStartPosition() const
unsigned m_statusBits
Volatile status information of this 3D hit.
dcel2d::VertexList fVertexList
const std::vector< float > getHitDelTSigVec() const
reco::ConvexHull fConvexHull
float getTotalCharge() const
reco::EdgeList & getBestEdgeList()
const float * getAvePosition() const
int getNumHitsUsed() const
reco::Hit3DToEdgeMap & getHit3DToEdgeMap()
std::list< HitPairListPtr > HitPairListPtrList
A utility class used in construction of 3D clusters.
reco::HitPairListPtr & getHitPairListPtr()
float getSigmaPeakTime() const
float m_docaToAxis
DOCA of hit at POCA to associated cluster axis.
friend bool operator<(const ClusterHit2D &a, const ClusterHit2D &b)
reco::PlaneToClusterParamsMap & getClusterParams()
reco::Hit3DToEdgeMap fHit3DToEdgeMap
unsigned int getStatusBits() const
const bool operator==(const reco::ClusterHit3D &other) const
float getDocaToAxis() const
std::unordered_map< const reco::ClusterHit2D *, HitPairSetPtr > Hit2DToHit3DSetMap
std::list< std::unique_ptr< reco::ClusterHit3D >> HitPairList
unsigned getStatusBits() const
ClusterParametersList & daughterList()
float getAvePeakTime() const
float m_sigmaPeakTime
Quad sum of peak time sigmas.
float getDocaToAxis() const
const float * getEndPosition() const
std::pair< const reco::ClusterHit3D *, reco::EdgeList > Hit3DToEdgePair
std::list< EdgeTuple > EdgeList
ClusterParametersList fClusterParameters
const recob::Hit * m_hit
Hit we are augmenting.
float m_avePeakTime
Average peak time of all associated recob::Hits.
PlaneToClusterParamsMap fClusterParams
reco::PrincipalComponents & getFullPCA()
reco::Hit3DToEdgeMap & getConvexHullEdgeMap()
float m_arcLenToPoca
arc length to POCA along cluster axis
std::list< Face > FaceList
float m_totalCharge
Total charge in the cluster.
reco::ProjectedPointList & getConvexHullExtremePoints()
float m_docaToAxis
DOCA to the associated cluster axis.
float m_timeTicks
The time (in ticks) for this hit.
reco::ConvexHullKinkTupleList & getConvexHullKinkPoints()
Define a container for working with the convex hull.
std::unordered_map< const reco::ClusterHit2D *, reco::HitPairListPtr > Hit2DToHit3DListMap
void clearStatusBits(unsigned bits) const
reco::EdgeList fBestEdgeList
std::vector< geo::WireID > m_wireIDVector
Wire ID's for the planes making up hit.
const recob::Hit & getHit() const
std::list< ConvexHullKinkTuple > ConvexHullKinkTupleList
std::tuple< const reco::ClusterHit3D *, const reco::ClusterHit3D *, double > EdgeTuple
std::list< const reco::ClusterHit3D * > HitPairListPtr
void UpdateParameters(const reco::ClusterHit2D *hit)
float m_totalCharge
Sum of charges of all associated recob::Hits.
void setDocaToAxis(float doca) const
float getXPosition() const
std::vector< std::vector< float > > EigenVectors
reco::Hit2DToHit3DListMap fHit2DToHit3DListMap
PlaneID_t Plane
Index of the plane within its TPC.
std::pair< reco::ClusterParameters *, HitPairSetPtr > ClusterToHitPairSetPair
Definition of data types for geometry description.
const float * getPosition() const
reco::EdgeList fConvexHullEdgeList
This has become multiuse... really need to split it up.
Detector simulation of raw signals on wires.
std::vector< const reco::ClusterHit2D * > ClusterHit2DVec
std::tuple< ProjectedPoint, Eigen::Vector2f, Eigen::Vector2f > ConvexHullKinkTuple
Point plus edges that point to it.
unsigned int m_statusBits
Volatile status information of this 3D hit.
std::pair< reco::PrincipalComponents, reco::HitPairClusterMap::iterator > PCAHitPairClusterMapPair
reco::ConvexHull & getConvexHull()
reco::Hit3DToEdgeMap fConvexHullEdgeMap
Map from 3D hit to associated edge.
void setID(const size_t &id) const
bool bitsAreSet(const unsigned int &bitsToCheck) const
const float * getEigenValues() const
const PrincipalComponents & getPcaResults() const
void setPosition(const float *pos) const
const float getAveHitDoca() const
QuadExpr operator+(double v, const QuadExpr &e)
dcel2d::FaceList & getFaceList()
const std::vector< geo::WireID > & getWireIDs() const
Definition of utility objects for use in the 3D clustering for LArSoft.
float getArclenToPoca() const
std::map< size_t, RecobClusterParameters > PlaneToClusterParamsMap
float getDeltaPeakTime() const
int m_clusterIdx
ID for this cluster.
std::unordered_map< const reco::ClusterHit2D *, ClusterToHitPairSetMap > Hit2DToClusterMap
std::vector< float > m_hitDelTSigVec
Delta t of hit to matching pair / sig.
reco::ProjectedPointList fProjectedPointList
The input set of points projected onto plane encompassed by the hull.
ClusterParameters(reco::HitPairClusterMap::iterator &mapItr)
reco::PrincipalComponents fFullPCA
ClusterHit2DVec m_hitVector
dcel2d::FaceList fFaceList
2D representation of charge deposited in the TDC/wire plane
EigenVectors m_eigenVectors
The three principle axes.
float getHitChiSquare() const
float m_xPosition
The x coordinate for this hit.
std::unordered_map< const reco::ClusterHit3D *, reco::EdgeList > Hit3DToEdgeMap
reco::ProjectedPointList & getProjectedPointList()
friend std::ostream & operator<<(std::ostream &o, const ClusterHit2D &c)
void setStatusBit(unsigned bits) const
std::unordered_map< reco::ClusterParameters *, HitPairSetPtr > ClusterToHitPairSetMap
Namespace collecting geometry-related classes utilities.
reco::EdgeList & getConvexHullEdgeList()
float m_position[3]
position of this hit combination in world coordinates
const ClusterHit2DVec & getHits() const
ClusterHit2DVec m_hitVector
Hits comprising this 3D hit.
std::tuple< float, float, const reco::ClusterHit3D * > ProjectedPoint
Projected coordinates and pointer to hit.
ClusterParameters(reco::HitPairListPtr &hitList)
dcel2d::HalfEdgeList & getHalfEdgeList()
std::list< Vertex > VertexList
reco::HitPairListPtr fHitPairListPtr
int getClusterIdx() const
std::list< ClusterParameters > ClusterParametersList
const EigenVectors & getEigenVectors() const
void addHit3D(const reco::ClusterHit3D *hit3D)
dcel2d::VertexList & getVertexList()
std::set< const reco::ClusterHit3D * > HitPairSetPtr
float getArcLenToPoca() const
void fillHit2DToHit3DListMap()
reco::ProjectedPointList fConvexHullExtremePoints
The points furthest from each other on hull.
unsigned getStatusBits() const
void setStatusBit(unsigned bits) const
void setStatusBit(unsigned bits) const
int m_numHitsUsed
Number of hits in the decomposition.