test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 }
int i
Definition: DBlmapReader.cc:9
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:556
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:815
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
Definition: deltaR.h:36
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:62
dbl *** dir
Definition: mlp_gen.cc:35