File indexing completed on 2025-03-13 02:32:20
0001 #include "RecoVertex/KalmanVertexFit/interface/KalmanVertexFitter.h"
0002 #include "RecoVertex/KalmanVertexFit/interface/KalmanVertexUpdator.h"
0003 #include "RecoVertex/VertexTools/interface/SequentialVertexSmoother.h"
0004 #include "RecoVertex/VertexTools/interface/DummyVertexSmoother.h"
0005 #include "RecoVertex/KalmanVertexFit/interface/KalmanVertexTrackUpdator.h"
0006 #include "RecoVertex/KalmanVertexFit/interface/KalmanSmoothedVertexChi2Estimator.h"
0007 #include "RecoVertex/KalmanVertexFit/interface/KalmanTrackToTrackCovCalculator.h"
0008 #include "RecoVertex/LinearizationPointFinders/interface/FsmwLinearizationPointFinder.h"
0009
0010 KalmanVertexFitter::KalmanVertexFitter(bool useSmoothing) : KalmanVertexFitter(useSmoothing, false) {}
0011
0012 KalmanVertexFitter::KalmanVertexFitter(bool useSmoothing, bool useMuonSystemBounds) {
0013 edm::ParameterSet pSet = defaultParameters();
0014 setup(pSet, useSmoothing, useMuonSystemBounds);
0015 }
0016
0017 KalmanVertexFitter::KalmanVertexFitter(const edm::ParameterSet& pSet, bool useSmoothing, bool useMuonSystemBounds) {
0018 setup(pSet, useSmoothing, useMuonSystemBounds);
0019 }
0020
0021 void KalmanVertexFitter::setup(const edm::ParameterSet& pSet, bool useSmoothing, bool useMuonSystemBounds) {
0022 if (useSmoothing) {
0023 KalmanVertexTrackUpdator<5> vtu;
0024 KalmanSmoothedVertexChi2Estimator<5> vse;
0025 KalmanTrackToTrackCovCalculator<5> covCalc;
0026 SequentialVertexSmoother<5> smoother(vtu, vse, covCalc);
0027 theSequentialFitter = new SequentialVertexFitter<5>(pSet,
0028 FsmwLinearizationPointFinder(20, -2., 0.4, 10.),
0029 KalmanVertexUpdator<5>(),
0030 smoother,
0031 LinearizedTrackStateFactory());
0032 } else {
0033 DummyVertexSmoother<5> smoother;
0034 theSequentialFitter = new SequentialVertexFitter<5>(pSet,
0035 FsmwLinearizationPointFinder(20, -2., 0.4, 10.),
0036 KalmanVertexUpdator<5>(),
0037 smoother,
0038 LinearizedTrackStateFactory());
0039 }
0040 if (useMuonSystemBounds)
0041 theSequentialFitter->setMuonSystemBounds();
0042 }
0043
0044 edm::ParameterSet KalmanVertexFitter::defaultParameters() const {
0045 edm::ParameterSet pSet;
0046 pSet.addParameter<double>("maxDistance", 0.01);
0047 pSet.addParameter<int>("maxNbrOfIterations", 10);
0048 return pSet;
0049 }