CMS 3D CMS Logo

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< GlobalTrackingGeometrygeometry_
 
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 29 of file MatcherUsingTracksAlgorithm.h.

Member Enumeration Documentation

◆ AlgoType

Enumerator
ByTrackRef 
ByDirectComparison 
ByPropagatingSrc 
ByPropagatingMatched 
ByPropagatingSrcTSCP 
ByPropagatingMatchedTSCP 

Definition at line 99 of file MatcherUsingTracksAlgorithm.h.

99  {
100  ByTrackRef,
106  }; // propagate closest to point

◆ SortBy

Enumerator
LocalPosDiff 
GlobalMomDeltaR 
GlobalMomDeltaEta 
GlobalMomDeltaPhi 
GlobalDPtRel 
Chi2 

Definition at line 126 of file MatcherUsingTracksAlgorithm.h.

◆ WhichState

Enumerator
AtVertex 
Innermost 
Outermost 

Definition at line 108 of file MatcherUsingTracksAlgorithm.h.

◆ WhichTrack

Enumerator
None 
TrackerTk 
MuonTk 
GlobalTk 

Definition at line 107 of file MatcherUsingTracksAlgorithm.h.

Constructor & Destructor Documentation

◆ MatcherUsingTracksAlgorithm()

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

Definition at line 19 of file MatcherUsingTracksAlgorithm.cc.

20  : whichTrack1_(None),
24  srcCut_(iConfig.existsAs<std::string>("srcPreselection") ? iConfig.getParameter<std::string>("srcPreselection")
25  : ""),
26  matchedCut_(iConfig.existsAs<std::string>("matchedPreselection")
27  ? iConfig.getParameter<std::string>("matchedPreselection")
28  : ""),
29  requireSameCharge_(iConfig.existsAs<bool>("requireSameCharge") ? iConfig.getParameter<bool>("requireSameCharge")
30  : false) {
31  std::string algo = iConfig.getParameter<std::string>("algorithm");
32  if (algo == "byTrackRef") {
33  algo_ = ByTrackRef;
34  } else if (algo == "byPropagatingSrc") {
36  } else if (algo == "byPropagatingMatched") {
38  } else if (algo == "byDirectComparison") {
40  } else
41  throw cms::Exception("Configuration") << "Value '" << algo << "' for algorithm not yet implemented.\n";
42 
43  getConf(iConfig, "src", whichTrack1_, whichState1_);
44  getConf(iConfig, "matched", whichTrack2_, whichState2_);
45 
46  if (algo_ == ByTrackRef) {
47  // validate the config
48  if (whichTrack1_ == None || whichTrack2_ == None)
49  throw cms::Exception("Configuration") << "Algorithm 'byTrackRef' needs tracks not to be 'none'.\n";
51  // read matching cuts
52  maxLocalPosDiff_ = iConfig.getParameter<double>("maxDeltaLocalPos");
53  maxGlobalMomDeltaR_ = iConfig.getParameter<double>("maxDeltaR");
55  iConfig.existsAs<double>("maxDeltaEta") ? iConfig.getParameter<double>("maxDeltaEta") : maxGlobalMomDeltaR_;
57  iConfig.existsAs<double>("maxDeltaPhi") ? iConfig.getParameter<double>("maxDeltaPhi") : maxGlobalMomDeltaR_;
58  maxGlobalDPtRel_ = iConfig.getParameter<double>("maxDeltaPtRel");
59 
60  // choice of sorting variable
61  std::string sortBy = iConfig.getParameter<std::string>("sortBy");
62  if (sortBy == "deltaLocalPos")
64  else if (sortBy == "deltaPtRel")
66  else if (sortBy == "deltaR")
68  else if (sortBy == "deltaEta")
70  else if (sortBy == "deltaPhi")
72  else if (sortBy == "chi2")
73  sortBy_ = Chi2;
74  else
75  throw cms::Exception("Configuration")
76  << "Parameter 'sortBy' must be one of: deltaLocalPos, deltaPtRel, deltaR, chi2.\n";
77  // validate the config
78  if (algo_ == ByPropagatingSrc) {
79  if (whichTrack2_ == None || whichState2_ == AtVertex) {
81  //throw cms::Exception("Configuration") << "Destination track must be non-null, and state must not be 'AtVertex' (not yet).\n";
82  }
83  } else if (algo_ == ByPropagatingMatched) {
84  if (whichTrack1_ == None || whichState1_ == AtVertex) {
86  //throw cms::Exception("Configuration") << "Destination track must be non-null, and state must not be 'AtVertex' (not yet).\n";
87  }
88  } else if (algo_ == ByDirectComparison) {
89  bool firstAtVertex = (whichTrack1_ == None || whichState1_ == AtVertex);
90  bool secAtVertex = (whichTrack2_ == None || whichState2_ == AtVertex);
91  if (firstAtVertex) {
92  if (!secAtVertex)
93  throw cms::Exception("Configuration")
94  << "When using 'byDirectComparison' with 'src' at vertex (or None), 'matched' must be at vertex too.\n";
95  } else {
96  if (secAtVertex)
97  throw cms::Exception("Configuration")
98  << "When using 'byDirectComparison' with 'src' not at vertex, 'matched' can't be at vertex or None.\n";
100  throw cms::Exception("Configuration") << "You can't use 'byDirectComparison' with non-matching states.\n";
101  }
102  }
103 
104  useChi2_ = iConfig.existsAs<bool>("computeChi2") ? iConfig.getParameter<bool>("computeChi2") : false;
105  if (useChi2_) {
106  if (whichTrack1_ == None && whichTrack2_ == None)
107  throw cms::Exception("Configuration") << "Can't compute chi2s if both tracks are set to 'none'.\n";
108  maxChi2_ = iConfig.getParameter<double>("maxChi2");
109  chi2DiagonalOnly_ = iConfig.getParameter<bool>("chi2DiagonalOnly");
111  chi2UseVertex_ = iConfig.getParameter<bool>("chi2UsePosition");
112  } else {
113  chi2UseVertex_ = iConfig.getParameter<bool>("chi2UseVertex");
114  if (algo_ == ByDirectComparison) {
115  std::string choice = iConfig.getParameter<std::string>("chi2MomentumForDxy");
116  if (choice == "src")
117  chi2FirstMomentum_ = true;
118  else if (choice != "matched")
119  throw cms::Exception("Configuration") << "chi2MomentumForDxy must be 'src' or 'matched'\n";
120  }
121  }
122  } else
123  maxChi2_ = 1;
124 
125  if (sortBy_ == Chi2 && !useChi2_)
126  throw cms::Exception("Configuration") << "Can't sort by chi2s if 'computeChi2s' is not set to true.\n";
127  }
128 }

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_.

