Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:51

0001 #ifndef DataFormat_ParticleFlowReco_PFDisplacedVertexSeed_h
0002 #define DataFormat_ParticleFlowReco_PFDisplacedVertexSeed_h
0003 
0004 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0005 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0006 
0007 #include <vector>
0008 #include <iostream>
0009 
0010 namespace reco {
0011 
0012   /// \brief Block of elements
0013   /*!
0014     \author Gouzevitch Maxime
0015     \date November 2009
0016 
0017     A DisplacedVertexSeed is an intermediate format, usually not persistent,
0018     used by PFDisplacedVertexFinder to keep the information for vertex fit.
0019     This format is produced after parsing of PFDisplacedVertexCandidate which
0020     by construction may contain many seeds. This format contains:
0021     - a set of Refs to tracks.
0022     - a Point which indicated the approximative position of the vertex.
0023   */
0024 
0025   class PFDisplacedVertexSeed {
0026   public:
0027     /// Default constructor
0028     PFDisplacedVertexSeed();
0029 
0030     /// Add a track Reference to the current Seed
0031     /// If the track reference is already in the collection, it is ignored
0032     void addElement(TrackBaseRef);
0033 
0034     /// Reserve space for elements
0035     void reserveElements(size_t);
0036 
0037     /// Add a track Ref to the Seed and recalculate the seedPoint with a new dcaPoint
0038     /// A weight different from 1 may be assign to the new DCA point
0039     void updateSeedPoint(const GlobalPoint& dcaPoint, const TrackBaseRef, const TrackBaseRef, double weight = 1);
0040 
0041     /// Merge two Seeds if their seed Points are close enough
0042     void mergeWith(const PFDisplacedVertexSeed& displacedVertex);
0043 
0044     /// Check if it is a new Seed
0045     bool isEmpty() const { return (elements_.empty()); }
0046 
0047     /// \return vector of unique references to tracks
0048     const std::vector<TrackBaseRef>& elements() const { return elements_; }
0049 
0050     const double nTracks() const { return elements_.size(); }
0051 
0052     /// \return the seedPoint for the vertex fitting
0053     const GlobalPoint& seedPoint() const { return seedPoint_; }
0054 
0055     /// \return the total weight
0056     const double totalWeight() const { return totalWeight_; }
0057 
0058     /// cout function
0059     void Dump(std::ostream& out = std::cout) const;
0060 
0061   private:
0062     friend std::ostream& operator<<(std::ostream& out, const PFDisplacedVertexSeed& co);
0063 
0064     /// --------- MEMBERS ---------- ///
0065 
0066     /// Set of tracks refs associated to the seed
0067     std::vector<TrackBaseRef> elements_;
0068     /// Seed point which indicated the approximative position of the vertex.
0069     GlobalPoint seedPoint_;
0070     /// Total weight of the points used to calculate the seed point.
0071     /// Necessary for UpdateSeed Point function
0072     float totalWeight_;
0073   };
0074 }  // namespace reco
0075 
0076 #endif