CMS 3D CMS Logo

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,
78  bool diagonalOnly,
79  bool useVertex,
80  bool useFirstMomentum);
81 
86  static double getChi2(const FreeTrajectoryState &start,
88  bool diagonalOnly,
89  bool useVertex);
90 
95  static double getChi2(const TrajectoryStateOnSurface &start,
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
Definition: start.py:1
FreeTrajectoryState startingState(const reco::Candidate &reco, WhichTrack whichTrack, WhichState whichState) const
Starting state for the propagation.
edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > geometryToken_
bool match(const reco::Candidate &c1, const reco::Candidate &c2, float &deltaR, float &deltaEta, float &deltaPhi, float &deltaLocalPos, float &deltaPtRel, float &chi2) const
TrajectoryStateOnSurface targetState(const reco::Candidate &reco, WhichTrack whichTrack, WhichState whichState) const
End state for the propagation.
void getConf(const edm::ParameterSet &iConfig, const std::string &whatFor, WhichTrack &whichTrack, WhichState &whichState)
Parse some configuration.
bool matchWithPropagation(const FreeTrajectoryState &start, const FreeTrajectoryState &target, float &lastDeltaR, float &lastDeltaEta, float &lastDeltaPhi, float &lastDeltaLocalPos, float &lastGlobalDPtRel, float &lastChi2) const
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfieldToken_
bool hasChi2() const
Return &#39;true&#39; if the matcher will produce also chi2.
static double getChi2(const FreeTrajectoryState &start, const FreeTrajectoryState &other, bool diagonalOnly, bool useVertex, bool useFirstMomentum)
bool hasMetrics() const
Return &#39;true&#39; if the matcher will produce meaningful deltaR, deltaLocalPos, deltaPtRel values...
static const double deltaEta
Definition: CaloConstants.h:8
StringCutObjectSelector< reco::Candidate, true > matchedCut_
edm::ESHandle< GlobalTrackingGeometry > geometry_
edm::ESHandle< MagneticField > magfield_
StringCutObjectSelector< reco::Candidate, true > srcCut_
edm::ESHandle< Propagator > propagator_
MatcherUsingTracksAlgorithm(const edm::ParameterSet &iConfig, edm::ConsumesCollector)
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...
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_
fixed size matrix
void init(const edm::EventSetup &iSetup)
Call this method at the beginning of each run, to initialize geometry, magnetic field and propagators...
def which(cmd)
Definition: eostools.py:336
Definition: Chi2.h:15
reco::TrackRef getTrack(const reco::Candidate &reco, WhichTrack which) const
Get track reference out of a Candidate (via dynamic_cast to reco::RecoCandidate)