Cluster3D.h
Go to the documentation of this file.
1 /**
2  *
3  * @brief Definition of utility objects for use in the 3D clustering for LArSoft
4  *
5  * The objects defined in this module are intended for internal use by the
6  * 3D clustering (see Cluster3D_module.cc in larreco/ClusterFinder).
7  * These objects mostly contain volatile information and are not suitable
8  * for storage in the art event store
9  *
10  * @author usher@slac.stanford.edu
11  *
12  */
13 
14 #ifndef RECO_CLUSTER3D_H
15 #define RECO_CLUSTER3D_H
16 
17 #include <iosfwd>
18 #include <vector>
19 #include <list>
20 #include <set>
21 #include <map>
22 #include <unordered_map>
23 
27 namespace recob { class Hit; }
28 
29 // Eigen
30 #include <Eigen/Core>
31 
32 namespace reco {
33 
34 // First define a container object to augment the sparse 2D hit information
36 {
37 public:
38 
39  ClusterHit2D(); // Default constructor
40 
41 private:
42 
43  mutable unsigned m_statusBits; ///< Volatile status information of this 3D hit
44  mutable float m_docaToAxis; ///< DOCA of hit at POCA to associated cluster axis
45  mutable float m_arcLenToPoca; ///< arc length to POCA along cluster axis
46  float m_xPosition; ///< The x coordinate for this hit
47  float m_timeTicks; ///< The time (in ticks) for this hit
48  geo::WireID m_wireID; ///< Keep track this particular hit's wireID
49  const recob::Hit* m_hit; ///< Hit we are augmenting
50 
51 public:
52 
53  enum StatusBits { SHAREDINPAIR = 0x00080000,
54  SHAREDINTRIPLET = 0x00040000,
55  USEDINPAIR = 0x00008000,
56  USEDINTRIPLET = 0x00004000,
57  SHAREDINCLUSTER = 0x00000200,
58  USEDINCLUSTER = 0x00000100,
59  USED = 0x00000001
60  };
61 
62  ClusterHit2D(unsigned statusBits,
63  float doca,
64  float poca,
65  float xPosition,
66  float timeTicks,
67  const geo::WireID& wireID,
68  const recob::Hit* recobHit);
69 
70  ClusterHit2D(const ClusterHit2D&);
71 
72  unsigned getStatusBits() const {return m_statusBits;}
73  float getDocaToAxis() const {return m_docaToAxis;}
74  float getArcLenToPoca() const {return m_arcLenToPoca;}
75  float getXPosition() const {return m_xPosition;}
76  float getTimeTicks() const {return m_timeTicks;}
77  const geo::WireID& WireID() const {return m_wireID;}
78  const recob::Hit* getHit() const {return m_hit;}
79 
80  void setStatusBit(unsigned bits) const {m_statusBits |= bits;}
81  void clearStatusBits(unsigned bits) const {m_statusBits &= ~bits;}
82  void setDocaToAxis(float doca) const {m_docaToAxis = doca;}
83  void setArcLenToPoca(float poca) const {m_arcLenToPoca = poca;}
84 
85  void setHit(const recob::Hit* hit) {m_hit = hit;}
86 
87  friend std::ostream& operator << (std::ostream& o, const ClusterHit2D& c);
88  friend bool operator < (const ClusterHit2D & a, const ClusterHit2D & b);
89 
90 };
91 
92 using ClusterHit2DVec = std::vector<const reco::ClusterHit2D*>;
93 
94 // Now define an object with the recob::Hit information that will comprise the 3D cluster
96 {
97 public:
98 
99  enum StatusBits { REJECTEDHIT = 0x80000000, ///< Hit has been rejected for any reason
100  SKELETONHIT = 0x10000000, ///< Hit is a "skeleton" hit
101  EDGEHIT = 0x20000000, ///< Hit is an "edge" hit
102  SEEDHIT = 0x40000000, ///< Hit is part of Seed for track fits
103  MADESPACEPOINT = 0x08000000, ///< Hit has been made into Space Point
104  CONVEXHULLVTX = 0x04000000, ///< Point is on primary cluster convex hull
105  EXTREMEPOINT = 0x02000000, ///< Is a convex hull extreme point
106  SKELETONPOSAVE = 0x00100000, ///< Skeleton hit position averaged
107  CLUSTERVISITED = 0x00008000, ///< "visited" by a clustering algorithm
108  CLUSTERNOISE = 0x00004000, ///< Labelled "noise" by a clustering algorithm
109  CLUSTERATTACHED = 0x00002000, ///< attached to a cluster
110  CLUSTERSHARED = 0x00001000, ///< 3D hit has 2D hits shared between clusters
111  PATHCHECKED = 0x00000800, ///< Path checking algorithm has seen this hit
112  SELECTEDBYMST = 0x00000100, ///< Hit has been used in Cluster Splitting MST
113  PCAOUTLIER = 0x00000080, ///< Hit labelled outlier in PCA
114  HITINVIEW0 = 0x00000001, ///< Hit contains 2D hit from view 0 (u plane)
115  HITINVIEW1 = 0x00000002, ///< Hit contains 2D hit from view 1 (v plane)
116  HITINVIEW2 = 0x00000004 ///< Hit contains 2D hit from view 2 (w plane)
117  };
118 
119 
120  ClusterHit3D(); // Default constructor
121 
122  ClusterHit3D(size_t id,
123  unsigned int statusBits,
124  const Eigen::Vector3f& position,
125  float totalCharge,
126  float avePeakTime,
127  float deltaPeakTime,
128  float sigmaPeakTime,
129  float hitChiSquare,
130  float overlapFraction,
131  float chargeAsymmetry,
132  float docaToAxis,
133  float arclenToPoca,
134  const ClusterHit2DVec& hitVec,
135  const std::vector<float>& hitDelTSigVec,
136  const std::vector<geo::WireID>& wireIDVec);
137 
138  ClusterHit3D(const ClusterHit3D&);
139 
140  void initialize(size_t id,
141  unsigned int statusBits,
142  const Eigen::Vector3f& position,
143  float totalCharge,
144  float avePeakTime,
145  float deltaPeakTime,
146  float sigmaPeakTime,
147  float hitChiSquare,
148  float overlapFraction,
149  float chargeAsymmetry,
150  float docaToAxis,
151  float arclenToPoca,
152  const ClusterHit2DVec& hitVec,
153  const std::vector<float>& hitDelTSigVec,
154  const std::vector<geo::WireID>& wireIDVec);
155 
156  size_t getID() const {return fID;}
157  unsigned int getStatusBits() const {return fStatusBits;}
158  const Eigen::Vector3f getPosition() const {return fPosition;}
159  float getX() const {return fPosition[0];}
160  float getY() const {return fPosition[1];}
161  float getZ() const {return fPosition[2];}
162  float getTotalCharge() const {return fTotalCharge;}
163  float getAvePeakTime() const {return fAvePeakTime;}
164  float getDeltaPeakTime() const {return fDeltaPeakTime;}
165  float getSigmaPeakTime() const {return fSigmaPeakTime;}
166  float getHitChiSquare() const {return fHitChiSquare;}
167  float getOverlapFraction() const {return fOverlapFraction;}
168  float getChargeAsymmetry() const {return fChargeAsymmetry;}
169  float getDocaToAxis() const {return fDocaToAxis;}
170  float getArclenToPoca() const {return fArclenToPoca;}
171  const ClusterHit2DVec& getHits() const {return fHitVector;}
172  const std::vector<float> getHitDelTSigVec() const {return fHitDelTSigVec;}
173  const std::vector<geo::WireID>& getWireIDs() const {return fWireIDVector;}
174 
175  ClusterHit2DVec& getHits() {return fHitVector;}
176 
177  bool bitsAreSet(const unsigned int& bitsToCheck) const {return fStatusBits & bitsToCheck;}
178 
179  void setID(const size_t& id) const {fID = id;}
180  void setStatusBit(unsigned bits) const {fStatusBits |= bits;}
181  void clearStatusBits(unsigned bits) const {fStatusBits &= ~bits;}
182  void setDocaToAxis(double doca) const {fDocaToAxis = doca;}
183  void setArclenToPoca(double poca) const {fArclenToPoca = poca;}
184  void setWireID(const geo::WireID& wid) const;
185 
186  void setPosition(const Eigen::Vector3f& pos) const {fPosition = pos;}
187 
188  const bool operator<(const reco::ClusterHit3D& other) const
189  {
190  if (fPosition[2] != other.fPosition[2]) return fPosition[2] < other.fPosition[2];
191  else return fPosition[0] < other.fPosition[0];
192  }
193 
194  const bool operator==(const reco::ClusterHit3D& other) const
195  {
196  return fID == other.fID;
197  }
198 
199  friend std::ostream& operator << (std::ostream& o, const ClusterHit3D& c);
200  //friend bool operator < (const ClusterHit3D & a, const ClusterHit3D & b);
201 
202 private:
203 
204  mutable size_t fID; ///< "id" of this hit (useful for indexing)
205  mutable unsigned int fStatusBits; ///< Volatile status information of this 3D hit
206  mutable Eigen::Vector3f fPosition; ///< position of this hit combination in world coordinates
207  float fTotalCharge; ///< Sum of charges of all associated recob::Hits
208  float fAvePeakTime; ///< Average peak time of all associated recob::Hits
209  float fDeltaPeakTime; ///< Largest delta peak time of associated recob::Hits
210  float fSigmaPeakTime; ///< Quad sum of peak time sigmas
211  float fHitChiSquare; ///< Hit ChiSquare relative to the average time
212  float fOverlapFraction; ///< Hit overlap fraction start/stop of triplet
213  float fChargeAsymmetry; ///< Assymetry of average of two closest to third charge
214  mutable float fDocaToAxis; ///< DOCA to the associated cluster axis
215  mutable float fArclenToPoca; ///< arc length along axis to DOCA point
216  ClusterHit2DVec fHitVector; ///< Hits comprising this 3D hit
217  mutable std::vector<float> fHitDelTSigVec; ///< Delta t of hit to matching pair / sig
218  mutable std::vector<geo::WireID> fWireIDVector; ///< Wire ID's for the planes making up hit
219 };
220 
221 // We also need to define a container for the output of the PCA Analysis
223 {
224 public:
225 
226  using EigenValues = Eigen::Vector3f;
227  using EigenVectors = Eigen::Matrix3f;
228 
230 
231 private:
232 
233  bool m_svdOK; ///< SVD Decomposition was successful
234  int m_numHitsUsed; ///< Number of hits in the decomposition
235  EigenValues m_eigenValues; ///< Eigen values from SVD decomposition
236  EigenVectors m_eigenVectors; ///< The three principle axes
237  Eigen::Vector3f m_avePosition; ///< Average position of hits fed to PCA
238  mutable double m_aveHitDoca; ///< Average doca of hits used in PCA
239 
240 public:
241 
242  PrincipalComponents(bool ok, int nHits, const EigenValues& eigenValues, const EigenVectors& eigenVecs, const Eigen::Vector3f& avePos, const float aveHitDoca = 9999.);
243 
244  bool getSvdOK() const {return m_svdOK;}
245  int getNumHitsUsed() const {return m_numHitsUsed;}
246  const EigenValues& getEigenValues() const {return m_eigenValues;}
247  const EigenVectors& getEigenVectors() const {return m_eigenVectors;}
248  const Eigen::Vector3f& getAvePosition() const {return m_avePosition;}
249  const float getAveHitDoca() const {return m_aveHitDoca;}
250 
251  void flipAxis(size_t axis);
252  void setAveHitDoca(double doca) const {m_aveHitDoca = doca;}
253 
254  friend std::ostream& operator << (std::ostream & o, const PrincipalComponents& a);
255  friend bool operator < (const PrincipalComponents& a, const PrincipalComponents& b);
256 
257 };
258 
260 {
261 public:
262 
263  Cluster3D(); ///Default constructor
264 
265 private:
266 
267  mutable unsigned m_statusBits; ///< Status bits for the cluster
268  PrincipalComponents m_pcaResults; ///< Output of the prinicipal componenets analysis
269  float m_totalCharge; ///< Total charge in the cluster
270  float m_startPosition[3]; ///< "start" position for cluster (world coordinates)
271  float m_endPosition[3]; ///< "end" position for cluster
272  int m_clusterIdx; ///< ID for this cluster
273 
274 public:
275  Cluster3D(unsigned statusBits,
276  const PrincipalComponents& pcaResults,
277  float totalCharge,
278  const float* startPosition,
279  const float* endPosition,
280  int idx);
281 
282  unsigned getStatusBits() const {return m_statusBits;}
283  const PrincipalComponents& getPcaResults() const {return m_pcaResults;}
284  float getTotalCharge() const {return m_totalCharge;}
285  const float* getStartPosition() const {return m_startPosition;}
286  const float* getEndPosition() const {return m_endPosition;}
287  int getClusterIdx() const {return m_clusterIdx;}
288 
289  void setStatusBit(unsigned bits) const {m_statusBits |= bits;}
290  void clearStatusBits(unsigned bits) const {m_statusBits &= ~bits;}
291 
293  friend std::ostream& operator << (std::ostream& o, const Cluster3D& c);
294  friend bool operator < (const Cluster3D & a, const Cluster3D & b);
295 };
296 
297 /**
298  * @brief A utility class used in construction of 3D clusters
299  */
301 {
302 public:
303  RecobClusterParameters() : m_startTime(999999.),
304  m_sigmaStartTime(1.),
305  m_endTime(0.),
306  m_sigmaEndTime(1.),
307  m_totalCharge(0.),
308  m_startWire(9999999),
309  m_endWire(0),
310  m_plane(geo::PlaneID()),
311  m_view(geo::kUnknown)
312  {
313  m_hitVector.clear();
314  }
315 
316  void UpdateParameters(const reco::ClusterHit2D* hit);
317 
318  float m_startTime;
320  float m_endTime;
323  unsigned int m_startWire;
324  unsigned int m_endWire;
328 };
329 
330 
331 /**
332  * @brief export some data structure definitions
333  */
334 using Hit2DListPtr = std::list<const reco::ClusterHit2D*>;
335 using HitPairListPtr = std::list<const reco::ClusterHit3D*>;
336 using HitPairSetPtr = std::set<const reco::ClusterHit3D*>;
337 using HitPairListPtrList = std::list<HitPairListPtr>;
338 using HitPairClusterMap = std::map<int, HitPairListPtr>;
339 using HitPairList = std::list<reco::ClusterHit3D>;
340 //using HitPairList = std::list<std::unique_ptr<reco::ClusterHit3D>>;
341 
342 using PCAHitPairClusterMapPair = std::pair<reco::PrincipalComponents, reco::HitPairClusterMap::iterator>;
343 using PlaneToClusterParamsMap = std::map<size_t, RecobClusterParameters>;
344 using EdgeTuple = std::tuple<const reco::ClusterHit3D*,const reco::ClusterHit3D*,double>;
345 using EdgeList = std::list<EdgeTuple>;
346 using Hit3DToEdgePair = std::pair<const reco::ClusterHit3D*, reco::EdgeList>;
347 using Hit3DToEdgeMap = std::unordered_map<const reco::ClusterHit3D*, reco::EdgeList>;
348 using Hit2DToHit3DListMap = std::unordered_map<const reco::ClusterHit2D*, reco::HitPairListPtr>;
349 //using VertexPoint = Eigen::Vector3f;
350 //using VertexPointList = std::list<Eigen::Vector3f>;
351 
352 using ProjectedPoint = std::tuple<float, float, const reco::ClusterHit3D*>; ///< Projected coordinates and pointer to hit
353 using ProjectedPointList = std::list<ProjectedPoint>;
354 using ConvexHullKinkTuple = std::tuple<ProjectedPoint, Eigen::Vector2f, Eigen::Vector2f>; ///< Point plus edges that point to it
355 using ConvexHullKinkTupleList = std::list<ConvexHullKinkTuple>;
356 
357 /**
358  * @brief Define a container for working with the convex hull
359  */
361 {
362 public:
364  {
365  fProjectedPointList.clear(),
366  fConvexHullPointList.clear(),
367  fConvexHullEdgeMap.clear(),
368  fConvexHullEdgeList.clear(),
369  fConvexHullExtremePoints.clear(),
370  fConvexHullKinkPoints.clear();
371  }
372 
373  void clear()
374  {
375  fProjectedPointList.clear(),
376  fConvexHullPointList.clear(),
377  fConvexHullEdgeMap.clear(),
378  fConvexHullEdgeList.clear(),
379  fConvexHullExtremePoints.clear(),
380  fConvexHullKinkPoints.clear();
381  }
382 
383  reco::ProjectedPointList& getProjectedPointList() {return fProjectedPointList;}
384  reco::ProjectedPointList& getConvexHullPointList() {return fConvexHullPointList;}
385  reco::Hit3DToEdgeMap& getConvexHullEdgeMap() {return fConvexHullEdgeMap;}
386  reco::EdgeList& getConvexHullEdgeList() {return fConvexHullEdgeList;}
387  reco::ProjectedPointList& getConvexHullExtremePoints() {return fConvexHullExtremePoints;}
388  reco::ConvexHullKinkTupleList& getConvexHullKinkPoints() {return fConvexHullKinkPoints;}
389 
390 
391 private:
392  reco::ProjectedPointList fProjectedPointList; ///< The input set of points projected onto plane encompassed by the hull
393  reco::ProjectedPointList fConvexHullPointList; ///< The points on the convex hull
394  reco::Hit3DToEdgeMap fConvexHullEdgeMap; ///< Map from 3D hit to associated edge
395  reco::EdgeList fConvexHullEdgeList; ///< An edge list translated back to 3D hits
396  reco::ProjectedPointList fConvexHullExtremePoints; ///< The points furthest from each other on hull
397  reco::ConvexHullKinkTupleList fConvexHullKinkPoints; ///< The points with large kinks along the convex hull
398 };
399 
400 /**
401  * @brief Class wrapping the above and containing volatile information to characterize the cluster
402  */
403 class ClusterParameters;
404 using ClusterParametersList = std::list<ClusterParameters>;
405 
407 {
408 public:
410  {
411  fClusterParams.clear();
412  fHitPairListPtr.clear();
413  fHit2DToHit3DListMap.clear();
414  fHit3DToEdgeMap.clear();
415  fBestHitPairListPtr.clear();
416  fBestEdgeList.clear();
417  fConvexHull.clear();
418  fFaceList.clear();
419  fVertexList.clear();
420  fHalfEdgeList.clear();
421  fClusterParameters.clear();
422  }
423 
424  ClusterParameters(reco::HitPairClusterMap::iterator& mapItr) : fHitPairListPtr(mapItr->second)
425  {
426  fClusterParams.clear();
427  fHit2DToHit3DListMap.clear();
428  fHit3DToEdgeMap.clear();
429  fBestHitPairListPtr.clear();
430  fBestEdgeList.clear();
431  fConvexHull.clear();
432  fFaceList.clear();
433  fVertexList.clear();
434  fHalfEdgeList.clear();
435  }
436 
437  ClusterParameters(reco::HitPairListPtr& hitList) : fHitPairListPtr(hitList)
438  {
439  fClusterParams.clear();
440  fHit2DToHit3DListMap.clear();
441  fHit3DToEdgeMap.clear();
442  fBestHitPairListPtr.clear();
443  fBestEdgeList.clear();
444  fConvexHull.clear();
445  fFaceList.clear();
446  fVertexList.clear();
447  fHalfEdgeList.clear();
448  }
449 
450  ClusterParametersList& daughterList() {return fClusterParameters;}
451 
453  {
454  fClusterParams[hit->WireID().Plane].UpdateParameters(hit);
455  }
456 
457  void addHit3D(const reco::ClusterHit3D* hit3D)
458  {
459  fHitPairListPtr.emplace_back(hit3D);
460 
461  for(const auto& hit2D : hit3D->getHits())
462  if (hit2D) fHit2DToHit3DListMap[hit2D].emplace_back(hit3D);
463  }
464 
466  {
467  for(const auto& hit3D : fHitPairListPtr)
468  {
469  for(const auto& hit2D : hit3D->getHits())
470  if (hit2D) fHit2DToHit3DListMap[hit2D].emplace_back(hit3D);
471  }
472  }
473 
475  reco::Hit2DToHit3DListMap& getHit2DToHit3DListMap() {return fHit2DToHit3DListMap;}
476  reco::HitPairListPtr& getHitPairListPtr() {return fHitPairListPtr;}
477  reco::PrincipalComponents& getFullPCA() {return fFullPCA;}
478  reco::PrincipalComponents& getSkeletonPCA() {return fSkeletonPCA;}
479  reco::Hit3DToEdgeMap& getHit3DToEdgeMap() {return fHit3DToEdgeMap;}
480  reco::HitPairListPtr& getBestHitPairListPtr() {return fBestHitPairListPtr;}
481  reco::EdgeList& getBestEdgeList() {return fBestEdgeList;}
482  reco::ConvexHull& getConvexHull() {return fConvexHull;}
483  dcel2d::FaceList& getFaceList() {return fFaceList;}
484  dcel2d::VertexList& getVertexList() {return fVertexList;}
485  dcel2d::HalfEdgeList& getHalfEdgeList() {return fHalfEdgeList;}
486 
487  friend bool operator < (const ClusterParameters &a, const ClusterParameters& b)
488  {
489  return a.fHitPairListPtr.size() > b.fHitPairListPtr.size();
490  }
491 
492 private:
494  reco::HitPairListPtr fHitPairListPtr; // This contains the list of 3D hits in the cluster
495  reco::Hit2DToHit3DListMap fHit2DToHit3DListMap; // Provides a mapping between 2D hits and 3D hits they make
496  reco::PrincipalComponents fFullPCA; // PCA run over full set of 3D hits
497  reco::PrincipalComponents fSkeletonPCA; // PCA run over just the "skeleton" 3D hits
500  reco::EdgeList fBestEdgeList; // This has become multiuse... really need to split it up
501  reco::ConvexHull fConvexHull; // Convex hull object
502  dcel2d::FaceList fFaceList; // Keeps track of "faces" from Voronoi Diagram
503  dcel2d::VertexList fVertexList; // Keeps track of "vertices" from Voronoi Diagram
504  dcel2d::HalfEdgeList fHalfEdgeList; // Keeps track of "halfedges" from Voronoi Diagram
505  ClusterParametersList fClusterParameters; // For possible daughter clusters
506 };
507 
508 using ClusterToHitPairSetPair = std::pair<reco::ClusterParameters*,HitPairSetPtr>;
509 using ClusterToHitPairSetMap = std::unordered_map<reco::ClusterParameters*,HitPairSetPtr>;
510 using Hit2DToHit3DSetMap = std::unordered_map<const reco::ClusterHit2D*,HitPairSetPtr>;
511 using Hit2DToClusterMap = std::unordered_map<const reco::ClusterHit2D*,ClusterToHitPairSetMap>;
512 
513 }
514 
515 #endif //RECO_CLUSTER3D_H
reco::HitPairListPtr & getBestHitPairListPtr()
Definition: Cluster3D.h:480
intermediate_table::iterator iterator
void setHit(const recob::Hit *hit)
Definition: Cluster3D.h:85
std::map< int, HitPairListPtr > HitPairClusterMap
Definition: Cluster3D.h:338
PrincipalComponents m_pcaResults
Output of the prinicipal componenets analysis.
Definition: Cluster3D.h:268
reco::ConvexHullKinkTupleList fConvexHullKinkPoints
The points with large kinks along the convex hull.
Definition: Cluster3D.h:397
void setAveHitDoca(double doca) const
Definition: Cluster3D.h:252
float fDeltaPeakTime
Largest delta peak time of associated recob::Hits.
Definition: Cluster3D.h:209
reco::HitPairListPtr fBestHitPairListPtr
Definition: Cluster3D.h:499
std::list< const reco::ClusterHit2D * > Hit2DListPtr
export some data structure definitions
Definition: Cluster3D.h:334
bool m_svdOK
SVD Decomposition was successful.
Definition: Cluster3D.h:233
std::list< reco::ClusterHit3D > HitPairList
Definition: Cluster3D.h:339
dcel2d::HalfEdgeList fHalfEdgeList
Definition: Cluster3D.h:504
bool getSvdOK() const
Definition: Cluster3D.h:244
unsigned m_statusBits
Default constructor.
Definition: Cluster3D.h:267
reco::PrincipalComponents fSkeletonPCA
Definition: Cluster3D.h:497
float getTotalCharge() const
Definition: Cluster3D.h:284
void clearStatusBits(unsigned bits) const
Definition: Cluster3D.h:81
float getTimeTicks() const
Definition: Cluster3D.h:76
Reconstruction base classes.
float fTotalCharge
Sum of charges of all associated recob::Hits.
Definition: Cluster3D.h:207
bool operator<(Cluster const &a, Cluster const &b)
Definition: Cluster.cxx:196
std::list< HalfEdge > HalfEdgeList
Definition: DCEL.h:184
double m_aveHitDoca
Average doca of hits used in PCA.
Definition: Cluster3D.h:238
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
const Eigen::Vector3f getPosition() const
Definition: Cluster3D.h:158
std::list< ProjectedPoint > ProjectedPointList
Definition: Cluster3D.h:353
void setArcLenToPoca(float poca) const
Definition: Cluster3D.h:83
const bool operator<(const reco::ClusterHit3D &other) const
Definition: Cluster3D.h:188
reco::PrincipalComponents & getSkeletonPCA()
Definition: Cluster3D.h:478
void clearStatusBits(unsigned bits) const
Definition: Cluster3D.h:181
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
void setArclenToPoca(double poca) const
Definition: Cluster3D.h:183
const geo::WireID & WireID() const
Definition: Cluster3D.h:77
void setDocaToAxis(double doca) const
Definition: Cluster3D.h:182
reco::Hit2DToHit3DListMap & getHit2DToHit3DListMap()
Definition: Cluster3D.h:475
const float * getStartPosition() const
Definition: Cluster3D.h:285
unsigned m_statusBits
Volatile status information of this 3D hit.
Definition: Cluster3D.h:43
dcel2d::VertexList fVertexList
Definition: Cluster3D.h:503
size_t fID
"id" of this hit (useful for indexing)
Definition: Cluster3D.h:204
const std::vector< float > getHitDelTSigVec() const
Definition: Cluster3D.h:172
reco::ConvexHull fConvexHull
Definition: Cluster3D.h:501
float getTotalCharge() const
Definition: Cluster3D.h:162
reco::EdgeList & getBestEdgeList()
Definition: Cluster3D.h:481
int getNumHitsUsed() const
Definition: Cluster3D.h:245
reco::Hit3DToEdgeMap & getHit3DToEdgeMap()
Definition: Cluster3D.h:479
std::list< HitPairListPtr > HitPairListPtrList
Definition: Cluster3D.h:337
A utility class used in construction of 3D clusters.
Definition: Cluster3D.h:300
reco::HitPairListPtr & getHitPairListPtr()
Definition: Cluster3D.h:476
float getSigmaPeakTime() const
Definition: Cluster3D.h:165
float fSigmaPeakTime
Quad sum of peak time sigmas.
Definition: Cluster3D.h:210
float m_docaToAxis
DOCA of hit at POCA to associated cluster axis.
Definition: Cluster3D.h:44
reco::PlaneToClusterParamsMap & getClusterParams()
Definition: Cluster3D.h:474
float fAvePeakTime
Average peak time of all associated recob::Hits.
Definition: Cluster3D.h:208
float getOverlapFraction() const
Definition: Cluster3D.h:167
reco::Hit3DToEdgeMap fHit3DToEdgeMap
Definition: Cluster3D.h:498
unsigned int getStatusBits() const
Definition: Cluster3D.h:157
const bool operator==(const reco::ClusterHit3D &other) const
Definition: Cluster3D.h:194
float getDocaToAxis() const
Definition: Cluster3D.h:169
const recob::Hit * getHit() const
Definition: Cluster3D.h:78
std::unordered_map< const reco::ClusterHit2D *, HitPairSetPtr > Hit2DToHit3DSetMap
Definition: Cluster3D.h:510
float getY() const
Definition: Cluster3D.h:160
unsigned getStatusBits() const
Definition: Cluster3D.h:282
std::vector< geo::WireID > fWireIDVector
Wire ID&#39;s for the planes making up hit.
Definition: Cluster3D.h:218
ClusterParametersList & daughterList()
Definition: Cluster3D.h:450
float getAvePeakTime() const
Definition: Cluster3D.h:163
float getDocaToAxis() const
Definition: Cluster3D.h:73
const float * getEndPosition() const
Definition: Cluster3D.h:286
std::vector< float > fHitDelTSigVec
Delta t of hit to matching pair / sig.
Definition: Cluster3D.h:217
std::pair< const reco::ClusterHit3D *, reco::EdgeList > Hit3DToEdgePair
Definition: Cluster3D.h:346
std::list< EdgeTuple > EdgeList
Definition: Cluster3D.h:345
EigenValues m_eigenValues
Eigen values from SVD decomposition.
Definition: Cluster3D.h:235
ClusterParametersList fClusterParameters
Definition: Cluster3D.h:505
const recob::Hit * m_hit
Hit we are augmenting.
Definition: Cluster3D.h:49
const EigenValues & getEigenValues() const
Definition: Cluster3D.h:246
PlaneToClusterParamsMap fClusterParams
Definition: Cluster3D.h:493
reco::PrincipalComponents & getFullPCA()
Definition: Cluster3D.h:477
reco::Hit3DToEdgeMap & getConvexHullEdgeMap()
Definition: Cluster3D.h:385
float getChargeAsymmetry() const
Definition: Cluster3D.h:168
float m_arcLenToPoca
arc length to POCA along cluster axis
Definition: Cluster3D.h:45
std::list< Face > FaceList
Definition: DCEL.h:183
float m_totalCharge
Total charge in the cluster.
Definition: Cluster3D.h:269
Eigen::Vector3f EigenValues
Definition: Cluster3D.h:226
unsigned int fStatusBits
Volatile status information of this 3D hit.
Definition: Cluster3D.h:205
reco::ProjectedPointList & getConvexHullExtremePoints()
Definition: Cluster3D.h:387
const double a
float m_timeTicks
The time (in ticks) for this hit.
Definition: Cluster3D.h:47
reco::ConvexHullKinkTupleList & getConvexHullKinkPoints()
Definition: Cluster3D.h:388
Define a container for working with the convex hull.
Definition: Cluster3D.h:360
std::unordered_map< const reco::ClusterHit2D *, reco::HitPairListPtr > Hit2DToHit3DListMap
Definition: Cluster3D.h:348
const Eigen::Vector3f & getAvePosition() const
Definition: Cluster3D.h:248
float fOverlapFraction
Hit overlap fraction start/stop of triplet.
Definition: Cluster3D.h:212
void clearStatusBits(unsigned bits) const
Definition: Cluster3D.h:290
reco::EdgeList fBestEdgeList
Definition: Cluster3D.h:500
std::list< ConvexHullKinkTuple > ConvexHullKinkTupleList
Definition: Cluster3D.h:355
size_t getID() const
Definition: Cluster3D.h:156
Eigen::Vector3f m_avePosition
Average position of hits fed to PCA.
Definition: Cluster3D.h:237
std::tuple< const reco::ClusterHit3D *, const reco::ClusterHit3D *, double > EdgeTuple
Definition: Cluster3D.h:344
std::list< const reco::ClusterHit3D * > HitPairListPtr
Definition: Cluster3D.h:335
void UpdateParameters(const reco::ClusterHit2D *hit)
Definition: Cluster3D.h:452
void setDocaToAxis(float doca) const
Definition: Cluster3D.h:82
float getXPosition() const
Definition: Cluster3D.h:75
reco::Hit2DToHit3DListMap fHit2DToHit3DListMap
Definition: Cluster3D.h:495
float fHitChiSquare
Hit ChiSquare relative to the average time.
Definition: Cluster3D.h:211
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:493
float fDocaToAxis
DOCA to the associated cluster axis.
Definition: Cluster3D.h:214
std::pair< reco::ClusterParameters *, HitPairSetPtr > ClusterToHitPairSetPair
Definition: Cluster3D.h:508
Definition of data types for geometry description.
reco::EdgeList fConvexHullEdgeList
An edge list translated back to 3D hits.
Definition: Cluster3D.h:395
Detector simulation of raw signals on wires.
std::vector< const reco::ClusterHit2D * > ClusterHit2DVec
Definition: Cluster3D.h:92
std::tuple< ProjectedPoint, Eigen::Vector2f, Eigen::Vector2f > ConvexHullKinkTuple
Point plus edges that point to it.
Definition: Cluster3D.h:354
std::pair< reco::PrincipalComponents, reco::HitPairClusterMap::iterator > PCAHitPairClusterMapPair
Definition: Cluster3D.h:342
reco::ConvexHull & getConvexHull()
Definition: Cluster3D.h:482
Declaration of signal hit object.
reco::ProjectedPointList fConvexHullPointList
The points on the convex hull.
Definition: Cluster3D.h:393
reco::Hit3DToEdgeMap fConvexHullEdgeMap
Map from 3D hit to associated edge.
Definition: Cluster3D.h:394
ClusterHit2DVec & getHits()
Definition: Cluster3D.h:175
void setID(const size_t &id) const
Definition: Cluster3D.h:179
bool bitsAreSet(const unsigned int &bitsToCheck) const
Definition: Cluster3D.h:177
DoubleProduct operator+(DoubleProduct const &left, DoubleProduct const right)
Definition: ToyProducts.h:97
const PrincipalComponents & getPcaResults() const
Definition: Cluster3D.h:283
float fChargeAsymmetry
Assymetry of average of two closest to third charge.
Definition: Cluster3D.h:213
const float getAveHitDoca() const
Definition: Cluster3D.h:249
dcel2d::FaceList & getFaceList()
Definition: Cluster3D.h:483
ClusterHit2DVec fHitVector
Hits comprising this 3D hit.
Definition: Cluster3D.h:216
float fArclenToPoca
arc length along axis to DOCA point
Definition: Cluster3D.h:215
geo::WireID m_wireID
Keep track this particular hit&#39;s wireID.
Definition: Cluster3D.h:48
const std::vector< geo::WireID > & getWireIDs() const
Definition: Cluster3D.h:173
Eigen::Matrix3f EigenVectors
Definition: Cluster3D.h:227
float getArclenToPoca() const
Definition: Cluster3D.h:170
std::map< size_t, RecobClusterParameters > PlaneToClusterParamsMap
Definition: Cluster3D.h:343
float getDeltaPeakTime() const
Definition: Cluster3D.h:164
static bool * b
Definition: config.cpp:1043
int m_clusterIdx
ID for this cluster.
Definition: Cluster3D.h:272
std::unordered_map< const reco::ClusterHit2D *, ClusterToHitPairSetMap > Hit2DToClusterMap
Definition: Cluster3D.h:511
reco::ProjectedPointList fProjectedPointList
The input set of points projected onto plane encompassed by the hull.
Definition: Cluster3D.h:392
ClusterParameters(reco::HitPairClusterMap::iterator &mapItr)
Definition: Cluster3D.h:424
detail::Node< FrameID, bool > PlaneID
Definition: CRTID.h:125
reco::PrincipalComponents fFullPCA
Definition: Cluster3D.h:496
ClusterHit2DVec m_hitVector
Definition: Cluster3D.h:327
dcel2d::FaceList fFaceList
Definition: Cluster3D.h:502
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:48
EigenVectors m_eigenVectors
The three principle axes.
Definition: Cluster3D.h:236
float getHitChiSquare() const
Definition: Cluster3D.h:166
float m_xPosition
The x coordinate for this hit.
Definition: Cluster3D.h:46
std::unordered_map< const reco::ClusterHit3D *, reco::EdgeList > Hit3DToEdgeMap
Definition: Cluster3D.h:347
reco::ProjectedPointList & getConvexHullPointList()
Definition: Cluster3D.h:384
reco::ProjectedPointList & getProjectedPointList()
Definition: Cluster3D.h:383
second_as<> second
Type of time stored in seconds, in double precision.
Definition: spacetime.h:85
void setStatusBit(unsigned bits) const
Definition: Cluster3D.h:289
std::unordered_map< reco::ClusterParameters *, HitPairSetPtr > ClusterToHitPairSetMap
Definition: Cluster3D.h:509
LArSoft geometry interface.
Definition: ChannelGeo.h:16
reco::EdgeList & getConvexHullEdgeList()
Definition: Cluster3D.h:386
const ClusterHit2DVec & getHits() const
Definition: Cluster3D.h:171
float getZ() const
Definition: Cluster3D.h:161
std::tuple< float, float, const reco::ClusterHit3D * > ProjectedPoint
Projected coordinates and pointer to hit.
Definition: Cluster3D.h:352
ClusterParameters(reco::HitPairListPtr &hitList)
Definition: Cluster3D.h:437
void setPosition(const Eigen::Vector3f &pos) const
Definition: Cluster3D.h:186
dcel2d::HalfEdgeList & getHalfEdgeList()
Definition: Cluster3D.h:485
std::list< Vertex > VertexList
Definition: DCEL.h:182
reco::HitPairListPtr fHitPairListPtr
Definition: Cluster3D.h:494
int getClusterIdx() const
Definition: Cluster3D.h:287
std::list< ClusterParameters > ClusterParametersList
Definition: Cluster3D.h:404
const EigenVectors & getEigenVectors() const
Definition: Cluster3D.h:247
std::ostream & operator<<(std::ostream &o, Cluster const &c)
Definition: Cluster.cxx:173
void addHit3D(const reco::ClusterHit3D *hit3D)
Definition: Cluster3D.h:457
dcel2d::VertexList & getVertexList()
Definition: Cluster3D.h:484
std::set< const reco::ClusterHit3D * > HitPairSetPtr
Definition: Cluster3D.h:336
Eigen::Vector3f fPosition
position of this hit combination in world coordinates
Definition: Cluster3D.h:206
float getArcLenToPoca() const
Definition: Cluster3D.h:74
float getX() const
Definition: Cluster3D.h:159
void fillHit2DToHit3DListMap()
Definition: Cluster3D.h:465
reco::ProjectedPointList fConvexHullExtremePoints
The points furthest from each other on hull.
Definition: Cluster3D.h:396
unsigned getStatusBits() const
Definition: Cluster3D.h:72
void setStatusBit(unsigned bits) const
Definition: Cluster3D.h:180
void setStatusBit(unsigned bits) const
Definition: Cluster3D.h:80
int m_numHitsUsed
Number of hits in the decomposition.
Definition: Cluster3D.h:234