#include <MatcherUsingTracksAlgorithm.h>
Public Member Functions | |
bool | hasChi2 () const |
Return 'true' if the matcher will produce also chi2. More... | |
bool | hasMetrics () const |
Return 'true' if the matcher will produce meaningful deltaR, deltaLocalPos, deltaPtRel values. More... | |
void | init (const edm::EventSetup &iSetup) |
Call this method at the beginning of each run, to initialize geometry, magnetic field and propagators. More... | |
bool | match (const reco::Candidate &c1, const reco::Candidate &c2, float &deltaR, float &deltaEta, float &deltaPhi, float &deltaLocalPos, float &deltaPtRel, float &chi2) const |
int | match (const reco::Candidate &tk, const edm::View< reco::Candidate > &c2s, float &deltaR, float &deltaEta, float &deltaPhi, float &deltaLocalPos, float &deltaPtRel, float &chi2) const |
MatcherUsingTracksAlgorithm (const edm::ParameterSet &iConfig) | |
virtual | ~MatcherUsingTracksAlgorithm () |
Static Public Member Functions | |
static void | cropAndInvert (AlgebraicSymMatrix55 &cov, bool diagonalOnly, bool top3by3only) |
Possibly crop the 3x3 part of the matrix or remove off-diagonal terms, then invert. More... | |
static double | getChi2 (const FreeTrajectoryState &start, const FreeTrajectoryState &other, bool diagonalOnly, bool useVertex, bool useFirstMomentum) |
static double | getChi2 (const FreeTrajectoryState &start, const TrajectoryStateClosestToPoint &other, bool diagonalOnly, bool useVertex) |
static double | getChi2 (const TrajectoryStateOnSurface &start, const TrajectoryStateOnSurface &other, bool diagonalOnly, bool usePosition) |
Private Types | |
enum | AlgoType { ByTrackRef, ByDirectComparison, ByPropagatingSrc, ByPropagatingMatched, ByPropagatingSrcTSCP, ByPropagatingMatchedTSCP } |
enum | SortBy { LocalPosDiff, GlobalMomDeltaR, GlobalMomDeltaEta, GlobalMomDeltaPhi, GlobalDPtRel, Chi2 } |
enum | WhichState { AtVertex, Innermost, Outermost } |
enum | WhichTrack { None, TrackerTk, MuonTk, GlobalTk } |
Private Member Functions | |
void | getConf (const edm::ParameterSet &iConfig, const std::string &whatFor, WhichTrack &whichTrack, WhichState &whichState) |
Parse some configuration. More... | |
reco::TrackRef | getTrack (const reco::Candidate &reco, WhichTrack which) const |
Get track reference out of a Candidate (via dynamic_cast to reco::RecoCandidate) More... | |
bool | matchByDirectComparison (const FreeTrajectoryState &start, const FreeTrajectoryState &other, float &lastDeltaR, float &lastDeltaEta, float &lastDeltaPhi, float &lastDeltaLocalPos, float &lastGlobalDPtRel, float &lastChi2) const |
Compare directly two states. return true if current pair is the new best match (in that case, update also deltaR and deltaLocalPos) More... | |
bool | matchWithPropagation (const FreeTrajectoryState &start, const FreeTrajectoryState &target, float &lastDeltaR, float &lastDeltaEta, float &lastDeltaPhi, float &lastDeltaLocalPos, float &lastGlobalDPtRel, float &lastChi2) const |
bool | matchWithPropagation (const FreeTrajectoryState &start, const TrajectoryStateOnSurface &target, float &lastDeltaR, float &lastDeltaEta, float &lastDeltaPhi, float &lastDeltaLocalPos, float &lastGlobalDPtRel, float &lastChi2) const |
FreeTrajectoryState | startingState (const reco::Candidate &reco, WhichTrack whichTrack, WhichState whichState) const |
Starting state for the propagation. More... | |
TrajectoryStateOnSurface | targetState (const reco::Candidate &reco, WhichTrack whichTrack, WhichState whichState) const |
End state for the propagation. More... | |
Private Attributes | |
AlgoType | algo_ |
bool | chi2DiagonalOnly_ |
bool | chi2FirstMomentum_ |
bool | chi2UseVertex_ |
edm::ESHandle< GlobalTrackingGeometry > | geometry_ |
edm::ESHandle< MagneticField > | magfield_ |
StringCutObjectSelector< reco::Candidate, true > | matchedCut_ |
float | maxChi2_ |
float | maxGlobalDPtRel_ |
float | maxGlobalMomDeltaEta_ |
float | maxGlobalMomDeltaPhi_ |
float | maxGlobalMomDeltaR_ |
float | maxLocalPosDiff_ |
edm::ESHandle< Propagator > | propagator_ |
bool | requireSameCharge_ |
SortBy | sortBy_ |
StringCutObjectSelector< reco::Candidate, true > | srcCut_ |
bool | useChi2_ |
WhichState | whichState1_ |
WhichState | whichState2_ |
WhichTrack | whichTrack1_ |
WhichTrack | whichTrack2_ |
Definition at line 30 of file MatcherUsingTracksAlgorithm.h.
|
private |
Enumerator | |
---|---|
ByTrackRef | |
ByDirectComparison | |
ByPropagatingSrc | |
ByPropagatingMatched | |
ByPropagatingSrcTSCP | |
ByPropagatingMatchedTSCP |
Definition at line 75 of file MatcherUsingTracksAlgorithm.h.
|
private |
Enumerator | |
---|---|
LocalPosDiff | |
GlobalMomDeltaR | |
GlobalMomDeltaEta | |
GlobalMomDeltaPhi | |
GlobalDPtRel | |
Chi2 |
Definition at line 97 of file MatcherUsingTracksAlgorithm.h.
|
private |
Enumerator | |
---|---|
AtVertex | |
Innermost | |
Outermost |
Definition at line 79 of file MatcherUsingTracksAlgorithm.h.
|
private |
Enumerator | |
---|---|
None | |
TrackerTk | |
MuonTk | |
GlobalTk |
Definition at line 78 of file MatcherUsingTracksAlgorithm.h.
|
explicit |
Definition at line 20 of file MatcherUsingTracksAlgorithm.cc.
References patPFMETCorrections_cff::algo, algo_, AtVertex, ByDirectComparison, ByPropagatingMatched, ByPropagatingMatchedTSCP, ByPropagatingSrc, ByPropagatingSrcTSCP, ByTrackRef, Chi2, chi2DiagonalOnly_, chi2FirstMomentum_, chi2UseVertex_, Exception, edm::ParameterSet::existsAs(), getConf(), edm::ParameterSet::getParameter(), GlobalDPtRel, GlobalMomDeltaEta, GlobalMomDeltaPhi, GlobalMomDeltaR, LocalPosDiff, maxChi2_, maxGlobalDPtRel_, maxGlobalMomDeltaEta_, maxGlobalMomDeltaPhi_, maxGlobalMomDeltaR_, maxLocalPosDiff_, None, sortBy_, AlCaHLTBitMon_QueryRunRegistry::string, useChi2_, whichState1_, whichState2_, whichTrack1_, and whichTrack2_.
|
inlinevirtual |
Definition at line 33 of file MatcherUsingTracksAlgorithm.h.
References alignmentValidation::c1, vertices_cff::chi2, spr::deltaEta, hiPixelPairStep_cff::deltaPhi, deltaR(), init(), and match().
|
static |
Possibly crop the 3x3 part of the matrix or remove off-diagonal terms, then invert.
Definition at line 482 of file MatcherUsingTracksAlgorithm.cc.
References mps_fire::i.
Referenced by getChi2(), and hasChi2().
|
static |
Compute the chi2 of two free trajectory states, in the curvilinear frame (q/p, theta, phi, dxy, dsz) At least one must have errors diagonalOnly: don't use off-diagonal terms of covariance matrix useVertex : use dxy, dsz in the chi2 (if false, use only q/p, theta, phi) useFirstMomentum : use the 'start' state momentum to compute dxy, dsx (if false, use 'other')
Definition at line 437 of file MatcherUsingTracksAlgorithm.cc.
References FreeTrajectoryState::charge(), cropAndInvert(), FreeTrajectoryState::curvilinearError(), diffTreeTool::diff, PVValHelper::dxy, FreeTrajectoryState::hasError(), PV3DBase< T, PVType, FrameType >::mag(), CurvilinearTrajectoryError::matrix(), FreeTrajectoryState::momentum(), AlCaHLTBitMon_ParallelJobs::p, p1, p2, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), FreeTrajectoryState::position(), EnergyCorrector::pt, PV3DBase< T, PVType, FrameType >::theta(), relativeConstraints::value, PV3DBase< T, PVType, FrameType >::x(), globals_cff::x1, globals_cff::x2, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by hasChi2(), matchByDirectComparison(), and matchWithPropagation().
|
static |
Compute the chi2 of one free trajectory state and a TrajectoryStateClosestToPoint closest to it, in the perigee frame At least one must have errors diagonalOnly: don't use off-diagonal terms of covariance matrix useVertex : use dxy, dsz in the chi2 (if false, use only q/p, theta, phi)
Definition at line 457 of file MatcherUsingTracksAlgorithm.cc.
References PerigeeTrajectoryError::covarianceMatrix(), cropAndInvert(), diffTreeTool::diff, PerigeeConversions::ftsToPerigeeError(), PerigeeConversions::ftsToPerigeeParameters(), FreeTrajectoryState::hasError(), TrajectoryStateClosestToPoint::hasError(), TrajectoryStateClosestToPoint::perigeeError(), TrajectoryStateClosestToPoint::perigeeParameters(), EnergyCorrector::pt, TrajectoryStateClosestToPoint::referencePoint(), and PerigeeTrajectoryParameters::vector().
|
static |
Compute the chi2 of two free trajectory states, in the local frame (q/p, dx, dy, dxdz, dydz) At least one must have errors diagonalOnly: don't use off-diagonal terms of covariance matrix useVertex : use dx, dy in the chi2 (if false, use only direction and q/p)
Definition at line 471 of file MatcherUsingTracksAlgorithm.cc.
References cropAndInvert(), diffTreeTool::diff, TrajectoryStateOnSurface::hasError(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localParameters(), LocalTrajectoryError::matrix(), and LocalTrajectoryParameters::mixedFormatVector().
|
private |
Parse some configuration.
Definition at line 101 of file MatcherUsingTracksAlgorithm.cc.
References algo_, AtVertex, ByTrackRef, Exception, edm::ParameterSet::getParameter(), GlobalTk, Innermost, MuonTk, None, Outermost, AlCaHLTBitMon_QueryRunRegistry::string, and TrackerTk.
Referenced by MatcherUsingTracksAlgorithm().
|
private |
Get track reference out of a Candidate (via dynamic_cast to reco::RecoCandidate)
Definition at line 235 of file MatcherUsingTracksAlgorithm.cc.
References reco::RecoCandidate::combinedMuon(), Exception, GlobalTk, MuonTk, trackingPlots::reco, reco::RecoCandidate::standAloneMuon(), reco::RecoCandidate::track(), and TrackerTk.
Referenced by match(), startingState(), and targetState().
|
inline |
Return 'true' if the matcher will produce also chi2.
Definition at line 51 of file MatcherUsingTracksAlgorithm.h.
References cropAndInvert(), TrackerKinkFinder_cfi::diagonalOnly, getChi2(), trackingPlots::other, useChi2_, TrackerKinkFinder_cfi::usePosition, and VerticesFromLeptons_cfi::useVertex.
|
inline |
Return 'true' if the matcher will produce meaningful deltaR, deltaLocalPos, deltaPtRel values.
Definition at line 48 of file MatcherUsingTracksAlgorithm.h.
References algo_, and ByTrackRef.
void MatcherUsingTracksAlgorithm::init | ( | const edm::EventSetup & | iSetup | ) |
Call this method at the beginning of each run, to initialize geometry, magnetic field and propagators.
Definition at line 227 of file MatcherUsingTracksAlgorithm.cc.
References geometry_, edm::EventSetup::get(), magfield_, and propagator_.
Referenced by ~MatcherUsingTracksAlgorithm().
bool MatcherUsingTracksAlgorithm::match | ( | const reco::Candidate & | c1, |
const reco::Candidate & | c2, | ||
float & | deltR, | ||
float & | deltEta, | ||
float & | deltPhi, | ||
float & | deltaLocalPos, | ||
float & | deltaPtRel, | ||
float & | chi2 | ||
) | const |
Try to match one track to another one. Return true if succeeded. For matches not by ref, it will update deltaR, deltaLocalPos and deltaPtRel if the match suceeded
Definition at line 120 of file MatcherUsingTracksAlgorithm.cc.
References algo_, ByDirectComparison, ByPropagatingMatched, ByPropagatingMatchedTSCP, ByPropagatingSrc, ByPropagatingSrcTSCP, ByTrackRef, reco::Candidate::charge(), getTrack(), edm::Ref< C, T, F >::id(), edm::Ref< C, T, F >::isNonnull(), matchByDirectComparison(), matchedCut_, matchWithPropagation(), requireSameCharge_, srcCut_, startingState(), edmPickEvents::target, targetState(), whichState1_, whichState2_, whichTrack1_, and whichTrack2_.
Referenced by match(), and ~MatcherUsingTracksAlgorithm().
int MatcherUsingTracksAlgorithm::match | ( | const reco::Candidate & | c1, |
const edm::View< reco::Candidate > & | c2s, | ||
float & | deltR, | ||
float & | deltEta, | ||
float & | deltPhi, | ||
float & | deltaLocalPos, | ||
float & | deltaPtRel, | ||
float & | chi2 | ||
) | const |
Find the best match to another candidate, and return its index in the vector For matches not by ref, it will update deltaR, deltaLocalPos and deltaPtRel if the match suceeded Returns -1 if the match fails
Definition at line 166 of file MatcherUsingTracksAlgorithm.cc.
References algo_, edm::View< T >::begin(), ByDirectComparison, ByPropagatingMatched, ByPropagatingMatchedTSCP, ByPropagatingSrc, ByPropagatingSrcTSCP, ByTrackRef, reco::Candidate::charge(), edm::View< T >::end(), cmsRelvalreport::exit, getTrack(), mps_fire::i, edm::Ref< C, T, F >::id(), edm::Ref< C, T, F >::isNonnull(), match(), matchByDirectComparison(), matchedCut_, matchWithPropagation(), requireSameCharge_, srcCut_, command_line::start, startingState(), edmPickEvents::target, targetState(), whichState1_, whichState2_, whichTrack1_, and whichTrack2_.
|
private |
Compare directly two states. return true if current pair is the new best match (in that case, update also deltaR and deltaLocalPos)
Definition at line 390 of file MatcherUsingTracksAlgorithm.cc.
References PV3DBase< T, PVType, FrameType >::barePhi(), chi2DiagonalOnly_, chi2FirstMomentum_, chi2UseVertex_, hiPixelPairStep_cff::deltaPhi, deltaR(), PV3DBase< T, PVType, FrameType >::eta(), getChi2(), GlobalDPtRel, GlobalMomDeltaEta, GlobalMomDeltaPhi, GlobalMomDeltaR, LocalPosDiff, PV3DBase< T, PVType, FrameType >::mag(), mag(), maxChi2_, maxGlobalDPtRel_, maxGlobalMomDeltaEta_, maxGlobalMomDeltaPhi_, maxGlobalMomDeltaR_, maxLocalPosDiff_, FreeTrajectoryState::momentum(), PV3DBase< T, PVType, FrameType >::perp(), FreeTrajectoryState::position(), sortBy_, and useChi2_.
Referenced by match().
|
private |
Propagate and match. return true if current pair is the new best match (in that case, update also deltaR and deltaLocalPos) Uses TrajectoryStateClosestToPointBuilder
Definition at line 337 of file MatcherUsingTracksAlgorithm.cc.
References PV3DBase< T, PVType, FrameType >::barePhi(), chi2DiagonalOnly_, chi2UseVertex_, hiPixelPairStep_cff::deltaPhi, deltaR(), PV3DBase< T, PVType, FrameType >::eta(), getChi2(), GlobalDPtRel, GlobalMomDeltaEta, GlobalMomDeltaPhi, GlobalMomDeltaR, LocalPosDiff, PV3DBase< T, PVType, FrameType >::mag(), mag(), maxChi2_, maxGlobalDPtRel_, maxGlobalMomDeltaEta_, maxGlobalMomDeltaPhi_, maxGlobalMomDeltaR_, maxLocalPosDiff_, FreeTrajectoryState::momentum(), TrajectoryStateClosestToPoint::momentum(), PV3DBase< T, PVType, FrameType >::perp(), FreeTrajectoryState::position(), TrajectoryStateClosestToPoint::position(), PhotonConversionTrajectorySeedProducerFromQuadruplets_cfi::propagator, sortBy_, and useChi2_.
Referenced by match().
|
private |
Propagate and match. return true if current pair is the new best match (in that case, update also deltaR and deltaLocalPos) Uses standard propagator to reach target's surface
Definition at line 286 of file MatcherUsingTracksAlgorithm.cc.
References PV3DBase< T, PVType, FrameType >::barePhi(), chi2DiagonalOnly_, chi2UseVertex_, hiPixelPairStep_cff::deltaPhi, deltaR(), PV3DBase< T, PVType, FrameType >::eta(), getChi2(), GlobalDPtRel, GlobalMomDeltaEta, GlobalMomDeltaPhi, GlobalMomDeltaR, TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::isValid(), LocalPosDiff, TrajectoryStateOnSurface::localPosition(), PV3DBase< T, PVType, FrameType >::mag(), mag(), maxChi2_, maxGlobalDPtRel_, maxGlobalMomDeltaEta_, maxGlobalMomDeltaPhi_, maxGlobalMomDeltaR_, maxLocalPosDiff_, FreeTrajectoryState::momentum(), PV3DBase< T, PVType, FrameType >::perp(), Propagator::propagate(), propagator_, sortBy_, TrajectoryStateOnSurface::surface(), and useChi2_.
|
private |
Starting state for the propagation.
Definition at line 249 of file MatcherUsingTracksAlgorithm.cc.
References AtVertex, reco::Candidate::charge(), getTrack(), trajectoryStateTransform::initialFreeState(), trajectoryStateTransform::innerFreeState(), Innermost, edm::Ref< C, T, F >::isNull(), magfield_, None, trajectoryStateTransform::outerFreeState(), Outermost, edm::ESHandle< T >::product(), reco::Candidate::px(), reco::Candidate::py(), reco::Candidate::pz(), reco::Candidate::vx(), reco::Candidate::vy(), and reco::Candidate::vz().
Referenced by match().
|
private |
End state for the propagation.
Definition at line 272 of file MatcherUsingTracksAlgorithm.cc.
References geometry_, getTrack(), Innermost, trajectoryStateTransform::innerStateOnSurface(), edm::Ref< C, T, F >::isNonnull(), magfield_, Outermost, trajectoryStateTransform::outerStateOnSurface(), and edm::ESHandle< T >::product().
Referenced by match().
|
private |
Definition at line 81 of file MatcherUsingTracksAlgorithm.h.
Referenced by getConf(), hasMetrics(), match(), and MatcherUsingTracksAlgorithm().
|
private |
Definition at line 96 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 96 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), and MatcherUsingTracksAlgorithm().
|
private |
Definition at line 96 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 104 of file MatcherUsingTracksAlgorithm.h.
Referenced by init(), and targetState().
|
private |
Definition at line 102 of file MatcherUsingTracksAlgorithm.h.
Referenced by init(), startingState(), and targetState().
|
private |
Definition at line 86 of file MatcherUsingTracksAlgorithm.h.
Referenced by match().
|
private |
Definition at line 94 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 93 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 91 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 92 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 90 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 89 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 103 of file MatcherUsingTracksAlgorithm.h.
Referenced by init(), and matchWithPropagation().
|
private |
Definition at line 95 of file MatcherUsingTracksAlgorithm.h.
Referenced by match().
|
private |
Definition at line 98 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 86 of file MatcherUsingTracksAlgorithm.h.
Referenced by match().
|
private |
Definition at line 96 of file MatcherUsingTracksAlgorithm.h.
Referenced by hasChi2(), matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 83 of file MatcherUsingTracksAlgorithm.h.
Referenced by match(), and MatcherUsingTracksAlgorithm().
|
private |
Definition at line 83 of file MatcherUsingTracksAlgorithm.h.
Referenced by match(), and MatcherUsingTracksAlgorithm().
|
private |
Definition at line 82 of file MatcherUsingTracksAlgorithm.h.
Referenced by match(), and MatcherUsingTracksAlgorithm().
|
private |
Definition at line 82 of file MatcherUsingTracksAlgorithm.h.
Referenced by match(), and MatcherUsingTracksAlgorithm().