CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
JetTracksAssociationDR Class Referenceabstract

#include <JetTracksAssociationDR.h>

Public Types

typedef
reco::JetTracksAssociation::Container 
Association
 Container for jet-track associations. More...
 
typedef edm::RefToBase< reco::JetJetRef
 
typedef std::vector< JetRefJetRefs
 
typedef edm::Handle< edm::View
< reco::Jet > > 
Jets
 Handle to jet collection. More...
 
typedef
reco::TrackBase::TrackQuality 
TrackQuality
 
typedef std::vector
< reco::TrackRef
TrackRefs
 
typedef edm::Handle
< reco::TrackCollection
Tracks
 Handle to track collection. More...
 

Public Member Functions

virtual void associateTracksToJet (reco::TrackRefVector &, const reco::Jet &, const TrackRefs &)=0
 Associate tracks to the given jet. More...
 
void associateTracksToJets (Association *, const JetRefs &, const TrackRefs &)
 
 JetTracksAssociationDR (double dr_threshold)
 Constructor taking dR threshold as argument. More...
 
virtual ~JetTracksAssociationDR ()
 Destructor. More...
 

Static Public Member Functions

static void createJetRefs (JetRefs &, const Jets &)
 
static void createTrackRefs (TrackRefs &, const Tracks &, const TrackQuality &)
 

Protected Member Functions

 JetTracksAssociationDR ()
 Private default constructor. More...
 

Protected Attributes

double mDeltaR2Threshold
 Threshold used to associate tracks to jets. More...
 

Detailed Description

Definition at line 17 of file JetTracksAssociationDR.h.

Member Typedef Documentation

Container for jet-track associations.

Definition at line 32 of file JetTracksAssociationDR.h.

Definition at line 41 of file JetTracksAssociationDR.h.

Definition at line 44 of file JetTracksAssociationDR.h.

Handle to jet collection.

Definition at line 35 of file JetTracksAssociationDR.h.

Definition at line 50 of file JetTracksAssociationDR.h.

Definition at line 47 of file JetTracksAssociationDR.h.

Handle to track collection.

Definition at line 38 of file JetTracksAssociationDR.h.

Constructor & Destructor Documentation

JetTracksAssociationDR::JetTracksAssociationDR ( double  dr_threshold)
explicit

Constructor taking dR threshold as argument.

Definition at line 10 of file JetTracksAssociationDR.cc.

11  : mDeltaR2Threshold(fDr*fDr)
12 {;}
double mDeltaR2Threshold
Threshold used to associate tracks to jets.
JetTracksAssociationDR::~JetTracksAssociationDR ( )
virtual

Destructor.

Definition at line 16 of file JetTracksAssociationDR.cc.

17 {;}
JetTracksAssociationDR::JetTracksAssociationDR ( )
inlineprotected

Private default constructor.

Definition at line 76 of file JetTracksAssociationDR.h.

76 {}

Member Function Documentation

virtual void JetTracksAssociationDR::associateTracksToJet ( reco::TrackRefVector ,
const reco::Jet ,
const TrackRefs  
)
pure virtual

Associate tracks to the given jet.

Referenced by associateTracksToJets().

void JetTracksAssociationDR::associateTracksToJets ( Association fAssociation,
const JetRefs fJets,
const TrackRefs fTracks 
)

Definition at line 21 of file JetTracksAssociationDR.cc.

References associateTracksToJet(), findQualityFiles::jj, and reco::JetTracksAssociation::setValue().

24 {
25  JetRefs::const_iterator ii = fJets.begin();
26  JetRefs::const_iterator jj = fJets.end();
27  for ( ; ii != jj; ++ii ) {
28  reco::TrackRefVector associated;
29  associateTracksToJet( associated, **ii, fTracks );
30  reco::JetTracksAssociation::setValue( fAssociation, *ii, associated );
31  }
32 }
virtual void associateTracksToJet(reco::TrackRefVector &, const reco::Jet &, const TrackRefs &)=0
Associate tracks to the given jet.
bool setValue(Container &, const reco::JetBaseRef &, reco::TrackRefVector)
associate jet with value. Returns false and associate nothing if jet is already associated ...
void JetTracksAssociationDR::createJetRefs ( JetRefs output,
const Jets input 
)
static

Definition at line 36 of file JetTracksAssociationDR.cc.

37  {
38  output.clear();
39  output.reserve( input->size() );
40  for ( unsigned ii = 0; ii < input->size(); ++ii ) {
41  output.push_back( input->refAt(ii) );
42  }
43 }
void JetTracksAssociationDR::createTrackRefs ( TrackRefs output,
const Tracks input,
const TrackQuality quality 
)
static

Definition at line 47 of file JetTracksAssociationDR.cc.

References reco::TrackBase::undefQuality.

49  {
50 
51  if ( quality == reco::TrackBase::undefQuality ) {
52  edm::LogError("JetTracksAssociationDR")
53  << " Unknown TrackQuality value: "
54  << static_cast<int>( quality )
55  << ". See possible values in 'reco::TrackBase::TrackQuality'";
56  }
57 
58  output.clear();
59  output.reserve( input->size() );
60  for ( unsigned ii = 0; ii < input->size(); ++ii ) {
61  if ( (*input)[ii].quality( quality ) ) {
62  output.push_back( reco::TrackRef( input, ii ) );
63  }
64  }
65 
66 }

Member Data Documentation

double JetTracksAssociationDR::mDeltaR2Threshold
protected

Threshold used to associate tracks to jets.

Definition at line 79 of file JetTracksAssociationDR.h.