14 #ifndef RECO_CLUSTER3D_H 15 #define RECO_CLUSTER3D_H 22 #include <unordered_map> 54 SHAREDINTRIPLET = 0x00040000,
55 USEDINPAIR = 0x00008000,
56 USEDINTRIPLET = 0x00004000,
57 SHAREDINCLUSTER = 0x00000200,
58 USEDINCLUSTER = 0x00000100,
100 SKELETONHIT = 0x10000000,
101 EDGEHIT = 0x20000000,
102 SEEDHIT = 0x40000000,
103 MADESPACEPOINT = 0x08000000,
104 CONVEXHULLVTX = 0x04000000,
105 EXTREMEPOINT = 0x02000000,
106 SKELETONPOSAVE = 0x00100000,
107 CLUSTERVISITED = 0x00008000,
108 CLUSTERNOISE = 0x00004000,
109 CLUSTERATTACHED = 0x00002000,
110 CLUSTERSHARED = 0x00001000,
111 PATHCHECKED = 0x00000800,
112 SELECTEDBYMST = 0x00000100,
113 PCAOUTLIER = 0x00000080,
114 HITINVIEW0 = 0x00000001,
115 HITINVIEW1 = 0x00000002,
116 HITINVIEW2 = 0x00000004
123 unsigned int statusBits,
130 float overlapFraction,
131 float chargeAsymmetry,
135 const std::vector<float>& hitDelTSigVec,
136 const std::vector<geo::WireID>& wireIDVec);
140 void initialize(
size_t id,
141 unsigned int statusBits,
148 float overlapFraction,
149 float chargeAsymmetry,
153 const std::vector<float>& hitDelTSigVec,
154 const std::vector<geo::WireID>& wireIDVec);
159 float getX()
const {
return fPosition[0];}
160 float getY()
const {
return fPosition[1];}
161 float getZ()
const {
return fPosition[2];}
173 const std::vector<geo::WireID>&
getWireIDs()
const {
return fWireIDVector;}
177 bool bitsAreSet(
const unsigned int& bitsToCheck)
const {
return fStatusBits & bitsToCheck;}
179 void setID(
const size_t&
id)
const {fID = id;}
191 else return fPosition[0] < other.
fPosition[0];
196 return fID == other.
fID;
251 void flipAxis(
size_t axis);
270 float m_startPosition[3];
271 float m_endPosition[3];
278 const float* startPosition,
279 const float* endPosition,
304 m_sigmaStartTime(1.),
308 m_startWire(9999999),
344 using EdgeTuple = std::tuple<const reco::ClusterHit3D*,const reco::ClusterHit3D*,double>;
347 using Hit3DToEdgeMap = std::unordered_map<const reco::ClusterHit3D*, reco::EdgeList>;
365 fProjectedPointList.clear(),
366 fConvexHullPointList.clear(),
367 fConvexHullEdgeMap.clear(),
368 fConvexHullEdgeList.clear(),
369 fConvexHullExtremePoints.clear(),
370 fConvexHullKinkPoints.clear();
375 fProjectedPointList.clear(),
376 fConvexHullPointList.clear(),
377 fConvexHullEdgeMap.clear(),
378 fConvexHullEdgeList.clear(),
379 fConvexHullExtremePoints.clear(),
380 fConvexHullKinkPoints.clear();
411 fClusterParams.clear();
412 fHitPairListPtr.clear();
413 fHit2DToHit3DListMap.clear();
414 fHit3DToEdgeMap.clear();
415 fBestHitPairListPtr.clear();
416 fBestEdgeList.clear();
420 fHalfEdgeList.clear();
421 fClusterParameters.clear();
426 fClusterParams.clear();
427 fHit2DToHit3DListMap.clear();
428 fHit3DToEdgeMap.clear();
429 fBestHitPairListPtr.clear();
430 fBestEdgeList.clear();
434 fHalfEdgeList.clear();
439 fClusterParams.clear();
440 fHit2DToHit3DListMap.clear();
441 fHit3DToEdgeMap.clear();
442 fBestHitPairListPtr.clear();
443 fBestEdgeList.clear();
447 fHalfEdgeList.clear();
454 fClusterParams[hit->
WireID().
Plane].UpdateParameters(hit);
459 fHitPairListPtr.emplace_back(hit3D);
461 for(
const auto& hit2D : hit3D->
getHits())
462 if (hit2D) fHit2DToHit3DListMap[hit2D].emplace_back(hit3D);
467 for(
const auto& hit3D : fHitPairListPtr)
469 for(
const auto& hit2D : hit3D->getHits())
470 if (hit2D) fHit2DToHit3DListMap[hit2D].emplace_back(hit3D);
515 #endif //RECO_CLUSTER3D_H reco::HitPairListPtr & getBestHitPairListPtr()
void setHit(const recob::Hit *hit)
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
float fDeltaPeakTime
Largest delta peak time of associated recob::Hits.
reco::HitPairListPtr fBestHitPairListPtr
std::list< const reco::ClusterHit2D * > Hit2DListPtr
export some data structure definitions
bool m_svdOK
SVD Decomposition was successful.
std::list< reco::ClusterHit3D > HitPairList
dcel2d::HalfEdgeList fHalfEdgeList
unsigned m_statusBits
Default constructor.
reco::PrincipalComponents fSkeletonPCA
float getTotalCharge() const
void clearStatusBits(unsigned bits) const
float getTimeTicks() const
Reconstruction base classes.
float fTotalCharge
Sum of charges of all associated recob::Hits.
bool operator<(Cluster const &a, Cluster const &b)
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.
const Eigen::Vector3f getPosition() const
std::list< ProjectedPoint > ProjectedPointList
void setArcLenToPoca(float poca) const
const bool operator<(const reco::ClusterHit3D &other) const
reco::PrincipalComponents & getSkeletonPCA()
void clearStatusBits(unsigned bits) const
The data type to uniquely identify a Plane.
void setArclenToPoca(double poca) const
const geo::WireID & WireID() 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
size_t fID
"id" of this hit (useful for indexing)
const std::vector< float > getHitDelTSigVec() const
reco::ConvexHull fConvexHull
float getTotalCharge() const
reco::EdgeList & getBestEdgeList()
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 fSigmaPeakTime
Quad sum of peak time sigmas.
float m_docaToAxis
DOCA of hit at POCA to associated cluster axis.
reco::PlaneToClusterParamsMap & getClusterParams()
float fAvePeakTime
Average peak time of all associated recob::Hits.
float getOverlapFraction() const
reco::Hit3DToEdgeMap fHit3DToEdgeMap
unsigned int getStatusBits() const
const bool operator==(const reco::ClusterHit3D &other) const
float getDocaToAxis() const
const recob::Hit * getHit() const
std::unordered_map< const reco::ClusterHit2D *, HitPairSetPtr > Hit2DToHit3DSetMap
unsigned getStatusBits() const
std::vector< geo::WireID > fWireIDVector
Wire ID's for the planes making up hit.
ClusterParametersList & daughterList()
float getAvePeakTime() const
float getDocaToAxis() const
const float * getEndPosition() const
std::vector< float > fHitDelTSigVec
Delta t of hit to matching pair / sig.
std::pair< const reco::ClusterHit3D *, reco::EdgeList > Hit3DToEdgePair
std::list< EdgeTuple > EdgeList
EigenValues m_eigenValues
Eigen values from SVD decomposition.
ClusterParametersList fClusterParameters
const recob::Hit * m_hit
Hit we are augmenting.
const EigenValues & getEigenValues() const
PlaneToClusterParamsMap fClusterParams
reco::PrincipalComponents & getFullPCA()
reco::Hit3DToEdgeMap & getConvexHullEdgeMap()
float getChargeAsymmetry() const
float m_arcLenToPoca
arc length to POCA along cluster axis
std::list< Face > FaceList
float m_totalCharge
Total charge in the cluster.
Eigen::Vector3f EigenValues
unsigned int fStatusBits
Volatile status information of this 3D hit.
reco::ProjectedPointList & getConvexHullExtremePoints()
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
const Eigen::Vector3f & getAvePosition() const
float fOverlapFraction
Hit overlap fraction start/stop of triplet.
void clearStatusBits(unsigned bits) const
reco::EdgeList fBestEdgeList
std::list< ConvexHullKinkTuple > ConvexHullKinkTupleList
Eigen::Vector3f m_avePosition
Average position of hits fed to PCA.
std::tuple< const reco::ClusterHit3D *, const reco::ClusterHit3D *, double > EdgeTuple
std::list< const reco::ClusterHit3D * > HitPairListPtr
void UpdateParameters(const reco::ClusterHit2D *hit)
void setDocaToAxis(float doca) const
float getXPosition() const
reco::Hit2DToHit3DListMap fHit2DToHit3DListMap
float fHitChiSquare
Hit ChiSquare relative to the average time.
PlaneID_t Plane
Index of the plane within its TPC.
float fDocaToAxis
DOCA to the associated cluster axis.
std::pair< reco::ClusterParameters *, HitPairSetPtr > ClusterToHitPairSetPair
Definition of data types for geometry description.
reco::EdgeList fConvexHullEdgeList
An edge list translated back to 3D hits.
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.
std::pair< reco::PrincipalComponents, reco::HitPairClusterMap::iterator > PCAHitPairClusterMapPair
reco::ConvexHull & getConvexHull()
Declaration of signal hit object.
reco::ProjectedPointList fConvexHullPointList
The points on the convex hull.
reco::Hit3DToEdgeMap fConvexHullEdgeMap
Map from 3D hit to associated edge.
ClusterHit2DVec & getHits()
void setID(const size_t &id) const
bool bitsAreSet(const unsigned int &bitsToCheck) const
DoubleProduct operator+(DoubleProduct const &left, DoubleProduct const right)
const PrincipalComponents & getPcaResults() const
float fChargeAsymmetry
Assymetry of average of two closest to third charge.
const float getAveHitDoca() const
dcel2d::FaceList & getFaceList()
ClusterHit2DVec fHitVector
Hits comprising this 3D hit.
float fArclenToPoca
arc length along axis to DOCA point
geo::WireID m_wireID
Keep track this particular hit's wireID.
const std::vector< geo::WireID > & getWireIDs() const
Eigen::Matrix3f EigenVectors
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
reco::ProjectedPointList fProjectedPointList
The input set of points projected onto plane encompassed by the hull.
ClusterParameters(reco::HitPairClusterMap::iterator &mapItr)
detail::Node< FrameID, bool > PlaneID
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 & getConvexHullPointList()
reco::ProjectedPointList & getProjectedPointList()
second_as<> second
Type of time stored in seconds, in double precision.
void setStatusBit(unsigned bits) const
std::unordered_map< reco::ClusterParameters *, HitPairSetPtr > ClusterToHitPairSetMap
LArSoft geometry interface.
reco::EdgeList & getConvexHullEdgeList()
const ClusterHit2DVec & getHits() const
std::tuple< float, float, const reco::ClusterHit3D * > ProjectedPoint
Projected coordinates and pointer to hit.
ClusterParameters(reco::HitPairListPtr &hitList)
void setPosition(const Eigen::Vector3f &pos) const
dcel2d::HalfEdgeList & getHalfEdgeList()
std::list< Vertex > VertexList
reco::HitPairListPtr fHitPairListPtr
int getClusterIdx() const
std::list< ClusterParameters > ClusterParametersList
const EigenVectors & getEigenVectors() const
std::ostream & operator<<(std::ostream &o, Cluster const &c)
void addHit3D(const reco::ClusterHit3D *hit3D)
dcel2d::VertexList & getVertexList()
std::set< const reco::ClusterHit3D * > HitPairSetPtr
Eigen::Vector3f fPosition
position of this hit combination in world coordinates
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.