CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MatcherUsingTracksAlgorithm.h
Go to the documentation of this file.
1 #ifndef MuonAnalysis_MuonAssociators_MatcherUsingTracksAlgorithm_h
2 #define MuonAnalysis_MuonAssociators_MatcherUsingTracksAlgorithm_h
3 //
4 // $Id: MatcherUsingTracksAlgorithm.h,v 1.8 2011/01/28 16:57:17 gpetrucc Exp $
5 //
6 
18 
23 
30 
32  public:
33  explicit MatcherUsingTracksAlgorithm(const edm::ParameterSet & iConfig);
35 
37  void init(const edm::EventSetup &iSetup) ;
38 
41  bool match(const reco::Candidate &c1, const reco::Candidate &c2, float &deltaR, float &deltaEta, float &deltaPhi, float &deltaLocalPos, float &deltaPtRel, float &chi2) const ;
42 
46  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 ;
47 
49  bool hasMetrics() const { return algo_ != ByTrackRef; }
50 
52  bool hasChi2() const { return useChi2_; }
53 
59  static double getChi2(const FreeTrajectoryState &start, const FreeTrajectoryState &other, bool diagonalOnly, bool useVertex, bool useFirstMomentum) ;
60 
65  static double getChi2(const FreeTrajectoryState &start, const TrajectoryStateClosestToPoint &other, bool diagonalOnly, bool useVertex) ;
66 
71  static double getChi2(const TrajectoryStateOnSurface &start, const TrajectoryStateOnSurface &other, bool diagonalOnly, bool usePosition) ;
72 
74  static void cropAndInvert(AlgebraicSymMatrix55 &cov, bool diagonalOnly, bool top3by3only) ;
75  private:
78  ByPropagatingSrcTSCP, ByPropagatingMatchedTSCP }; // propagate closest to point
81 
85 
86  // Preselection cuts on both sides
88 
89  // Matching cuts
95  float maxChi2_;
100 
101 
102  //- Tools
106 
108  reco::TrackRef getTrack(const reco::Candidate &reco, WhichTrack which) const ;
109 
111  FreeTrajectoryState startingState(const reco::Candidate &reco, WhichTrack whichTrack, WhichState whichState) const ;
112 
114  TrajectoryStateOnSurface targetState(const reco::Candidate &reco, WhichTrack whichTrack, WhichState whichState) const ;
115 
119  float &lastDeltaR, float &lastDeltaEta, float &lastDeltaPhi, float &lastDeltaLocalPos, float &lastGlobalDPtRel, float &lastChi2) const ;
120 
124  float &lastDeltaR, float &lastDeltaEta, float &lastDeltaPhi, float &lastDeltaLocalPos, float &lastGlobalDPtRel, float &lastChi2) const ;
125 
128  float &lastDeltaR, float &lastDeltaEta, float &lastDeltaPhi, float &lastDeltaLocalPos, float &lastGlobalDPtRel, float &lastChi2) const ;
129 
131  void getConf(const edm::ParameterSet & iConfig, const std::string &whatFor, WhichTrack &whichTrack, WhichState &whichState) ;
132 
133 };
134 
135 
136 #endif
bool hasChi2() const
Return &#39;true&#39; if the matcher will produce also chi2.
void getConf(const edm::ParameterSet &iConfig, const std::string &whatFor, WhichTrack &whichTrack, WhichState &whichState)
Parse some configuration.
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
static double getChi2(const FreeTrajectoryState &start, const FreeTrajectoryState &other, bool diagonalOnly, bool useVertex, bool useFirstMomentum)
bool matchWithPropagation(const FreeTrajectoryState &start, const FreeTrajectoryState &target, float &lastDeltaR, float &lastDeltaEta, float &lastDeltaPhi, float &lastDeltaLocalPos, float &lastGlobalDPtRel, float &lastChi2) const
bool hasMetrics() const
Return &#39;true&#39; if the matcher will produce meaningful deltaR, deltaLocalPos, deltaPtRel values...
edm::ESHandle< GlobalTrackingGeometry > geometry_
edm::ESHandle< MagneticField > magfield_
MatcherUsingTracksAlgorithm(const edm::ParameterSet &iConfig)
edm::ESHandle< Propagator > propagator_
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
TrajectoryStateOnSurface targetState(const reco::Candidate &reco, WhichTrack whichTrack, WhichState whichState) const
End state for the propagation.
StringCutObjectSelector< reco::Candidate, true > srcCut_
FreeTrajectoryState startingState(const reco::Candidate &reco, WhichTrack whichTrack, WhichState whichState) const
Starting state for the propagation.
static void cropAndInvert(AlgebraicSymMatrix55 &cov, bool diagonalOnly, bool top3by3only)
Possibly crop the 3x3 part of the matrix or remove off-diagonal terms, then invert.
bool match(const reco::Candidate &c1, const reco::Candidate &c2, float &deltaR, float &deltaEta, float &deltaPhi, float &deltaLocalPos, float &deltaPtRel, float &chi2) const
void init(const edm::EventSetup &iSetup)
Call this method at the beginning of each run, to initialize geometry, magnetic field and propagators...
reco::TrackRef getTrack(const reco::Candidate &reco, WhichTrack which) const
Get track reference out of a Candidate (via dynamic_cast to reco::RecoCandidate)
StringCutObjectSelector< reco::Candidate, true > matchedCut_
Definition: Chi2.h:17
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...