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 SKELETONPOSAVE = 0x00100000,
98 CLUSTERVISITED = 0x00008000,
99 CLUSTERNOISE = 0x00004000,
100 CLUSTERATTACHED = 0x00002000,
101 CLUSTERSHARED = 0x00001000,
102 PATHCHECKED = 0x00000800,
103 SELECTEDBYMST = 0x00000100,
104 PCAOUTLIER = 0x00000080,
105 HITINVIEW0 = 0x00000001,
106 HITINVIEW1 = 0x00000002,
107 HITINVIEW2 = 0x00000004
114 unsigned int statusBits,
115 const float* position,
124 const std::vector<float>& hitDelTSigVec,
125 const std::vector<geo::WireID>& wireIDVec);
129 void initialize(
size_t id,
130 unsigned int statusBits,
131 const float* position,
140 const std::vector<float>& hitDelTSigVec,
141 const std::vector<geo::WireID>& wireIDVec);
146 float getX()
const {
return m_position[0];}
147 float getY()
const {
return m_position[1];}
148 float getZ()
const {
return m_position[2];}
158 const std::vector<geo::WireID>&
getWireIDs()
const {
return m_wireIDVector;}
162 void setID(
const size_t&
id)
const {m_id = id;}
169 void setPosition(
const float* pos)
const {m_position[0] = pos[0]; m_position[1] = pos[1]; m_position[2] = pos[2];}
174 else return m_position[0] < other.
m_position[0];
179 return m_id == other.
m_id;
189 mutable float m_position[3];
215 float m_eigenValues[3];
217 float m_avePosition[3];
222 PrincipalComponents(
bool ok,
int nHits,
const float* eigenValues,
const EigenVectors& eigenVecs,
const float* avePos,
const float aveHitDoca = 9999.);
231 void flipAxis(
size_t axis);
250 float m_startPosition[3];
251 float m_endPosition[3];
258 const float* startPosition,
259 const float* endPosition,
284 m_sigmaStartTime(1.),
288 m_startWire(9999999),
319 using HitPairList = std::list<std::unique_ptr<reco::ClusterHit3D>>;
323 using EdgeTuple = std::tuple<const reco::ClusterHit3D*,const reco::ClusterHit3D*,double>;
326 using Hit3DToEdgeMap = std::unordered_map<const reco::ClusterHit3D*, reco::EdgeList>;
342 m_clusterParams.clear();
343 m_hitPairListPtr.clear();
344 m_hit2DToHit3DListMap.clear();
345 m_hit3DToEdgeMap.clear();
346 m_bestHitPairListPtr.clear();
347 m_bestEdgeList.clear();
349 m_vertexList.clear();
350 m_halfEdgeList.clear();
351 m_clusterParameters.clear();
356 m_clusterParams.clear();
357 m_hit2DToHit3DListMap.clear();
358 m_hit3DToEdgeMap.clear();
359 m_bestHitPairListPtr.clear();
360 m_bestEdgeList.clear();
362 m_vertexList.clear();
363 m_halfEdgeList.clear();
368 m_clusterParams.clear();
369 m_hit2DToHit3DListMap.clear();
370 m_hit3DToEdgeMap.clear();
371 m_bestHitPairListPtr.clear();
372 m_bestEdgeList.clear();
374 m_vertexList.clear();
375 m_halfEdgeList.clear();
387 m_hitPairListPtr.emplace_back(hit3D);
389 for(
const auto& hit2D : hit3D->
getHits())
390 if (hit2D) m_hit2DToHit3DListMap[hit2D].emplace_back(hit3D);
395 for(
const auto& hit3D : m_hitPairListPtr)
397 for(
const auto& hit2D : hit3D->getHits())
398 if (hit2D) m_hit2DToHit3DListMap[hit2D].emplace_back(hit3D);
441 #endif //RECO_CLUSTER3D_H reco::HitPairListPtr & getBestHitPairListPtr()
dcel2d::VertexList m_vertexList
std::map< int, HitPairListPtr > HitPairClusterMap
PrincipalComponents m_pcaResults
Output of the prinicipal componenets analysis.
void setAveHitDoca(double doca) const
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)
unsigned m_statusBits
Default constructor.
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.
reco::Hit2DToHit3DListMap m_hit2DToHit3DListMap
geo::WireID WireID() const
Initial tdc tick for hit.
void setArcLenToPoca(float poca) const
const bool operator<(const reco::ClusterHit3D &other) const
reco::EdgeList m_bestEdgeList
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
dcel2d::FaceList m_faceList
reco::Hit2DToHit3DListMap & getHit2DToHit3DListMap()
const float * getStartPosition() const
unsigned m_statusBits
Volatile status information of this 3D hit.
const std::vector< float > getHitDelTSigVec() const
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
reco::PrincipalComponents m_skeletonPCA
float m_docaToAxis
DOCA of hit at POCA to associated cluster axis.
friend bool operator<(const ClusterHit2D &a, const ClusterHit2D &b)
reco::PlaneToClusterParamsMap & getClusterParams()
dcel2d::HalfEdgeList m_halfEdgeList
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
reco::HitPairListPtr m_bestHitPairListPtr
std::pair< const reco::ClusterHit3D *, reco::EdgeList > Hit3DToEdgePair
std::list< EdgeTuple > EdgeList
const recob::Hit * m_hit
Hit we are augmenting.
float m_avePeakTime
Average peak time of all associated recob::Hits.
reco::PrincipalComponents & getFullPCA()
float m_arcLenToPoca
arc length to POCA along cluster axis
std::list< Face > FaceList
float m_totalCharge
Total charge in the cluster.
ClusterParametersList m_clusterParameters
float m_docaToAxis
DOCA to the associated cluster axis.
float m_timeTicks
The time (in ticks) for this hit.
std::unordered_map< const reco::ClusterHit2D *, reco::HitPairListPtr > Hit2DToHit3DListMap
void clearStatusBits(unsigned bits) const
std::vector< geo::WireID > m_wireIDVector
Wire ID's for the planes making up hit.
const recob::Hit & getHit() const
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
PlaneToClusterParamsMap m_clusterParams
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
Detector simulation of raw signals on wires.
std::vector< const reco::ClusterHit2D * > ClusterHit2DVec
unsigned int m_statusBits
Volatile status information of this 3D hit.
std::pair< reco::PrincipalComponents, reco::HitPairClusterMap::iterator > PCAHitPairClusterMapPair
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()
reco::Hit3DToEdgeMap m_hit3DToEdgeMap
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
reco::PrincipalComponents m_fullPCA
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.
ClusterParameters(reco::HitPairClusterMap::iterator &mapItr)
ClusterHit2DVec m_hitVector
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::HitPairListPtr m_hitPairListPtr
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.
float m_position[3]
position of this hit combination in world coordinates
const ClusterHit2DVec & getHits() const
ClusterHit2DVec m_hitVector
Hits comprising this 3D hit.
ClusterParameters(reco::HitPairListPtr &hitList)
dcel2d::HalfEdgeList & getHalfEdgeList()
std::list< Vertex > VertexList
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()
unsigned getStatusBits() const
void setStatusBit(unsigned bits) const
void setStatusBit(unsigned bits) const
int m_numHitsUsed
Number of hits in the decomposition.