CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/src/RecoVertex/GaussianSumVertexFit/src/GsfVertexFitter.cc

Go to the documentation of this file.
00001 #include "RecoVertex/GaussianSumVertexFit/interface/GsfVertexFitter.h"
00002 #include "RecoVertex/VertexTools/interface/DummyVertexSmoother.h"
00003 #include "RecoVertex/GaussianSumVertexFit/interface/GsfVertexSmoother.h"
00004 #include "RecoVertex/GaussianSumVertexFit/interface/MultiPerigeeLTSFactory.h"
00005 
00006 
00007 
00008 GsfVertexFitter::GsfVertexFitter(const edm::ParameterSet& pSet,
00009         const LinearizationPointFinder & linP )
00010 {
00011   float theMaxShift = pSet.getParameter<double>("maxDistance"); //0.01
00012   int theMaxStep = pSet.getParameter<int>("maxNbrOfIterations"); //10
00013   bool limitComponents_ = pSet.getParameter<bool>("limitComponents");
00014   bool useSmoothing = pSet.getParameter<bool>("smoothTracks");
00015 
00016   VertexSmoother<5> * theSmoother;
00017   DeepCopyPointerByClone<GsfVertexMerger> theMerger;
00018 
00019   if (limitComponents_) {
00020     edm::ParameterSet mergerPSet = pSet.getParameter<edm::ParameterSet>("GsfMergerParameters");
00021     theMerger = new GsfVertexMerger(mergerPSet);
00022   }
00023 
00024   if (useSmoothing) theSmoother = new GsfVertexSmoother(limitComponents_, &*theMerger);
00025     else theSmoother = new DummyVertexSmoother<5>();
00026 
00027   theSequentialFitter = new SequentialVertexFitter<5>(linP, 
00028         GsfVertexUpdator(limitComponents_, &*theMerger),
00029         *theSmoother, MultiPerigeeLTSFactory());
00030   theSequentialFitter->setMaximumDistance(theMaxShift);
00031   theSequentialFitter->setMaximumNumberOfIterations(theMaxStep);
00032 
00033   delete theSmoother;
00034  }
00035 
00036 GsfVertexFitter::GsfVertexFitter(const GsfVertexFitter & original)
00037 {
00038   theSequentialFitter = original.theSequentialFitter->clone();
00039 }
00040 
00041 GsfVertexFitter::~GsfVertexFitter()
00042 {
00043   delete theSequentialFitter;
00044 }