Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:26:51

0001 #ifndef RecoPixelVertexing_DivisiveVertexFinder_h
0002 #define RecoPixelVertexing_DivisiveVertexFinder_h
0003 /** \class DivisiveVertexFinder DivisiveVertexFinder.h RecoPixelVertexing/PixelVertexFinding/interface/DivisiveVertexFinder.h 
0004 
0005  Description: Fits a primary vertex in 1D (z) using the "divisive method"
0006 
0007  Implementation: 
0008  This class was ported from ORCA by me (Aaron).  It was originally written by ...
0009  Find the PV candidates with a simple divisive method.
0010  Divide the luminosity region in several regions according 
0011  to the track distance and for each of them make a PVCluster. 
0012  Iteratively discard tracks and recover them in a new PVCluster.
0013  Return a sorted vector<Vertex> (aka VertexCollection) with the z coordinate of PV candidates
0014  \param ntkmin Minimum number of tracks required to form a cluster.
0015  \param useError physical distances or weighted distances.
0016  \param zsep Maximum distance between two adjacent tracks that belong
0017  to the same initial cluster.
0018  \param wei Compute the cluster "center" with an unweighted or a weighted
0019  average of the tracks. Weighted means weighted with the error
0020  of the data point.
0021 
0022  \author Aaron Dominguez (UNL)
0023 */
0024 #include <vector>
0025 #include "DataFormats/VertexReco/interface/Vertex.h"
0026 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0027 #include "DataFormats/TrackReco/interface/Track.h"
0028 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0029 //#include "CommonTools/Clustering1D/interface/DivisiveClusterizer1D.h"
0030 #include "RecoPixelVertexing/PixelVertexFinding/interface/DivisiveClusterizer1D.h"
0031 
0032 #include "RecoPixelVertexing/PixelVertexFinding/interface/PVClusterComparer.h"
0033 
0034 class DivisiveVertexFinder {
0035 public:
0036   DivisiveVertexFinder(double track_pt_min,
0037                        double track_pt_max,
0038                        double track_chi2_max,
0039                        double track_prob_min,
0040                        double zOffset = 5.0,
0041                        int ntrkMin = 5,
0042                        bool useError = true,
0043                        double zSeparation = 0.05,
0044                        bool wtAverage = true,
0045                        int verbosity = 0);
0046   ~DivisiveVertexFinder();
0047 
0048   /// Run the divisive algorithm and return a vector of vertexes for the input track collection
0049   bool findVertexes(const reco::TrackRefVector &trks,     // input
0050                     reco::VertexCollection &vertexes);    // output
0051   bool findVertexesAlt(const reco::TrackRefVector &trks,  // input
0052                        reco::VertexCollection &vertexes,
0053                        const math::XYZPoint &bs);  // output
0054 private:
0055   /// Cuts on vertex formation and other options
0056   double zOffset_, zSeparation_;
0057   int ntrkMin_;
0058   bool useError_, wtAverage_;
0059 
0060   /// We use Wolfgang's templated class that implements the actual divisive method
0061   pixeltemp::DivisiveClusterizer1D<reco::Track> divmeth_;
0062   //  DivisiveClusterizer1D< reco::Track > divmeth_;
0063 
0064   // How loud should I be?
0065   int verbose_;
0066 
0067   PVClusterComparer *pvComparer_;
0068 };
0069 #endif