CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
helper::SimpleJetTrackAssociator Class Reference

#include <SimpleJetTrackAssociator.h>

Public Member Functions

void associate (const math::XYZVector &dir, const edm::View< reco::Track > &in, reco::TrackRefVector &out)
 
void associateTransient (const math::XYZVector &dir, const reco::TrackCollection &in, reco::TrackRefVector &out)
 
 SimpleJetTrackAssociator ()
 
 SimpleJetTrackAssociator (double deltaR, int32_t nHits, double chi2nMax)
 

Private Attributes

double chi2nMax_
 
double deltaR2_
 
int32_t nHits_
 

Detailed Description

Definition at line 6 of file SimpleJetTrackAssociator.h.

Constructor & Destructor Documentation

helper::SimpleJetTrackAssociator::SimpleJetTrackAssociator ( )
inline
helper::SimpleJetTrackAssociator::SimpleJetTrackAssociator ( double  deltaR,
int32_t  nHits,
double  chi2nMax 
)
inline

Member Function Documentation

void helper::SimpleJetTrackAssociator::associate ( const math::XYZVector dir,
const edm::View< reco::Track > &  in,
reco::TrackRefVector out 
)

Definition at line 19 of file SimpleJetTrackAssociator.cc.

References chi2nMax_, reco::deltaR2(), deltaR2_, mps_fire::i, gen::n, nHits_, reco::TrackBase::normalizedChi2(), reco::TrackBase::numberOfValidHits(), edm::RefVector< C, T, F >::push_back(), edm::View< T >::refAt(), edm::View< T >::size(), and protons_cff::t.

Referenced by SimpleJetTrackAssociator().

20  {
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 }
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:600
size_type size() const
RefToBase< value_type > refAt(size_type i) const
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:901
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
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
void helper::SimpleJetTrackAssociator::associateTransient ( const math::XYZVector dir,
const reco::TrackCollection in,
reco::TrackRefVector out 
)

Definition at line 6 of file SimpleJetTrackAssociator.cc.

References chi2nMax_, reco::deltaR2(), deltaR2_, mps_fire::i, gen::n, nHits_, reco::TrackBase::normalizedChi2(), reco::TrackBase::numberOfValidHits(), edm::RefVector< C, T, F >::push_back(), and protons_cff::t.

Referenced by SimpleJetTrackAssociator().

7  {
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 }
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:600
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:901
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
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

Member Data Documentation

double helper::SimpleJetTrackAssociator::chi2nMax_
private

Definition at line 21 of file SimpleJetTrackAssociator.h.

Referenced by associate(), and associateTransient().

double helper::SimpleJetTrackAssociator::deltaR2_
private

Definition at line 19 of file SimpleJetTrackAssociator.h.

Referenced by associate(), and associateTransient().

int32_t helper::SimpleJetTrackAssociator::nHits_
private

Definition at line 20 of file SimpleJetTrackAssociator.h.

Referenced by associate(), and associateTransient().