CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/RecoParticleFlow/PFTracking/interface/PFDisplacedVertexCandidateFinder.h

Go to the documentation of this file.
00001 #ifndef RecoParticleFlow_PFTracking_PFDisplacedVertexCandidateFinder_h
00002 #define RecoParticleFlow_PFTracking_PFDisplacedVertexCandidateFinder_h 
00003 
00004 #include "DataFormats/ParticleFlowReco/interface/PFDisplacedVertexCandidate.h"
00005 #include "DataFormats/ParticleFlowReco/interface/PFDisplacedVertexCandidateFwd.h"
00006 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00007 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00008 #include "DataFormats/VertexReco/interface/VertexFwd.h"
00009 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
00010 
00011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00012 
00013 #include "TrackingTools/TrajectoryParametrization/interface/GlobalTrajectoryParameters.h"
00014 #include "TrackingTools/PatternTools/interface/TwoTrackMinimumDistance.h"
00015 
00017 
00022 class MagneticField;
00023 
00024 class PFDisplacedVertexCandidateFinder {
00025 
00026  public:
00027 
00028   PFDisplacedVertexCandidateFinder();
00029 
00030   ~PFDisplacedVertexCandidateFinder();
00031   
00032 
00034   typedef std::vector<bool> Mask;
00035 
00036   typedef std::list< reco::TrackBaseRef >::iterator IE;
00037   typedef std::list< reco::TrackBaseRef >::const_iterator IEC;  
00038   typedef reco::PFDisplacedVertexCandidateCollection::const_iterator IBC;
00039   
00040 
00042 
00044   void setParameters(double dcaCut, double primaryVertexCut, double dcaPInnerHitCut,
00045                      const edm::ParameterSet& ps_trk) {
00046     dcaCut_ = dcaCut;
00047     primaryVertexCut2_ = primaryVertexCut*primaryVertexCut;
00048     dcaPInnerHitCut2_ = dcaPInnerHitCut*dcaPInnerHitCut;
00049     nChi2_max_ = ps_trk.getParameter<double>("nChi2_max");
00050     pt_min_ = ps_trk.getParameter<double>("pt_min");
00051     pt_min_prim_ = ps_trk.getParameter<double>("pt_min_prim");
00052     dxy_ = ps_trk.getParameter<double>("dxy");
00053   }
00054 
00056   void setDebug( bool debug ) {debug_ = debug;}
00057 
00060   void setInput(const edm::Handle<reco::TrackCollection>& trackh,  
00061                 const MagneticField* magField ); 
00062   
00063   
00065   std::auto_ptr< reco::PFDisplacedVertexCandidateCollection > transferVertexCandidates() {return vertexCandidates_;}
00066 
00067   const std::auto_ptr< reco::PFDisplacedVertexCandidateCollection >& vertexCandidates() const 
00068     {return vertexCandidates_;}
00069 
00071 
00072   void findDisplacedVertexCandidates();
00073 
00074 
00075   void setPrimaryVertex(edm::Handle< reco::VertexCollection > mainVertexHandle, 
00076                         edm::Handle< reco::BeamSpot > beamSpotHandle);
00077 
00078  private:
00079 
00081 
00083   IE associate(IE next, IE last, reco::PFDisplacedVertexCandidate& tempVertexCandidate);
00084 
00086   void link( const reco::TrackBaseRef& el1, 
00087              const reco::TrackBaseRef& el2,
00088              double& dist,
00089              GlobalPoint& P,
00090              reco::PFDisplacedVertexCandidate::VertexLinkTest& linktest);
00091 
00094   void packLinks( reco::PFDisplacedVertexCandidate& vertexCandidate); 
00095 
00096 
00098 
00101   GlobalTrajectoryParameters
00102     getGlobalTrajectoryParameters(const reco::Track*) const;
00103 
00104 
00106   bool goodPtResolution( const reco::TrackBaseRef& trackref) const;
00107 
00110   bool isSelected(const reco::TrackBaseRef& trackref)
00111     { return goodPtResolution(trackref);}
00112 
00113   friend std::ostream& operator<<(std::ostream&, const PFDisplacedVertexCandidateFinder&);
00114                  
00115 
00116 
00118 
00119   std::auto_ptr< reco::PFDisplacedVertexCandidateCollection > vertexCandidates_;
00120   
00121 
00123   std::list< reco::TrackBaseRef >  eventTracks_;
00124 
00125 
00129   Mask     trackMask_;
00132   std::vector < GlobalTrajectoryParameters > eventTrackTrajectories_;
00133 
00135 
00138   double dcaCut_;
00140   double primaryVertexCut2_;
00142   double dcaPInnerHitCut2_;
00143 
00147   double nChi2_max_;
00148   double pt_min_;
00149 
00150   double pt_min_prim_;
00151   double dxy_;
00152 
00155   unsigned vertexCandidatesSize_;
00156   
00157   // Two track minimum distance algo
00158   TwoTrackMinimumDistance theMinimum_;
00159 
00160   math::XYZPoint pvtx_;
00161 
00163   bool   debug_;
00164   
00165   // Tracker geometry for extrapolation
00166   const MagneticField* magField_;
00167 
00168 };
00169 
00170 #endif
00171 
00172