#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 29 of file MatcherUsingTracksAlgorithm.h.
|
private |
Enumerator | |
---|---|
ByTrackRef | |
ByDirectComparison | |
ByPropagatingSrc | |
ByPropagatingMatched | |
ByPropagatingSrcTSCP | |
ByPropagatingMatchedTSCP |
Definition at line 99 of file MatcherUsingTracksAlgorithm.h.
|
private |
Enumerator | |
---|---|
LocalPosDiff | |
GlobalMomDeltaR | |
GlobalMomDeltaEta | |
GlobalMomDeltaPhi | |
GlobalDPtRel | |
Chi2 |
Definition at line 126 of file MatcherUsingTracksAlgorithm.h.
|
private |
Enumerator | |
---|---|
AtVertex | |
Innermost | |
Outermost |
Definition at line 108 of file MatcherUsingTracksAlgorithm.h.
|
private |
|
explicit |
Definition at line 19 of file MatcherUsingTracksAlgorithm.cc.
References 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, muonL1Match_cfi::sortBy, sortBy_, AlCaHLTBitMon_QueryRunRegistry::string, useChi2_, whichState1_, whichState2_, whichTrack1_, and whichTrack2_.
|
inlinevirtual |
Definition at line 32 of file MatcherUsingTracksAlgorithm.h.
|
static |
Possibly crop the 3x3 part of the matrix or remove off-diagonal terms, then invert.
Definition at line 622 of file MatcherUsingTracksAlgorithm.cc.
References HLT_2018_cff::diagonalOnly, mps_fire::i, and dqmiolumiharvest::j.
Referenced by getChi2().
|
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 560 of file MatcherUsingTracksAlgorithm.cc.
References cropAndInvert(), HLT_2018_cff::diagonalOnly, change_name::diff, PVValHelper::dxy, trackingPlots::other, AlCaHLTBitMon_ParallelJobs::p, p1, p2, DiDispStaMuonMonitor_cfi::pt, HLT_2018_cff::useVertex, relativeConstraints::value, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.
Referenced by 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 587 of file MatcherUsingTracksAlgorithm.cc.
References PerigeeTrajectoryError::covarianceMatrix(), cropAndInvert(), HLT_2018_cff::diagonalOnly, change_name::diff, PerigeeConversions::ftsToPerigeeError(), PerigeeConversions::ftsToPerigeeParameters(), trackingPlots::other, DiDispStaMuonMonitor_cfi::pt, and HLT_2018_cff::useVertex.
|
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 606 of file MatcherUsingTracksAlgorithm.cc.
References cropAndInvert(), HLT_2018_cff::diagonalOnly, change_name::diff, trackingPlots::other, and HLT_2018_cff::usePosition.
|
private |
Parse some configuration.
Definition at line 130 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 308 of file MatcherUsingTracksAlgorithm.cc.
References reco::RecoCandidate::combinedMuon(), Exception, GlobalTk, MuonTk, 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 64 of file MatcherUsingTracksAlgorithm.h.
References useChi2_.
|
inline |
Return 'true' if the matcher will produce meaningful deltaR, deltaLocalPos, deltaPtRel values.
Definition at line 61 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 302 of file MatcherUsingTracksAlgorithm.cc.
References geometry_, edm::EventSetup::get(), get, magfield_, and propagator_.
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 160 of file MatcherUsingTracksAlgorithm.cc.
References algo_, ByDirectComparison, ByPropagatingMatched, ByPropagatingMatchedTSCP, ByPropagatingSrc, ByPropagatingSrcTSCP, ByTrackRef, alignmentValidation::c1, reco::Candidate::charge(), hltPixelTracks_cff::chi2, getTrack(), matchByDirectComparison(), matchedCut_, matchWithPropagation(), requireSameCharge_, srcCut_, startingState(), RandomServiceHelper::t1, RandomServiceHelper::t2, filterCSVwithJSON::target, targetState(), whichState1_, whichState2_, whichTrack1_, and whichTrack2_.
Referenced by match().
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 219 of file MatcherUsingTracksAlgorithm.cc.
References algo_, edm::View< T >::begin(), ByDirectComparison, ByPropagatingMatched, ByPropagatingMatchedTSCP, ByPropagatingSrc, ByPropagatingSrcTSCP, ByTrackRef, alignmentValidation::c1, hltPixelTracks_cff::chi2, edm::View< T >::end(), beamvalidation::exit(), getTrack(), mps_fire::i, match(), matchByDirectComparison(), matchedCut_, matchWithPropagation(), requireSameCharge_, srcCut_, command_line::start, startingState(), RandomServiceHelper::t1, RandomServiceHelper::t2, filterCSVwithJSON::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 503 of file MatcherUsingTracksAlgorithm.cc.
References Chi2, chi2DiagonalOnly_, chi2FirstMomentum_, chi2UseVertex_, SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, getChi2(), GlobalDPtRel, GlobalMomDeltaEta, GlobalMomDeltaPhi, GlobalMomDeltaR, LocalPosDiff, mag(), maxChi2_, maxGlobalDPtRel_, maxGlobalMomDeltaEta_, maxGlobalMomDeltaPhi_, maxGlobalMomDeltaR_, maxLocalPosDiff_, sortBy_, filterCSVwithJSON::target, 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 441 of file MatcherUsingTracksAlgorithm.cc.
References PV3DBase< T, PVType, FrameType >::barePhi(), Chi2, chi2DiagonalOnly_, chi2UseVertex_, SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, runTheMatrix::err, PV3DBase< T, PVType, FrameType >::eta(), getChi2(), GlobalDPtRel, GlobalMomDeltaEta, GlobalMomDeltaPhi, GlobalMomDeltaR, LocalPosDiff, mag(), maxChi2_, maxGlobalDPtRel_, maxGlobalMomDeltaEta_, maxGlobalMomDeltaPhi_, maxGlobalMomDeltaR_, maxLocalPosDiff_, TrajectoryStateClosestToPoint::momentum(), PV3DBase< T, PVType, FrameType >::perp(), TrajectoryStateClosestToPoint::position(), TrackCandidateProducer_cfi::propagator, sortBy_, filterCSVwithJSON::target, 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 379 of file MatcherUsingTracksAlgorithm.cc.
References PV3DBase< T, PVType, FrameType >::barePhi(), Chi2, chi2DiagonalOnly_, chi2UseVertex_, SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, PV3DBase< T, PVType, FrameType >::eta(), getChi2(), GlobalDPtRel, GlobalMomDeltaEta, GlobalMomDeltaPhi, GlobalMomDeltaR, TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::isValid(), LocalPosDiff, TrajectoryStateOnSurface::localPosition(), mag(), maxChi2_, maxGlobalDPtRel_, maxGlobalMomDeltaEta_, maxGlobalMomDeltaPhi_, maxGlobalMomDeltaR_, maxLocalPosDiff_, PV3DBase< T, PVType, FrameType >::perp(), Propagator::propagate(), propagator_, sortBy_, filterCSVwithJSON::target, and useChi2_.
|
private |
Starting state for the propagation.
Definition at line 329 of file MatcherUsingTracksAlgorithm.cc.
References AtVertex, getTrack(), trajectoryStateTransform::initialFreeState(), trajectoryStateTransform::innerFreeState(), Innermost, edm::Ref< C, T, F >::isNull(), magfield_, None, trajectoryStateTransform::outerFreeState(), Outermost, edm::ESHandle< T >::product(), and runTheMatrix::ret.
Referenced by match().
|
private |
End state for the propagation.
Definition at line 359 of file MatcherUsingTracksAlgorithm.cc.
References geometry_, getTrack(), Innermost, trajectoryStateTransform::innerStateOnSurface(), edm::Ref< C, T, F >::isNonnull(), magfield_, Outermost, trajectoryStateTransform::outerStateOnSurface(), edm::ESHandle< T >::product(), and runTheMatrix::ret.
Referenced by match().
|
private |
Definition at line 110 of file MatcherUsingTracksAlgorithm.h.
Referenced by getConf(), hasMetrics(), match(), and MatcherUsingTracksAlgorithm().
|
private |
Definition at line 125 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 125 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), and MatcherUsingTracksAlgorithm().
|
private |
Definition at line 125 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 132 of file MatcherUsingTracksAlgorithm.h.
Referenced by init(), and targetState().
|
private |
Definition at line 130 of file MatcherUsingTracksAlgorithm.h.
Referenced by init(), startingState(), and targetState().
|
private |
Definition at line 115 of file MatcherUsingTracksAlgorithm.h.
Referenced by match().
|
private |
Definition at line 123 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 122 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 120 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 121 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 119 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 118 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 131 of file MatcherUsingTracksAlgorithm.h.
Referenced by init(), and matchWithPropagation().
|
private |
Definition at line 124 of file MatcherUsingTracksAlgorithm.h.
Referenced by match().
|
private |
Definition at line 127 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 115 of file MatcherUsingTracksAlgorithm.h.
Referenced by match().
|
private |
Definition at line 125 of file MatcherUsingTracksAlgorithm.h.
Referenced by hasChi2(), matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 112 of file MatcherUsingTracksAlgorithm.h.
Referenced by match(), and MatcherUsingTracksAlgorithm().
|
private |
Definition at line 112 of file MatcherUsingTracksAlgorithm.h.
Referenced by match(), and MatcherUsingTracksAlgorithm().
|
private |
Definition at line 111 of file MatcherUsingTracksAlgorithm.h.
Referenced by match(), and MatcherUsingTracksAlgorithm().
|
private |
Definition at line 111 of file MatcherUsingTracksAlgorithm.h.
Referenced by match(), and MatcherUsingTracksAlgorithm().