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 
6 
7 // -----------------------------------------------------------------------------
8 //
10  : mDeltaR2Threshold(fDr*fDr)
11 {;}
12 
13 // -----------------------------------------------------------------------------
14 //
16 {;}
17 
18 // -----------------------------------------------------------------------------
19 //
21  const JetRefs& fJets,
22  const TrackRefs& fTracks )
23 {
24  JetRefs::const_iterator ii = fJets.begin();
25  JetRefs::const_iterator jj = fJets.end();
26  for ( ; ii != jj; ++ii ) {
27  reco::TrackRefVector associated;
28  associateTracksToJet( associated, **ii, fTracks );
29  reco::JetTracksAssociation::setValue( fAssociation, *ii, associated );
30  }
31 }
32 
33 // -----------------------------------------------------------------------------
34 //
36  const Jets& input ) {
37  output.clear();
38  output.reserve( input->size() );
39  for ( unsigned ii = 0; ii < input->size(); ++ii ) {
40  output.push_back( input->refAt(ii) );
41  }
42 }
43 
44 // -----------------------------------------------------------------------------
45 //
47  const Tracks& input,
48  const TrackQuality& quality ) {
49 
50  if ( quality == reco::TrackBase::undefQuality ) {
51  edm::LogError("JetTracksAssociationDR")
52  << " Unknown TrackQuality value: "
53  << static_cast<int>( quality )
54  << ". See possible values in 'reco::TrackBase::TrackQuality'";
55  }
56 
57  output.clear();
58  output.reserve( input->size() );
59  for ( unsigned ii = 0; ii < input->size(); ++ii ) {
60  if ( (*input)[ii].quality( quality ) ) {
61  output.push_back( reco::TrackRef( input, ii ) );
62  }
63  }
64 
65 }
JetTracksAssociationDR()
Private default constructor.
size_type size() const
std::vector< reco::TrackRef > TrackRefs
int ii
Definition: cuy.py:588
static std::string const input
Definition: EdmProvDump.cc:44
RefToBase< value_type > refAt(size_type i) const
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 ...
std::vector< JetRef > JetRefs
This class analyses the reconstruction quality for a given track.
Definition: TrackQuality.h:28
void associateTracksToJets(Association *, const JetRefs &, const TrackRefs &)
static void createJetRefs(JetRefs &, const Jets &)
virtual ~JetTracksAssociationDR()
Destructor.
static void createTrackRefs(TrackRefs &, const Tracks &, const TrackQuality &)