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 15 of file JetTracksAssociationDRCalo.h.

Constructor & Destructor Documentation

JetTracksAssociationDRCalo::JetTracksAssociationDRCalo ( double  fDr)

Definition at line 107 of file JetTracksAssociationDRCalo.cc.

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

Definition at line 18 of file JetTracksAssociationDRCalo.h.

18 {}

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

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

116 {
117  // cache track parameters
118  std::vector<ImpactPoint> impacts;
119  for (unsigned t = 0; t < fTracks.size(); ++t) {
120  GlobalPoint impact = propagateTrackToCalo (*(fTracks[t]), fField, fPropagator);
121  if (impact.mag () > 0) { // successful extrapolation
122  ImpactPoint goodTrack;
123  goodTrack.index = t;
124  goodTrack.eta = impact.eta ();
125  goodTrack.phi = impact.barePhi();
126  impacts.push_back (goodTrack);
127  }
128  }
129 
130  for (unsigned j = 0; j < fJets.size(); ++j) {
131  reco::TrackRefVector assoTracks;
132  const reco::Jet* jet = &*(fJets[j]);
133  double jetEta = jet->eta();
134  double jetPhi = jet->phi();
135  for (unsigned t = 0; t < impacts.size(); ++t) {
136  double dR2 = deltaR2 (jetEta, jetPhi, impacts[t].eta, impacts[t].phi);
137  if (dR2 < mDeltaR2Threshold) assoTracks.push_back (fTracks[impacts[t].index]);
138  }
139  reco::JetTracksAssociation::setValue (fAssociation, fJets[j], assoTracks);
140  }
141 }
Base class for all types of Jets.
Definition: Jet.h:21
T eta() const
virtual double eta() const
momentum pseudorapidity
T barePhi() const
Definition: PV3DBase.h:67
T mag() const
Definition: PV3DBase.h:66
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
double deltaR2(const Vector1 &v1, const Vector2 &v2)
Definition: VectorUtil.h:78
T eta() const
Definition: PV3DBase.h:75
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:64
virtual double phi() const
momentum azimuthal angle
Definition: DDAxes.h:10
math::XYZPoint JetTracksAssociationDRCalo::propagateTrackToCalorimeter ( const reco::Track fTrack,
const MagneticField fField,
const Propagator fPropagator 
)
static

propagating the track to the Calorimeter

Definition at line 143 of file JetTracksAssociationDRCalo.cc.

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

Referenced by jptJetAnalysis::TrackPropagatorToCalo::impactPoint().

146 {
147  GlobalPoint result (propagateTrackToCalo (fTrack, fField, fPropagator));
148  return math::XYZPoint (result.x(), result.y(), result.z());
149 }
tuple result
Definition: query.py:137
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13

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