CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
JetTracksAssociationDR.cc
Go to the documentation of this file.
1 // Associate jets with tracks by simple "dR" criteria
2 // Fedor Ratnikov (UMd), Aug. 28, 2007
3 // $Id: JetTracksAssociationDR.cc,v 1.4.2.2 2009/02/23 12:59:13 bainbrid Exp $
4 
7 
8 // -----------------------------------------------------------------------------
9 //
11  : mDeltaR2Threshold(fDr*fDr)
12 {;}
13 
14 // -----------------------------------------------------------------------------
15 //
17 {;}
18 
19 // -----------------------------------------------------------------------------
20 //
22  const JetRefs& fJets,
23  const TrackRefs& fTracks )
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 }
33 
34 // -----------------------------------------------------------------------------
35 //
37  const Jets& input ) {
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 }
44 
45 // -----------------------------------------------------------------------------
46 //
48  const Tracks& input,
49  const TrackQuality& quality ) {
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 }
JetTracksAssociationDR()
Private default constructor.
std::vector< reco::TrackRef > TrackRefs
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 ...
tuple input
Definition: collect_tpl.py:10
std::vector< JetRef > JetRefs
This class analyses the reconstruction quality for a given track.
Definition: TrackQuality.h:26
void associateTracksToJets(Association *, const JetRefs &, const TrackRefs &)
static void createJetRefs(JetRefs &, const Jets &)
virtual ~JetTracksAssociationDR()
Destructor.
static void createTrackRefs(TrackRefs &, const Tracks &, const TrackQuality &)