ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
AtFindVertex.h
Go to the documentation of this file.
1 #ifndef ATFINDVERTEX_H
2 #define ATFINDVERTEX_H
3 // IWYU pragma: no_include <ext/alloc_traits.h>
4 
5 #include "AtTrack.h"
6 
7 #include <Math/Vector3D.h> // for DisplacemenXYZVectorD
8 #include <Math/Vector3Dfwd.h> // for XYZVector
9 #include <Rtypes.h>
10 #include <TObject.h>
11 
12 #include <algorithm> // for max
13 #include <utility> // for pair
14 #include <vector> // for vector
15 
16 class TBuffer;
17 class TClass;
18 class TMemberInspector;
19 
21 
24  std::vector<AtTrack> tracks;
25 };
26 
27 class AtFindVertex : public TObject {
28 
29 public:
30  AtFindVertex(Double_t lineDistThreshold = 15);
31  virtual ~AtFindVertex();
32 
33  void FindVertex(std::vector<AtTrack> tracks, Int_t nbTracksPerVtx);
34  void FindVertexSingleLine(std::vector<AtTrack> tracks);
35  void FindVertexMultipleLines(std::vector<AtTrack> tracks, Int_t nbTracksPerVtx);
36  XYZVector ClosestPoint2Lines(std::vector<Double_t> line1, std::vector<Double_t> line2);
37  std::vector<XYZVector> ClosestPointProjOnLines(std::vector<Double_t> line1, std::vector<Double_t> line2);
38  std::vector<std::vector<Int_t>> SortTrackSameVtx(std::vector<std::vector<Double_t>> lines);
39  std::vector<XYZVector> CoGVtx(std::vector<std::vector<Int_t>> vtxCand, std::vector<std::vector<Double_t>> lines,
40  std::vector<Double_t> wlines);
41  std::vector<std::pair<Int_t, XYZVector>>
42  CoGVtxSingleTrack(std::vector<std::vector<Double_t>> lines, std::vector<Int_t> itracks);
43  XYZVector ptOnLine(std::vector<Double_t> line, XYZVector pointToProj);
44  Double_t distPtLine(XYZVector dir, XYZVector ptLine, XYZVector pt);
45  Double_t distLines(std::vector<Double_t> line1, std::vector<Double_t> line2);
46  Double_t angLines(std::vector<Double_t> line1, std::vector<Double_t> line2);
47  Bool_t checkExclusivity(std::vector<Int_t> v1, std::vector<Int_t> v2);
48 
49  void SetTracksVertex(tracksFromVertex val) { fTracksFromVertex.push_back(val); }
50 
51  void SetLineDistThreshold(Double_t val) { fLineDistThreshold = val; }
52 
53  void SetBeam(XYZVector pos, XYZVector dir)
54  {
55  fBeamPoint = pos;
56  fBeamDir = dir;
57  fBeamLine.resize(6);
58  fBeamLine[0] = fBeamPoint.X();
59  fBeamLine[1] = fBeamPoint.Y();
60  fBeamLine[2] = fBeamPoint.Z();
61  fBeamLine[3] = fBeamDir.X();
62  fBeamLine[4] = fBeamDir.Y();
63  fBeamLine[5] = fBeamDir.Z();
64  }
65 
66  std::vector<tracksFromVertex> GetTracksVertex() { return fTracksFromVertex; }
67 
68 private:
69  std::vector<tracksFromVertex> fTracksFromVertex;
70 
71  Double_t fLineDistThreshold;
72  XYZVector fBeamPoint;
73  XYZVector fBeamDir;
74  std::vector<Double_t> fBeamLine;
75  std::vector<std::vector<Double_t>> fLineCand;
76 
77  ClassDef(AtFindVertex, 1);
78 };
79 
80 #endif //#ifndef AtFindVertex_H
AtFindVertex::checkExclusivity
Bool_t checkExclusivity(std::vector< Int_t > v1, std::vector< Int_t > v2)
Definition: AtFindVertex.cxx:365
AtFindVertex::SortTrackSameVtx
std::vector< std::vector< Int_t > > SortTrackSameVtx(std::vector< std::vector< Double_t >> lines)
Definition: AtFindVertex.cxx:136
AtFindVertex::angLines
Double_t angLines(std::vector< Double_t > line1, std::vector< Double_t > line2)
Definition: AtFindVertex.cxx:356
AtFindVertex::AtFindVertex
AtFindVertex(Double_t lineDistThreshold=15)
Definition: AtFindVertex.cxx:29
AtFindVertex::CoGVtx
std::vector< XYZVector > CoGVtx(std::vector< std::vector< Int_t >> vtxCand, std::vector< std::vector< Double_t >> lines, std::vector< Double_t > wlines)
Definition: AtFindVertex.cxx:224
tracksFromVertex::vertex
XYZVector vertex
Definition: AtFindVertex.h:23
XYZVector
ROOT::Math::XYZVector XYZVector
Definition: AtFindVertex.h:20
AtFindVertex::distLines
Double_t distLines(std::vector< Double_t > line1, std::vector< Double_t > line2)
Definition: AtFindVertex.cxx:344
AtFindVertex::distPtLine
Double_t distPtLine(XYZVector dir, XYZVector ptLine, XYZVector pt)
Definition: AtFindVertex.cxx:338
AtFindVertex::SetLineDistThreshold
void SetLineDistThreshold(Double_t val)
Definition: AtFindVertex.h:51
AtFindVertex::~AtFindVertex
virtual ~AtFindVertex()
AtFindVertex::SetBeam
void SetBeam(XYZVector pos, XYZVector dir)
Definition: AtFindVertex.h:53
tracksFromVertex
Definition: AtFindVertex.h:22
AtFindVertex::ptOnLine
XYZVector ptOnLine(std::vector< Double_t > line, XYZVector pointToProj)
Definition: AtFindVertex.cxx:321
AtFindVertex::SetTracksVertex
void SetTracksVertex(tracksFromVertex val)
Definition: AtFindVertex.h:49
AtFindVertex::ClosestPoint2Lines
XYZVector ClosestPoint2Lines(std::vector< Double_t > line1, std::vector< Double_t > line2)
Definition: AtFindVertex.cxx:283
AtFindVertex::GetTracksVertex
std::vector< tracksFromVertex > GetTracksVertex()
Definition: AtFindVertex.h:66
tracksFromVertex::tracks
std::vector< AtTrack > tracks
Definition: AtFindVertex.h:24
AtTrack.h
AtFindVertex::FindVertexSingleLine
void FindVertexSingleLine(std::vector< AtTrack > tracks)
Definition: AtFindVertex.cxx:54
AtFindVertex::FindVertexMultipleLines
void FindVertexMultipleLines(std::vector< AtTrack > tracks, Int_t nbTracksPerVtx)
Definition: AtFindVertex.cxx:86
AtFindVertex::ClosestPointProjOnLines
std::vector< XYZVector > ClosestPointProjOnLines(std::vector< Double_t > line1, std::vector< Double_t > line2)
Definition: AtFindVertex.cxx:301
AtFindVertex
Definition: AtFindVertex.h:27
AtFindVertex::FindVertex
void FindVertex(std::vector< AtTrack > tracks, Int_t nbTracksPerVtx)
Definition: AtFindVertex.cxx:44
AtFindVertex::CoGVtxSingleTrack
std::vector< std::pair< Int_t, XYZVector > > CoGVtxSingleTrack(std::vector< std::vector< Double_t >> lines, std::vector< Int_t > itracks)
Definition: AtFindVertex.cxx:203