82 double Length(
size_t start,
size_t stop,
size_t step = 1)
const;
84 double Dist2(
const TVector2& p2d,
unsigned int view,
unsigned int tpc,
unsigned int cryo)
const;
85 double Dist2(
const TVector3& p3d)
const;
97 unsigned int NHits(
unsigned int view)
const;
101 std::vector< unsigned int >
TPCs(
void)
const;
102 std::vector< unsigned int >
Cryos(
void)
const;
112 for (
auto n :
fNodes)
if (n->
TPC() == tpc)
return true;
119 std::pair< TVector2, TVector2 >
WireDriftRange(
unsigned int view,
unsigned int tpc,
unsigned int cryo)
const;
125 bool Flip(std::vector< pma::Track3D* >& allTracks);
139 bool normalized =
true)
const;
143 double dist = 0.4)
const;
145 int NextHit(
int index,
unsigned int view =
geo::kZ,
bool inclDisabled =
false)
const;
146 int PrevHit(
int index,
unsigned int view =
geo::kZ,
bool inclDisabled =
false)
const;
153 double HitDxByView(
size_t index,
unsigned int view)
const;
184 unsigned int skip = 0,
bool inclDisabled =
false)
const;
200 double Optimize(
int nNodes = -1,
double eps = 0.01,
201 bool selAllHits =
true,
bool setAllNodes =
true,
202 size_t selSegHits = 0,
size_t selVtxHits = 0);
209 double TuneFullTree(
double eps = 0.001,
double gmax = 50.0);
232 std::vector< pma::Node3D* >
const &
Nodes(
void)
const {
return fNodes; }
237 void AddNode(TVector3
const & p3d,
unsigned int tpc,
unsigned int cryo)
239 double ds =
fNodes.empty() ? 0 :
fNodes.back()->GetDriftShift();
245 TVector3
const & p3d,
size_t at_idx,
246 unsigned int tpc,
unsigned int cryo);
259 bool GetBranches(std::vector< pma::Track3D const * >& branches,
bool skipFirst =
false)
const;
289 void InternalFlip(std::vector< pma::Track3D* >& toSort);
294 bool InitFromHits(
int tpc,
int cryo,
float initEndSegW = 0.05F);
300 unsigned int view,
unsigned int tpc,
unsigned int cryo,
301 double& dist,
bool skipFirst =
false);
327 bool skipFrontVtx =
false,
bool skipBackVtx =
false)
const;
unsigned int TestHits(const std::vector< art::Ptr< recob::Hit > > &hits, double dist=0.4) const
Count close 2D hits.
bool SelectHits(float fraction=1.0F)
std::vector< pma::Segment3D * > fSegments
bool HasTagFlag(ETag value) const
pma::Node3D * LastElement(void) const
std::vector< unsigned int > TPCs(void) const
void AutoFlip(pma::Track3D::EDirection dir, double thr=0.0, unsigned int n=0)
void CleanupTails(void)
Cut out tails with no hits assigned.
bool InitFromHits(int tpc, int cryo, float initEndSegW=0.05F)
bool HasTPC(int tpc) const
std::vector< float > DriftsOfWireIntersection(unsigned int wire, unsigned int view) const
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 UpdateProjection(void)
void SetTagFlag(ETag value)
double Dist2(const TVector2 &p2d, unsigned int view, unsigned int tpc, unsigned int cryo) const
void InsertNode(TVector3 const &p3d, size_t at_idx, unsigned int tpc, unsigned int cryo)
bool IsAttachedTo(pma::Track3D const *trk) const
unsigned int FrontTPC(void) const
unsigned int BackTPC(void) const
int PrevHit(int index, unsigned int view=geo::kZ, bool inclDisabled=false) const
float GetPenalty(void) const
Implementation of the Projection Matching Algorithm.
std::vector< pma::Node3D * > const & Nodes(void) const
int index_of(const pma::Hit3D *hit) const
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)
double GetObjFunction(float penaltyFactor=1.0F) const
Objective function optimized in track reconstruction.
void AddNode(TVector3 const &p3d, unsigned int tpc, unsigned int cryo)
bool GetUnconstrainedProj3D(art::Ptr< recob::Hit > hit, TVector3 &p3d, double &dist2) const
Planes which measure Z direction.
float GetEndSegWeight(void) const
Implementation of the Projection Matching Algorithm.
void AddRefPoint(double x, double y, double z)
void DeleteSegments(void)
pma::Track3D * Split(size_t idx, bool try_start_at_idx=true)
bool AttachBackToOtherTPC(pma::Node3D *vStart)
std::vector< pma::Segment3D * > const & Segments(void) const
void RemoveHits(const std::vector< art::Ptr< recob::Hit > > &hits)
Remove hits; removes also hit->node/seg assignments.
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.
double TuneSinglePass(bool skipFirst=false)
pma::Hit3D *& operator[](size_t index)
void AddRefPoint(const TVector3 &p)
double AverageDist2(void) const
unsigned int NEnabledHits(unsigned int view=geo::kUnknown) const
int TPC(void) const
TPC index or -1 if out of any TPC.
bool ShiftEndsToHits(void)
unsigned int fMaxHitsPerSeg
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
std::pair< TVector2, TVector2 > WireDriftRange(unsigned int view, unsigned int tpc, unsigned int cryo) const
unsigned int fSegStopValue
void ExtendWith(pma::Track3D *src)
Extend the track with everything from src, delete the src;.
pma::Hit3D * release_at(size_t index)
unsigned int NHits(unsigned int view) const
pma::Hit3D *const & back() const
void SetMaxHitsPerSeg(unsigned int value)
void MakeFastProjection(void)
void InitFromMiddle(int tpc, int cryo)
void SetPenalty(float value)
unsigned int BackCryo(void) const
bool HasRefPoint(TVector3 *p) const
void SetEndSegWeight(float value)
bool CanFlip(void) const
Check if the track can be flipped without breaking any other track.
size_t CompleteMissingWires(unsigned int view)
double Optimize(int nNodes=-1, double eps=0.01, bool selAllHits=true, bool setAllNodes=true, size_t selSegHits=0, size_t selVtxHits=0)
Main optimization method.
Implementation of the Projection Matching Algorithm.
unsigned int GetMaxHitsPerSeg(void) const
pma::Hit3D *const & front() const
void UpdateHitsRadius(void)
double GetObjFnInTree(bool skipFirst=false)
void InternalFlip(std::vector< pma::Track3D * > &toSort)
bool erase(const art::Ptr< recob::Hit > &hit)
bool AttachToSameTPC(pma::Node3D *vStart)
unsigned int FrontCryo(void) const
std::vector< unsigned int > Cryos(void) const
void RebuildSegments(void)
Detector simulation of raw signals on wires.
bool SelectRndHits(size_t segmax, size_t vtxmax)
double TestHitsMse(const std::vector< art::Ptr< recob::Hit > > &hits, bool normalized=true) const
MSE of 2D hits.
unsigned int DisableSingleViewEnds(void)
void push_back(pma::Hit3D *hit)
bool HasTwoViews(size_t nmin=1) const
void MakeProjectionInTree(bool skipFirst=false)
pma::Track3D * GetRoot(void)
std::string value(boost::any const &)
double Length(size_t step=1) const
bool UpdateParamsInTree(bool skipFirst=false)
pma::Segment3D * PrevSegment(pma::Node3D *vtx) const
bool RemoveNode(size_t idx)
void ReassignHitsInTree(pma::Track3D *plRoot=0)
bool Initialize(float initEndSegW=0.05F)
int NextHit(int index, unsigned int view=geo::kZ, bool inclDisabled=false) const
void MakeProjection(void)
void SetT0FromDx(double dx)
Function to convert dx into dT0.
double GetRawdEdxSequence(std::map< size_t, std::vector< double > > &dedx, unsigned int view=geo::kZ, unsigned int skip=0, bool inclDisabled=false) const
std::vector< pma::Node3D * > fNodes
double HitDxByView(size_t index, unsigned int view) const
bool SwapVertices(size_t v0, size_t v1)
pma::Track3D * GetNearestTrkInTree(const TVector3 &p3d_cm, double &dist, bool skipFirst=false)
std::vector< pma::Hit3D * > fHits
bool AttachBackTo(pma::Node3D *vStart)
pma::Node3D * FirstElement(void) const
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
void ApplyDriftShiftInTree(double dx, bool skipFirst=false)
Adjust track tree position in the drift direction (when T0 is being corrected).
std::vector< TVector3 * > fAssignedPoints
void AddHits(const std::vector< art::Ptr< recob::Hit > > &hits)
bool InitFromRefPoints(int tpc, int cryo)