LArSoft  v07_13_02
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
31 
32 namespace tca {
33 
34  extern TCEvent evt;
35  extern TCConfig tcc;
36 // extern HistStuff hist;
37  // vector of hits, tjs, etc in each slice
38  extern std::vector<TCSlice> slices;
39 
40  void MakeJunkVertices(TCSlice& slc, const CTP_t& inCTP);
41  void Find2DVertices(TCSlice& slc, const CTP_t& inCTP, unsigned short pass = USHRT_MAX);
42  void FindVtxTjs(TCSlice& slc, VtxStore& theVtx);
43  void FindNeutralVertices(TCSlice& slc);
44  void MakeJunkTjVertices(TCSlice& slc, const CTP_t& inCTP);
45  void ChkVxTjs(TCSlice& slc, const CTP_t& inCTP, bool prt);
46  bool MergeWithVertex(TCSlice& slc, VtxStore& vx2, unsigned short existingVxID);
47  void SplitTrajCrossingVertices(TCSlice& slc, CTP_t inCTP);
48  void FindHammerVertices(TCSlice& slc, const CTP_t& inCTP);
49  void FindHammerVertices2(TCSlice& slc, const CTP_t& inCTP);
50  void Find3DVertices(TCSlice& slc);
51  void Match3DVtxTjs(TCSlice& slc, bool prt);
52  void CompleteIncomplete3DVertices(TCSlice& slc);
53 // bool RefineVtxPosition(TCSlice& slc, const Trajectory& tj, unsigned short& nearPt, short nPtsToChk, bool prt);
54  void CompleteIncomplete3DVerticesInGaps(TCSlice& slc);
55  // Improve hit assignments near vertex
56  void VtxHitsSwap(TCSlice& slc, const CTP_t inCTP);
57 
58  unsigned short TPNearVertex(TCSlice& slc, const TrajPoint& tp);
59  bool AttachPFPToVertex(TCSlice& slc, PFPStruct& pfp, unsigned short end, unsigned short vx3ID, bool prt);
60  bool AttachAnyTrajToVertex(TCSlice& slc, unsigned short iv, bool prt);
61  bool AttachTrajToVertex(TCSlice& slc, Trajectory& tj, VtxStore& vx, bool prt);
62  float TrajPointVertexPull(TCSlice& slc, const TrajPoint& tp, const VtxStore& vx);
63  float VertexVertexPull(TCSlice& slc, const Vtx3Store& vx1, const Vtx3Store& vx2);
64  float VertexVertexPull(TCSlice& slc, const VtxStore& vx1, const VtxStore& vx2);
65  bool FitVertex(TCSlice& slc, VtxStore& vx, bool prt);
66  bool FitVertex(TCSlice& slc, VtxStore& vx, std::vector<TrajPoint> vxTp, bool prt);
67  bool StoreVertex(TCSlice& slc, VtxStore& vx);
68  bool ChkVtxAssociations(TCSlice& slc, const CTP_t& inCTP);
69  void ScoreVertices(TCSlice& slc);
70  void KillPoorVertices(TCSlice& slc);
71  void SetVx2Score(TCSlice& slc);
72  void SetVx2Score(TCSlice& slc, VtxStore& vx2);
73  void SetVx3Score(TCSlice& slc, Vtx3Store& vx3);
74  unsigned short Vx3Topo(TCSlice& slc, Vtx3Store& vx3);
75  void SetHighScoreBits(TCSlice& slc, Vtx3Store& vx3);
76  bool MakeVertexObsolete(std::string fcnLabel, TCSlice& slc, VtxStore& vx2, bool forceKill);
77  bool MakeVertexObsolete(TCSlice& slc, Vtx3Store& vx3);
78  std::vector<int> GetVtxTjIDs(const TCSlice& slc, const VtxStore& vx2);
79  std::vector<int> GetVtxTjIDs(const TCSlice& slc, const Vtx3Store& vx3, float& score);
80  std::vector<unsigned short> GetPFPVertices(const TCSlice& slc, const PFPStruct& pfp);
81  void PosInPlane(const TCSlice& slc, const Vtx3Store& vx3, unsigned short plane, Point2_t& pos);
82  unsigned short IsCloseToVertex(TCSlice& slc, VtxStore& vx);
83  unsigned short IsCloseToVertex(TCSlice& slc, Vtx3Store& vx3);
84 } // namespace
85 
86 #endif // ifndef TRAJCLUSTERALGVERTEX_H
void VtxHitsSwap(TCSlice &slc, const CTP_t inCTP)
Definition: TCVertex.cxx:2962
bool MergeWithVertex(TCSlice &slc, VtxStore &vx, unsigned short oVxID)
Definition: TCVertex.cxx:701
bool MakeVertexObsolete(std::string fcnLabel, TCSlice &slc, VtxStore &vx2, bool forceKill)
Definition: TCVertex.cxx:3120
bool FitVertex(TCSlice &slc, VtxStore &vx, bool prt)
Definition: TCVertex.cxx:2131
TCConfig tcc
Definition: DataStructs.cxx:6
void SplitTrajCrossingVertices(TCSlice &slc, CTP_t inCTP)
Definition: TCVertex.cxx:1268
float TrajPointVertexPull(TCSlice &slc, const TrajPoint &tp, const VtxStore &vx)
Definition: TCVertex.cxx:2029
bool AttachAnyTrajToVertex(TCSlice &slc, unsigned short ivx, bool prt)
Definition: TCVertex.cxx:1868
void SetVx3Score(TCSlice &slc, Vtx3Store &vx3)
Definition: TCVertex.cxx:2483
bool AttachPFPToVertex(TCSlice &slc, PFPStruct &pfp, unsigned short end, unsigned short vx3ID, bool prt)
Definition: TCVertex.cxx:1830
bool StoreVertex(TCSlice &slc, VtxStore &vx)
Definition: TCVertex.cxx:2093
std::vector< unsigned short > GetPFPVertices(const TCSlice &slc, const PFPStruct &pfp)
Definition: TCVertex.cxx:3267
std::array< float, 2 > Point2_t
Definition: DataStructs.h:37
bool ChkVtxAssociations(TCSlice &slc, const CTP_t &inCTP)
Definition: TCVertex.cxx:2326
void ScoreVertices(TCSlice &slc)
Definition: TCVertex.cxx:2391
Definition of data types for geometry description.
void CompleteIncomplete3DVerticesInGaps(TCSlice &slc)
Definition: TCVertex.cxx:2669
std::vector< TCSlice > slices
Definition: DataStructs.cxx:10
void FindVtxTjs(TCSlice &slc, VtxStore &vx2)
Definition: TCVertex.cxx:409
unsigned short IsCloseToVertex(TCSlice &slc, VtxStore &inVx2)
Definition: TCVertex.cxx:3297
unsigned int CTP_t
Definition: DataStructs.h:41
void SetHighScoreBits(TCSlice &slc, Vtx3Store &vx3)
Definition: TCVertex.cxx:2436
bool AttachTrajToVertex(TCSlice &slc, Trajectory &tj, VtxStore &vx, bool prt)
Definition: TCVertex.cxx:1893
void MakeJunkTjVertices(TCSlice &slc, const CTP_t &inCTP)
std::vector< int > GetVtxTjIDs(const TCSlice &slc, const VtxStore &vx2)
Definition: TCVertex.cxx:3226
unsigned short Vx3Topo(TCSlice &slc, Vtx3Store &vx3)
Definition: TCVertex.cxx:2641
void Find2DVertices(TCSlice &slc, const CTP_t &inCTP, unsigned short pass)
Definition: TCVertex.cxx:114
void KillPoorVertices(TCSlice &slc)
Definition: TCVertex.cxx:2418
unsigned short TPNearVertex(TCSlice &slc, const TrajPoint &tp)
Definition: TCVertex.cxx:1816
void SetVx2Score(TCSlice &slc)
Definition: TCVertex.cxx:2504
void FindHammerVertices(TCSlice &slc, const CTP_t &inCTP)
Definition: TCVertex.cxx:1154
void CompleteIncomplete3DVertices(TCSlice &slc)
Definition: TCVertex.cxx:2759
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
void FindNeutralVertices(TCSlice &slc)
Definition: TCVertex.cxx:529
void PosInPlane(const TCSlice &slc, const Vtx3Store &vx3, unsigned short plane, Point2_t &pos)
Definition: TCVertex.cxx:3287
float VertexVertexPull(TCSlice &slc, const Vtx3Store &vx1, const Vtx3Store &vx2)
Definition: TCVertex.cxx:2064
void MakeJunkVertices(TCSlice &slc, const CTP_t &inCTP)
Definition: TCVertex.cxx:14
TCEvent evt
Definition: DataStructs.cxx:5
void Find3DVertices(TCSlice &slc)
Definition: TCVertex.cxx:1392
void FindHammerVertices2(TCSlice &slc, const CTP_t &inCTP)
Definition: TCVertex.cxx:979
void ChkVxTjs(TCSlice &slc, const CTP_t &inCTP, bool prt)
Definition: TCVertex.cxx:874
void Match3DVtxTjs(TCSlice &slc, bool prt)
Definition: TCVertex.cxx:1693