◆ ~MatcherUsingTracksAlgorithm()

virtual MatcherUsingTracksAlgorithm::~MatcherUsingTracksAlgorithm ( )
inlinevirtual

Definition at line 32 of file MatcherUsingTracksAlgorithm.h.

32 {}

Member Function Documentation

◆ cropAndInvert()

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 622 of file MatcherUsingTracksAlgorithm.cc.

622  {
623  if (!top3by3only) {
624  if (diagonalOnly) {
625  for (size_t i = 0; i < 5; ++i) {
626  for (size_t j = i + 1; j < 5; ++j) {
627  cov(i, j) = 0;
628  }
629  }
630  }
631  cov.Invert();
632  } else {
633  // get 3x3 covariance
634  AlgebraicSymMatrix33 momCov = cov.Sub<AlgebraicSymMatrix33>(0, 0); // get 3x3 matrix
635  if (diagonalOnly) {
636  momCov(0, 1) = 0;
637  momCov(0, 2) = 0;
638  momCov(1, 2) = 0;
639  }
640  // invert
641  momCov.Invert();
642  // place it
643  cov.Place_at(momCov, 0, 0);
644  // zero the rest
645  for (size_t i = 3; i < 5; ++i) {
646  for (size_t j = i; j < 5; ++j) {
647  cov(i, j) = 0;
648  }
649  }
650  }
651 }

References HLT_2018_cff::diagonalOnly, mps_fire::i, and dqmiolumiharvest::j.

Referenced by getChi2().

◆ getChi2() [1/3]

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 560 of file MatcherUsingTracksAlgorithm.cc.

564  {
565  if (!start.hasError() && !other.hasError())
566  throw cms::Exception("LogicError") << "At least one of the two states must have errors to make chi2s.\n";
568  if (start.hasError())
569  cov += start.curvilinearError().matrix();
570  if (other.hasError())
571  cov += other.curvilinearError().matrix();
573  GlobalVector p1 = start.momentum(), p2 = other.momentum();
574  GlobalPoint x1 = start.position(), x2 = other.position();
575  GlobalVector p = useFirstMomentum ? p1 : p2;
576  double pt = p.perp(), pm = p.mag();
577  double dsz = (x1.z() - x2.z()) * pt / pm - ((x1.x() - x2.x()) * p.x() + (x1.y() - x2.y()) * p.y()) / pt * p.z() / pm;
578  double dxy = (-(x1.x() - x2.x()) * p.y() + (x1.y() - x2.y()) * p.x()) / pt;
579  AlgebraicVector5 diff(start.charge() / p1.mag() - other.charge() / p2.mag(),
580  p1.theta() - p2.theta(),
581  (p1.phi() - p2.phi()).value(),
582  dxy,
583  dsz);
584  return ROOT::Math::Similarity(diff, cov);
585 }

References cropAndInvert(), HLT_2018_cff::diagonalOnly, change_name::diff, PVValHelper::dxy, trackingPlots::other, AlCaHLTBitMon_ParallelJobs::p, p1, p2, DiDispStaMuonMonitor_cfi::pt, HLT_2018_cff::useVertex, relativeConstraints::value, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

Referenced by matchByDirectComparison(), and matchWithPropagation().

◆ getChi2() [2/3]

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 587 of file MatcherUsingTracksAlgorithm.cc.

590  {
591  if (!start.hasError() && !other.hasError())
592  throw cms::Exception("LogicError") << "At least one of the two states must have errors to make chi2s.\n";
593  double pt; // needed by pgconvert
595  if (start.hasError())
597  if (other.hasError())
598  cov += other.perigeeError().covarianceMatrix();
600  AlgebraicVector5 pgpar1 = PerigeeConversions::ftsToPerigeeParameters(start, other.referencePoint(), pt).vector();
601  AlgebraicVector5 pgpar2 = other.perigeeParameters().vector();
602  AlgebraicVector5 diff(pgpar1 - pgpar2);
603  return ROOT::Math::Similarity(diff, cov);
604 }

References PerigeeTrajectoryError::covarianceMatrix(), cropAndInvert(), HLT_2018_cff::diagonalOnly, change_name::diff, PerigeeConversions::ftsToPerigeeError(), PerigeeConversions::ftsToPerigeeParameters(), trackingPlots::other, DiDispStaMuonMonitor_cfi::pt, and HLT_2018_cff::useVertex.

◆ getChi2() [3/3]

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 606 of file MatcherUsingTracksAlgorithm.cc.

609  {
610  if (!start.hasError() && !other.hasError())
611  throw cms::Exception("LogicError") << "At least one of the two states must have errors to make chi2s.\n";
613  if (start.hasError())
614  cov += start.localError().matrix();
615  if (other.hasError())
616  cov += other.localError().matrix();
618  AlgebraicVector5 diff(start.localParameters().mixedFormatVector() - other.localParameters().mixedFormatVector());
619  return ROOT::Math::Similarity(diff, cov);
620 }

