File indexing completed on 2024-04-06 12:29:02
0001 #ifndef AdaptiveVertexFitter_H
0002 #define AdaptiveVertexFitter_H
0003
0004 #include "RecoVertex/VertexPrimitives/interface/VertexFitter.h"
0005 #include "RecoVertex/LinearizationPointFinders/interface/DefaultLinearizationPointFinder.h"
0006 #include "RecoVertex/VertexTools/interface/GeometricAnnealing.h"
0007 #include "RecoVertex/KalmanVertexFit/interface/KalmanVertexUpdator.h"
0008 #include "RecoVertex/VertexTools/interface/DummyVertexSmoother.h"
0009
0010 #include "RecoVertex/VertexPrimitives/interface/VertexState.h"
0011 #include "RecoVertex/VertexPrimitives/interface/VertexTrackCompatibilityEstimator.h"
0012 #include "RecoVertex/VertexTools/interface/LinearizedTrackStateFactory.h"
0013 #include "RecoVertex/KalmanVertexFit/interface/KalmanVertexTrackCompatibilityEstimator.h"
0014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 class AdaptiveVertexFitter : public VertexFitter<5> {
0030 public:
0031 typedef ReferenceCountingPointer<VertexTrack<5> > RefCountedVertexTrack;
0032 typedef ReferenceCountingPointer<LinearizedTrackState<5> > RefCountedLinearizedTrackState;
0033
0034
0035
0036
0037
0038
0039 AdaptiveVertexFitter(const AnnealingSchedule &ann = GeometricAnnealing(),
0040 const LinearizationPointFinder &linP = DefaultLinearizationPointFinder(),
0041 const VertexUpdator<5> &updator = KalmanVertexUpdator<5>(),
0042 const VertexTrackCompatibilityEstimator<5> &estor = KalmanVertexTrackCompatibilityEstimator<5>(),
0043 const VertexSmoother<5> &smoother = DummyVertexSmoother<5>(),
0044 const AbstractLTSFactory<5> <sf = LinearizedTrackStateFactory());
0045
0046 AdaptiveVertexFitter(const AdaptiveVertexFitter &original);
0047
0048 ~AdaptiveVertexFitter() override;
0049
0050
0051
0052
0053
0054
0055
0056 CachingVertex<5> vertex(const std::vector<reco::TransientTrack> &) const override;
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066 CachingVertex<5> vertex(const std::vector<RefCountedVertexTrack> &) const override;
0067
0068
0069
0070
0071 CachingVertex<5> vertex(const std::vector<RefCountedVertexTrack> &, const reco::BeamSpot &spot) const override;
0072
0073
0074
0075
0076 CachingVertex<5> vertex(const std::vector<reco::TransientTrack> &, const GlobalPoint &linPoint) const override;
0077
0078
0079
0080
0081
0082
0083 CachingVertex<5> vertex(const std::vector<reco::TransientTrack> &,
0084 const GlobalPoint &priorPos,
0085 const GlobalError &priorError) const override;
0086
0087
0088
0089
0090
0091 CachingVertex<5> vertex(const std::vector<reco::TransientTrack> &tracks,
0092 const reco::BeamSpot &beamSpot) const override;
0093
0094
0095
0096
0097
0098 CachingVertex<5> vertex(const std::vector<RefCountedVertexTrack> &,
0099 const GlobalPoint &priorPos,
0100 const GlobalError &priorError) const override;
0101
0102 AdaptiveVertexFitter *clone() const override;
0103
0104
0105
0106
0107
0108
0109
0110 void setWeightThreshold(float w);
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123 void setParameters(double maxshift = 0.0001,
0124 double maxlpshift = 0.1,
0125 unsigned maxstep = 30,
0126 double weightthreshold = .001);
0127
0128
0129
0130
0131
0132
0133 void setParameters(const edm::ParameterSet &);
0134
0135 void gsfIntermediarySmoothing(bool sm) { gsfIntermediarySmoothing_ = sm; }
0136
0137 bool gsfIntermediarySmoothing() const { return gsfIntermediarySmoothing_; }
0138
0139 private:
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150 std::vector<RefCountedVertexTrack> reLinearizeTracks(const std::vector<RefCountedVertexTrack> &tracks,
0151 const CachingVertex<5> &vertex) const;
0152
0153
0154
0155
0156
0157 std::vector<RefCountedVertexTrack> reWeightTracks(const std::vector<RefCountedLinearizedTrackState> &,
0158 const CachingVertex<5> &seed) const;
0159
0160
0161
0162
0163
0164
0165 std::vector<RefCountedVertexTrack> reWeightTracks(const std::vector<RefCountedVertexTrack> &,
0166 const CachingVertex<5> &seed) const;
0167
0168
0169
0170
0171
0172
0173 std::vector<RefCountedVertexTrack> weightTracks(const std::vector<RefCountedLinearizedTrackState> &,
0174 const VertexState &seed) const;
0175
0176
0177
0178
0179 std::vector<RefCountedVertexTrack> linearizeTracks(const std::vector<reco::TransientTrack> &,
0180 const VertexState &) const;
0181
0182
0183
0184 CachingVertex<5> fit(const std::vector<RefCountedVertexTrack> &tracks,
0185 const VertexState &priorSeed,
0186 bool withPrior) const;
0187
0188 double getWeight(float chi2) const;
0189
0190 private:
0191 double theMaxShift;
0192 double theMaxLPShift;
0193 int theMaxStep;
0194 double theWeightThreshold;
0195 mutable int theNr;
0196
0197 LinearizationPointFinder *theLinP;
0198 VertexUpdator<5> *theUpdator;
0199 VertexSmoother<5> *theSmoother;
0200 AnnealingSchedule *theAssProbComputer;
0201 VertexTrackCompatibilityEstimator<5> *theComp;
0202 const AbstractLTSFactory<5> *theLinTrkFactory;
0203 bool gsfIntermediarySmoothing_;
0204 };
0205
0206 #endif