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
00009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00010
00011 #include "TrackingTools/TrajectoryParametrization/interface/GlobalTrajectoryParameters.h"
00012 #include "TrackingTools/PatternTools/interface/TwoTrackMinimumDistance.h"
00013
00015
00020 class MagneticField;
00021
00022 class PFDisplacedVertexCandidateFinder {
00023
00024 public:
00025
00026 PFDisplacedVertexCandidateFinder();
00027
00028 ~PFDisplacedVertexCandidateFinder();
00029
00030
00032 typedef std::vector<bool> Mask;
00033
00034 typedef std::list< reco::TrackBaseRef >::iterator IE;
00035 typedef std::list< reco::TrackBaseRef >::const_iterator IEC;
00036 typedef reco::PFDisplacedVertexCandidateCollection::const_iterator IBC;
00037
00038
00040
00042 void setParameters(double dcaCut, double primaryVertexCut, double dcaPInnerHitCut,
00043 const edm::ParameterSet& ps_trk) {
00044 dcaCut_ = dcaCut;
00045 primaryVertexCut2_ = primaryVertexCut*primaryVertexCut;
00046 dcaPInnerHitCut2_ = dcaPInnerHitCut*dcaPInnerHitCut;
00047 nChi2_max_ = ps_trk.getParameter<double>("nChi2_max");
00048 pt_min_ = ps_trk.getParameter<double>("pt_min");
00049 }
00050
00052 void setDebug( bool debug ) {debug_ = debug;}
00053
00056 void setInput(const edm::Handle<reco::TrackCollection>& trackh,
00057 const MagneticField* magField );
00058
00059
00061 std::auto_ptr< reco::PFDisplacedVertexCandidateCollection > transferVertexCandidates() {return vertexCandidates_;}
00062
00063 const std::auto_ptr< reco::PFDisplacedVertexCandidateCollection >& vertexCandidates() const
00064 {return vertexCandidates_;}
00065
00067
00068 void findDisplacedVertexCandidates();
00069
00070
00071 private:
00072
00074
00076 IE associate(IE next, IE last, reco::PFDisplacedVertexCandidate& tempVertexCandidate);
00077
00079 void link( const reco::TrackBaseRef& el1,
00080 const reco::TrackBaseRef& el2,
00081 double& dist,
00082 GlobalPoint& P,
00083 reco::PFDisplacedVertexCandidate::VertexLinkTest& linktest);
00084
00087 void packLinks( reco::PFDisplacedVertexCandidate& vertexCandidate);
00088
00089
00091
00094 GlobalTrajectoryParameters
00095 getGlobalTrajectoryParameters(const reco::Track*) const;
00096
00097
00099 bool goodPtResolution( const reco::TrackBaseRef& trackref) const;
00100
00103 bool isSelected(const reco::TrackBaseRef& trackref)
00104 { return goodPtResolution(trackref);}
00105
00106 friend std::ostream& operator<<(std::ostream&, const PFDisplacedVertexCandidateFinder&);
00107
00108
00109
00111
00112 std::auto_ptr< reco::PFDisplacedVertexCandidateCollection > vertexCandidates_;
00113
00114
00116 std::list< reco::TrackBaseRef > eventTracks_;
00117
00118
00122 Mask trackMask_;
00125 std::vector < GlobalTrajectoryParameters > eventTrackTrajectories_;
00126
00128
00131 double dcaCut_;
00133 double primaryVertexCut2_;
00135 double dcaPInnerHitCut2_;
00136
00140 double nChi2_max_;
00141 double pt_min_;
00142
00145 unsigned vertexCandidatesSize_;
00146
00147
00148 TwoTrackMinimumDistance theMinimum_;
00149
00150
00151
00153 bool debug_;
00154
00155
00156 const MagneticField* magField_;
00157
00158 };
00159
00160 #endif
00161
00162