CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
JetTracksAssociationExplicit Class Reference

#include <JetTracksAssociationExplicit.h>

Public Member Functions

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

Detailed Description

Definition at line 10 of file JetTracksAssociationExplicit.h.

Constructor & Destructor Documentation

JetTracksAssociationExplicit::JetTracksAssociationExplicit ( )

Definition at line 9 of file JetTracksAssociationExplicit.cc.

10 {}
JetTracksAssociationExplicit::~JetTracksAssociationExplicit ( )
inline

Definition at line 13 of file JetTracksAssociationExplicit.h.

13 {}

Member Function Documentation

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

Definition at line 12 of file JetTracksAssociationExplicit.cc.

References edm::hlt::Exception, reco::PFJet::getTrackRefs(), j, pfJet, and reco::JetTracksAssociation::setValue().

Referenced by JetTracksAssociatorExplicit::produce().

15 {
16  for (unsigned j = 0; j < fJets.size(); ++j) {
17  reco::PFJet const * pfJet = dynamic_cast<reco::PFJet const *>( &* (fJets[j]) ) ;
18  if ( pfJet != 0 ) {
19  reco::TrackRefVector assoTracks = pfJet->getTrackRefs();
20  reco::JetTracksAssociation::setValue (fAssociation, fJets[j], assoTracks);
21  } else {
22  throw cms::Exception("InvalidConfiguration")
23  << "From JetTracksAssociationExplicit::produce: Only PFJets are currently supported for this module" << std::endl;
24  }
25  }
26 }
Jets made from PFObjects.
Definition: PFJet.h:21
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
reco::TrackRefVector getTrackRefs() const
Definition: PFJet.cc:59