References cropAndInvert(), HLT_2018_cff::diagonalOnly, change_name::diff, trackingPlots::other, and HLT_2018_cff::usePosition.

◆ getConf()

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

Parse some configuration.

Definition at line 130 of file MatcherUsingTracksAlgorithm.cc.

133  {
134  std::string s_whichTrack = iConfig.getParameter<std::string>(whatFor + "Track");
135  if (s_whichTrack == "none") {
136  whichTrack = None;
137  } else if (s_whichTrack == "tracker") {
138  whichTrack = TrackerTk;
139  } else if (s_whichTrack == "muon") {
140  whichTrack = MuonTk;
141  } else if (s_whichTrack == "global") {
142  whichTrack = GlobalTk;
143  } else
144  throw cms::Exception("Configuration") << "Parameter 'useTrack' must be 'none', 'tracker', 'muon', 'global'\n";
145  if ((whichTrack != None) && (algo_ != ByTrackRef)) {
146  std::string s_whichState = iConfig.getParameter<std::string>(whatFor + "State");
147  if (s_whichState == "atVertex") {
148  whichState = AtVertex;
149  } else if (s_whichState == "innermost") {
150  whichState = Innermost;
151  } else if (s_whichState == "outermost") {
152  whichState = Outermost;
153  } else
154  throw cms::Exception("Configuration") << "Parameter 'useState' must be 'atVertex', 'innermost', 'outermost'\n";
155  }
156 }

References algo_, AtVertex, ByTrackRef, Exception, edm::ParameterSet::getParameter(), GlobalTk, Innermost, MuonTk, None, Outermost, AlCaHLTBitMon_QueryRunRegistry::string, and TrackerTk.

Referenced by MatcherUsingTracksAlgorithm().

◆ getTrack()

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 308 of file MatcherUsingTracksAlgorithm.cc.

308  {
309  reco::TrackRef tk;
310  const reco::RecoCandidate *rc = dynamic_cast<const reco::RecoCandidate *>(&reco);
311  if (rc == nullptr)
312  throw cms::Exception("Invalid Data") << "Input object is not a RecoCandidate.\n";
313  switch (whichTrack) {
314  case TrackerTk:
315  tk = rc->track();
316  break;
317  case MuonTk:
318  tk = rc->standAloneMuon();
319  break;
320  case GlobalTk:
321  tk = rc->combinedMuon();
322  break;
323  default:
324  break; // just to make gcc happy
325  }
326  return tk;
327 }

References reco::RecoCandidate::combinedMuon(), Exception, GlobalTk, MuonTk, reco::RecoCandidate::standAloneMuon(), reco::RecoCandidate::track(), and TrackerTk.

Referenced by match(), startingState(), and targetState().

◆ hasChi2()

bool MatcherUsingTracksAlgorithm::hasChi2 ( ) const
inline

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

Definition at line 64 of file MatcherUsingTracksAlgorithm.h.

64 { return useChi2_; }

References useChi2_.

◆ hasMetrics()

bool MatcherUsingTracksAlgorithm::hasMetrics ( ) const
inline

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

Definition at line 61 of file MatcherUsingTracksAlgorithm.h.

61 { return algo_ != ByTrackRef; }

References algo_, and ByTrackRef.

◆ init()

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 302 of file MatcherUsingTracksAlgorithm.cc.

302  {
304  iSetup.get<TrackingComponentsRecord>().get("SteppingHelixPropagatorAny", propagator_);
306 }

References geometry_, edm::EventSetup::get(), get, magfield_, and propagator_.

◆ match() [1/2]

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 160 of file MatcherUsingTracksAlgorithm.cc.

167  {
168  if (!(srcCut_(c1) && matchedCut_(c2)))
169  return false;
170  if (requireSameCharge_ && (c1.charge() != c2.charge()))
171  return false;
172  switch (algo_) {
173  case ByTrackRef: {
176  if (t1.isNonnull()) {
177  if (t1 == t2)
178  return true;
179  if (t1.id() != t2.id()) {
180  edm::LogWarning("MatcherUsingTracksAlgorithm")
181  << "Trying to match by reference tracks coming from different collections.\n";
182  }
183  }
184  }
185  [[fallthrough]];
186  case ByPropagatingSrc: {
189  return matchWithPropagation(start, target, deltR, deltEta, deltPhi, deltaLocalPos, deltaPtRel, chi2);
190  }
191  case ByPropagatingMatched: {
194  return matchWithPropagation(start, target, deltR, deltEta, deltPhi, deltaLocalPos, deltaPtRel, chi2);
195  }
196  case ByPropagatingSrcTSCP: {
199  return matchWithPropagation(start, target, deltR, deltEta, deltPhi, deltaLocalPos, deltaPtRel, chi2);
200  }
204  return matchWithPropagation(start, target, deltR, deltEta, deltPhi, deltaLocalPos, deltaPtRel, chi2);
205  }
206 
207  case ByDirectComparison: {
210  return matchByDirectComparison(start, otherstart, deltR, deltEta, deltPhi, deltaLocalPos, deltaPtRel, chi2);
211  }
212  }
213  return false;
214 }

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().

◆ match() [2/2]

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 219 of file MatcherUsingTracksAlgorithm.cc.

