CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 105 of file JetTracksAssociationDRCalo.cc.

106 : mDeltaR2Threshold (fDr*fDr)
107 {}
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.

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 109 of file JetTracksAssociationDRCalo.cc.

References PV3DBase< T, PVType, FrameType >::barePhi(), reco::deltaR2(), eta, PV3DBase< T, PVType, FrameType >::eta(), reco::LeafCandidate::eta(), spr::goodTrack(), cmsHarvester::index, 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 lumiQTWidget::t.

114 {
115  // cache track parameters
116  std::vector<ImpactPoint> impacts;
117  for (unsigned t = 0; t < fTracks.size(); ++t) {
118  GlobalPoint impact = propagateTrackToCalo (*(fTracks[t]), fField, fPropagator);
119  if (impact.mag () > 0) { // successful extrapolation
120  ImpactPoint goodTrack;
121  goodTrack.index = t;
122  goodTrack.eta = impact.eta ();
123  goodTrack.phi = impact.barePhi();
124  impacts.push_back (goodTrack);
125  }
126  }
127 
128  for (unsigned j = 0; j < fJets.size(); ++j) {
129  reco::TrackRefVector assoTracks;
130  const reco::Jet* jet = &*(fJets[j]);
131  double jetEta = jet->eta();
132  double jetPhi = jet->phi();
133  for (unsigned t = 0; t < impacts.size(); ++t) {
134  double dR2 = deltaR2 (jetEta, jetPhi, impacts[t].eta, impacts[t].phi);
135  if (dR2 < mDeltaR2Threshold) assoTracks.push_back (fTracks[impacts[t].index]);
136  }
137  reco::JetTracksAssociation::setValue (fAssociation, fJets[j], assoTracks);
138  }
139 }
Base class for all types of Jets.
Definition: Jet.h:20
virtual double phi() const final
momentum azimuthal angle
T barePhi() const
Definition: PV3DBase.h:68
T mag() const
Definition: PV3DBase.h:67
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 ...
int j
Definition: DBlmapReader.cc:9
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
Definition: deltaR.h:36
T eta() const
Definition: PV3DBase.h:76
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:69
virtual double eta() const final
momentum pseudorapidity
math::XYZPoint JetTracksAssociationDRCalo::propagateTrackToCalorimeter ( const reco::Track fTrack,
const MagneticField fField,
const Propagator fPropagator 
)
static

propagating the track to the Calorimeter

Definition at line 141 of file JetTracksAssociationDRCalo.cc.

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

144 {
145  GlobalPoint result (propagateTrackToCalo (fTrack, fField, fPropagator));
146  return math::XYZPoint (result.x(), result.y(), result.z());
147 }
tuple result
Definition: mps_fire.py:84
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 31 of file JetTracksAssociationDRCalo.h.

Referenced by produce().