CMS 3D CMS Logo

SimpleJetTrackAssociator.cc
Go to the documentation of this file.
4 
8  for (size_t i = 0, n = in.size(); i < n; i++) {
9  const reco::Track &t = in[i];
10  if ((t.numberOfValidHits() < nHits_) || (t.normalizedChi2() > chi2nMax_))
11  continue;
12  if (deltaR2(dir, t) < deltaR2_) {
13  reco::TrackRef tr(&in, i); // note: transient ref
14  out.push_back(tr);
15  }
16  }
17 }
18 
22  for (size_t i = 0, n = in.size(); i < n; i++) {
23  const reco::Track &t = in[i];
24  if ((t.numberOfValidHits() < nHits_) || (t.normalizedChi2() > chi2nMax_))
25  continue;
26  if (deltaR2(dir, t) < deltaR2_) {
27  reco::TrackRef tr = in.refAt(i).castTo<reco::TrackRef>();
28  out.push_back(tr);
29  }
30  }
31 }
void associateTransient(const math::XYZVector &dir, const reco::TrackCollection &in, reco::TrackRefVector &out)
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:572
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
size_type size() const
RefToBase< value_type > refAt(size_type i) const
void associate(const math::XYZVector &dir, const edm::View< reco::Track > &in, reco::TrackRefVector &out)
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:740
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67