#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, edm::ConsumesCollector) | |
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... | |
Definition at line 34 of file MatcherUsingTracksAlgorithm.h.
|
private |
Enumerator | |
---|---|
ByTrackRef | |
ByDirectComparison | |
ByPropagatingSrc | |
ByPropagatingMatched | |
ByPropagatingSrcTSCP | |
ByPropagatingMatchedTSCP |
Definition at line 104 of file MatcherUsingTracksAlgorithm.h.
|
private |
Enumerator | |
---|---|
LocalPosDiff | |
GlobalMomDeltaR | |
GlobalMomDeltaEta | |
GlobalMomDeltaPhi | |
GlobalDPtRel | |
Chi2 |
Definition at line 131 of file MatcherUsingTracksAlgorithm.h.
|
private |
Enumerator | |
---|---|
AtVertex | |
Innermost | |
Outermost |
Definition at line 113 of file MatcherUsingTracksAlgorithm.h.
|
private |
Enumerator | |
---|---|
None | |
TrackerTk | |
MuonTk | |
GlobalTk |
Definition at line 112 of file MatcherUsingTracksAlgorithm.h.
|
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 37 of file MatcherUsingTracksAlgorithm.h.
|
static |
Possibly crop the 3x3 part of the matrix or remove off-diagonal terms, then invert.
Definition at line 625 of file MatcherUsingTracksAlgorithm.cc.
References HLT_2022v12_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 563 of file MatcherUsingTracksAlgorithm.cc.
References cropAndInvert(), HLT_2022v12_cff::diagonalOnly, change_name::diff, PVValHelper::dxy, trackingPlots::other, AlCaHLTBitMon_ParallelJobs::p, LaserDQM_cfg::p1, SiStripOfflineCRack_cfg::p2, DiDispStaMuonMonitor_cfi::pt, VerticesFromLeptons_cfi::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 590 of file MatcherUsingTracksAlgorithm.cc.
References PerigeeTrajectoryError::covarianceMatrix(), cropAndInvert(), HLT_2022v12_cff::diagonalOnly, change_name::diff, PerigeeConversions::ftsToPerigeeError(), PerigeeConversions::ftsToPerigeeParameters(), trackingPlots::other, DiDispStaMuonMonitor_cfi::pt, VerticesFromLeptons_cfi::useVertex, and trackerHitRTTI::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 609 of file MatcherUsingTracksAlgorithm.cc.
References cropAndInvert(), HLT_2022v12_cff::diagonalOnly, change_name::diff, trackingPlots::other, and HLT_2022v12_cff::usePosition.
|
private |
Parse some configuration.
Definition at line 133 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 311 of file MatcherUsingTracksAlgorithm.cc.
References reco::RecoCandidate::combinedMuon(), Exception, GlobalTk, MuonTk, dt_dqm_sourceclient_common_cff::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 69 of file MatcherUsingTracksAlgorithm.h.
References useChi2_.
|
inline |
Return 'true' if the matcher will produce meaningful deltaR, deltaLocalPos, deltaPtRel values.
Definition at line 66 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 305 of file MatcherUsingTracksAlgorithm.cc.
References geometry_, geometryToken_, edm::EventSetup::getHandle(), magfield_, magfieldToken_, propagator_, and propagatorToken_.
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 163 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 222 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 506 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 444 of file MatcherUsingTracksAlgorithm.cc.
References PV3DBase< T, PVType, FrameType >::barePhi(), Chi2, chi2DiagonalOnly_, chi2UseVertex_, SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, submitPVResolutionJobs::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 382 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 332 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 362 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 115 of file MatcherUsingTracksAlgorithm.h.
Referenced by getConf(), hasMetrics(), match(), and MatcherUsingTracksAlgorithm().
|
private |
Definition at line 130 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 130 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), and MatcherUsingTracksAlgorithm().
|
private |
Definition at line 130 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 137 of file MatcherUsingTracksAlgorithm.h.
Referenced by init(), and targetState().
|
private |
Definition at line 141 of file MatcherUsingTracksAlgorithm.h.
Referenced by init().
|
private |
Definition at line 135 of file MatcherUsingTracksAlgorithm.h.
Referenced by init(), startingState(), and targetState().
|
private |
Definition at line 139 of file MatcherUsingTracksAlgorithm.h.
Referenced by init().
|
private |
Definition at line 120 of file MatcherUsingTracksAlgorithm.h.
Referenced by match().
|
private |
Definition at line 128 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 127 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 125 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 126 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 124 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 123 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 136 of file MatcherUsingTracksAlgorithm.h.
Referenced by init(), and matchWithPropagation().
|
private |
Definition at line 140 of file MatcherUsingTracksAlgorithm.h.
Referenced by init().
|
private |
Definition at line 129 of file MatcherUsingTracksAlgorithm.h.
Referenced by match().
|
private |
Definition at line 132 of file MatcherUsingTracksAlgorithm.h.
Referenced by matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 120 of file MatcherUsingTracksAlgorithm.h.
Referenced by match().
|
private |
Definition at line 130 of file MatcherUsingTracksAlgorithm.h.
Referenced by hasChi2(), matchByDirectComparison(), MatcherUsingTracksAlgorithm(), and matchWithPropagation().
|
private |
Definition at line 117 of file MatcherUsingTracksAlgorithm.h.
Referenced by match(), and MatcherUsingTracksAlgorithm().
|
private |
Definition at line 117 of file MatcherUsingTracksAlgorithm.h.
Referenced by match(), and MatcherUsingTracksAlgorithm().
|
private |
Definition at line 116 of file MatcherUsingTracksAlgorithm.h.
Referenced by match(), and MatcherUsingTracksAlgorithm().
|
private |
Definition at line 116 of file MatcherUsingTracksAlgorithm.h.
Referenced by match(), and MatcherUsingTracksAlgorithm().