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
JetTracksAssociationDRVertex Class Reference

#include <JetTracksAssociationDRVertex.h>

Public Member Functions

 JetTracksAssociationDRVertex (double fDr)
 
void produce (reco::JetTracksAssociation::Container *fAssociation, const std::vector< edm::RefToBase< reco::Jet > > &fJets, const std::vector< reco::TrackRef > &fTracks) const
 
 ~JetTracksAssociationDRVertex ()
 

Private Attributes

double mDeltaR2Threshold
 fidutial dR between track in the vertex and jet's reference direction More...
 

Detailed Description

Definition at line 10 of file JetTracksAssociationDRVertex.h.

Constructor & Destructor Documentation

JetTracksAssociationDRVertex::JetTracksAssociationDRVertex ( double  fDr)

Definition at line 13 of file JetTracksAssociationDRVertex.cc.

14 : mDeltaR2Threshold (fDr*fDr)
15 {}
double mDeltaR2Threshold
fidutial dR between track in the vertex and jet&#39;s reference direction
JetTracksAssociationDRVertex::~JetTracksAssociationDRVertex ( )
inline

Definition at line 13 of file JetTracksAssociationDRVertex.h.

13 {}

Member Function Documentation

void JetTracksAssociationDRVertex::produce ( reco::JetTracksAssociation::Container fAssociation,
const std::vector< edm::RefToBase< reco::Jet > > &  fJets,
const std::vector< reco::TrackRef > &  fTracks 
) const

Definition at line 17 of file JetTracksAssociationDRVertex.cc.

References reco::deltaR2(), reco::TrackBase::eta(), eta(), reco::LeafCandidate::eta(), i, j, metsig::jet, reco::btau::jetEta, reco::btau::jetPhi, mDeltaR2Threshold, reco::TrackBase::p(), phi, reco::TrackBase::phi(), reco::LeafCandidate::phi(), edm::RefVector< C, T, F >::push_back(), reco::JetTracksAssociation::setValue(), and edmStreamStallGrapher::t.

Referenced by JetTracksAssociatorAtVertex::produce().

20 {
21  // cache tracks kinematics
22  std::vector <math::RhoEtaPhiVector> trackP3s;
23  trackP3s.reserve (fTracks.size());
24  for (unsigned i = 0; i < fTracks.size(); ++i) {
25  const reco::Track* track = &*(fTracks[i]);
26  trackP3s.push_back (math::RhoEtaPhiVector (track->p(),track->eta(), track->phi()));
27  }
28  //loop on jets and associate
29  for (unsigned j = 0; j < fJets.size(); ++j) {
30  reco::TrackRefVector assoTracks;
31  const reco::Jet* jet = &*(fJets[j]);
32  double jetEta = jet->eta();
33  double jetPhi = jet->phi();
34  for (unsigned t = 0; t < fTracks.size(); ++t) {
35  double dR2 = deltaR2 (jetEta, jetPhi, trackP3s[t].eta(), trackP3s[t].phi());
36  if (dR2 < mDeltaR2Threshold) assoTracks.push_back (fTracks[t]);
37  }
38  reco::JetTracksAssociation::setValue (fAssociation, fJets[j], assoTracks);
39  }
40 }
double p() const
momentum vector magnitude
Definition: TrackBase.h:127
int i
Definition: DBlmapReader.cc:9
virtual float phi() const
momentum azimuthal angle
Base class for all types of Jets.
Definition: Jet.h:20
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:137
T eta() const
RhoEtaPhiVectorD RhoEtaPhiVector
spatial vector with cylindrical internal representation using pseudorapidity
Definition: Vector3D.h:32
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:139
bool setValue(Container &, const reco::JetBaseRef &, reco::TrackRefVector)
associate jet with value. Returns false and associate nothing if jet is already associated ...
virtual float eta() const
momentum pseudorapidity
double mDeltaR2Threshold
fidutial dR between track in the vertex and jet&#39;s reference direction
int j
Definition: DBlmapReader.cc:9
double deltaR2(const T1 &t1, const T2 &t2)
Definition: deltaR.h:36
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:64
Definition: DDAxes.h:10

Member Data Documentation

double JetTracksAssociationDRVertex::mDeltaR2Threshold
private

fidutial dR between track in the vertex and jet's reference direction

Definition at line 20 of file JetTracksAssociationDRVertex.h.

Referenced by produce().