LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
TCVertex.h
Go to the documentation of this file.
1 //
3 //
4 // TCAlg vertex code
5 //
6 // Bruce Baller
7 //
9 #ifndef TRAJCLUSTERALGVERTEX_H
10 #define TRAJCLUSTERALGVERTEX_H
11 
12 
13 // C/C++ standard libraries
14 #include <array>
15 #include <vector>
16 #include <bitset>
17 #include <utility> // std::pair<>
18 #include <cmath>
19 #include <iostream>
20 #include <iomanip>
21 #include <algorithm>
22 
24 
25 // LArSoft libraries
30 
31 namespace tca {
32 
33  void MakeJunkVertices(TjStuff& tjs, const CTP_t& inCTP);
34  void Find2DVertices(TjStuff& tjs, const CTP_t& inCTP);
35  void FindNeutralVertices(TjStuff& tjs, const geo::TPCID& tpcid);
36  void MakeJunkTjVertices(TjStuff& tjs, const CTP_t& inCTP);
37  void ChkVxTjs(TjStuff& tjs, const CTP_t& inCTP, bool prt);
38  bool MergeWithVertex(TjStuff& tjs, VtxStore& vx2, unsigned short existingVxID, bool prt);
39  void SplitTrajCrossingVertices(TjStuff& tjs, CTP_t inCTP);
40  void FindHammerVertices(TjStuff& tjs, const CTP_t& inCTP);
41  void FindHammerVertices2(TjStuff& tjs, const CTP_t& inCTP);
42  void Find3DVertices(TjStuff& tjs, const geo::TPCID& tpcid);
43  void Match3DVtxTjs(TjStuff& tjsconst, const geo::TPCID& tpcid, bool prt);
44  void CompleteIncomplete3DVertices(TjStuff& tjs, const geo::TPCID& tpcid);
45  bool RefineVtxPosition(TjStuff& tjs, const Trajectory& tj, unsigned short& nearPt, short nPtsToChk, bool prt);
46  void CompleteIncomplete3DVerticesInGaps(TjStuff& tjs, const geo::TPCID& tpcid);
47  // Improve hit assignments near vertex
48  void VtxHitsSwap(TjStuff& tjs, const CTP_t inCTP);
49 
50  unsigned short TPNearVertex(TjStuff& tjs, const TrajPoint& tp);
51  bool AttachPFPToVertex(TjStuff& tjs, PFPStruct& pfp, unsigned short end, unsigned short vx3ID, bool prt);
52  bool AttachAnyTrajToVertex(TjStuff& tjs, unsigned short iv, bool prt);
53  bool AttachTrajToVertex(TjStuff& tjs, Trajectory& tj, VtxStore& vx, bool prt);
54  float TrajPointVertexPull(TjStuff& tjs, const TrajPoint& tp, const VtxStore& vx);
55  float VertexVertexPull(TjStuff& tjs, const Vtx3Store& vx1, const Vtx3Store& vx2);
56  float VertexVertexPull(TjStuff& tjs, const VtxStore& vx1, const VtxStore& vx2);
57  bool FitVertex(TjStuff& tjs, VtxStore& vx, bool prt);
58  bool FitVertex(TjStuff& tjs, VtxStore& vx, std::vector<TrajPoint> vxTp, bool prt);
59  bool StoreVertex(TjStuff& tjs, VtxStore& vx);
60  bool ChkVtxAssociations(TjStuff& tjs, const CTP_t& inCTP);
61  void ScoreVertices(TjStuff& tjs, const geo::TPCID& tpcid, bool prt);
62  void KillPoorVertices(TjStuff& tjs, const geo::TPCID& tpcid);
63  void SetVx2Score(TjStuff& tjs, bool prt);
64  void SetVx2Score(TjStuff& tjs, VtxStore& vx2, bool prt);
65  void SetVx3Score(TjStuff& tjs, Vtx3Store& vx3, bool prt);
66  unsigned short Vx3Topo(TjStuff& tjs, Vtx3Store& vx3);
67  void SetHighScoreBits(TjStuff& tjs, Vtx3Store& vx3);
68  bool MakeVertexObsolete(TjStuff& tjs, VtxStore& vx2, bool forceKill);
69  bool MakeVertexObsolete(TjStuff& tjs, Vtx3Store& vx3);
70  std::vector<int> GetVtxTjIDs(const TjStuff& tjs, const VtxStore& vx2);
71  std::vector<int> GetVtxTjIDs(const TjStuff& tjs, const Vtx3Store& vx3, float& score);
72  std::vector<unsigned short> GetPFPVertices(const TjStuff& tjs, const PFPStruct& pfp);
73  void PosInPlane(const TjStuff& tjs, const Vtx3Store& vx3, unsigned short plane, Point2_t& pos);
74  unsigned short IsCloseToVertex(TjStuff& tjs, VtxStore& vx);
75  unsigned short IsCloseToVertex(TjStuff& tjs, Vtx3Store& vx3);
76 } // namespace
77 
78 #endif // ifndef TRAJCLUSTERALGVERTEX_H
void SetVx3Score(TjStuff &tjs, Vtx3Store &vx3, bool prt)
Definition: TCVertex.cxx:2303
bool ChkVtxAssociations(TjStuff &tjs, const CTP_t &inCTP)
Definition: TCVertex.cxx:2128
float TrajPointVertexPull(TjStuff &tjs, const TrajPoint &tp, const VtxStore &vx)
Definition: TCVertex.cxx:1847
void Find3DVertices(TjStuff &tjs, const geo::TPCID &tpcid)
Definition: TCVertex.cxx:1215
bool RefineVtxPosition(TjStuff &tjs, const Trajectory &tj, unsigned short &nearPt, short nPtsToChk, bool prt)
Definition: TCVertex.cxx:2735
void CompleteIncomplete3DVertices(TjStuff &tjs, const geo::TPCID &tpcid)
Definition: TCVertex.cxx:2569
void SplitTrajCrossingVertices(TjStuff &tjs, CTP_t inCTP)
Definition: TCVertex.cxx:1091
bool FitVertex(TjStuff &tjs, VtxStore &vx, bool prt)
Definition: TCVertex.cxx:1946
bool AttachAnyTrajToVertex(TjStuff &tjs, unsigned short ivx, bool prt)
Definition: TCVertex.cxx:1689
void ChkVxTjs(TjStuff &tjs, const CTP_t &inCTP, bool prt)
Definition: TCVertex.cxx:715
unsigned short IsCloseToVertex(TjStuff &tjs, VtxStore &inVx2)
Definition: TCVertex.cxx:3093
std::vector< unsigned short > GetPFPVertices(const TjStuff &tjs, const PFPStruct &pfp)
Definition: TCVertex.cxx:3063
void SetHighScoreBits(TjStuff &tjs, Vtx3Store &vx3)
Definition: TCVertex.cxx:2256
bool AttachTrajToVertex(TjStuff &tjs, Trajectory &tj, VtxStore &vx, bool prt)
Definition: TCVertex.cxx:1712
void FindNeutralVertices(TjStuff &tjs, const geo::TPCID &tpcid)
Definition: TCVertex.cxx:369
bool AttachPFPToVertex(TjStuff &tjs, PFPStruct &pfp, unsigned short end, unsigned short vx3ID, bool prt)
Definition: TCVertex.cxx:1651
bool MakeVertexObsolete(TjStuff &tjs, VtxStore &vx2, bool forceKill)
Definition: TCVertex.cxx:2917
std::array< float, 2 > Point2_t
Definition: DataStructs.h:37
void MakeJunkVertices(TjStuff &tjs, const CTP_t &inCTP)
Definition: TCVertex.cxx:14
void Match3DVtxTjs(TjStuff &tjs, const geo::TPCID &tpcid, bool prt)
Definition: TCVertex.cxx:1506
void VtxHitsSwap(TjStuff &tjs, const CTP_t inCTP)
Definition: TCVertex.cxx:2758
void Find2DVertices(TjStuff &tjs, const CTP_t &inCTP)
Definition: TCVertex.cxx:114
void FindHammerVertices2(TjStuff &tjs, const CTP_t &inCTP)
Definition: TCVertex.cxx:819
void MakeJunkTjVertices(TjStuff &tjs, const CTP_t &inCTP)
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
Definition of data types for geometry description.
void ScoreVertices(TjStuff &tjs, const geo::TPCID &tpcid, bool prt)
Definition: TCVertex.cxx:2193
std::vector< int > GetVtxTjIDs(const TjStuff &tjs, const VtxStore &vx2)
Definition: TCVertex.cxx:3022
void CompleteIncomplete3DVerticesInGaps(TjStuff &tjs, const geo::TPCID &tpcid)
Definition: TCVertex.cxx:2478
unsigned int CTP_t
Definition: DataStructs.h:41
bool MergeWithVertex(TjStuff &tjs, VtxStore &vx, unsigned short oVxID, bool prt)
Definition: TCVertex.cxx:544
void FindHammerVertices(TjStuff &tjs, const CTP_t &inCTP)
Definition: TCVertex.cxx:995
void KillPoorVertices(TjStuff &tjs, const geo::TPCID &tpcid)
Definition: TCVertex.cxx:2233
void SetVx2Score(TjStuff &tjs, bool prt)
Definition: TCVertex.cxx:2322
unsigned short TPNearVertex(TjStuff &tjs, const TrajPoint &tp)
Definition: TCVertex.cxx:1637
void PosInPlane(const TjStuff &tjs, const Vtx3Store &vx3, unsigned short plane, Point2_t &pos)
Definition: TCVertex.cxx:3083
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
bool StoreVertex(TjStuff &tjs, VtxStore &vx)
Definition: TCVertex.cxx:1911
unsigned short Vx3Topo(TjStuff &tjs, Vtx3Store &vx3)
Definition: TCVertex.cxx:2450
float VertexVertexPull(TjStuff &tjs, const Vtx3Store &vx1, const Vtx3Store &vx2)
Definition: TCVertex.cxx:1882