CMS 3D CMS Logo

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 //
9 JetTracksAssociationDR::JetTracksAssociationDR(double fDr) : mDeltaR2Threshold(fDr * fDr) { ; }
10 
11 // -----------------------------------------------------------------------------
12 //
14 
15 // -----------------------------------------------------------------------------
16 //
18  const JetRefs& fJets,
19  const TrackRefs& fTracks) {
20  JetRefs::const_iterator ii = fJets.begin();
21  JetRefs::const_iterator jj = fJets.end();
22  for (; ii != jj; ++ii) {
23  reco::TrackRefVector associated;
24  associateTracksToJet(associated, **ii, fTracks);
25  reco::JetTracksAssociation::setValue(fAssociation, *ii, associated);
26  }
27 }
28 
29 // -----------------------------------------------------------------------------
30 //
32  output.clear();
33  output.reserve(input->size());
34  for (unsigned ii = 0; ii < input->size(); ++ii) {
35  output.push_back(input->refAt(ii));
36  }
37 }
38 
39 // -----------------------------------------------------------------------------
40 //
43  edm::LogError("JetTracksAssociationDR") << " Unknown TrackQuality value: " << static_cast<int>(quality)
44  << ". See possible values in 'reco::TrackBase::TrackQuality'";
45  }
46 
47  output.clear();
48  output.reserve(input->size());
49  for (unsigned ii = 0; ii < input->size(); ++ii) {
50  if ((*input)[ii].quality(quality)) {
51  output.push_back(reco::TrackRef(input, ii));
52  }
53  }
54 }
JetTracksAssociationDR()
Private default constructor.
std::vector< reco::TrackRef > TrackRefs
Log< level::Error, false > LogError
static std::string const input
Definition: EdmProvDump.cc:47
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 ...
ii
Definition: cuy.py:589
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 &)
string quality
virtual ~JetTracksAssociationDR()
Destructor.
static void createTrackRefs(TrackRefs &, const Tracks &, const TrackQuality &)