14 #ifndef RECO_CLUSTER3D_H 15 #define RECO_CLUSTER3D_H 21 #include <unordered_map> 51 SHAREDINPAIR = 0x00080000,
52 SHAREDINTRIPLET = 0x00040000,
53 USEDINPAIR = 0x00008000,
54 USEDINTRIPLET = 0x00004000,
55 SHAREDINCLUSTER = 0x00000200,
56 USEDINCLUSTER = 0x00000100,
96 REJECTEDHIT = 0x80000000,
97 SKELETONHIT = 0x10000000,
100 MADESPACEPOINT = 0x08000000,
101 CONVEXHULLVTX = 0x04000000,
102 EXTREMEPOINT = 0x02000000,
103 SKELETONPOSAVE = 0x00100000,
104 CLUSTERVISITED = 0x00008000,
105 CLUSTERNOISE = 0x00004000,
106 CLUSTERATTACHED = 0x00002000,
107 CLUSTERSHARED = 0x00001000,
108 PATHCHECKED = 0x00000800,
109 SELECTEDBYMST = 0x00000100,
110 PCAOUTLIER = 0x00000080,
111 HITINVIEW0 = 0x00000001,
112 HITINVIEW1 = 0x00000002,
113 HITINVIEW2 = 0x00000004
119 unsigned int statusBits,
120 const Eigen::Vector3f& position,
126 float overlapFraction,
127 float chargeAsymmetry,
131 const std::vector<float>& hitDelTSigVec,
132 const std::vector<geo::WireID>& wireIDVec);
137 void initialize(
size_t id,
138 unsigned int statusBits,
139 const Eigen::Vector3f& position,
145 float overlapFraction,
146 float chargeAsymmetry,
150 const std::vector<float>& hitDelTSigVec,
151 const std::vector<geo::WireID>& wireIDVec);
153 size_t getID()
const {
return fID; }
156 float getX()
const {
return fPosition[0]; }
157 float getY()
const {
return fPosition[1]; }
158 float getZ()
const {
return fPosition[2]; }
170 const std::vector<geo::WireID>&
getWireIDs()
const {
return fWireIDVector; }
174 bool bitsAreSet(
const unsigned int& bitsToCheck)
const {
return fStatusBits & bitsToCheck; }
176 void setID(
const size_t&
id)
const { fID = id; }
183 void setPosition(
const Eigen::Vector3f& pos)
const { fPosition = pos; }
188 return fPosition[2] < other.
fPosition[2];
190 return fPosition[0] < other.
fPosition[0];
237 const Eigen::Vector3f& avePos,
238 const float aveHitDoca = 9999.);
247 void flipAxis(
size_t axis);
262 float m_startPosition[3];
263 float m_endPosition[3];
270 const float* startPosition,
271 const float* endPosition,
295 : m_startTime(999999.)
296 , m_sigmaStartTime(1.)
300 , m_startWire(9999999)
334 std::pair<reco::PrincipalComponents, reco::HitPairClusterMap::iterator>;
336 using EdgeTuple = std::tuple<const reco::ClusterHit3D*, const reco::ClusterHit3D*, double>;
339 using Hit3DToEdgeMap = std::unordered_map<const reco::ClusterHit3D*, reco::EdgeList>;
345 tuple<float, float, const reco::ClusterHit3D*>;
348 tuple<ProjectedPoint, Eigen::Vector2f, Eigen::Vector2f>;
358 fProjectedPointList.clear(), fConvexHullPointList.clear(), fConvexHullEdgeMap.clear(),
359 fConvexHullEdgeList.clear(), fConvexHullExtremePoints.clear(),
360 fConvexHullKinkPoints.clear();
365 fProjectedPointList.clear(), fConvexHullPointList.clear(), fConvexHullEdgeMap.clear(),
366 fConvexHullEdgeList.clear(), fConvexHullExtremePoints.clear(),
367 fConvexHullKinkPoints.clear();
399 fClusterParams.clear();
400 fHitPairListPtr.clear();
401 fHit2DToHit3DListMap.clear();
402 fHit3DToEdgeMap.clear();
403 fBestHitPairListPtr.clear();
404 fBestEdgeList.clear();
408 fHalfEdgeList.clear();
409 fClusterParameters.clear();
414 fClusterParams.clear();
415 fHit2DToHit3DListMap.clear();
416 fHit3DToEdgeMap.clear();
417 fBestHitPairListPtr.clear();
418 fBestEdgeList.clear();
422 fHalfEdgeList.clear();
427 fClusterParams.clear();
428 fHit2DToHit3DListMap.clear();
429 fHit3DToEdgeMap.clear();
430 fBestHitPairListPtr.clear();
431 fBestEdgeList.clear();
435 fHalfEdgeList.clear();
442 fClusterParams[hit->
WireID().
Plane].UpdateParameters(hit);
447 fHitPairListPtr.emplace_back(hit3D);
449 for (
const auto& hit2D : hit3D->
getHits())
450 if (hit2D) fHit2DToHit3DListMap[hit2D].emplace_back(hit3D);
455 for (
const auto& hit3D : fHitPairListPtr) {
456 for (
const auto& hit2D : hit3D->getHits())
457 if (hit2D) fHit2DToHit3DListMap[hit2D].emplace_back(hit3D);
499 using Hit2DToClusterMap = std::unordered_map<const reco::ClusterHit2D*, ClusterToHitPairSetMap>;
503 #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::tuple< float, float, const reco::ClusterHit3D * > ProjectedPoint
Projected coordinates and pointer to hit.
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
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
std::unordered_map< reco::ClusterParameters *, HitPairSetPtr > ClusterToHitPairSetMap
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
float getDocaToAxis() const
const recob::Hit * getHit() const
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
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
float getAveHitDoca() const
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.
std::tuple< const reco::ClusterHit3D *, const reco::ClusterHit3D *, double > EdgeTuple
reco::ProjectedPointList & getConvexHullExtremePoints()
std::unordered_map< const reco::ClusterHit2D *, ClusterToHitPairSetMap > Hit2DToClusterMap
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::list< const reco::ClusterHit3D * > HitPairListPtr
void UpdateParameters(const reco::ClusterHit2D *hit)
void setDocaToAxis(float doca) const
float getXPosition() const
std::unordered_map< const reco::ClusterHit2D *, HitPairSetPtr > Hit2DToHit3DSetMap
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.
Definition of data types for geometry description.
friend bool operator<(const ClusterParameters &a, const ClusterParameters &b)
reco::EdgeList fConvexHullEdgeList
An edge list translated back to 3D hits.
Detector simulation of raw signals on wires.
std::vector< const reco::ClusterHit2D * > ClusterHit2DVec
bool operator==(const reco::ClusterHit3D &other) const
std::pair< reco::PrincipalComponents, reco::HitPairClusterMap::iterator > PCAHitPairClusterMapPair
reco::ConvexHull & getConvexHull()
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
const PrincipalComponents & getPcaResults() const
std::tuple< ProjectedPoint, Eigen::Vector2f, Eigen::Vector2f > ConvexHullKinkTuple
Point plus edges that point to it.
float fChargeAsymmetry
Assymetry of average of two closest to third charge.
QuadExpr operator+(double v, const QuadExpr &e)
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.
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
std::pair< reco::ClusterParameters *, HitPairSetPtr > ClusterToHitPairSetPair
float m_xPosition
The x coordinate for this hit.
std::unordered_map< const reco::ClusterHit3D *, reco::EdgeList > Hit3DToEdgeMap
bool operator<(const reco::ClusterHit3D &other) const
reco::ProjectedPointList & getConvexHullPointList()
reco::ProjectedPointList & getProjectedPointList()
second_as<> second
Type of time stored in seconds, in double precision.
void setStatusBit(unsigned bits) const
Namespace collecting geometry-related classes utilities.
reco::EdgeList & getConvexHullEdgeList()
const ClusterHit2DVec & getHits() const
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.