28 class DetectorClocksData;
29 class DetectorPropertiesData;
61 kBeamIncompatible = 0x030000
71 return (fTag &
value);
76 fTag = (
ETag)(fTag | value);
100 return fHits.front();
121 double Length(
size_t start,
size_t stop,
size_t step = 1)
const;
123 double Dist2(
const TVector2& p2d,
unsigned int view,
unsigned int tpc,
unsigned int cryo)
const;
124 double Dist2(
const TVector3& p3d)
const;
137 unsigned int NHits(
unsigned int view)
const;
138 unsigned int NEnabledHits(
unsigned int view =
geo::kUnknown)
const;
139 bool HasTwoViews(
size_t nmin = 1)
const;
141 std::vector<unsigned int> TPCs()
const;
142 std::vector<unsigned int> Cryos()
const;
147 return fNodes.front()->TPC();
152 return fNodes.front()->Cryo();
158 return fNodes.back()->TPC();
163 return fNodes.back()->Cryo();
169 for (
auto n : fNodes)
170 if (n->
TPC() == tpc)
return true;
181 unsigned int cryo)
const;
194 bool CanFlip()
const;
198 std::vector<pma::Track3D*>& allTracks,
206 bool normalized =
true)
const;
211 double dist = 0.4)
const;
213 int NextHit(
int index,
unsigned int view =
geo::kZ,
bool inclDisabled =
false)
const;
214 int PrevHit(
int index,
unsigned int view =
geo::kZ,
bool inclDisabled =
false)
const;
221 double HitDxByView(
size_t index,
unsigned int view)
const;
251 double GetRawdEdxSequence(std::map<
size_t, std::vector<double>>& dedx,
253 unsigned int skip = 0,
254 bool inclDisabled =
false)
const;
258 unsigned int view)
const;
264 fAssignedPoints.push_back(
new TVector3(p));
269 fAssignedPoints.push_back(
new TVector3(x, y, z));
271 bool HasRefPoint(TVector3*
p)
const;
277 double GetObjFunction(
float penaltyFactor = 1.0F)
const;
283 bool selAllHits =
true,
284 bool setAllNodes =
true,
285 size_t selSegHits = 0,
286 size_t selVtxHits = 0);
288 void SortHitsInTree(
bool skipFirst =
false);
289 void MakeProjectionInTree(
bool skipFirst =
false);
290 bool UpdateParamsInTree(
bool skipFirst,
size_t& depth);
291 double GetObjFnInTree(
bool skipFirst =
false);
292 double TuneSinglePass(
bool skipFirst =
false);
293 double TuneFullTree(
double eps = 0.001,
double gmax = 50.0);
300 bool skipFirst =
false);
323 bool ShiftEndsToHits();
325 std::vector<pma::Segment3D*>
const&
334 std::vector<pma::Node3D*>
const&
342 return fNodes.front();
347 return fNodes.back();
357 double ds = fNodes.empty() ? 0 : fNodes.back()->GetDriftShift();
358 AddNode(
new pma::Node3D(detProp, p3d, tpc, cryo,
false, ds));
367 bool RemoveNode(
size_t idx);
371 bool try_start_at_idx =
true);
373 bool AttachTo(
pma::Node3D* vStart,
bool noFlip =
false);
381 bool GetBranches(std::vector<pma::Track3D const*>& branches,
bool skipFirst =
false)
const;
383 void MakeProjection();
384 void UpdateProjection();
387 unsigned int DisableSingleViewEnds();
388 bool SelectHits(
float fraction = 1.0F);
389 bool SelectRndHits(
size_t segmax,
size_t vtxmax);
390 bool SelectAllHits();
395 return fEndSegWeight;
400 fEndSegWeight =
value;
406 return fPenaltyFactor;
411 fPenaltyFactor =
value;
417 return fMaxHitsPerSeg;
422 fMaxHitsPerSeg =
value;
427 void MakeFastProjection();
435 void InternalFlip(std::vector<pma::Track3D*>& toSort);
437 void UpdateHitsRadius();
438 double AverageDist2()
const;
443 float initEndSegW = 0.05F);
447 pma::Track3D* GetNearestTrkInTree(
const TVector3& p3d_cm,
double&
dist,
bool skipFirst =
false);
448 pma::Track3D* GetNearestTrkInTree(
const TVector2& p2d_cm,
453 bool skipFirst =
false);
454 void ReassignHitsInTree(
pma::Track3D* plRoot =
nullptr);
461 double HitDxByView(
size_t index,
464 bool secondDir =
false)
const;
473 double& dist2)
const;
475 void DeleteSegments();
476 void RebuildSegments();
477 bool SwapVertices(
size_t v0,
size_t v1);
489 bool skipFrontVtx =
false,
490 bool skipBackVtx =
false)
const;
496 unsigned int fMaxHitsPerSeg{70};
497 float fPenaltyFactor{1.0F};
498 float fMaxSegStopFactor{8.0F};
500 unsigned int fSegStopValue{2};
501 unsigned int fMinSegStop{2};
502 unsigned int fMaxSegStop{2};
504 float fSegStopFactor{0.2F};
505 float fPenaltyValue{0.1F};
506 float fEndSegWeight{0.05F};
507 float fHitsRadius{1.0F};
float Length(const PFPStruct &pfp)
bool HasTPC(int tpc) const
void SetTagFlag(ETag value)
void AddNode(detinfo::DetectorPropertiesData const &detProp, TVector3 const &p3d, unsigned int tpc, unsigned int cryo)
double Dist2(const TVector2 &v1, const TVector2 &v2)
void AddHits(TCSlice &slc, Trajectory &tj, unsigned short ipt, bool &sigOK)
pma::Hit3D * operator[](size_t index)
pma::Hit3D const * front() const
Planes which measure Z direction.
Implementation of the Projection Matching Algorithm.
void AddRefPoint(double x, double y, double z)
std::vector< pma::Segment3D * > fSegments
unsigned int BackTPC() const
float GetPenalty() const noexcept
bool SortHits(HitLoc const &h1, HitLoc const &h2)
recob::tracking::Vector_t Vector3D
void AddRefPoint(const TVector3 &p)
int TPC(void) const
TPC index or -1 if out of any TPC.
unsigned int BackCryo() const
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
unsigned int GetMaxHitsPerSeg() const noexcept
void SetMaxHitsPerSeg(unsigned int value) noexcept
float GetEndSegWeight() const noexcept
fInnerVessel push_back(Point(-578.400000, 0.000000, 0.000000))
pma::Node3D * FirstElement() const
pma::Node3D * LastElement() const
bool HasTagFlag(ETag value) const noexcept
void SetEndSegWeight(float value) noexcept
std::vector< pma::Segment3D * > const & Segments() const noexcept
Implementation of the Projection Matching Algorithm.
unsigned int FrontTPC() const
unsigned int FrontCryo() const
General LArSoft Utilities.
ETag GetTag() const noexcept
Definition of data types for geometry description.
std::vector< pma::Node3D * > fNodes
Detector simulation of raw signals on wires.
void push_back(pma::Hit3D *hit)
Implementation of the Projection Matching Algorithm.
double Length(size_t step=1) const
vector< string > Split(string input, string delim)
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
bool HasT0() const noexcept
const unsigned int kCosmic
pma::Hit3D const * back() const
void SetPenalty(float value) noexcept
pma::Hit3D const * operator[](size_t index) const
std::vector< pma::Node3D * > const & Nodes() const noexcept
std::vector< pma::Hit3D * > fHits