CMS 3D CMS Logo

SimpleJetTrackAssociator.cc
Go to the documentation of this file.
4 
5 void
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_)) continue;
11  if (deltaR2(dir, t) < deltaR2_) {
12  reco::TrackRef tr(&in, i); // note: transient ref
13  out.push_back(tr);
14  }
15  }
16 }
17 
18 void
21  for (size_t i = 0, n = in.size(); i < n; i++) {
22  const reco::Track & t = in[i];
23  if ((t.numberOfValidHits() < nHits_) || (t.normalizedChi2() > chi2nMax_)) continue;
24  if (deltaR2(dir, t) < deltaR2_) {
25  reco::TrackRef tr = in.refAt(i).castTo<reco::TrackRef>();
26  out.push_back(tr);
27  }
28  }
29 }
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:561
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:15
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:820
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:69
dbl *** dir
Definition: mlp_gen.cc:35