CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MatcherUsingTracksAlgorithm.h
Go to the documentation of this file.
1 #ifndef MuonAnalysis_MuonAssociators_MatcherUsingTracksAlgorithm_h
2 #define MuonAnalysis_MuonAssociators_MatcherUsingTracksAlgorithm_h
3 //
4 //
5 
16 
22 
29 
33 
35 public:
38 
40  void init(const edm::EventSetup &iSetup);
41 
44  bool match(const reco::Candidate &c1,
45  const reco::Candidate &c2,
46  float &deltaR,
47  float &deltaEta,
48  float &deltaPhi,
49  float &deltaLocalPos,
50  float &deltaPtRel,
51  float &chi2) const;
52 
56  int match(const reco::Candidate &tk,
57  const edm::View<reco::Candidate> &c2s,
58  float &deltaR,
59  float &deltaEta,
60  float &deltaPhi,
61  float &deltaLocalPos,
62  float &deltaPtRel,
63  float &chi2) const;
64 
66  bool hasMetrics() const { return algo_ != ByTrackRef; }
67 
69  bool hasChi2() const { return useChi2_; }
70 
76  static double getChi2(const FreeTrajectoryState &start,
77  const FreeTrajectoryState &other,
78  bool diagonalOnly,
79  bool useVertex,
80  bool useFirstMomentum);
81 
86  static double getChi2(const FreeTrajectoryState &start,
87  const TrajectoryStateClosestToPoint &other,
88  bool diagonalOnly,
89  bool useVertex);
90 
95  static double getChi2(const TrajectoryStateOnSurface &start,
96  const TrajectoryStateOnSurface &other,
97  bool diagonalOnly,
98  bool usePosition);
99 
101  static void cropAndInvert(AlgebraicSymMatrix55 &cov, bool diagonalOnly, bool top3by3only);
102 
103 private:
104  enum AlgoType {
111  }; // propagate closest to point
114 
118 
119  // Preselection cuts on both sides
121 
122  // Matching cuts
128  float maxChi2_;
133 
134  //- Tools
138 
142 
145 
147  FreeTrajectoryState startingState(const reco::Candidate &reco, WhichTrack whichTrack, WhichState whichState) const;
148 
150  TrajectoryStateOnSurface targetState(const reco::Candidate &reco, WhichTrack whichTrack, WhichState whichState) const;
151 
156  float &lastDeltaR,
157  float &lastDeltaEta,
158  float &lastDeltaPhi,
159  float &lastDeltaLocalPos,
160  float &lastGlobalDPtRel,
161  float &lastChi2) const;
162 
167  float &lastDeltaR,
168  float &lastDeltaEta,
169  float &lastDeltaPhi,
170  float &lastDeltaLocalPos,
171  float &lastGlobalDPtRel,
172  float &lastChi2) const;
173 
176  const FreeTrajectoryState &other,
177  float &lastDeltaR,
178  float &lastDeltaEta,
179  float &lastDeltaPhi,
180  float &lastDeltaLocalPos,
181  float &lastGlobalDPtRel,
182  float &lastChi2) const;
183 
185  void getConf(const edm::ParameterSet &iConfig,
186  const std::string &whatFor,
187  WhichTrack &whichTrack,
188  WhichState &whichState);
189 };
190 
191 #endif
def which
Definition: eostools.py:336
edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > geometryToken_
bool hasChi2() const
Return &#39;true&#39; if the matcher will produce also chi2.
void diagonalOnly(Matrix &m)
Definition: MatrixSTypes.h:27
void getConf(const edm::ParameterSet &iConfig, const std::string &whatFor, WhichTrack &whichTrack, WhichState &whichState)
Parse some configuration.
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfieldToken_
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
static const double deltaEta
Definition: CaloConstants.h:8
StringCutObjectSelector< reco::Candidate, true > matchedCut_
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_
StringCutObjectSelector< reco::Candidate, true > srcCut_
edm::ESHandle< Propagator > propagator_
MatcherUsingTracksAlgorithm(const edm::ParameterSet &iConfig, edm::ConsumesCollector)
TrajectoryStateOnSurface targetState(const reco::Candidate &reco, WhichTrack whichTrack, WhichState whichState) const
End state for the propagation.
FreeTrajectoryState startingState(const reco::Candidate &reco, WhichTrack whichTrack, WhichState whichState) const
Starting state for the propagation.
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
static void cropAndInvert(AlgebraicSymMatrix55 &cov, bool diagonalOnly, bool top3by3only)
Possibly crop the 3x3 part of the matrix or remove off-diagonal terms, then invert.
edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorToken_
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)
Definition: Chi2.h:15
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...