CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
MatcherUsingTracksAlgorithm Class Reference

#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< MagneticFieldmagfield_
 
StringCutObjectSelector
< reco::Candidate, true > 
matchedCut_
 
float maxChi2_
 
float maxGlobalDPtRel_
 
float maxGlobalMomDeltaEta_
 
float maxGlobalMomDeltaPhi_
 
float maxGlobalMomDeltaR_
 
float maxLocalPosDiff_
 
edm::ESHandle< Propagatorpropagator_
 
bool requireSameCharge_
 
SortBy sortBy_
 
StringCutObjectSelector
< reco::Candidate, true > 
srcCut_
 
bool useChi2_
 
WhichState whichState1_
 
WhichState whichState2_
 
WhichTrack whichTrack1_
 
WhichTrack whichTrack2_
 

Detailed Description

Definition at line 30 of file MatcherUsingTracksAlgorithm.h.

Member Enumeration Documentation

Enumerator
ByTrackRef 
ByDirectComparison 
ByPropagatingSrc 
ByPropagatingMatched 
ByPropagatingSrcTSCP 
ByPropagatingMatchedTSCP 

Definition at line 75 of file MatcherUsingTracksAlgorithm.h.

Enumerator
LocalPosDiff 
GlobalMomDeltaR 
GlobalMomDeltaEta 
GlobalMomDeltaPhi 
GlobalDPtRel 
Chi2 

Definition at line 97 of file MatcherUsingTracksAlgorithm.h.

Enumerator
AtVertex 
Innermost 
Outermost 

Definition at line 79 of file MatcherUsingTracksAlgorithm.h.

Enumerator
None 
TrackerTk 
MuonTk 
GlobalTk 

Definition at line 78 of file MatcherUsingTracksAlgorithm.h.

Constructor & Destructor Documentation

MatcherUsingTracksAlgorithm::MatcherUsingTracksAlgorithm ( const edm::ParameterSet iConfig)
explicit

Definition at line 20 of file MatcherUsingTracksAlgorithm.cc.

virtual MatcherUsingTracksAlgorithm::~MatcherUsingTracksAlgorithm ( )
inlinevirtual

Definition at line 33 of file MatcherUsingTracksAlgorithm.h.

Member Function Documentation

void MatcherUsingTracksAlgorithm::cropAndInvert ( AlgebraicSymMatrix55 cov,
bool  diagonalOnly,
bool  top3by3only 
)
static

Possibly crop the 3x3 part of the matrix or remove off-diagonal terms, then invert.

Definition at line 482 of file MatcherUsingTracksAlgorithm.cc.

double MatcherUsingTracksAlgorithm::getChi2 ( const FreeTrajectoryState start,
const FreeTrajectoryState other,
bool  diagonalOnly,
bool  useVertex,
bool  useFirstMomentum 
)
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.

double MatcherUsingTracksAlgorithm::getChi2 ( const FreeTrajectoryState start,
const TrajectoryStateClosestToPoint other,
bool  diagonalOnly,
bool  useVertex 
)
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.

double MatcherUsingTracksAlgorithm::getChi2 ( const TrajectoryStateOnSurface start,
const TrajectoryStateOnSurface other,
bool  diagonalOnly,
bool  usePosition 
)
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.

void MatcherUsingTracksAlgorithm::getConf ( const edm::ParameterSet iConfig,
const std::string &  whatFor,
WhichTrack whichTrack,
WhichState whichState 
)
private

Parse some configuration.

Definition at line 101 of file MatcherUsingTracksAlgorithm.cc.

reco::TrackRef MatcherUsingTracksAlgorithm::getTrack ( const reco::Candidate reco,
WhichTrack  which 
) const
private

Get track reference out of a Candidate (via dynamic_cast to reco::RecoCandidate)

Definition at line 235 of file MatcherUsingTracksAlgorithm.cc.

bool MatcherUsingTracksAlgorithm::hasChi2 ( ) const
inline

Return 'true' if the matcher will produce also chi2.

Definition at line 51 of file MatcherUsingTracksAlgorithm.h.

bool MatcherUsingTracksAlgorithm::hasMetrics ( ) const
inline

Return 'true' if the matcher will produce meaningful deltaR, deltaLocalPos, deltaPtRel values.

Definition at line 48 of file MatcherUsingTracksAlgorithm.h.

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.

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.

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.

bool MatcherUsingTracksAlgorithm::matchByDirectComparison ( const FreeTrajectoryState start,
const FreeTrajectoryState other,
float &  lastDeltaR,
float &  lastDeltaEta,
float &  lastDeltaPhi,
float &  lastDeltaLocalPos,
float &  lastGlobalDPtRel,
float &  lastChi2 
) const
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.