226  {
227  if (!srcCut_(c1))
228  return -1;
229 
230  // working and output variables
233  int match = -1;
234 
235  // pre-fetch some states if needed
239  } else if (algo_ == ByPropagatingMatched)
241 
242  // loop on the collection
244  int i;
245  for (it = c2s.begin(), ed = c2s.end(), i = 0; it != ed; ++it, ++i) {
246  if (!matchedCut_(*it))
247  continue;
248  if (requireSameCharge_ && (c1.charge() != it->charge()))
249  continue;
250  bool exit = false;
251  switch (algo_) {
252  case ByTrackRef: {
255  if (t1.isNonnull()) {
256  if (t1 == t2) {
257  match = i;
258  exit = true;
259  }
260  if (t1.id() != t2.id()) {
261  edm::LogWarning("MatcherUsingTracksAlgorithm")
262  << "Trying to match by reference tracks coming from different collections.\n";
263  }
264  }
265  } break;
266  case ByPropagatingSrc:
267  case ByPropagatingMatched: {
270  else if (algo_ == ByPropagatingSrc)
272  if (matchWithPropagation(start, target, deltR, deltEta, deltPhi, deltaLocalPos, deltaPtRel, chi2)) {
273  match = i;
274  }
275  } break;
276  case ByDirectComparison: {
278  if (matchByDirectComparison(start, otherstart, deltR, deltEta, deltPhi, deltaLocalPos, deltaPtRel, chi2)) {
279  match = i;
280  }
281  } break;
282  case ByPropagatingSrcTSCP: {
284  if (matchWithPropagation(start, otherstart, deltR, deltEta, deltPhi, deltaLocalPos, deltaPtRel, chi2)) {
285  match = i;
286  }
287  } break;
290  if (matchWithPropagation(otherstart, start, deltR, deltEta, deltPhi, deltaLocalPos, deltaPtRel, chi2)) {
291  match = i;
292  }
293  } break;
294  }
295  if (exit)
296  break;
297  }
298 
299  return match;
300 }

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_.

◆ matchByDirectComparison()

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 503 of file MatcherUsingTracksAlgorithm.cc.

510  {
511  if ((start.momentum().mag() == 0) || target.momentum().mag() == 0)
512  return false;
513 
514  bool isBest = false;
515  float thisLocalPosDiff = (start.position() - target.position()).mag();
516  float thisGlobalMomDeltaR = deltaR(start.momentum(), target.momentum());
517  float thisGlobalMomDeltaPhi = fabs(deltaPhi(start.momentum().barePhi(), target.momentum().barePhi()));
518  float thisGlobalMomDeltaEta = fabs(start.momentum().eta() - target.momentum().eta());
519  float thisGlobalDPtRel = (start.momentum().perp() - target.momentum().perp()) / target.momentum().perp();
520 
521  if ((thisLocalPosDiff < maxLocalPosDiff_) && (thisGlobalMomDeltaR < maxGlobalMomDeltaR_) &&
522  (thisGlobalMomDeltaEta < maxGlobalMomDeltaEta_) && (thisGlobalMomDeltaPhi < maxGlobalMomDeltaPhi_) &&
523  (fabs(thisGlobalDPtRel) < maxGlobalDPtRel_)) {
525  if (thisChi2 >= maxChi2_)
526  return false;
527  switch (sortBy_) {
528  case LocalPosDiff:
529  isBest = (thisLocalPosDiff < lastDeltaLocalPos);
530  break;
531  case GlobalMomDeltaR:
532  isBest = (thisGlobalMomDeltaR < lastDeltaR);
533  break;
534  case GlobalMomDeltaEta:
535  isBest = (thisGlobalMomDeltaEta < lastDeltaEta);
536  break;
537  case GlobalMomDeltaPhi:
538  isBest = (thisGlobalMomDeltaPhi < lastDeltaPhi);
539  break;
540  case GlobalDPtRel:
541  isBest = (thisGlobalDPtRel < lastGlobalDPtRel);
542  break;
543  case Chi2:
544  isBest = (thisChi2 < lastChi2);
545  break;
546  }
547  if (isBest) {
548  lastDeltaLocalPos = thisLocalPosDiff;
549  lastDeltaR = thisGlobalMomDeltaR;
550  lastDeltaEta = thisGlobalMomDeltaEta;
551  lastDeltaPhi = thisGlobalMomDeltaPhi;
552  lastGlobalDPtRel = thisGlobalDPtRel;
553  lastChi2 = thisChi2;
554  }
555  } // if match
556 
557  return isBest;
558 }

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().

◆ matchWithPropagation() [1/2]

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 441 of file MatcherUsingTracksAlgorithm.cc.

448  {
449  if ((start.momentum().mag() == 0) || (target.momentum().mag() == 0))
450  return false;
452  /*2.2.X*/ try {
454  // if (!tscp.isValid()) return false; // in 3.1.X
455 
456  bool isBest = false;
457  float thisLocalPosDiff = (tscp.position() - target.position()).mag();
458  float thisGlobalMomDeltaR = deltaR(tscp.momentum(), target.momentum());
459  float thisGlobalMomDeltaPhi = fabs(deltaPhi(tscp.momentum().barePhi(), target.momentum().barePhi()));
460  float thisGlobalMomDeltaEta = fabs(tscp.momentum().eta() - target.momentum().eta());
461  float thisGlobalDPtRel = (tscp.momentum().perp() - target.momentum().perp()) / target.momentum().perp();
462 
463  if ((thisLocalPosDiff < maxLocalPosDiff_) && (thisGlobalMomDeltaR < maxGlobalMomDeltaR_) &&
464  (thisGlobalMomDeltaEta < maxGlobalMomDeltaEta_) && (thisGlobalMomDeltaPhi < maxGlobalMomDeltaPhi_) &&
465  (fabs(thisGlobalDPtRel) < maxGlobalDPtRel_)) {
466  float thisChi2 = useChi2_ ? getChi2(target, tscp, chi2DiagonalOnly_, chi2UseVertex_) : 0;
467  if (thisChi2 >= maxChi2_)
468  return false;
469  switch (sortBy_) {
470  case LocalPosDiff:
471  isBest = (thisLocalPosDiff < lastDeltaLocalPos);
472  break;
473  case GlobalMomDeltaR:
474  isBest = (thisGlobalMomDeltaR < lastDeltaR);
475  break;
476  case GlobalMomDeltaEta:
477  isBest = (thisGlobalMomDeltaEta < lastDeltaEta);
478  break;
479  case GlobalMomDeltaPhi:
480  isBest = (thisGlobalMomDeltaPhi < lastDeltaPhi);
481  break;
482  case GlobalDPtRel:
483  isBest = (thisGlobalDPtRel < lastGlobalDPtRel);
484  break;
485  case Chi2:
486  isBest = (thisChi2 < lastChi2);
487  break;
488  }
489  if (isBest) {
490  lastDeltaLocalPos = thisLocalPosDiff;
491  lastDeltaR = thisGlobalMomDeltaR;
492  lastDeltaEta = thisGlobalMomDeltaEta;
493  lastDeltaPhi = thisGlobalMomDeltaPhi;
494  lastGlobalDPtRel = thisGlobalDPtRel;
495  lastChi2 = thisChi2;
496  }
497  } // if match
498 
499  return isBest;
500  /*2.2.X*/ } catch (const TrajectoryStateException &err) { return false; }
501 }

