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