CMS 3D CMS Logo

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

#include <JetVetoedTracksAssociatorDRVertex.h>

Public Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 13 of file JetVetoedTracksAssociatorDRVertex.h.

Constructor & Destructor Documentation

◆ JetVetoedTracksAssociationDRVertex()

JetVetoedTracksAssociationDRVertex::JetVetoedTracksAssociationDRVertex ( double  fDr)

Definition at line 4 of file JetVetoedTracksAssociatorDRVertex.cc.

4 : mDeltaR2Threshold(dr * dr) {}
double mDeltaR2Threshold
fidutial dR between track in the vertex and jet&#39;s reference direction

◆ ~JetVetoedTracksAssociationDRVertex()

JetVetoedTracksAssociationDRVertex::~JetVetoedTracksAssociationDRVertex ( )
inline

Definition at line 16 of file JetVetoedTracksAssociatorDRVertex.h.

16 {}

Member Function Documentation

◆ produce()

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

Definition at line 6 of file JetVetoedTracksAssociatorDRVertex.cc.

References TrackCategories::BWeakDecay, TrackCategories::CWeakDecay, HLTMuonOfflineAnalyzer_cfi::deltaR2, PVValHelper::eta, TrackClassifier::evaluate(), mps_fire::i, TrackCategories::is(), dqmiolumiharvest::j, metsig::jet, reco::btau::jetEta, reco::btau::jetPhi, mDeltaR2Threshold, phi, TrackCategories::PrimaryVertex, edm::RefVector< C, T, F >::push_back(), reco::JetTracksAssociation::setValue(), submitPVValidationJobs::t, and HLT_2022v11_cff::track.

Referenced by JetVetoedTracksAssociatorAtVertex::produce().

9  {
10  // cache tracks kinematics
11  std::vector<math::RhoEtaPhiVector> trackP3s;
12  trackP3s.reserve(fTracks.size());
13  for (unsigned i = 0; i < fTracks.size(); ++i) {
14  const reco::Track *track = &*(fTracks[i]);
15  trackP3s.push_back(math::RhoEtaPhiVector(track->p(), track->eta(), track->phi()));
16  }
17  // loop on jets and associate
18  for (unsigned j = 0; j < fJets.size(); ++j) {
19  reco::TrackRefVector assoTracks;
20  const reco::Jet *jet = &*(fJets[j]);
21  double jetEta = jet->eta();
22  double jetPhi = jet->phi();
23  for (unsigned t = 0; t < fTracks.size(); ++t) {
24  double dR2 = deltaR2(jetEta, jetPhi, trackP3s[t].eta(), trackP3s[t].phi());
25  classifier.evaluate(reco::TrackBaseRef(fTracks[t]));
26  if (dR2 < mDeltaR2Threshold &&
27  (classifier.is(TrackClassifier::BWeakDecay) || classifier.is(TrackClassifier::CWeakDecay) ||
29  assoTracks.push_back(fTracks[t]);
30  }
31  reco::JetTracksAssociation::setValue(fAssociation, fJets[j], assoTracks);
32  }
33 }
Base class for all types of Jets.
Definition: Jet.h:20
RhoEtaPhiVectorD RhoEtaPhiVector
spatial vector with cylindrical internal representation using pseudorapidity
Definition: Vector3D.h:33
bool setValue(Container &, const reco::JetBaseRef &, reco::TrackRefVector)
associate jet with value. Returns false and associate nothing if jet is already associated ...
bool is(Category category) const
Returns track flag for a given category.
TrackClassifier const & evaluate(reco::TrackBaseRef const &)
Classify the RecoTrack in categories.
double mDeltaR2Threshold
fidutial dR between track in the vertex and jet&#39;s reference direction
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67

Member Data Documentation

◆ mDeltaR2Threshold

double JetVetoedTracksAssociationDRVertex::mDeltaR2Threshold
private

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

Definition at line 25 of file JetVetoedTracksAssociatorDRVertex.h.

Referenced by produce().