CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 9 of file SimpleJetTrackAssociator.h.

10  : deltaR2_(deltaR * deltaR), nHits_(nHits), chi2nMax_(chi2nMax) {}
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ uint32_t const *__restrict__ gpuPixelDoublets::CellNeighborsVector const gpuPixelDoublets::CellTracksVector const GPUCACell::OuterHitOfCell const int32_t nHits

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

21  {
22  for (size_t i = 0, n = in.size(); i < n; i++) {
23  const reco::Track &t = in[i];
24  if ((t.numberOfValidHits() < nHits_) || (t.normalizedChi2() > chi2nMax_))
25  continue;
26  if (deltaR2(dir, t) < deltaR2_) {
27  reco::TrackRef tr = in.refAt(i).castTo<reco::TrackRef>();
28  out.push_back(tr);
29  }
30  }
31 }
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:593
size_type size() const
RefToBase< value_type > refAt(size_type i) const
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:798
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&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:67
void helper::SimpleJetTrackAssociator::associateTransient ( const math::XYZVector dir,
const reco::TrackCollection in,
reco::TrackRefVector out 
)

Definition at line 5 of file SimpleJetTrackAssociator.cc.

References chi2nMax_, reco::deltaR2(), deltaR2_, mps_fire::i, dqmiodumpmetadata::n, nHits_, reco::TrackBase::normalizedChi2(), reco::TrackBase::numberOfValidHits(), edm::RefVector< C, T, F >::push_back(), and submitPVValidationJobs::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_))
11  continue;
12  if (deltaR2(dir, t) < deltaR2_) {
13  reco::TrackRef tr(&in, i); // note: transient ref
14  out.push_back(tr);
15  }
16  }
17 }
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:593
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:798
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&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:67

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