References PV3DBase< T, PVType, FrameType >::barePhi(), Chi2, chi2DiagonalOnly_, chi2UseVertex_, SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, runTheMatrix::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().

◆ matchWithPropagation() [2/2]

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 379 of file MatcherUsingTracksAlgorithm.cc.

386  {
387  if ((start.momentum().mag() == 0) || !target.isValid())
388  return false;
389 
391 
392  bool isBest = false;
393  if (tsos.isValid()) {
394  float thisLocalPosDiff = (tsos.localPosition() - target.localPosition()).mag();
395  float thisGlobalMomDeltaR = deltaR(tsos.globalMomentum(), target.globalMomentum());
396  float thisGlobalMomDeltaPhi = fabs(deltaPhi(tsos.globalMomentum().barePhi(), target.globalMomentum().barePhi()));
397  float thisGlobalMomDeltaEta = fabs(tsos.globalMomentum().eta() - target.globalMomentum().eta());
398  float thisGlobalDPtRel =
399  (tsos.globalMomentum().perp() - target.globalMomentum().perp()) / target.globalMomentum().perp();
400 
401  if ((thisLocalPosDiff < maxLocalPosDiff_) && (thisGlobalMomDeltaR < maxGlobalMomDeltaR_) &&
402  (thisGlobalMomDeltaEta < maxGlobalMomDeltaEta_) && (thisGlobalMomDeltaPhi < maxGlobalMomDeltaPhi_) &&
403  (fabs(thisGlobalDPtRel) < maxGlobalDPtRel_)) {
404  float thisChi2 = useChi2_ ? getChi2(target, tsos, chi2DiagonalOnly_, chi2UseVertex_) : 0;
405  if (thisChi2 >= maxChi2_)
406  return false;
407  switch (sortBy_) {
408  case LocalPosDiff:
409  isBest = (thisLocalPosDiff < lastDeltaLocalPos);
410  break;
411  case GlobalMomDeltaR:
412  isBest = (thisGlobalMomDeltaR < lastDeltaR);
413  break;
414  case GlobalMomDeltaEta:
415  isBest = (thisGlobalMomDeltaEta < lastDeltaEta);
416  break;
417  case GlobalMomDeltaPhi:
418  isBest = (thisGlobalMomDeltaPhi < lastDeltaPhi);
419  break;
420  case GlobalDPtRel:
421  isBest = (thisGlobalDPtRel < lastGlobalDPtRel);
422  break;
423  case Chi2:
424  isBest = (thisChi2 < lastChi2);
425  break;
426  }
427  if (isBest) {
428  lastDeltaLocalPos = thisLocalPosDiff;
429  lastDeltaR = thisGlobalMomDeltaR;
430  lastDeltaEta = thisGlobalMomDeltaEta;
431  lastDeltaPhi = thisGlobalMomDeltaPhi;
432  lastGlobalDPtRel = thisGlobalDPtRel;
433  lastChi2 = thisChi2;
434  }
435  } // if match
436  }
437 
438  return isBest;
439 }

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_.

◆ startingState()

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

Starting state for the propagation.

Definition at line 329 of file MatcherUsingTracksAlgorithm.cc.

331  {
333  if (whichTrack != None) {
334  reco::TrackRef tk = getTrack(reco, whichTrack);
335  if (tk.isNull()) {
337  } else {
338  switch (whichState) {
339  case AtVertex:
341  break;
342  case Innermost:
344  break;
345  case Outermost:
347  break;
348  }
349  }
350  } else {
351  ret = FreeTrajectoryState(GlobalPoint(reco.vx(), reco.vy(), reco.vz()),
352  GlobalVector(reco.px(), reco.py(), reco.pz()),
353  reco.charge(),
354  magfield_.product());
355  }
356  return ret;
357 }

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().

◆ targetState()

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

End state for the propagation.

Definition at line 359 of file MatcherUsingTracksAlgorithm.cc.

361  {
363  reco::TrackRef tk = getTrack(reco, whichTrack);
364  if (tk.isNonnull()) {
365  switch (whichState) {
366  case Innermost:
368  break;
369  case Outermost:
371  break;
372  default:
373  break; // just to make gcc happy
374  }
375  }
376  return ret;
377 }

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().

Member Data Documentation

◆ algo_

AlgoType MatcherUsingTracksAlgorithm::algo_
private

◆ chi2DiagonalOnly_

bool MatcherUsingTracksAlgorithm::chi2DiagonalOnly_
private

◆ chi2FirstMomentum_

bool MatcherUsingTracksAlgorithm::chi2FirstMomentum_
private

◆ chi2UseVertex_

bool MatcherUsingTracksAlgorithm::chi2UseVertex_
private

◆ geometry_

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

