CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
JetTracksAssociationDRCalo Class Reference

#include <JetTracksAssociationDRCalo.h>

Public Member Functions

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

Static Public Member Functions

static math::XYZPoint propagateTrackToCalorimeter (const reco::Track &fTrack, const MagneticField &fField, const Propagator &fPropagator)
 propagating the track to the Calorimeter More...
 

Private Attributes

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

Detailed Description

Definition at line 14 of file JetTracksAssociationDRCalo.h.

Constructor & Destructor Documentation

JetTracksAssociationDRCalo::JetTracksAssociationDRCalo ( double  fDr)

Definition at line 96 of file JetTracksAssociationDRCalo.cc.

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

Definition at line 17 of file JetTracksAssociationDRCalo.h.

References produce(), and propagateTrackToCalorimeter().

17 {}

Member Function Documentation

void JetTracksAssociationDRCalo::produce ( reco::JetTracksAssociation::Container fAssociation,
const std::vector< edm::RefToBase< reco::Jet > > &  fJets,
const std::vector< reco::TrackRef > &  fTracks,
const MagneticField fField,
const Propagator fPropagator 
) const

Definition at line 98 of file JetTracksAssociationDRCalo.cc.

References PV3DBase< T, PVType, FrameType >::barePhi(), HLTMuonOfflineAnalyzer_cfi::deltaR2, PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), reco::LeafCandidate::eta(), spr::goodTrack(), dqmiolumiharvest::j, metsig::jet, reco::btau::jetEta, reco::btau::jetPhi, PV3DBase< T, PVType, FrameType >::mag(), mDeltaR2Threshold, phi, reco::LeafCandidate::phi(), edm::RefVector< C, T, F >::push_back(), reco::JetTracksAssociation::setValue(), and OrderedSet::t.

Referenced by ~JetTracksAssociationDRCalo().

102  {
103  // cache track parameters
104  std::vector<ImpactPoint> impacts;
105  for (unsigned t = 0; t < fTracks.size(); ++t) {
106  GlobalPoint impact = propagateTrackToCalo(*(fTracks[t]), fField, fPropagator);
107  if (impact.mag() > 0) { // successful extrapolation
108  ImpactPoint goodTrack;
109  goodTrack.index = t;
110  goodTrack.eta = impact.eta();
111  goodTrack.phi = impact.barePhi();
112  impacts.push_back(goodTrack);
113  }
114  }
115 
116  for (unsigned j = 0; j < fJets.size(); ++j) {
117  reco::TrackRefVector assoTracks;
118  const reco::Jet* jet = &*(fJets[j]);
119  double jetEta = jet->eta();
120  double jetPhi = jet->phi();
121  for (unsigned t = 0; t < impacts.size(); ++t) {
122  double dR2 = deltaR2(jetEta, jetPhi, impacts[t].eta, impacts[t].phi);
123  if (dR2 < mDeltaR2Threshold)
124  assoTracks.push_back(fTracks[impacts[t].index]);
125  }
126  reco::JetTracksAssociation::setValue(fAssociation, fJets[j], assoTracks);
127  }
128 }
double eta() const final
momentum pseudorapidity
Base class for all types of Jets.
Definition: Jet.h:20
T barePhi() const
Definition: PV3DBase.h:65
T mag() const
Definition: PV3DBase.h:64
double mDeltaR2Threshold
fidutial dR between track in the vertex and jet&#39;s reference direction
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
bool setValue(Container &, const reco::JetBaseRef &, reco::TrackRefVector)
associate jet with value. Returns false and associate nothing if jet is already associated ...
T eta() const
Definition: PV3DBase.h:73
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67
double phi() const final
momentum azimuthal angle
math::XYZPoint JetTracksAssociationDRCalo::propagateTrackToCalorimeter ( const reco::Track fTrack,
const MagneticField fField,
const Propagator fPropagator 
)
static

propagating the track to the Calorimeter

Definition at line 130 of file JetTracksAssociationDRCalo.cc.

References mps_fire::result, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by ~JetTracksAssociationDRCalo().

132  {
133  GlobalPoint result(propagateTrackToCalo(fTrack, fField, fPropagator));
134  return math::XYZPoint(result.x(), result.y(), result.z());
135 }
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12

Member Data Documentation

double JetTracksAssociationDRCalo::mDeltaR2Threshold
private

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

Definition at line 32 of file JetTracksAssociationDRCalo.h.

Referenced by produce().