#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 |
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) |
virtual CachingVertex< 5 > | vertex (const std::vector< reco::TransientTrack > &) const |
virtual CachingVertex< 5 > | vertex (const std::vector< RefCountedVertexTrack > &) const |
virtual CachingVertex< 5 > | vertex (const std::vector< RefCountedVertexTrack > &, const reco::BeamSpot &spot) const |
virtual CachingVertex< 5 > | vertex (const std::vector< reco::TransientTrack > &, const GlobalPoint &linPoint) const |
virtual CachingVertex< 5 > | vertex (const std::vector< reco::TransientTrack > &, const GlobalPoint &priorPos, const GlobalError &priorError) const |
virtual CachingVertex< 5 > | vertex (const std::vector< reco::TransientTrack > &tracks, const reco::BeamSpot &beamSpot) const |
virtual CachingVertex< 5 > | vertex (const std::vector< RefCountedVertexTrack > &, const GlobalPoint &priorPos, const GlobalError &priorError) const |
virtual | ~AdaptiveVertexFitter () |
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_ |
int | mctr_ |
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.
typedef ReferenceCountingPointer<VertexTrack<5> > AdaptiveVertexFitter::RefCountedVertexTrack |
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 98 of file AdaptiveVertexFitter.cc.
References setParameters().
Referenced by clone().
AdaptiveVertexFitter::AdaptiveVertexFitter | ( | const AdaptiveVertexFitter & | original | ) |
Definition at line 120 of file AdaptiveVertexFitter.cc.
|
virtual |
Definition at line 132 of file AdaptiveVertexFitter.cc.
References theAssProbComputer, theComp, theLinP, theLinTrkFactory, theSmoother, and theUpdator.
|
virtual |
Fit vertex out of a VertexSeed
Implements VertexFitter< 5 >.
Definition at line 372 of file AdaptiveVertexFitter.cc.
References AdaptiveVertexFitter().
Referenced by AdaptiveGsfVertexFitter::AdaptiveGsfVertexFitter().
|
private |
perform the fit
Definition at line 522 of file AdaptiveVertexFitter.cc.
References VertexUpdator< N >::add(), AnnealingSchedule::anneal(), AnnealingSchedule::currentTemp(), mergeVDriftHistosByStation::file, getId(), gsfIntermediarySmoothing_, i, AnnealingSchedule::isAnnealed(), CachingVertex< N >::isValid(), LogDebug, m, mag(), PV3DBase< T, PVType, FrameType >::perp(), CachingVertex< N >::position(), reLinearizeTracks(), AnnealingSchedule::resetAnnealing(), reWeightTracks(), VertexSmoother< N >::smooth(), relval_parameters_module::step, theAssProbComputer, theMaxLPShift, theMaxShift, theMaxStep, theSmoother, theUpdator, theWeightThreshold, transverse(), AnnealingSchedule::weight(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by vertex().
|
private |
Definition at line 377 of file AdaptiveVertexFitter.cc.
References alignCSCRings::e, theAssProbComputer, AnnealingSchedule::weight(), and histoStyle::weight.
Referenced by 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 gsfIntermediarySmoothing_.
|
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 317 of file AdaptiveVertexFitter.cc.
References alignCSCRings::e, cppFunctionSkipper::exception, i, AbstractLTSFactory< N >::linearizedTrackState(), theLinTrkFactory, and weightTracks().
Referenced by 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 344 of file AdaptiveVertexFitter.cc.
References alignCSCRings::e, cppFunctionSkipper::exception, i, AbstractLTSFactory< N >::linearizedTrackState(), reWeightTracks(), theLinTrkFactory, and CachingVertex< N >::vertexState().
Referenced by fit().
|
private |
Construct a new container of VertexTracks with new weights accounting for vertex error, from an existing set of LinearizedTracks.
Definition at line 396 of file AdaptiveVertexFitter.cc.
References AnnealingSchedule::currentTemp(), alignCSCRings::e, VertexTrackCompatibilityEstimator< N >::estimate(), cppFunctionSkipper::exception, mergeVDriftHistosByStation::file, getId(), getWeight(), i, m, CachingVertex< N >::position(), python.multivaluedict::sort(), theAssProbComputer, theComp, theNr, CachingVertex< N >::vertexState(), VertexTrackFactory< N >::vertexTrack(), AnnealingSchedule::weight(), and histoStyle::weight.
Referenced by fit(), 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 502 of file AdaptiveVertexFitter.cc.
References i, and 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 142 of file AdaptiveVertexFitter.cc.
References theMaxLPShift, theMaxShift, theMaxStep, and theWeightThreshold.
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 152 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 114 of file AdaptiveVertexFitter.cc.
References theWeightThreshold, and w().
Referenced by PFTauPrimaryVertexProducer::produce(), and AdaptiveVertexReconstructor::setupFitters().
|
virtual |
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 161 of file AdaptiveVertexFitter.cc.
References fit(), LinearizationPointFinder::getLinearizationPoint(), linearizeTracks(), python.multivaluedict::sort(), theLinP, and testEve_cfg::tracks.
Referenced by NuclearVertexBuilder::FillVertexWithAdaptVtxFitter(), V0Fitter::fitAll(), PFDisplacedVertexFinder::fitVertexFromSeed(), PrimaryVertexAnalyzer4PU::getSimEvents(), InclusiveVertexFinder::produce(), PFTauPrimaryVertexProducer::produce(), TrackVertexArbitration::trackVertexArbitrator(), AdaptiveGsfVertexFitter::vertex(), and AdaptiveVertexReconstructor::vertices().
|
virtual |
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 182 of file AdaptiveVertexFitter.cc.
References fit().
|
virtual |
Same as above, only now also with BeamSpot constraint.
Definition at line 197 of file AdaptiveVertexFitter.cc.
References fit().
|
virtual |
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 215 of file AdaptiveVertexFitter.cc.
References fit(), and linearizeTracks().
|
virtual |
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 272 of file AdaptiveVertexFitter.cc.
References fit(), and linearizeTracks().
|
virtual |
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 237 of file AdaptiveVertexFitter.cc.
References fit(), LinearizationPointFinder::getLinearizationPoint(), linearizeTracks(), python.multivaluedict::sort(), theLinP, and testEve_cfg::tracks.
|
virtual |
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 293 of file AdaptiveVertexFitter.cc.
References fit().
|
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 451 of file AdaptiveVertexFitter.cc.
References AnnealingSchedule::currentTemp(), VertexTrackCompatibilityEstimator< N >::estimate(), mergeVDriftHistosByStation::file, getId(), getWeight(), i, m, AnnealingSchedule::resetAnnealing(), theAssProbComputer, theComp, theNr, VertexTrackFactory< N >::vertexTrack(), AnnealingSchedule::weight(), and histoStyle::weight.
Referenced by linearizeTracks().
|
private |
Definition at line 215 of file AdaptiveVertexFitter.h.
Referenced by fit(), and gsfIntermediarySmoothing().
|
mutableprivate |
Definition at line 216 of file AdaptiveVertexFitter.h.
|
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().