CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

Definition at line 10 of file SimpleJetTrackAssociator.h.

10  :
11  deltaR2_(deltaR*deltaR), nHits_(nHits), chi2nMax_(chi2nMax) {}
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17

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 reco::deltaR2(), i, gen::n, reco::TrackBase::normalizedChi2(), reco::TrackBase::numberOfValidHits(), edm::RefVector< C, T, F >::push_back(), edm::View< T >::refAt(), edm::View< T >::size(), and tree::t.

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 }
tuple t
Definition: tree.py:139
int i
Definition: DBlmapReader.cc:9
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:524
size_type size() const
RefToBase< value_type > refAt(size_type i) const
double deltaR2(const T1 &t1, const T2 &t2)
Definition: deltaR.h:36
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:783
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
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_, i, gen::n, nHits_, reco::TrackBase::normalizedChi2(), reco::TrackBase::numberOfValidHits(), edm::RefVector< C, T, F >::push_back(), and tree::t.

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 }
tuple t
Definition: tree.py:139
int i
Definition: DBlmapReader.cc:9
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:524
double deltaR2(const T1 &t1, const T2 &t2)
Definition: deltaR.h:36
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:783
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

Member Data Documentation

double helper::SimpleJetTrackAssociator::chi2nMax_
private

Definition at line 21 of file SimpleJetTrackAssociator.h.

Referenced by associateTransient().

double helper::SimpleJetTrackAssociator::deltaR2_
private

Definition at line 19 of file SimpleJetTrackAssociator.h.

Referenced by associateTransient().

int32_t helper::SimpleJetTrackAssociator::nHits_
private

Definition at line 20 of file SimpleJetTrackAssociator.h.

Referenced by associateTransient().