CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
14 
29  public:
33  struct VertexLink {
34  VertexLink() : distance_(-1), dcaPoint_(0, 0, 0), test_(0) {}
35  VertexLink(float d, GlobalPoint p, char t) : distance_(d), dcaPoint_(p), test_(t) {}
36  float distance_;
38  char test_;
39  };
40 
44 
45  typedef std::map<unsigned int, VertexLink> VertexLinkData;
46 
49  typedef std::map<float, std::pair<int, int> > DistMap;
50  typedef std::vector<float> DistVector;
51 
54 
56  void addElement(const TrackBaseRef);
57 
61  void setLink(unsigned i1,
62  unsigned i2,
63  const float dist,
64  const GlobalPoint& dcaPoint,
66 
68  void associatedElements(const unsigned i,
70  std::multimap<float, unsigned>& sortedAssociates,
71  const VertexLinkTest test = LINKTEST_DCA) const;
72 
74 
76  DistMap r2Map() const;
77 
80  DistVector r2Vector() const;
81 
83  DistVector distVector() const;
84 
86  const GlobalPoint dcaPoint(unsigned ie1, unsigned ie2) const;
87 
89  bool isValid() const { return elements_.size() > 1; }
90 
92  const TrackBaseRef& tref(unsigned ie) const { return elements_[ie]; }
93 
95  const std::vector<TrackBaseRef>& elements() const { return elements_; }
96 
98  unsigned nTracks() const { return elements_.size(); }
99 
101  const VertexLinkData& vertexLinkData() const { return vertexLinkData_; }
102 
104  void Dump(std::ostream& out = std::cout) const;
105 
106  private:
108 
110  const float dist(unsigned ie1, unsigned ie2) const;
111 
113  bool testLink(unsigned ie1, unsigned ie2) const;
114 
116  friend std::ostream& operator<<(std::ostream&, const PFDisplacedVertexCandidate&);
117 
119 
122  unsigned vertexLinkDataSize() const;
123 
126  bool matrix2vector(unsigned i, unsigned j, unsigned& index) const;
127 
129 
131  std::vector<TrackBaseRef> elements_;
132 
135  };
136 } // namespace reco
137 
138 #endif
void addElement(const TrackBaseRef)
add a track Reference to the current Candidate
const VertexLinkData & vertexLinkData() const
std::vector< TrackBaseRef > elements_
--—— MEMBERS --—— ///
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
const std::vector< TrackBaseRef > & elements() const
void Dump(std::ostream &out=std::cout) const
cout function
unsigned vertexLinkDataSize() const
--—— Storage of the information --—— ///
bool matrix2vector(unsigned i, unsigned j, unsigned &index) const
PFDisplacedVertexCandidate()
Default constructor.
tuple d
Definition: ztail.py:151
void setLink(unsigned i1, unsigned i2, const float dist, const GlobalPoint &dcaPoint, const VertexLinkTest test=LINKTEST_DCA)
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 --—— ///
std::map< unsigned int, VertexLink > VertexLinkData
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:18
const float dist(unsigned ie1, unsigned ie2) const
--—— Internal tools --—— ///
VertexLinkData vertexLinkData_
map of links between tracks
tuple cout
Definition: gather_cfg.py:144
std::map< float, std::pair< int, int > > DistMap