CMS 3D CMS Logo

PFDisplacedVertexCandidate.h
Go to the documentation of this file.
1 #ifndef DataFormat_ParticleFlowReco_PFDisplacedVertexCandidate_h
2 #define DataFormat_ParticleFlowReco_PFDisplacedVertexCandidate_h
3 
6 
7 #include <vector>
8 #include <map>
9 #include <iostream>
10 
11 namespace reco {
12 
13 
15 
30 
31 
32  public:
33 
37  struct VertexLink {
38  VertexLink() : distance_(-1), dcaPoint_(0,0,0), test_(0) {}
39  VertexLink(float d, GlobalPoint p, char t) : distance_(d), dcaPoint_(p), test_(t) {}
40  float distance_;
42  char test_;
43  };
44 
51  };
52 
53 
54  typedef std::map< unsigned int, VertexLink > VertexLinkData;
55 
58  typedef std::map< float, std::pair<int,int> > DistMap;
59  typedef std::vector< float > DistVector;
60 
63 
64 
66  void addElement(const TrackBaseRef);
67 
71  void setLink(unsigned i1,
72  unsigned i2,
73  const float dist,
74  const GlobalPoint& dcaPoint,
76 
77 
79  void associatedElements( const unsigned i,
80  const VertexLinkData& vertexLinkData,
81  std::multimap<float, unsigned>& sortedAssociates,
82  const VertexLinkTest test=LINKTEST_DCA ) const;
83 
85 
87  DistMap r2Map() const;
88 
91  DistVector r2Vector() const;
92 
94  DistVector distVector() const;
95 
97  const GlobalPoint dcaPoint( unsigned ie1, unsigned ie2) const;
98 
99 
101  bool isValid() const
102  {return elements_.size()>1;}
103 
104 
106  const TrackBaseRef& tref(unsigned ie) const
107  {return elements_[ie];}
108 
110  const std::vector < TrackBaseRef >& elements() const
111  {return elements_;}
112 
114  unsigned nTracks() const
115  {return elements_.size();}
116 
117 
119  const VertexLinkData& vertexLinkData() const
120  {return vertexLinkData_;}
121 
123  void Dump(std::ostream& out = std::cout) const;
124 
125  private:
126 
128 
130  const float dist( unsigned ie1, unsigned ie2) const;
131 
133  bool testLink (unsigned ie1, unsigned ie2) const;
134 
136  friend std::ostream& operator<<( std::ostream&, const PFDisplacedVertexCandidate& );
137 
138 
140 
143  unsigned vertexLinkDataSize() const;
144 
147  bool matrix2vector(unsigned i, unsigned j, unsigned& index) const;
148 
149 
151 
153  std::vector < TrackBaseRef > elements_;
154 
156  VertexLinkData vertexLinkData_;
157 
158 
159  };
160 }
161 
162 #endif
163 
164 
165 
void addElement(const TrackBaseRef)
add a track Reference to the current Candidate
const VertexLinkData & vertexLinkData() const
A block of tracks linked together.
void associatedElements(const unsigned i, const VertexLinkData &vertexLinkData, std::multimap< float, unsigned > &sortedAssociates, const VertexLinkTest test=LINKTEST_DCA) const
associate 2 elements
std::vector< TrackBaseRef > elements_
--—— MEMBERS --—— ///
void Dump(std::ostream &out=std::cout) const
cout function
std::map< float, std::pair< int, int > > DistMap
unsigned vertexLinkDataSize() const
--—— Storage of the information --—— ///
bool matrix2vector(unsigned i, unsigned j, unsigned &index) const
void setLink(unsigned i1, unsigned i2, const float dist, const GlobalPoint &dcaPoint, const VertexLinkTest test=LINKTEST_DCA)
std::map< unsigned int, VertexLink > VertexLinkData
const TrackBaseRef & tref(unsigned ie) const
const GlobalPoint dcaPoint(unsigned ie1, unsigned ie2) const
bool testLink(unsigned ie1, unsigned ie2) const
test if a link between two tracks is valid: value_link =! -1
bool isValid() const
A Vertex Candidate is valid if it has at least two tracks.
DistMap r2Map() const
--—— Provide useful information --—— ///
friend std::ostream & operator<<(std::ostream &, const PFDisplacedVertexCandidate &)
cout function
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalPoint
point in global coordinate system
Definition: Point3D.h:17
const float dist(unsigned ie1, unsigned ie2) const
--—— Internal tools --—— ///
fixed size matrix
VertexLinkData vertexLinkData_
map of links between tracks
const std::vector< TrackBaseRef > & elements() const