Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:08

0001 #ifndef RecoBTag_GhostTrackVertexFinder_h
0002 #define RecoBTag_GhostTrackVertexFinder_h
0003 
0004 #include <memory>
0005 #include <vector>
0006 #include <set>
0007 
0008 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0009 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
0010 #include "DataFormats/GeometryCommonDetAlgo/interface/GlobalError.h"
0011 
0012 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
0013 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0014 
0015 #include "TrackingTools/TransientTrack/interface/TransientTrack.h"
0016 
0017 #include "RecoVertex/VertexPrimitives/interface/TransientVertex.h"
0018 #include "RecoVertex/VertexPrimitives/interface/VertexFitter.h"
0019 #include "RecoVertex/VertexPrimitives/interface/VertexReconstructor.h"
0020 
0021 #include "RecoVertex/GhostTrackFitter/interface/GhostTrackFitter.h"
0022 #include "RecoVertex/GhostTrackFitter/interface/GhostTrack.h"
0023 
0024 namespace reco {
0025 
0026   class GhostTrack;
0027   class GhostTrackFitter;
0028 
0029   class GhostTrackVertexFinder {  // : public VertexReconstructor
0030   public:
0031     enum FitType { kAlwaysWithGhostTrack, kSingleTracksWithGhostTrack, kRefitGhostTrackWithVertices };
0032 
0033     GhostTrackVertexFinder();
0034     GhostTrackVertexFinder(double maxFitChi2, double mergeThreshold, double primcut, double seccut, FitType fitType);
0035     ~GhostTrackVertexFinder();
0036 
0037     std::vector<TransientVertex> vertices(const reco::Vertex &primaryVertex,
0038                                           const GlobalVector &direction,
0039                                           double coneRadius,
0040                                           const std::vector<TransientTrack> &tracks) const;
0041 
0042     std::vector<TransientVertex> vertices(const GlobalPoint &primaryPosition,
0043                                           const GlobalError &primaryError,
0044                                           const GlobalVector &direction,
0045                                           double coneRadius,
0046                                           const std::vector<TransientTrack> &tracks) const;
0047 
0048     std::vector<TransientVertex> vertices(const reco::Vertex &primaryVertex,
0049                                           const GlobalVector &direction,
0050                                           double coneRadius,
0051                                           const reco::BeamSpot &beamSpot,
0052                                           const std::vector<TransientTrack> &tracks) const;
0053 
0054     std::vector<TransientVertex> vertices(const GlobalPoint &primaryPosition,
0055                                           const GlobalError &primaryError,
0056                                           const GlobalVector &direction,
0057                                           double coneRadius,
0058                                           const reco::BeamSpot &beamSpot,
0059                                           const std::vector<TransientTrack> &tracks) const;
0060 
0061     std::vector<TransientVertex> vertices(const reco::Vertex &primaryVertex,
0062                                           const GlobalVector &direction,
0063                                           double coneRadius,
0064                                           const reco::BeamSpot &beamSpot,
0065                                           const std::vector<TransientTrack> &primaries,
0066                                           const std::vector<TransientTrack> &tracks) const;
0067 
0068     std::vector<TransientVertex> vertices(const GlobalPoint &primaryPosition,
0069                                           const GlobalError &primaryError,
0070                                           const GlobalVector &direction,
0071                                           double coneRadius,
0072                                           const reco::BeamSpot &beamSpot,
0073                                           const std::vector<TransientTrack> &primaries,
0074                                           const std::vector<TransientTrack> &tracks) const;
0075 
0076     std::vector<TransientVertex> vertices(const reco::Vertex &primaryVertex,
0077                                           const reco::Track &ghostTrack,
0078                                           const std::vector<TransientTrack> &tracks,
0079                                           const std::vector<float> &weights = std::vector<float>()) const;
0080 
0081     std::vector<TransientVertex> vertices(const reco::Vertex &primaryVertex,
0082                                           const reco::Track &ghostTrack,
0083                                           const reco::BeamSpot &beamSpot,
0084                                           const std::vector<TransientTrack> &tracks,
0085                                           const std::vector<float> &weights = std::vector<float>()) const;
0086 
0087     std::vector<TransientVertex> vertices(const reco::Vertex &primaryVertex,
0088                                           const reco::Track &ghostTrack,
0089                                           const reco::BeamSpot &beamSpot,
0090                                           const std::vector<TransientTrack> &primaries,
0091                                           const std::vector<TransientTrack> &tracks,
0092                                           const std::vector<float> &weights = std::vector<float>()) const;
0093 
0094     std::vector<TransientVertex> vertices(const GlobalPoint &primaryPosition,
0095                                           const GlobalError &primaryError,
0096                                           const GhostTrack &ghostTrack) const;
0097 
0098     std::vector<TransientVertex> vertices(const GlobalPoint &primaryPosition,
0099                                           const GlobalError &primaryError,
0100                                           const reco::BeamSpot &beamSpot,
0101                                           const GhostTrack &ghostTrack) const;
0102 
0103     std::vector<TransientVertex> vertices(const GlobalPoint &primaryPosition,
0104                                           const GlobalError &primaryError,
0105                                           const reco::BeamSpot &beamSpot,
0106                                           const std::vector<TransientTrack> &primaries,
0107                                           const GhostTrack &ghostTrack) const;
0108 
0109     std::vector<TransientVertex> vertices(const reco::Vertex &primaryVertex, const GhostTrack &ghostTrack) const;
0110 
0111     std::vector<TransientVertex> vertices(const reco::Vertex &primaryVertex,
0112                                           const reco::BeamSpot &beamSpot,
0113                                           const GhostTrack &ghostTrack) const;
0114 
0115     std::vector<TransientVertex> vertices(const reco::Vertex &primaryVertex,
0116                                           const reco::BeamSpot &beamSpot,
0117                                           const std::vector<TransientTrack> &primaries,
0118                                           const GhostTrack &ghostTrack) const;
0119 
0120     std::vector<TransientVertex> vertices(const GhostTrack &ghostTrack,
0121                                           const CachingVertex<5> &primary = CachingVertex<5>(),
0122                                           const reco::BeamSpot &beamSpot = reco::BeamSpot(),
0123                                           bool hasBeamSpot = false,
0124                                           bool hasPrimaries = false) const;
0125 
0126   private:
0127     struct FinderInfo;
0128 
0129     std::vector<CachingVertex<5> > initialVertices(const FinderInfo &info) const;
0130 
0131     CachingVertex<5> mergeVertices(const CachingVertex<5> &vertex1,
0132                                    const CachingVertex<5> &vertex2,
0133                                    const FinderInfo &info,
0134                                    bool isPrimary) const;
0135 
0136     bool recursiveMerge(std::vector<CachingVertex<5> > &vertices, const FinderInfo &info) const;
0137 
0138     bool reassignTracks(std::vector<CachingVertex<5> > &vertices, const FinderInfo &info) const;
0139 
0140     void refitGhostTrack(std::vector<CachingVertex<5> > &vertices, FinderInfo &info) const;
0141 
0142     GhostTrackFitter &ghostTrackFitter() const;
0143     VertexFitter<5> &vertexFitter(bool primary) const;
0144 
0145     static double vertexCompat(const CachingVertex<5> &vtx1,
0146                                const CachingVertex<5> &vtx2,
0147                                const FinderInfo &info,
0148                                double scale1 = 1.0,
0149                                double scale2 = 1.0);
0150 
0151     double maxFitChi2_;
0152     double mergeThreshold_;
0153     double primcut_;
0154     double seccut_;
0155     FitType fitType_;
0156 
0157     mutable std::unique_ptr<GhostTrackFitter> ghostTrackFitter_;
0158     mutable std::unique_ptr<VertexFitter<5> > primVertexFitter_;
0159     mutable std::unique_ptr<VertexFitter<5> > secVertexFitter_;
0160   };
0161 
0162 }  // namespace reco
0163 #endif  // RecoBTag_GhostTrackVertexFinder_h