CMS 3D CMS Logo

helper::SimpleJetTrackAssociator Class Reference

#include <PhysicsTools/PatUtils/interface/SimpleJetTrackAssociator.h>

List of all members.

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 (double deltaR, int32_t nHits, double chi2nMax)
 SimpleJetTrackAssociator ()

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]

Definition at line 8 of file SimpleJetTrackAssociator.h.

00008                                            :
00009                     deltaR2_(0), nHits_(0), chi2nMax_(0) { }
                SimpleJetTrackAssociator(double deltaR, int32_t nHits, double chi2nMax) :

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

Definition at line 10 of file SimpleJetTrackAssociator.h.

00010                                                                                         :
00011                     deltaR2_(deltaR*deltaR), nHits_(nHits), chi2nMax_(chi2nMax) {}
                


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

00020                                                                                {
00021         for (size_t i = 0, n = in.size(); i < n; i++) {
00022                 const reco::Track & t = in[i];
00023                 if ((t.numberOfValidHits() < nHits_) || (t.normalizedChi2() > chi2nMax_)) continue;
00024                 if (deltaR2(dir, t) < deltaR2_) {
00025                         reco::TrackRef tr = in.refAt(i).castTo<reco::TrackRef>();
00026                         out.push_back(tr);
00027                 }
00028         }
00029 }

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_, deltaR2(), deltaR2_, i, n, nHits_, reco::TrackBase::normalizedChi2(), reco::TrackBase::numberOfValidHits(), edm::RefVector< C, T, F >::push_back(), and t.

00007                                                                                 {
00008         for (size_t i = 0, n = in.size(); i < n; i++) {
00009                 const reco::Track & t = in[i];
00010                 if ((t.numberOfValidHits() < nHits_) || (t.normalizedChi2() > chi2nMax_)) continue;
00011                 if (deltaR2(dir, t) < deltaR2_) {
00012                         reco::TrackRef tr(&in, i); // note: transient ref
00013                         out.push_back(tr);
00014                 }
00015         }
00016 }


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().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:47:29 2009 for CMSSW by  doxygen 1.5.4