Definition at line 132 of file MatcherUsingTracksAlgorithm.h.

Referenced by init(), and targetState().

◆ magfield_

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

Definition at line 130 of file MatcherUsingTracksAlgorithm.h.

Referenced by init(), startingState(), and targetState().

◆ matchedCut_

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

Definition at line 115 of file MatcherUsingTracksAlgorithm.h.

Referenced by match().

◆ maxChi2_

float MatcherUsingTracksAlgorithm::maxChi2_
private

◆ maxGlobalDPtRel_

float MatcherUsingTracksAlgorithm::maxGlobalDPtRel_
private

◆ maxGlobalMomDeltaEta_

float MatcherUsingTracksAlgorithm::maxGlobalMomDeltaEta_
private

◆ maxGlobalMomDeltaPhi_

float MatcherUsingTracksAlgorithm::maxGlobalMomDeltaPhi_
private

◆ maxGlobalMomDeltaR_

float MatcherUsingTracksAlgorithm::maxGlobalMomDeltaR_
private

◆ maxLocalPosDiff_

float MatcherUsingTracksAlgorithm::maxLocalPosDiff_
private

◆ propagator_

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

Definition at line 131 of file MatcherUsingTracksAlgorithm.h.

Referenced by init(), and matchWithPropagation().

◆ requireSameCharge_

bool MatcherUsingTracksAlgorithm::requireSameCharge_
private

Definition at line 124 of file MatcherUsingTracksAlgorithm.h.

Referenced by match().

◆ sortBy_

SortBy MatcherUsingTracksAlgorithm::sortBy_
private

◆ srcCut_

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

Definition at line 115 of file MatcherUsingTracksAlgorithm.h.

Referenced by match().

◆ useChi2_

bool MatcherUsingTracksAlgorithm::useChi2_
private

◆ whichState1_

WhichState MatcherUsingTracksAlgorithm::whichState1_
private

Definition at line 112 of file MatcherUsingTracksAlgorithm.h.

Referenced by match(), and MatcherUsingTracksAlgorithm().

◆ whichState2_

WhichState MatcherUsingTracksAlgorithm::whichState2_
private

Definition at line 112 of file MatcherUsingTracksAlgorithm.h.

Referenced by match(), and MatcherUsingTracksAlgorithm().

◆ whichTrack1_

WhichTrack MatcherUsingTracksAlgorithm::whichTrack1_
private

Definition at line 111 of file MatcherUsingTracksAlgorithm.h.

Referenced by match(), and MatcherUsingTracksAlgorithm().

◆ whichTrack2_

WhichTrack MatcherUsingTracksAlgorithm::whichTrack2_
private

Definition at line 111 of file MatcherUsingTracksAlgorithm.h.

Referenced by match(), and MatcherUsingTracksAlgorithm().

