File indexing completed on 2024-04-06 12:29:07
0001 #include "RecoVertex/GaussianSumVertexFit/interface/GsfVertexFitter.h"
0002 #include "RecoVertex/VertexTools/interface/DummyVertexSmoother.h"
0003 #include "RecoVertex/GaussianSumVertexFit/interface/GsfVertexSmoother.h"
0004 #include "RecoVertex/GaussianSumVertexFit/interface/MultiPerigeeLTSFactory.h"
0005
0006 GsfVertexFitter::GsfVertexFitter(const edm::ParameterSet& pSet, const LinearizationPointFinder& linP) {
0007 float theMaxShift = pSet.getParameter<double>("maxDistance");
0008 int theMaxStep = pSet.getParameter<int>("maxNbrOfIterations");
0009 bool limitComponents_ = pSet.getParameter<bool>("limitComponents");
0010 bool useSmoothing = pSet.getParameter<bool>("smoothTracks");
0011
0012 VertexSmoother<5>* theSmoother;
0013 DeepCopyPointerByClone<GsfVertexMerger> theMerger;
0014
0015 if (limitComponents_) {
0016 edm::ParameterSet mergerPSet = pSet.getParameter<edm::ParameterSet>("GsfMergerParameters");
0017 theMerger = new GsfVertexMerger(mergerPSet);
0018 }
0019
0020 if (useSmoothing)
0021 theSmoother = new GsfVertexSmoother(limitComponents_, &*theMerger);
0022 else
0023 theSmoother = new DummyVertexSmoother<5>();
0024
0025 theSequentialFitter = new SequentialVertexFitter<5>(
0026 linP, GsfVertexUpdator(limitComponents_, &*theMerger), *theSmoother, MultiPerigeeLTSFactory());
0027 theSequentialFitter->setMaximumDistance(theMaxShift);
0028 theSequentialFitter->setMaximumNumberOfIterations(theMaxStep);
0029
0030 delete theSmoother;
0031 }
0032
0033 GsfVertexFitter::GsfVertexFitter(const GsfVertexFitter& original) {
0034 theSequentialFitter = original.theSequentialFitter->clone();
0035 }
0036
0037 GsfVertexFitter::~GsfVertexFitter() { delete theSequentialFitter; }