28 class DetectorClocksData;
29 class DetectorPropertiesData;
64 kBeamIncompatible = 0x030000
89 size_t size()
const {
return fHits.size(); }
95 double Length(
size_t start,
size_t stop,
size_t step = 1)
const;
97 double Dist2(
const TVector2& p2d,
unsigned int view,
unsigned int tpc,
unsigned int cryo)
const;
98 double Dist2(
const TVector3& p3d)
const;
111 unsigned int NHits(
unsigned int view)
const;
112 unsigned int NEnabledHits(
unsigned int view =
geo::kUnknown)
const;
113 bool HasTwoViews(
size_t nmin = 1)
const;
115 std::vector<unsigned int> TPCs()
const;
116 std::vector<unsigned int> Cryos()
const;
118 unsigned int FrontTPC()
const {
return fNodes.front()->TPC(); }
119 unsigned int FrontCryo()
const {
return fNodes.front()->Cryo(); }
121 unsigned int BackTPC()
const {
return fNodes.back()->TPC(); }
122 unsigned int BackCryo()
const {
return fNodes.back()->Cryo(); }
126 for (
auto n : fNodes)
127 if (n->
TPC() == tpc)
return true;
138 unsigned int cryo)
const;
151 bool CanFlip()
const;
155 std::vector<pma::Track3D*>& allTracks,
163 bool normalized =
true)
const;
168 double dist = 0.4)
const;
170 int NextHit(
int index,
unsigned int view =
geo::kZ,
bool inclDisabled =
false)
const;
171 int PrevHit(
int index,
unsigned int view =
geo::kZ,
bool inclDisabled =
false)
const;
178 double HitDxByView(
size_t index,
unsigned int view)
const;
208 double GetRawdEdxSequence(std::map<
size_t, std::vector<double>>& dedx,
210 unsigned int skip = 0,
211 bool inclDisabled =
false)
const;
215 unsigned int view)
const;
218 void AddRefPoint(
const TVector3& p) { fAssignedPoints.push_back(
new TVector3(p)); }
221 fAssignedPoints.push_back(
new TVector3(x, y, z));
223 bool HasRefPoint(TVector3* p)
const;
229 double GetObjFunction(
float penaltyFactor = 1.0F)
const;
235 bool selAllHits =
true,
236 bool setAllNodes =
true,
237 size_t selSegHits = 0,
238 size_t selVtxHits = 0);
240 void SortHitsInTree(
bool skipFirst =
false);
241 void MakeProjectionInTree(
bool skipFirst =
false);
242 bool UpdateParamsInTree(
bool skipFirst,
size_t& depth);
243 double GetObjFnInTree(
bool skipFirst =
false);
244 double TuneSinglePass(
bool skipFirst =
false);
245 double TuneFullTree(
double eps = 0.001,
double gmax = 50.0);
252 bool skipFirst =
false);
257 double GetT0()
const {
return fT0; }
260 bool HasT0() const noexcept {
return fT0Flag; }
267 bool ShiftEndsToHits();
269 std::vector<pma::Segment3D*>
const&
Segments() const noexcept {
return fSegments; }
274 std::vector<pma::Node3D*>
const&
Nodes() const noexcept {
return fNodes; }
284 double ds = fNodes.empty() ? 0 : fNodes.back()->GetDriftShift();
285 AddNode(
new pma::Node3D(detProp, p3d, tpc, cryo,
false, ds));
294 bool RemoveNode(
size_t idx);
298 bool try_start_at_idx =
true);
300 bool AttachTo(
pma::Node3D* vStart,
bool noFlip =
false);
308 bool GetBranches(std::vector<pma::Track3D const*>& branches,
bool skipFirst =
false)
const;
310 void MakeProjection();
311 void UpdateProjection();
314 unsigned int DisableSingleViewEnds();
315 bool SelectHits(
float fraction = 1.0F);
316 bool SelectRndHits(
size_t segmax,
size_t vtxmax);
317 bool SelectAllHits();
330 void MakeFastProjection();
338 void InternalFlip(std::vector<pma::Track3D*>& toSort);
340 void UpdateHitsRadius();
341 double AverageDist2()
const;
346 float initEndSegW = 0.05F);
350 pma::Track3D* GetNearestTrkInTree(
const TVector3& p3d_cm,
double&
dist,
bool skipFirst =
false);
351 pma::Track3D* GetNearestTrkInTree(
const TVector2& p2d_cm,
356 bool skipFirst =
false);
357 void ReassignHitsInTree(
pma::Track3D* plRoot =
nullptr);
364 double HitDxByView(
size_t index,
367 bool secondDir =
false)
const;
376 double& dist2)
const;
378 void DeleteSegments();
379 void RebuildSegments();
380 bool SwapVertices(
size_t v0,
size_t v1);
392 bool skipFrontVtx =
false,
393 bool skipBackVtx =
false)
const;
399 unsigned int fMaxHitsPerSeg{70};
400 float fPenaltyFactor{1.0F};
401 float fMaxSegStopFactor{8.0F};
403 unsigned int fSegStopValue{2};
404 unsigned int fMinSegStop{2};
405 unsigned int fMaxSegStop{2};
407 float fSegStopFactor{0.2F};
408 float fPenaltyValue{0.1F};
409 float fEndSegWeight{0.05F};
410 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
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
void SetMaxHitsPerSeg(unsigned int value) noexcept
float GetEndSegWeight() const noexcept
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
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
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