Vector3DBase
Definition: Vector3DBase.h:8
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:355
MatcherUsingTracksAlgorithm::targetState
TrajectoryStateOnSurface targetState(const reco::Candidate &reco, WhichTrack whichTrack, WhichState whichState) const
End state for the propagation.
Definition: MatcherUsingTracksAlgorithm.cc:359
MatcherUsingTracksAlgorithm::geometry_
edm::ESHandle< GlobalTrackingGeometry > geometry_
Definition: MatcherUsingTracksAlgorithm.h:132
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
change_name.diff
diff
Definition: change_name.py:13
RandomServiceHelper.t2
t2
Definition: RandomServiceHelper.py:257
edm::View::begin
const_iterator begin() const
MatcherUsingTracksAlgorithm::chi2UseVertex_
bool chi2UseVertex_
Definition: MatcherUsingTracksAlgorithm.h:125
AlgebraicSymMatrix33
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
Definition: AlgebraicROOTObjects.h:21
mps_fire.i
i
Definition: mps_fire.py:355
start
Definition: start.py:1
HLT_2018_cff.useVertex
useVertex
Definition: HLT_2018_cff.py:25062
trajectoryStateTransform::outerFreeState
FreeTrajectoryState outerFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
Definition: TrajectoryStateTransform.cc:98
trajectoryStateTransform::initialFreeState
FreeTrajectoryState initialFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
Definition: TrajectoryStateTransform.cc:58
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
reco::RecoCandidate::combinedMuon
virtual reco::TrackRef combinedMuon() const
reference to a stand-alone muon Track
Definition: RecoCandidate.cc:23
PerigeeConversions::ftsToPerigeeParameters
PerigeeTrajectoryParameters ftsToPerigeeParameters(const FTS &originalFTS, const GlobalPoint &referencePoint, double &pt)
Definition: PerigeeConversions.cc:7
edm::Ref::isNull
bool isNull() const
Checks for null.
Definition: Ref.h:235
testProducerWithPsetDescEmpty_cfi.x2
x2
Definition: testProducerWithPsetDescEmpty_cfi.py:28
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
MatcherUsingTracksAlgorithm::GlobalMomDeltaEta
Definition: MatcherUsingTracksAlgorithm.h:126
MatcherUsingTracksAlgorithm::maxChi2_
float maxChi2_
Definition: MatcherUsingTracksAlgorithm.h:123
MatcherUsingTracksAlgorithm::None
Definition: MatcherUsingTracksAlgorithm.h:107
GlobalTrackingGeometryRecord
Definition: GlobalTrackingGeometryRecord.h:17
reco::RecoCandidate::standAloneMuon
virtual reco::TrackRef standAloneMuon() const
reference to a stand-alone muon Track
Definition: RecoCandidate.cc:21
edm::ParameterSet::existsAs
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:160
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
reco::RecoCandidate::track
virtual reco::TrackRef track() const
reference to a Track
Definition: RecoCandidate.cc:13
edm::Ref< TrackCollection >
trajectoryStateTransform::outerStateOnSurface
TrajectoryStateOnSurface outerStateOnSurface(const reco::Track &tk, const TrackingGeometry &geom, const MagneticField *field, bool withErr=true)
Definition: TrajectoryStateTransform.cc:118
MatcherUsingTracksAlgorithm::maxGlobalMomDeltaEta_
float maxGlobalMomDeltaEta_
Definition: MatcherUsingTracksAlgorithm.h:120
Chi2
Definition: Chi2.h:15
MatcherUsingTracksAlgorithm::maxLocalPosDiff_
float maxLocalPosDiff_
Definition: MatcherUsingTracksAlgorithm.h:118
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
cmsdt::algo
algo
Definition: constants.h:164
MatcherUsingTracksAlgorithm::sortBy_
SortBy sortBy_
Definition: MatcherUsingTracksAlgorithm.h:127
MatcherUsingTracksAlgorithm::ByTrackRef
Definition: MatcherUsingTracksAlgorithm.h:100
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
MatcherUsingTracksAlgorithm::GlobalTk
Definition: MatcherUsingTracksAlgorithm.h:107
RandomServiceHelper.t1
t1
Definition: RandomServiceHelper.py:256
MatcherUsingTracksAlgorithm::matchByDirectComparison
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,...
Definition: MatcherUsingTracksAlgorithm.cc:503
MatcherUsingTracksAlgorithm::MuonTk
Definition: MatcherUsingTracksAlgorithm.h:107
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
TrackCandidateProducer_cfi.propagator
propagator
Definition: TrackCandidateProducer_cfi.py:17
MatcherUsingTracksAlgorithm::getConf
void getConf(const edm::ParameterSet &iConfig, const std::string &whatFor, WhichTrack &whichTrack, WhichState &whichState)
Parse some configuration.
Definition: MatcherUsingTracksAlgorithm.cc:130
MatcherUsingTracksAlgorithm::srcCut_
StringCutObjectSelector< reco::Candidate, true > srcCut_
Definition: MatcherUsingTracksAlgorithm.h:115
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
reco::Candidate::charge
virtual int charge() const =0
electric charge
TrajectoryStateClosestToPoint::position
GlobalPoint position() const
Definition: TrajectoryStateClosestToPoint.h:90
MatcherUsingTracksAlgorithm::Innermost
Definition: MatcherUsingTracksAlgorithm.h:108
TrajectoryStateException
Common base class.
Definition: TrajectoryStateExceptions.h:12
MatcherUsingTracksAlgorithm::whichState2_
WhichState whichState2_
Definition: MatcherUsingTracksAlgorithm.h:112
p2
double p2[4]
Definition: TauolaWrapper.h:90
trackingPlots.other
other
Definition: trackingPlots.py:1465
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
MatcherUsingTracksAlgorithm::ByDirectComparison
Definition: MatcherUsingTracksAlgorithm.h:101
muonL1Match_cfi.sortBy
sortBy
Definition: muonL1Match_cfi.py:19
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
MatcherUsingTracksAlgorithm::useChi2_
bool useChi2_
Definition: MatcherUsingTracksAlgorithm.h:125
MatcherUsingTracksAlgorithm::ByPropagatingMatchedTSCP
Definition: MatcherUsingTracksAlgorithm.h:105
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MatcherUsingTracksAlgorithm::TrackerTk
Definition: MatcherUsingTracksAlgorithm.h:107
MatcherUsingTracksAlgorithm::matchWithPropagation
bool matchWithPropagation(const FreeTrajectoryState &start, const FreeTrajectoryState &target, float &lastDeltaR, float &lastDeltaEta, float &lastDeltaPhi, float &lastDeltaLocalPos, float &lastGlobalDPtRel, float &lastChi2) const
Definition: MatcherUsingTracksAlgorithm.cc:441
edm::LogWarning
Definition: MessageLogger.h:141
MatcherUsingTracksAlgorithm::whichTrack2_
WhichTrack whichTrack2_
Definition: MatcherUsingTracksAlgorithm.h:111
TrajectoryStateOnSurface::localPosition
LocalPoint localPosition() const
Definition: TrajectoryStateOnSurface.h:74
MatcherUsingTracksAlgorithm::cropAndInvert
static void cropAndInvert(AlgebraicSymMatrix55 &cov, bool diagonalOnly, bool top3by3only)
Possibly crop the 3x3 part of the matrix or remove off-diagonal terms, then invert.
Definition: MatcherUsingTracksAlgorithm.cc:622
MatcherUsingTracksAlgorithm::getTrack
reco::TrackRef getTrack(const reco::Candidate &reco, WhichTrack which) const
Get track reference out of a Candidate (via dynamic_cast to reco::RecoCandidate)
Definition: MatcherUsingTracksAlgorithm.cc:308
MatcherUsingTracksAlgorithm::chi2FirstMomentum_
bool chi2FirstMomentum_
Definition: MatcherUsingTracksAlgorithm.h:125
PV3DBase::barePhi
T barePhi() const
Definition: PV3DBase.h:65
runTheMatrix.err
err
Definition: runTheMatrix.py:288
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
MatcherUsingTracksAlgorithm::maxGlobalDPtRel_
float maxGlobalDPtRel_
Definition: MatcherUsingTracksAlgorithm.h:122
MatcherUsingTracksAlgorithm::chi2DiagonalOnly_
bool chi2DiagonalOnly_
Definition: MatcherUsingTracksAlgorithm.h:125
MatcherUsingTracksAlgorithm::maxGlobalMomDeltaPhi_
float maxGlobalMomDeltaPhi_
Definition: MatcherUsingTracksAlgorithm.h:121
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
alignmentValidation.c1
c1
do drawing
Definition: alignmentValidation.py:1025
MatcherUsingTracksAlgorithm::ByPropagatingSrc
Definition: MatcherUsingTracksAlgorithm.h:102
p1
double p1[4]
Definition: TauolaWrapper.h:89
MatcherUsingTracksAlgorithm::LocalPosDiff
Definition: MatcherUsingTracksAlgorithm.h:126
Propagator::propagate
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
TrajectoryStateClosestToPoint
Definition: TrajectoryStateClosestToPoint.h:18
reco::RecoCandidate
Definition: RecoCandidate.h:20
AlgebraicVector5
ROOT::Math::SVector< double, 5 > AlgebraicVector5
Definition: AlgebraicROOTObjects.h:14
get
#define get
HLT_2018_cff.usePosition
usePosition
Definition: HLT_2018_cff.py:10155
MatcherUsingTracksAlgorithm::propagator_
edm::ESHandle< Propagator > propagator_
Definition: MatcherUsingTracksAlgorithm.h:131
MatcherUsingTracksAlgorithm::getChi2
static double getChi2(const FreeTrajectoryState &start, const FreeTrajectoryState &other, bool diagonalOnly, bool useVertex, bool useFirstMomentum)
Definition: MatcherUsingTracksAlgorithm.cc:560
MatcherUsingTracksAlgorithm::Chi2
Definition: MatcherUsingTracksAlgorithm.h:126
MatcherUsingTracksAlgorithm::whichState1_
WhichState whichState1_
Definition: MatcherUsingTracksAlgorithm.h:112
PerigeeTrajectoryError::covarianceMatrix
const AlgebraicSymMatrix55 & covarianceMatrix() const
Definition: PerigeeTrajectoryError.h:29
MatcherUsingTracksAlgorithm::whichTrack1_
WhichTrack whichTrack1_
Definition: MatcherUsingTracksAlgorithm.h:111
MatcherUsingTracksAlgorithm::magfield_
edm::ESHandle< MagneticField > magfield_
Definition: MatcherUsingTracksAlgorithm.h:130
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
trajectoryStateTransform::innerFreeState
FreeTrajectoryState innerFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
Definition: TrajectoryStateTransform.cc:86
TrajectoryStateOnSurface::globalMomentum
GlobalVector globalMomentum() const
Definition: TrajectoryStateOnSurface.h:66
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
MatcherUsingTracksAlgorithm::AtVertex
Definition: MatcherUsingTracksAlgorithm.h:108
TSCPBuilderNoMaterial
Definition: TSCPBuilderNoMaterial.h:17
PVValHelper::dxy
Definition: PVValidationHelpers.h:47
MatcherUsingTracksAlgorithm::matchedCut_
StringCutObjectSelector< reco::Candidate, true > matchedCut_
Definition: MatcherUsingTracksAlgorithm.h:115
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
MatcherUsingTracksAlgorithm::match
bool match(const reco::Candidate &c1, const reco::Candidate &c2, float &deltaR, float &deltaEta, float &deltaPhi, float &deltaLocalPos, float &deltaPtRel, float &chi2) const
Definition: MatcherUsingTracksAlgorithm.cc:160
MatcherUsingTracksAlgorithm::Outermost
Definition: MatcherUsingTracksAlgorithm.h:108
relativeConstraints.value
value
Definition: relativeConstraints.py:53
Exception
Definition: hltDiff.cc:246
MatcherUsingTracksAlgorithm::startingState
FreeTrajectoryState startingState(const reco::Candidate &reco, WhichTrack whichTrack, WhichState whichState) const
Starting state for the propagation.
Definition: MatcherUsingTracksAlgorithm.cc:329
edm::View::const_iterator
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
filterCSVwithJSON.target
target
Definition: filterCSVwithJSON.py:32
MatcherUsingTracksAlgorithm::ByPropagatingMatched
Definition: MatcherUsingTracksAlgorithm.h:103
HLT_2018_cff.diagonalOnly
diagonalOnly
Definition: HLT_2018_cff.py:10156
MatcherUsingTracksAlgorithm::algo_
AlgoType algo_
Definition: MatcherUsingTracksAlgorithm.h:110
cms::Exception
Definition: Exception.h:70
edm::View::end
const_iterator end() const
beamvalidation.exit
def exit(msg="")
Definition: beamvalidation.py:53
command_line.start
start
Definition: command_line.py:167
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
trajectoryStateTransform::innerStateOnSurface
TrajectoryStateOnSurface innerStateOnSurface(const reco::Track &tk, const TrackingGeometry &geom, const MagneticField *field, bool withErr=true)
Definition: TrajectoryStateTransform.cc:110
MatcherUsingTracksAlgorithm::maxGlobalMomDeltaR_
float maxGlobalMomDeltaR_
Definition: MatcherUsingTracksAlgorithm.h:119
TrajectoryStateClosestToPoint::momentum
GlobalVector momentum() const
Definition: TrajectoryStateClosestToPoint.h:92
PerigeeConversions::ftsToPerigeeError
PerigeeTrajectoryError ftsToPerigeeError(const FTS &originalFTS)
Definition: PerigeeConversions.cc:51
AlgebraicSymMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Definition: AlgebraicROOTObjects.h:23
MatcherUsingTracksAlgorithm::GlobalMomDeltaPhi
Definition: MatcherUsingTracksAlgorithm.h:126
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
MatcherUsingTracksAlgorithm::GlobalDPtRel
Definition: MatcherUsingTracksAlgorithm.h:126
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
MatcherUsingTracksAlgorithm::requireSameCharge_
bool requireSameCharge_
Definition: MatcherUsingTracksAlgorithm.h:124
MatcherUsingTracksAlgorithm::GlobalMomDeltaR
Definition: MatcherUsingTracksAlgorithm.h:126
MatcherUsingTracksAlgorithm::ByPropagatingSrcTSCP
Definition: MatcherUsingTracksAlgorithm.h:104
TrackingComponentsRecord
Definition: TrackingComponentsRecord.h:12