Go to the documentation of this file.00001 #ifndef SequentialVertexFitter_H
00002 #define SequentialVertexFitter_H
00003
00004 #include "RecoVertex/VertexPrimitives/interface/VertexFitter.h"
00005 #include "RecoVertex/VertexTools/interface/LinearizationPointFinder.h"
00006 #include "RecoVertex/VertexPrimitives/interface/VertexUpdator.h"
00007 #include "RecoVertex/VertexPrimitives/interface/VertexSmoother.h"
00008 #include "RecoVertex/VertexTools/interface/LinearizedTrackStateFactory.h"
00009 #include "RecoVertex/VertexTools/interface/VertexTrackFactory.h"
00010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00011 #include "FWCore/Utilities/interface/isFinite.h"
00012 #include <cmath>
00013
00014
00015
00034 template <unsigned int N>
00035 class SequentialVertexFitter : public VertexFitter<N> {
00036
00037 public:
00038
00039 typedef ReferenceCountingPointer<RefittedTrackState<N> > RefCountedRefittedTrackState;
00040 typedef ReferenceCountingPointer<VertexTrack<N> > RefCountedVertexTrack;
00041 typedef ReferenceCountingPointer<LinearizedTrackState<N> > RefCountedLinearizedTrackState;
00042
00043
00050 SequentialVertexFitter(const LinearizationPointFinder & linP,
00051 const VertexUpdator<N> & updator, const VertexSmoother<N> & smoother,
00052 const AbstractLTSFactory<N> & ltsf);
00053
00058 SequentialVertexFitter(const edm::ParameterSet& pSet,
00059 const LinearizationPointFinder & linP,
00060 const VertexUpdator<N> & updator, const VertexSmoother<N> & smoother,
00061 const AbstractLTSFactory<N> & ltsf);
00062
00067 SequentialVertexFitter(const SequentialVertexFitter & original);
00068
00069
00070 virtual ~SequentialVertexFitter();
00071
00072
00079 void setMaximumDistance(float maxShift) {theMaxShift = maxShift;}
00080
00081
00086 void setMaximumNumberOfIterations(int maxIterations)
00087 {theMaxStep = maxIterations;}
00088
00096 virtual CachingVertex<N> vertex(const std::vector<reco::TransientTrack> & tracks) const;
00097
00107 virtual CachingVertex<N> vertex(const std::vector<RefCountedVertexTrack> & tracks) const;
00108
00112 virtual CachingVertex<N> vertex(const std::vector<RefCountedVertexTrack> & tracks, const reco::BeamSpot & spot ) const;
00113
00114
00117 virtual CachingVertex<N> vertex(const std::vector<reco::TransientTrack> & tracks,
00118 const GlobalPoint& linPoint) const;
00119
00124 virtual CachingVertex<N> vertex(const std::vector<reco::TransientTrack> & tracks,
00125 const reco::BeamSpot& beamSpot) const;
00126
00127
00133 virtual CachingVertex<N> vertex(const std::vector<reco::TransientTrack> & tracks,
00134 const GlobalPoint& priorPos,
00135 const GlobalError& priorError) const;
00136
00141 virtual CachingVertex<N> vertex(const std::vector<RefCountedVertexTrack> & tracks,
00142 const GlobalPoint& priorPos,
00143 const GlobalError& priorError) const;
00144
00145
00146
00157
00158
00162 const LinearizationPointFinder * linearizationPointFinder() const
00163 {return theLinP;}
00164
00165 const VertexUpdator<N> * vertexUpdator() const
00166 {return theUpdator;}
00167
00168 const VertexSmoother<N> * vertexSmoother() const
00169 {return theSmoother;}
00170
00171 const float maxShift() const
00172 {return theMaxShift;}
00173
00174 const int maxStep() const
00175 {return theMaxStep;}
00176
00177 const edm::ParameterSet parameterSet() const
00178 {return thePSet;}
00179
00180 SequentialVertexFitter * clone() const {
00181 return new SequentialVertexFitter(* this);
00182 }
00183
00184 const AbstractLTSFactory<N> * linearizedTrackStateFactory() const
00185 { return theLTrackFactory;}
00186
00187 protected:
00188
00193 SequentialVertexFitter() {}
00194
00195 private:
00196
00206 CachingVertex<N> fit(const std::vector<RefCountedVertexTrack> & tracks,
00207 const VertexState priorVertex, bool withPrior) const;
00208
00216 std::vector<RefCountedVertexTrack> linearizeTracks(const std::vector<reco::TransientTrack> & tracks,
00217 const VertexState state) const;
00218
00229 std::vector<RefCountedVertexTrack> reLinearizeTracks(
00230 const std::vector<RefCountedVertexTrack> & tracks,
00231 const VertexState state) const;
00232
00233
00238 void readParameters();
00239 void setDefaultParameters();
00240
00244 inline bool hasNan(const GlobalPoint& point) const {
00245 using namespace std;
00246 return (edm::isNotFinite(point.x())|| edm::isNotFinite(point.y()) || edm::isNotFinite(point.z()));
00247 }
00248
00249
00250 float theMaxShift;
00251 int theMaxStep;
00252
00253 edm::ParameterSet thePSet;
00254 LinearizationPointFinder* theLinP;
00255 VertexUpdator<N> * theUpdator;
00256 VertexSmoother<N> * theSmoother;
00257 const AbstractLTSFactory<N> * theLTrackFactory;
00258
00259 VertexTrackFactory<N> theVTrackFactory;
00260
00261
00262 };
00263
00264 #endif