bool MatcherUsingTracksAlgorithm::matchWithPropagation ( const FreeTrajectoryState start,
const FreeTrajectoryState target,
float &  lastDeltaR,
float &  lastDeltaEta,
float &  lastDeltaPhi,
float &  lastDeltaLocalPos,
float &  lastGlobalDPtRel,
float &  lastChi2 
) const
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.

bool MatcherUsingTracksAlgorithm::matchWithPropagation ( const FreeTrajectoryState start,
const TrajectoryStateOnSurface target,
float &  lastDeltaR,
float &  lastDeltaEta,
float &  lastDeltaPhi,
float &  lastDeltaLocalPos,
float &  lastGlobalDPtRel,
float &  lastChi2 
) const
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.

FreeTrajectoryState MatcherUsingTracksAlgorithm::startingState ( const reco::Candidate reco,
WhichTrack  whichTrack,
WhichState  whichState 
) const
private

Starting state for the propagation.

Definition at line 249 of file MatcherUsingTracksAlgorithm.cc.

TrajectoryStateOnSurface MatcherUsingTracksAlgorithm::targetState ( const reco::Candidate reco,
WhichTrack  whichTrack,
WhichState  whichState 
) const
private

End state for the propagation.

Definition at line 272 of file MatcherUsingTracksAlgorithm.cc.

Member Data Documentation

AlgoType MatcherUsingTracksAlgorithm::algo_
private

Definition at line 81 of file MatcherUsingTracksAlgorithm.h.

bool MatcherUsingTracksAlgorithm::chi2DiagonalOnly_
private

Definition at line 96 of file MatcherUsingTracksAlgorithm.h.

bool MatcherUsingTracksAlgorithm::chi2FirstMomentum_
private

Definition at line 96 of file MatcherUsingTracksAlgorithm.h.

bool MatcherUsingTracksAlgorithm::chi2UseVertex_
private

Definition at line 96 of file MatcherUsingTracksAlgorithm.h.

edm::ESHandle<GlobalTrackingGeometry> MatcherUsingTracksAlgorithm::geometry_
private

Definition at line 104 of file MatcherUsingTracksAlgorithm.h.

edm::ESHandle<MagneticField> MatcherUsingTracksAlgorithm::magfield_
private

Definition at line 102 of file MatcherUsingTracksAlgorithm.h.

StringCutObjectSelector<reco::Candidate,true> MatcherUsingTracksAlgorithm::matchedCut_
private

Definition at line 86 of file MatcherUsingTracksAlgorithm.h.

float MatcherUsingTracksAlgorithm::maxChi2_
private

Definition at line 94 of file MatcherUsingTracksAlgorithm.h.

float MatcherUsingTracksAlgorithm::maxGlobalDPtRel_
private

Definition at line 93 of file MatcherUsingTracksAlgorithm.h.

float MatcherUsingTracksAlgorithm::maxGlobalMomDeltaEta_
private

Definition at line 91 of file MatcherUsingTracksAlgorithm.h.

float MatcherUsingTracksAlgorithm::maxGlobalMomDeltaPhi_
private

Definition at line 92 of file MatcherUsingTracksAlgorithm.h.

float MatcherUsingTracksAlgorithm::maxGlobalMomDeltaR_
private

Definition at line 90 of file MatcherUsingTracksAlgorithm.h.

float MatcherUsingTracksAlgorithm::maxLocalPosDiff_
private

Definition at line 89 of file MatcherUsingTracksAlgorithm.h.

edm::ESHandle<Propagator> MatcherUsingTracksAlgorithm::propagator_
private

Definition at line 103 of file MatcherUsingTracksAlgorithm.h.

bool MatcherUsingTracksAlgorithm::requireSameCharge_
private

Definition at line 95 of file MatcherUsingTracksAlgorithm.h.

SortBy MatcherUsingTracksAlgorithm::sortBy_
private

Definition at line 98 of file MatcherUsingTracksAlgorithm.h.

StringCutObjectSelector<reco::Candidate,true> MatcherUsingTracksAlgorithm::srcCut_
private

Definition at line 86 of file MatcherUsingTracksAlgorithm.h.

bool MatcherUsingTracksAlgorithm::useChi2_
private

Definition at line 96 of file MatcherUsingTracksAlgorithm.h.

WhichState MatcherUsingTracksAlgorithm::whichState1_
private

Definition at line 83 of file MatcherUsingTracksAlgorithm.h.

WhichState MatcherUsingTracksAlgorithm::whichState2_
private

Definition at line 83 of file MatcherUsingTracksAlgorithm.h.

WhichTrack MatcherUsingTracksAlgorithm::whichTrack1_
private

Definition at line 82 of file MatcherUsingTracksAlgorithm.h.

WhichTrack MatcherUsingTracksAlgorithm::whichTrack2_
private

Definition at line 82 of file MatcherUsingTracksAlgorithm.h.