All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PmaTrack3D.h
Go to the documentation of this file.
1 /**
2  * @file PmaTrack3D.h
3  *
4  * @author D.Stefan and R.Sulej
5  *
6  * @brief Implementation of the Projection Matching Algorithm
7  *
8  * Build 3D segments and whole tracks by simultaneous matching hits in 2D projections.
9  * Based on the "Precise 3D track reco..." AHEP (2013) 260820, with all the tricks that we
10  * developed later and with the work for the track-vertex topology optimization done at FNAL.
11  *
12  * Progress:
13  * May-June 2015: basic functionality for single (not-branching) 3D track optimization and dQ/dx.
14  * August 2015: 3D vertex finding and branching tracks optimization.
15  */
16 
17 #ifndef PmaTrack3D_h
18 #define PmaTrack3D_h
19 
20 #include "TVector2.h"
21 #include "TVector3.h"
22 
27 namespace detinfo {
28  class DetectorClocksData;
29  class DetectorPropertiesData;
30 }
31 
32 namespace pma {
33  class Segment3D;
34  class Track3D;
35 }
36 
37 #include <utility>
38 #include <vector>
39 
40 class pma::Track3D {
41 public:
42  enum ETrackEnd { kBegin = -1, kEnd = 1 };
43  enum EDirection { kForward = -1, kBackward = 1 };
44  enum ETag {
47  kEmLike = 1,
48  kStopping = 2,
49  kCosmic = 4,
50 
51  kGeometry_YY = 0x000100,
52  kGeometry_YZ = 0x000200,
53  kGeometry_ZZ = 0x000300,
54  kGeometry_XX = 0x000400,
55  kGeometry_XY = 0x000500,
56  kGeometry_XZ = 0x000600,
57 
58  kGeometry_Y = 0x001000,
59  kGeometry_Z = 0x002000,
60  kGeometry_X = 0x003000,
61 
64  kBeamIncompatible = 0x030000
65  };
66  ETag
67  GetTag() const noexcept
68  {
69  return fTag;
70  }
71  bool
72  HasTagFlag(ETag value) const noexcept
73  {
74  return (fTag & value);
75  }
76  void
78  {
79  fTag = (ETag)(fTag | value);
80  }
81 
82  Track3D();
83  Track3D(const Track3D& src);
84  ~Track3D();
85 
86  bool Initialize(detinfo::DetectorPropertiesData const& detProp, float initEndSegW = 0.05F);
87 
88  pma::Hit3D* release_at(size_t index);
89  void
91  {
92  hit->fParent = this;
93  fHits.push_back(hit);
94  }
95  bool push_back(const detinfo::DetectorPropertiesData& detProp, const art::Ptr<recob::Hit>& hit);
96  bool erase(const art::Ptr<recob::Hit>& hit);
97 
98  pma::Hit3D* operator[](size_t index) { return fHits[index]; }
99  pma::Hit3D const* operator[](size_t index) const { return fHits[index]; }
100  pma::Hit3D const*
101  front() const
102  {
103  return fHits.front();
104  }
105  pma::Hit3D const*
106  back() const
107  {
108  return fHits.back();
109  }
110  size_t
111  size() const
112  {
113  return fHits.size();
114  }
115 
116  int index_of(const pma::Hit3D* hit) const;
117  int index_of(const pma::Node3D* n) const;
118 
119  double
120  Length(size_t step = 1) const
121  {
122  return Length(0, size() - 1, step);
123  }
124  double Length(size_t start, size_t stop, size_t step = 1) const;
125 
126  double Dist2(const TVector2& p2d, unsigned int view, unsigned int tpc, unsigned int cryo) const;
127  double Dist2(const TVector3& p3d) const;
128 
129  /// Get trajectory direction at given hit index.
130  pma::Vector3D GetDirection3D(size_t index) const;
131 
132  /// Add hits; does not update hit->node/seg assignments nor hit projection to
133  /// track, so MakeProjection() and SortHits() should be called as needed.
135  const std::vector<art::Ptr<recob::Hit>>& hits);
136 
137  /// Remove hits; removes also hit->node/seg assignments.
138  void RemoveHits(const std::vector<art::Ptr<recob::Hit>>& hits);
139 
140  unsigned int NHits(unsigned int view) const;
141  unsigned int NEnabledHits(unsigned int view = geo::kUnknown) const;
142  bool HasTwoViews(size_t nmin = 1) const;
143 
144  std::vector<unsigned int> TPCs() const;
145  std::vector<unsigned int> Cryos() const;
146 
147  unsigned int
148  FrontTPC() const
149  {
150  return fNodes.front()->TPC();
151  }
152  unsigned int
153  FrontCryo() const
154  {
155  return fNodes.front()->Cryo();
156  }
157 
158  unsigned int
159  BackTPC() const
160  {
161  return fNodes.back()->TPC();
162  }
163  unsigned int
164  BackCryo() const
165  {
166  return fNodes.back()->Cryo();
167  }
168 
169  bool
170  HasTPC(int tpc) const
171  {
172  for (auto n : fNodes)
173  if (n->TPC() == tpc) return true;
174  return false;
175  }
176 
177  /// Rectangular region of the track 2D projection in view/tpc/cryo; first in
178  /// the returned pair is (min_wire; min_drift), second is (max_wire;
179  /// max_drift). Used for preselection of neighbouring hits in the track
180  /// validation functions.
181  std::pair<TVector2, TVector2> WireDriftRange(detinfo::DetectorPropertiesData const& detProp,
182  unsigned int view,
183  unsigned int tpc,
184  unsigned int cryo) const;
185 
186  /// Invert the order of hits and vertices in the track, break other tracks if
187  /// needed (new tracks are added to the allTracks vector). Returns true if
188  /// successful or false if any of required track flips was not possible (e.g.
189  /// resulting track would be composed of hits from a single 2D projection).
190  bool Flip(const detinfo::DetectorPropertiesData& detProp, std::vector<pma::Track3D*>& allTracks);
191 
192  /// Invert the order of hits and vertices in the track, will fail on
193  /// configuration that causes breaking another track.
194  void Flip();
195 
196  /// Check if the track can be flipped without breaking any other track.
197  bool CanFlip() const;
198 
199  void AutoFlip(pma::Track3D::EDirection dir, double thr = 0.0, unsigned int n = 0);
201  std::vector<pma::Track3D*>& allTracks,
203  double thr = 0.0,
204  unsigned int n = 0);
205 
206  /// MSE of 2D hits.
208  const std::vector<art::Ptr<recob::Hit>>& hits,
209  bool normalized = true) const; // normalize to the number of hits
210 
211  /// Count close 2D hits.
213  const std::vector<art::Ptr<recob::Hit>>& hits,
214  double dist = 0.4) const; // max acceptable distance [cm]
215 
216  int NextHit(int index, unsigned int view = geo::kZ, bool inclDisabled = false) const;
217  int PrevHit(int index, unsigned int view = geo::kZ, bool inclDisabled = false) const;
218 
219  /// Length of the track part associated with index'th hit. Calculated as a half distance to
220  /// the preceding hit plus half distance to the subsequent hit. In case of the first (last)
221  /// hit - missing part is estimated as 1/4 of the distance to the next (previous) hit.
222  /// NOTE: only hits from a given view are considered; other hits are accounted for
223  /// segment lengths but overall dx is calculated between hits in given view.
224  double HitDxByView(size_t index, unsigned int view) const;
225 
226  /// Sequence of <hit_index, (wire, drift, X, Y, Z, dE, dx, range)> values for the track,
227  /// hits tagged as outliers are skipped by default.
228  /** Results are pushed into the dedx vector given in the function arguments:
229 
230  hit (segment middle if many hits) 2D projection in view:
231  dedx[n][0] = wire;
232  dedx[n][1] = drift;
233 
234  hit (segment middle if many hits) 3D position [cm]:
235  dedx[n][2] = X;
236  dedx[n][3] = Y;
237  dedx[n][4] = Z;
238 
239  dedx[n][5] = dE [now ADC], energy assigned to the segment;
240 
241  dedx[n][6] = dx [cm], length of the segment.
242 
243  dedx[n][7] = range, total length to the track endpoint;
244 
245  Parameters:
246  dedx - vector to store results (empty at the begining);
247  view - view (U, V or Z) from which dedx is created;
248  skip - number of hits to skip at the begining (first hit has poorly estimated segment
249  length so it can be convenient to set skip=1 and handle first hit charge manually);
250  inclDisabled - if true then artificial hits added with CompleteMissingWires() are used,
251  otherwise only true hits found in ADC are used.
252 
253  Return value: sum of ADC's of hits skipped at the begining. */
254  double GetRawdEdxSequence(std::map<size_t, std::vector<double>>& dedx,
255  unsigned int view = geo::kZ,
256  unsigned int skip = 0,
257  bool inclDisabled = false) const;
258 
260  unsigned int wire,
261  unsigned int view) const;
262  size_t CompleteMissingWires(detinfo::DetectorPropertiesData const& detProp, unsigned int view);
263 
264  void
265  AddRefPoint(const TVector3& p)
266  {
267  fAssignedPoints.push_back(new TVector3(p));
268  }
269  void
270  AddRefPoint(double x, double y, double z)
271  {
272  fAssignedPoints.push_back(new TVector3(x, y, z));
273  }
274  bool HasRefPoint(TVector3* p) const;
275 
276  /// MSE of hits weighted with hit amplidudes and wire plane coefficients.
277  double GetMse(unsigned int view = geo::kUnknown) const;
278 
279  /// Objective function optimized in track reconstruction.
280  double GetObjFunction(float penaltyFactor = 1.0F) const;
281 
282  /// Main optimization method.
284  int nNodes = -1,
285  double eps = 0.01,
286  bool selAllHits = true,
287  bool setAllNodes = true,
288  size_t selSegHits = 0,
289  size_t selVtxHits = 0);
290 
291  void SortHitsInTree(bool skipFirst = false);
292  void MakeProjectionInTree(bool skipFirst = false);
293  bool UpdateParamsInTree(bool skipFirst, size_t& depth);
294  double GetObjFnInTree(bool skipFirst = false);
295  double TuneSinglePass(bool skipFirst = false);
296  double TuneFullTree(double eps = 0.001, double gmax = 50.0);
297 
298  /// Adjust track tree position in the drift direction (when T0 is being
299  /// corrected).
302  double dx,
303  bool skipFirst = false);
304  /// Function to convert dx into dT0
305  void SetT0FromDx(const detinfo::DetectorClocksData& clockData,
307  double dx);
308  double
309  GetT0() const
310  {
311  return fT0;
312  }
313  /// Check if the T0 has been set - enables us to distinguish between T0 set
314  /// very close to zero or not set.
315  bool
316  HasT0() const noexcept
317  {
318  return fT0Flag;
319  }
320 
321  /// Cut out tails with no hits assigned.
322  void CleanupTails();
323 
324  /// Move the first/last Node3D to the first/last hit in the track;
325  /// returns true if all OK, false if empty segments found.
326  bool ShiftEndsToHits();
327 
328  std::vector<pma::Segment3D*> const&
329  Segments() const noexcept
330  {
331  return fSegments;
332  }
333 
336 
337  std::vector<pma::Node3D*> const&
338  Nodes() const noexcept
339  {
340  return fNodes;
341  }
342  pma::Node3D*
343  FirstElement() const
344  {
345  return fNodes.front();
346  }
347  pma::Node3D*
348  LastElement() const
349  {
350  return fNodes.back();
351  }
352 
353  void AddNode(pma::Node3D* node);
354  void
356  TVector3 const& p3d,
357  unsigned int tpc,
358  unsigned int cryo)
359  {
360  double ds = fNodes.empty() ? 0 : fNodes.back()->GetDriftShift();
361  AddNode(new pma::Node3D(detProp, p3d, tpc, cryo, false, ds));
362  }
364 
366  TVector3 const& p3d,
367  size_t at_idx,
368  unsigned int tpc,
369  unsigned int cryo);
370  bool RemoveNode(size_t idx);
371 
373  size_t idx,
374  bool try_start_at_idx = true);
375 
376  bool AttachTo(pma::Node3D* vStart, bool noFlip = false);
377  bool AttachBackTo(pma::Node3D* vStart);
378  bool IsAttachedTo(pma::Track3D const* trk) const;
379 
380  /// Extend the track with everything from src, delete the src;
381  void ExtendWith(pma::Track3D* src);
382 
384  bool GetBranches(std::vector<pma::Track3D const*>& branches, bool skipFirst = false) const;
385 
386  void MakeProjection();
387  void UpdateProjection();
388  void SortHits();
389 
390  unsigned int DisableSingleViewEnds();
391  bool SelectHits(float fraction = 1.0F);
392  bool SelectRndHits(size_t segmax, size_t vtxmax);
393  bool SelectAllHits();
394 
395  float
397  {
398  return fEndSegWeight;
399  }
400  void
401  SetEndSegWeight(float value) noexcept
402  {
404  }
405 
406  float
407  GetPenalty() const noexcept
408  {
409  return fPenaltyFactor;
410  }
411  void
412  SetPenalty(float value) noexcept
413  {
415  }
416 
417  unsigned int
419  {
420  return fMaxHitsPerSeg;
421  }
422  void
423  SetMaxHitsPerSeg(unsigned int value) noexcept
424  {
426  }
427 
428 private:
429  void ClearNodes();
430  void MakeFastProjection();
431 
432  bool AttachToSameTPC(pma::Node3D* vStart);
433  bool AttachToOtherTPC(pma::Node3D* vStart);
434 
435  bool AttachBackToSameTPC(pma::Node3D* vStart);
436  bool AttachBackToOtherTPC(pma::Node3D* vStart);
437 
438  void InternalFlip(std::vector<pma::Track3D*>& toSort);
439 
440  void UpdateHitsRadius();
441  double AverageDist2() const;
442 
444  int tpc,
445  int cryo,
446  float initEndSegW = 0.05F);
447  bool InitFromRefPoints(detinfo::DetectorPropertiesData const& detProp, int tpc, int cryo);
448  void InitFromMiddle(detinfo::DetectorPropertiesData const& detProp, int tpc, int cryo);
449 
450  pma::Track3D* GetNearestTrkInTree(const TVector3& p3d_cm, double& dist, bool skipFirst = false);
451  pma::Track3D* GetNearestTrkInTree(const TVector2& p2d_cm,
452  unsigned int view,
453  unsigned int tpc,
454  unsigned int cryo,
455  double& dist,
456  bool skipFirst = false);
457  void ReassignHitsInTree(pma::Track3D* plRoot = nullptr);
458 
459  /// Distance to the nearest subsequent (dir = Track3D::kForward) or preceeding
460  /// (dir = Track3D::kBackward) hit in given view. In case of last (first) hit
461  /// in this view the half-distance in opposite direction is returned.
462  /// Parameter secondDir is only for internal protection - please leave the
463  /// default value.
464  double HitDxByView(size_t index,
465  unsigned int view,
467  bool secondDir = false) const;
468 
469  /// Calculate 3D position corresponding to 2D hit, return true if the 3D point
470  /// is in the same TPC as the hit, false otherwise. Calculates also distance^2
471  /// between the hit and 2D projection of the track. NOTE: results are
472  /// meaningful only if the function returns true.
474  art::Ptr<recob::Hit> hit,
475  TVector3& p3d,
476  double& dist2) const;
477 
478  void DeleteSegments();
479  void RebuildSegments();
480  bool SwapVertices(size_t v0, size_t v1);
481  bool UpdateParams();
482 
484 
485  std::vector<pma::Hit3D*> fHits;
486 
487  std::vector<TVector3*> fAssignedPoints;
488 
489  pma::Element3D* GetNearestElement(const TVector2& p2d,
490  unsigned int view,
491  int tpc = -1,
492  bool skipFrontVtx = false,
493  bool skipBackVtx = false) const;
494  pma::Element3D* GetNearestElement(const TVector3& p3d) const;
495 
496  std::vector<pma::Node3D*> fNodes;
497  std::vector<pma::Segment3D*> fSegments;
498 
499  unsigned int fMaxHitsPerSeg{70};
500  float fPenaltyFactor{1.0F};
501  float fMaxSegStopFactor{8.0F};
502 
503  unsigned int fSegStopValue{2};
504  unsigned int fMinSegStop{2};
505  unsigned int fMaxSegStop{2};
506 
507  float fSegStopFactor{0.2F};
508  float fPenaltyValue{0.1F};
509  float fEndSegWeight{0.05F};
510  float fHitsRadius{1.0F};
511 
512  double fT0{};
513  bool fT0Flag{false};
514 
516 };
517 
518 #endif
void MakeProjection()
bool SelectHits(float fraction=1.0F)
void AddHits(detinfo::DetectorPropertiesData const &detProp, const std::vector< art::Ptr< recob::Hit >> &hits)
Definition: PmaTrack3D.cxx:404
void MakeFastProjection()
process_name opflash particleana ie ie ie z
void AutoFlip(pma::Track3D::EDirection dir, double thr=0.0, unsigned int n=0)
Definition: PmaTrack3D.cxx:673
bool HasTPC(int tpc) const
Definition: PmaTrack3D.h:170
bool HasTagFlag(ETag value) const noexcept
Definition: PmaTrack3D.h:72
double GetMse(unsigned int view=geo::kUnknown) const
MSE of hits weighted with hit amplidudes and wire plane coefficients.
void SortHitsInTree(bool skipFirst=false)
bool AttachTo(pma::Node3D *vStart, bool noFlip=false)
void SetTagFlag(ETag value)
Definition: PmaTrack3D.h:77
double Dist2(const TVector2 &p2d, unsigned int view, unsigned int tpc, unsigned int cryo) const
void AddNode(detinfo::DetectorPropertiesData const &detProp, TVector3 const &p3d, unsigned int tpc, unsigned int cryo)
Definition: PmaTrack3D.h:355
bool IsAttachedTo(pma::Track3D const *trk) const
process_name opflash particleana ie x
bool SelectAllHits()
pma::Track3D * fParent
Definition: PmaHit3D.h:199
void ClearNodes()
Definition: PmaTrack3D.cxx:114
int PrevHit(int index, unsigned int view=geo::kZ, bool inclDisabled=false) const
Definition: PmaTrack3D.cxx:928
void ApplyDriftShiftInTree(const detinfo::DetectorClocksData &clockData, detinfo::DetectorPropertiesData const &detProp, double dx, bool skipFirst=false)
pma::Hit3D * operator[](size_t index)
Definition: PmaTrack3D.h:98
Unknown view.
Definition: geo_types.h:136
pma::Hit3D const * front() const
Definition: PmaTrack3D.h:101
unsigned int TestHits(detinfo::DetectorPropertiesData const &detProp, const std::vector< art::Ptr< recob::Hit >> &hits, double dist=0.4) const
Count close 2D hits.
Definition: PmaTrack3D.cxx:859
pdgs p
Definition: selectors.fcl:22
void ReassignHitsInTree(pma::Track3D *plRoot=nullptr)
int index_of(const pma::Hit3D *hit) const
Definition: PmaTrack3D.cxx:336
ETag GetTag() const noexcept
Definition: PmaTrack3D.h:67
void RebuildSegments()
bool AttachBackToSameTPC(pma::Node3D *vStart)
bool GetBranches(std::vector< pma::Track3D const * > &branches, bool skipFirst=false) const
bool AttachToOtherTPC(pma::Node3D *vStart)
bool CheckEndSegment(pma::Track3D::ETrackEnd endCode)
bool InitFromHits(detinfo::DetectorPropertiesData const &detProp, int tpc, int cryo, float initEndSegW=0.05F)
Definition: PmaTrack3D.cxx:122
float GetEndSegWeight() const noexcept
Definition: PmaTrack3D.h:396
double GetObjFunction(float penaltyFactor=1.0F) const
Objective function optimized in track reconstruction.
std::vector< pma::Node3D * > const & Nodes() const noexcept
Definition: PmaTrack3D.h:338
bool Initialize(detinfo::DetectorPropertiesData const &detProp, float initEndSegW=0.05F)
Definition: PmaTrack3D.cxx:78
float GetPenalty() const noexcept
Definition: PmaTrack3D.h:407
Planes which measure Z direction.
Definition: geo_types.h:132
Implementation of the Projection Matching Algorithm.
std::vector< unsigned int > TPCs() const
Definition: PmaTrack3D.cxx:453
void AddRefPoint(double x, double y, double z)
Definition: PmaTrack3D.h:270
process_name hit
Definition: cheaterreco.fcl:51
std::vector< pma::Segment3D * > fSegments
Definition: PmaTrack3D.h:497
bool AttachBackToOtherTPC(pma::Node3D *vStart)
float fPenaltyValue
Definition: PmaTrack3D.h:508
unsigned int BackTPC() const
Definition: PmaTrack3D.h:159
recob::tracking::Vector_t Vector3D
double TuneFullTree(double eps=0.001, double gmax=50.0)
pma::Vector3D GetDirection3D(size_t index) const
Get trajectory direction at given hit index.
Definition: PmaTrack3D.cxx:379
double Optimize(const detinfo::DetectorPropertiesData &detProp, int nNodes=-1, double eps=0.01, bool selAllHits=true, bool setAllNodes=true, size_t selSegHits=0, size_t selVtxHits=0)
Main optimization method.
double TuneSinglePass(bool skipFirst=false)
float fEndSegWeight
Definition: PmaTrack3D.h:509
void AddRefPoint(const TVector3 &p)
Definition: PmaTrack3D.h:265
unsigned int NEnabledHits(unsigned int view=geo::kUnknown) const
Definition: PmaTrack3D.cxx:433
std::vector< unsigned int > Cryos() const
Definition: PmaTrack3D.cxx:472
unsigned int BackCryo() const
Definition: PmaTrack3D.h:164
unsigned int fMaxHitsPerSeg
Definition: PmaTrack3D.h:499
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
pma::Track3D * Split(detinfo::DetectorPropertiesData const &detProp, size_t idx, bool try_start_at_idx=true)
void SetMaxHitsPerSeg(unsigned int value) noexcept
Definition: PmaTrack3D.h:423
double TestHitsMse(detinfo::DetectorPropertiesData const &detProp, const std::vector< art::Ptr< recob::Hit >> &hits, bool normalized=true) const
MSE of 2D hits.
Definition: PmaTrack3D.cxx:833
bool UpdateParamsInTree(bool skipFirst, size_t &depth)
bool CanFlip() const
Check if the track can be flipped without breaking any other track.
Definition: PmaTrack3D.cxx:654
double GetT0() const
Definition: PmaTrack3D.h:309
unsigned int fSegStopValue
Definition: PmaTrack3D.h:503
void ExtendWith(pma::Track3D *src)
Extend the track with everything from src, delete the src;.
void AddNode(pma::Node3D *node)
pma::Hit3D * release_at(size_t index)
Definition: PmaTrack3D.cxx:344
unsigned int NHits(unsigned int view) const
Definition: PmaTrack3D.cxx:423
pma::Node3D * FirstElement() const
Definition: PmaTrack3D.h:343
process_name opflash particleana ie ie y
std::vector< pma::Segment3D * > const & Segments() const noexcept
Definition: PmaTrack3D.h:329
pma::Node3D * LastElement() const
Definition: PmaTrack3D.h:348
pma::Track3D * GetRoot()
void SetEndSegWeight(float value) noexcept
Definition: PmaTrack3D.h:401
double fT0
Definition: PmaTrack3D.h:512
bool GetUnconstrainedProj3D(detinfo::DetectorPropertiesData const &detProp, art::Ptr< recob::Hit > hit, TVector3 &p3d, double &dist2) const
bool HasRefPoint(TVector3 *p) const
bool InitFromRefPoints(detinfo::DetectorPropertiesData const &detProp, int tpc, int cryo)
Definition: PmaTrack3D.cxx:212
std::vector< float > DriftsOfWireIntersection(detinfo::DetectorPropertiesData const &detProp, unsigned int wire, unsigned int view) const
void SetT0FromDx(const detinfo::DetectorClocksData &clockData, detinfo::DetectorPropertiesData const &detProp, double dx)
Function to convert dx into dT0.
Implementation of the Projection Matching Algorithm.
void RemoveHits(const std::vector< art::Ptr< recob::Hit >> &hits)
Remove hits; removes also hit-&gt;node/seg assignments.
Definition: PmaTrack3D.cxx:413
float fPenaltyFactor
Definition: PmaTrack3D.h:500
double GetObjFnInTree(bool skipFirst=false)
void InternalFlip(std::vector< pma::Track3D * > &toSort)
Definition: PmaTrack3D.cxx:605
unsigned int FrontTPC() const
Definition: PmaTrack3D.h:148
unsigned int FrontCryo() const
Definition: PmaTrack3D.h:153
bool erase(const art::Ptr< recob::Hit > &hit)
Definition: PmaTrack3D.cxx:365
void UpdateHitsRadius()
unsigned int DisableSingleViewEnds()
Definition of data types for geometry description.
bool AttachToSameTPC(pma::Node3D *vStart)
void InsertNode(detinfo::DetectorPropertiesData const &detProp, TVector3 const &p3d, size_t at_idx, unsigned int tpc, unsigned int cryo)
std::vector< pma::Node3D * > fNodes
Definition: PmaTrack3D.h:496
bool SelectRndHits(size_t segmax, size_t vtxmax)
unsigned int GetMaxHitsPerSeg() const noexcept
Definition: PmaTrack3D.h:418
tuple dir
Definition: dropbox.py:28
size_t CompleteMissingWires(detinfo::DetectorPropertiesData const &detProp, unsigned int view)
void InitFromMiddle(detinfo::DetectorPropertiesData const &detProp, int tpc, int cryo)
Definition: PmaTrack3D.cxx:300
void DeleteSegments()
void push_back(pma::Hit3D *hit)
Definition: PmaTrack3D.h:90
bool UpdateParams()
double AverageDist2() const
bool HasTwoViews(size_t nmin=1) const
Definition: PmaTrack3D.cxx:443
void CleanupTails()
Cut out tails with no hits assigned.
void MakeProjectionInTree(bool skipFirst=false)
double Length(size_t step=1) const
Definition: PmaTrack3D.h:120
double GetRawdEdxSequence(std::map< size_t, std::vector< double >> &dedx, unsigned int view=geo::kZ, unsigned int skip=0, bool inclDisabled=false) const
Contains all timing reference information for the detector.
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
std::vector< TVector3 * > fAssignedPoints
Definition: PmaTrack3D.h:487
pma::Segment3D * PrevSegment(pma::Node3D *vtx) const
bool RemoveNode(size_t idx)
bool HasT0() const noexcept
Definition: PmaTrack3D.h:316
float fSegStopFactor
Definition: PmaTrack3D.h:507
int NextHit(int index, unsigned int view=geo::kZ, bool inclDisabled=false) const
Definition: PmaTrack3D.cxx:910
pma::Hit3D const * back() const
Definition: PmaTrack3D.h:106
void SetPenalty(float value) noexcept
Definition: PmaTrack3D.h:412
double HitDxByView(size_t index, unsigned int view) const
bool SwapVertices(size_t v0, size_t v1)
pma::Hit3D const * operator[](size_t index) const
Definition: PmaTrack3D.h:99
temporary value
pma::Track3D * GetNearestTrkInTree(const TVector3 &p3d_cm, double &dist, bool skipFirst=false)
float fMaxSegStopFactor
Definition: PmaTrack3D.h:501
unsigned int fMinSegStop
Definition: PmaTrack3D.h:504
float fHitsRadius
Definition: PmaTrack3D.h:510
size_t size() const
Definition: PmaTrack3D.h:111
bool ShiftEndsToHits()
bool AttachBackTo(pma::Node3D *vStart)
unsigned int fMaxSegStop
Definition: PmaTrack3D.h:505
pma::Element3D * GetNearestElement(const TVector2 &p2d, unsigned int view, int tpc=-1, bool skipFrontVtx=false, bool skipBackVtx=false) const
pma::Segment3D * NextSegment(pma::Node3D *vtx) const
auto const detProp
std::pair< TVector2, TVector2 > WireDriftRange(detinfo::DetectorPropertiesData const &detProp, unsigned int view, unsigned int tpc, unsigned int cryo) const
Definition: PmaTrack3D.cxx:491
std::vector< pma::Hit3D * > fHits
Definition: PmaTrack3D.h:485
void UpdateProjection()