#include <AdaptiveVertexFitter.h>
Public Types | |
typedef ReferenceCountingPointer< LinearizedTrackState< 5 > > | RefCountedLinearizedTrackState |
typedef ReferenceCountingPointer< VertexTrack< 5 > > | RefCountedVertexTrack |
Public Member Functions | |
AdaptiveVertexFitter (const AnnealingSchedule &ann=GeometricAnnealing(), const LinearizationPointFinder &linP=DefaultLinearizationPointFinder(), const VertexUpdator< 5 > &updator=KalmanVertexUpdator< 5 >(), const VertexTrackCompatibilityEstimator< 5 > &estor=KalmanVertexTrackCompatibilityEstimator< 5 >(), const VertexSmoother< 5 > &smoother=DummyVertexSmoother< 5 >(), const AbstractLTSFactory< 5 > <sf=LinearizedTrackStateFactory()) | |
AdaptiveVertexFitter (const AdaptiveVertexFitter &original) | |
AdaptiveVertexFitter * | clone () const override |
void | gsfIntermediarySmoothing (bool sm) |
bool | gsfIntermediarySmoothing () const |
void | setParameters (double maxshift=0.0001, double maxlpshift=0.1, unsigned maxstep=30, double weightthreshold=.001) |
void | setParameters (const edm::ParameterSet &) |
void | setWeightThreshold (float w) |
CachingVertex< 5 > | vertex (const std::vector< reco::TransientTrack > &) const override |
CachingVertex< 5 > | vertex (const std::vector< RefCountedVertexTrack > &) const override |
CachingVertex< 5 > | vertex (const std::vector< RefCountedVertexTrack > &, const reco::BeamSpot &spot) const override |
CachingVertex< 5 > | vertex (const std::vector< reco::TransientTrack > &, const GlobalPoint &linPoint) const override |
CachingVertex< 5 > | vertex (const std::vector< reco::TransientTrack > &, const GlobalPoint &priorPos, const GlobalError &priorError) const override |
CachingVertex< 5 > | vertex (const std::vector< reco::TransientTrack > &tracks, const reco::BeamSpot &beamSpot) const override |
CachingVertex< 5 > | vertex (const std::vector< RefCountedVertexTrack > &, const GlobalPoint &priorPos, const GlobalError &priorError) const override |
~AdaptiveVertexFitter () override | |
Public Member Functions inherited from VertexFitter< 5 > | |
virtual CachingVertex< N > | vertex (const std::vector< typename CachingVertex< N >::RefCountedVertexTrack > &tracks) const =0 |
virtual CachingVertex< N > | vertex (const std::vector< typename CachingVertex< N >::RefCountedVertexTrack > &tracks, const reco::BeamSpot &spot) const =0 |
virtual CachingVertex< N > | vertex (const std::vector< typename CachingVertex< N >::RefCountedVertexTrack > &tracks, const GlobalPoint &priorPos, const GlobalError &priorError) const =0 |
VertexFitter () | |
virtual | ~VertexFitter () |
Private Member Functions | |
CachingVertex< 5 > | fit (const std::vector< RefCountedVertexTrack > &tracks, const VertexState &priorSeed, bool withPrior) const |
double | getWeight (float chi2) const |
std::vector< RefCountedVertexTrack > | linearizeTracks (const std::vector< reco::TransientTrack > &, const VertexState &) const |
std::vector< RefCountedVertexTrack > | reLinearizeTracks (const std::vector< RefCountedVertexTrack > &tracks, const CachingVertex< 5 > &vertex) const |
std::vector< RefCountedVertexTrack > | reWeightTracks (const std::vector< RefCountedLinearizedTrackState > &, const CachingVertex< 5 > &seed) const |
std::vector< RefCountedVertexTrack > | reWeightTracks (const std::vector< RefCountedVertexTrack > &, const CachingVertex< 5 > &seed) const |
std::vector< RefCountedVertexTrack > | weightTracks (const std::vector< RefCountedLinearizedTrackState > &, const VertexState &seed) const |
Private Attributes | |
bool | gsfIntermediarySmoothing_ |
AnnealingSchedule * | theAssProbComputer |
VertexTrackCompatibilityEstimator< 5 > * | theComp |
LinearizationPointFinder * | theLinP |
const AbstractLTSFactory< 5 > * | theLinTrkFactory |
double | theMaxLPShift |
double | theMaxShift |
int | theMaxStep |
int | theNr |
VertexSmoother< 5 > * | theSmoother |
VertexUpdator< 5 > * | theUpdator |
double | theWeightThreshold |
An iterative reweighted fitter. Very robust, very adaptive.
See CMS Note 2007/008.
Exceptions VertexException( "Supplied fewer than two tracks" ) VertexException( "fewer than 2 significant tracks (w>threshold)" )
Definition at line 29 of file AdaptiveVertexFitter.h.
typedef ReferenceCountingPointer<LinearizedTrackState<5> > AdaptiveVertexFitter::RefCountedLinearizedTrackState |
Definition at line 34 of file AdaptiveVertexFitter.h.
Definition at line 33 of file AdaptiveVertexFitter.h.
AdaptiveVertexFitter::AdaptiveVertexFitter | ( | const AnnealingSchedule & | ann = GeometricAnnealing() , |
const LinearizationPointFinder & | linP = DefaultLinearizationPointFinder() , |
||
const VertexUpdator< 5 > & | updator = KalmanVertexUpdator<5>() , |
||
const VertexTrackCompatibilityEstimator< 5 > & | estor = KalmanVertexTrackCompatibilityEstimator<5>() , |
||
const VertexSmoother< 5 > & | smoother = DummyVertexSmoother<5>() , |
||
const AbstractLTSFactory< 5 > & | ltsf = LinearizedTrackStateFactory() |
||
) |
Reimplemented constructors to use any kind of linearisation point finder, vertex updator and smoother. If no smoother is to be used, do not specify an instance for it.
Definition at line 95 of file AdaptiveVertexFitter.cc.
References setParameters().
Referenced by clone(), and setWeightThreshold().
AdaptiveVertexFitter::AdaptiveVertexFitter | ( | const AdaptiveVertexFitter & | original | ) |
Definition at line 117 of file AdaptiveVertexFitter.cc.
|
override |
Definition at line 129 of file AdaptiveVertexFitter.cc.
References theAssProbComputer, theComp, theLinP, theLinTrkFactory, theSmoother, and theUpdator.
|
overridevirtual |
Fit vertex out of a VertexSeed
Implements VertexFitter< 5 >.
Definition at line 369 of file AdaptiveVertexFitter.cc.
References AdaptiveVertexFitter().
Referenced by AdaptiveGsfVertexFitter::AdaptiveGsfVertexFitter().
|
private |
perform the fit
Definition at line 518 of file AdaptiveVertexFitter.cc.
References VertexUpdator< N >::add(), AnnealingSchedule::anneal(), vertices_cff::chi2, AnnealingSchedule::currentTemp(), VertexState::error(), FrontierConditions_GlobalTag_cff::file, getId(), gsfIntermediarySmoothing_, AnnealingSchedule::isAnnealed(), CachingVertex< N >::isValid(), LogDebug, funct::m, mag(), PV3DBase< T, PVType, FrameType >::perp(), VertexState::position(), CachingVertex< N >::position(), reLinearizeTracks(), AnnealingSchedule::resetAnnealing(), reWeightTracks(), VertexSmoother< N >::smooth(), theAssProbComputer, theMaxLPShift, theMaxShift, theMaxStep, theSmoother, theUpdator, theWeightThreshold, l1t::tracks, AnnealingSchedule::weight(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by gsfIntermediarySmoothing(), trackingPlots.Iteration::modules(), and vertex().
|
private |
Definition at line 374 of file AdaptiveVertexFitter.cc.
References MillePedeFileConverter_cfg::e, theAssProbComputer, AnnealingSchedule::weight(), and mps_merge::weight.
Referenced by gsfIntermediarySmoothing(), reWeightTracks(), and weightTracks().
|
inline |
Definition at line 141 of file AdaptiveVertexFitter.h.
References gsfIntermediarySmoothing_.
Referenced by AdaptiveGsfVertexFitter::AdaptiveGsfVertexFitter().
|
inline |
Definition at line 143 of file AdaptiveVertexFitter.h.
References vertices_cff::chi2, fit(), getWeight(), gsfIntermediarySmoothing_, linearizeTracks(), reLinearizeTracks(), reWeightTracks(), SurveyInfoScenario_cff::seed, l1t::tracks, vertex(), and weightTracks().
|
private |
Linearize tracks, for the first time in the iteration.
Construct a container of VertexTrack from a set of reco::TransientTracks. As this is the first iteration of the adaptive fit, the initial error does not enter in the computation of the weights. This is to avoid that all tracks get the same weight when using a very large initial error matrix.
Definition at line 314 of file AdaptiveVertexFitter.cc.
References MillePedeFileConverter_cfg::e, cppFunctionSkipper::exception, mps_fire::i, AbstractLTSFactory< N >::linearizedTrackState(), VertexState::position(), theLinTrkFactory, and weightTracks().
Referenced by gsfIntermediarySmoothing(), and vertex().
|
private |
Construct new a container of VertexTrack with a new linearization point and vertex seed, from an existing set of VertexTrack, from which only the recTracks will be used.
tracks | The original container of VertexTracks, from which the reco::TransientTracks will be extracted. |
vertex | The seed to use for the VertexTracks. This position will also be used as the new linearization point. |
Construct new a container of VertexTrack with a new linearization point and vertex seed, from an existing set of VertexTrack, from which only the recTracks will be used.
Definition at line 341 of file AdaptiveVertexFitter.cc.
References MillePedeFileConverter_cfg::e, cppFunctionSkipper::exception, AbstractLTSFactory< N >::linearizedTrackState(), VertexState::position(), reWeightTracks(), SurveyInfoScenario_cff::seed, theLinTrkFactory, and CachingVertex< N >::vertexState().
Referenced by fit(), and gsfIntermediarySmoothing().
|
private |
Construct a new container of VertexTracks with new weights accounting for vertex error, from an existing set of LinearizedTracks.
Definition at line 393 of file AdaptiveVertexFitter.cc.
References vertices_cff::chi2, AnnealingSchedule::currentTemp(), SoftLeptonByDistance_cfi::distance, MillePedeFileConverter_cfg::e, VertexTrackCompatibilityEstimator< N >::estimate(), cppFunctionSkipper::exception, FrontierConditions_GlobalTag_cff::file, getId(), getWeight(), mps_fire::i, funct::m, CachingVertex< N >::position(), SurveyInfoScenario_cff::seed, theAssProbComputer, theComp, theNr, CachingVertex< N >::vertexState(), VertexTrackFactory< N >::vertexTrack(), and AnnealingSchedule::weight().
Referenced by fit(), gsfIntermediarySmoothing(), reLinearizeTracks(), and reWeightTracks().
|
private |
Construct new a container of VertexTracks with new weights accounting for vertex error, from an existing set of VertexTracks. From these the LinearizedTracks will be reused.
Construct new a container of VertexTrack with new weights accounting for vertex error, from an existing set of VertexTracks. From these the LinearizedTracks will be reused.
Definition at line 498 of file AdaptiveVertexFitter.cc.
References reWeightTracks().
void AdaptiveVertexFitter::setParameters | ( | double | maxshift = 0.0001 , |
double | maxlpshift = 0.1 , |
||
unsigned | maxstep = 30 , |
||
double | weightthreshold = .001 |
||
) |
Reads the configurable parameters.
maxshift | if the vertex moves further than this (in cm), then we re-iterate. |
maxlpshift | if the vertex moves further than this, then we re-linearize the tracks. |
maxstep | that's the maximum of iterations that we allow for. |
weightthreshold | that's the minimum track weight for a track to be considered "significant". If fewer than two tracks are significant, an exception is thrown. |
Definition at line 139 of file AdaptiveVertexFitter.cc.
References theMaxLPShift, theMaxShift, theMaxStep, theWeightThreshold, and vertexReco_cff::weightthreshold.
Referenced by AdaptiveGsfVertexFitter::AdaptiveGsfVertexFitter(), AdaptiveVertexFitter(), ConfigurableAdaptiveFitter::configure(), and setParameters().
void AdaptiveVertexFitter::setParameters | ( | const edm::ParameterSet & | s | ) |
Sets parameters. The following parameters are expected: maxshift, maxlpshift, maxstep, weightthreshold
Definition at line 149 of file AdaptiveVertexFitter.cc.
References edm::ParameterSet::getParameter(), and setParameters().
void AdaptiveVertexFitter::setWeightThreshold | ( | float | w | ) |
Set the weight threshold should be used only to find (once) a good value FIXME this should disappear in the final version
Definition at line 111 of file AdaptiveVertexFitter.cc.
References AdaptiveVertexFitter(), theWeightThreshold, and w.
Referenced by PFTauPrimaryVertexProducerBase::produce(), and AdaptiveVertexReconstructor::setupFitters().
|
overridevirtual |
Method returning the fitted vertex, from a container of reco::TransientTracks. The linearization point will be searched with the given LP finder. No prior vertex position will be used in the vertex fit.
Implements VertexFitter< 5 >.
Definition at line 158 of file AdaptiveVertexFitter.cc.
References fit(), LinearizationPointFinder::getLinearizationPoint(), linearizeTracks(), SurveyInfoScenario_cff::seed, theLinP, and l1t::tracks.
Referenced by PrimaryVertexResolution::Plots::calculateAndFillResolution(), Tau.Tau::dxy(), NuclearVertexBuilder::FillVertexWithAdaptVtxFitter(), V0Fitter::fitAll(), PFDisplacedVertexFinder::fitVertexFromSeed(), gsfIntermediarySmoothing(), PFTauPrimaryVertexProducerBase::produce(), TemplatedInclusiveVertexFinder< InputContainer, VTX >::produce(), TrackVertexArbitration< VTX >::trackVertexArbitrator(), AdaptiveGsfVertexFitter::vertex(), and AdaptiveVertexReconstructor::vertices().
|
override |
Method returning the fitted vertex, from a container of VertexTracks. For the first loop, the LinearizedTrack contained in the VertexTracks will be used. If subsequent loops are needed, the new VertexTracks will be created with the last estimate of the vertex as linearization point. No prior vertex position will be used in the vertex fit.
Definition at line 179 of file AdaptiveVertexFitter.cc.
References fit(), and SurveyInfoScenario_cff::seed.
Referenced by Tau.Tau::dxy().
|
override |
Same as above, only now also with BeamSpot constraint.
Definition at line 194 of file AdaptiveVertexFitter.cc.
References fit().
Referenced by Tau.Tau::dxy().
|
overridevirtual |
Fit vertex out of a std::vector of reco::TransientTracks. Uses the specified linearization point.
Fit vertex out of a set of reco::TransientTracks. Uses the specified linearization point.
Implements VertexFitter< 5 >.
Definition at line 212 of file AdaptiveVertexFitter.cc.
References fit(), linearizeTracks(), and SurveyInfoScenario_cff::seed.
Referenced by Tau.Tau::dxy().
|
overridevirtual |
Fit vertex out of a set of reco::TransientTracks. Uses the position as both the linearization point AND as prior estimate of the vertex position. The error is used for the weight of the prior estimate.
Implements VertexFitter< 5 >.
Definition at line 269 of file AdaptiveVertexFitter.cc.
References fit(), linearizeTracks(), and SurveyInfoScenario_cff::seed.
Referenced by Tau.Tau::dxy().
|
overridevirtual |
Fit vertex out of a set of TransientTracks. The specified BeamSpot will be used as priot, but NOT for the linearization. The specified LinearizationPointFinder will be used to find the linearization point.
Implements VertexFitter< 5 >.
Definition at line 234 of file AdaptiveVertexFitter.cc.
References fit(), LinearizationPointFinder::getLinearizationPoint(), linearizeTracks(), theLinP, and l1t::tracks.
Referenced by Tau.Tau::dxy().
|
override |
Fit vertex out of a set of VertexTracks Uses the position and error for the prior estimate of the vertex. This position is not used to relinearize the tracks.
Definition at line 290 of file AdaptiveVertexFitter.cc.
References fit(), and SurveyInfoScenario_cff::seed.
Referenced by Tau.Tau::dxy().
|
private |
Weight the tracks, for the first time, using KalmanChiSquare.
track weighting, as opposed to re-weighting, must always be done with a reset annealer!
Definition at line 447 of file AdaptiveVertexFitter.cc.
References vertices_cff::chi2, AnnealingSchedule::currentTemp(), SoftLeptonByDistance_cfi::distance, VertexTrackCompatibilityEstimator< N >::estimate(), FrontierConditions_GlobalTag_cff::file, getId(), getWeight(), mps_fire::i, funct::m, AnnealingSchedule::resetAnnealing(), theAssProbComputer, theComp, theNr, VertexTrackFactory< N >::vertexTrack(), and AnnealingSchedule::weight().
Referenced by gsfIntermediarySmoothing(), and linearizeTracks().
|
private |
Definition at line 215 of file AdaptiveVertexFitter.h.
Referenced by fit(), and gsfIntermediarySmoothing().
|
private |
Definition at line 212 of file AdaptiveVertexFitter.h.
Referenced by fit(), getWeight(), reWeightTracks(), weightTracks(), and ~AdaptiveVertexFitter().
|
private |
Definition at line 213 of file AdaptiveVertexFitter.h.
Referenced by reWeightTracks(), weightTracks(), and ~AdaptiveVertexFitter().
|
private |
Definition at line 209 of file AdaptiveVertexFitter.h.
Referenced by vertex(), and ~AdaptiveVertexFitter().
|
private |
Definition at line 214 of file AdaptiveVertexFitter.h.
Referenced by linearizeTracks(), reLinearizeTracks(), and ~AdaptiveVertexFitter().
|
private |
Definition at line 204 of file AdaptiveVertexFitter.h.
Referenced by fit(), and setParameters().
|
private |
Definition at line 203 of file AdaptiveVertexFitter.h.
Referenced by fit(), and setParameters().
|
private |
Definition at line 205 of file AdaptiveVertexFitter.h.
Referenced by fit(), and setParameters().
|
mutableprivate |
Definition at line 207 of file AdaptiveVertexFitter.h.
Referenced by reWeightTracks(), and weightTracks().
|
private |
Definition at line 211 of file AdaptiveVertexFitter.h.
Referenced by fit(), and ~AdaptiveVertexFitter().
|
private |
Definition at line 210 of file AdaptiveVertexFitter.h.
Referenced by fit(), and ~AdaptiveVertexFitter().
|
private |
Definition at line 206 of file AdaptiveVertexFitter.h.
Referenced by fit(), setParameters(), and setWeightThreshold().