Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
RecoJets
JetAssociationProducers
src
JetTracksAssociatorExplicit.cc
Go to the documentation of this file.
1
// \class JetTracksAssociatorExplicit JetTracksAssociatorExplicit.cc
2
//
3
// Original Author: Andrea Rizzi
4
// Created: Wed Apr 12 11:12:49 CEST 2006
5
// Accommodated for Jet Package by: Fedor Ratnikov Jul. 30, 2007
6
// $Id: JetTracksAssociatorExplicit.cc,v 1.1 2012/01/13 21:11:04 srappocc Exp $
7
//
8
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
9
10
// user include files
11
#include "
FWCore/Framework/interface/Event.h
"
12
#include "
DataFormats/Common/interface/View.h
"
13
#include "
DataFormats/JetReco/interface/Jet.h
"
14
#include "
DataFormats/TrackReco/interface/Track.h
"
15
#include "
DataFormats/JetReco/interface/JetTracksAssociation.h
"
16
17
#include "
JetTracksAssociatorExplicit.h
"
18
19
JetTracksAssociatorExplicit::JetTracksAssociatorExplicit
(
const
edm::ParameterSet
& fConfig)
20
: mJets (fConfig.getParameter<edm::InputTag> (
"jets"
)),
21
mTracks (fConfig.getParameter<edm::InputTag> (
"tracks"
)),
22
mAssociatorExplicit ()
23
{
24
25
produces<reco::JetTracksAssociation::Container> ();
26
}
27
28
JetTracksAssociatorExplicit::~JetTracksAssociatorExplicit
() {}
29
30
void
JetTracksAssociatorExplicit::produce
(
edm::Event
& fEvent,
const
edm::EventSetup
& fSetup) {
31
edm::Handle <edm::View <reco::Jet>
> jets_h;
32
fEvent.
getByLabel
(
mJets
, jets_h);
33
edm::Handle <reco::TrackCollection>
tracks_h;
34
fEvent.
getByLabel
(
mTracks
, tracks_h);
35
36
std::auto_ptr<reco::JetTracksAssociation::Container> jetTracks (
new
reco::JetTracksAssociation::Container
(
reco::JetRefBaseProd
(jets_h)));
37
38
// format inputs
39
std::vector <edm::RefToBase<reco::Jet> >
allJets
;
40
allJets.reserve (jets_h->size());
41
for
(
unsigned
i
= 0;
i
< jets_h->size(); ++
i
) allJets.push_back (jets_h->refAt(
i
));
42
std::vector <reco::TrackRef>
allTracks
;
43
allTracks.reserve (tracks_h->size());
44
// run algo
45
for
(
unsigned
i
= 0;
i
< tracks_h->size(); ++
i
) {
46
allTracks.push_back (
reco::TrackRef
(tracks_h,
i
));
47
}
48
49
50
mAssociatorExplicit
.
produce
(&*jetTracks, allJets, allTracks);
51
52
53
// store output
54
fEvent.
put
(jetTracks);
55
}
reco::JetExtendedAssociation::allJets
std::vector< reco::JetBaseRef > allJets(const Container &)
fill list of all jets associated with values. Return # of jets in the list
Definition:
JetExtendedAssociation.cc:62
i
int i
Definition:
DBlmapReader.cc:9
MessageLogger.h
JetTracksAssociatorExplicit::~JetTracksAssociatorExplicit
virtual ~JetTracksAssociatorExplicit()
Definition:
JetTracksAssociatorExplicit.cc:28
Event.h
JetTracksAssociatorExplicit::mTracks
edm::InputTag mTracks
Definition:
JetTracksAssociatorExplicit.h:29
edm::Handle
Definition:
AssociativeIterator.h:48
edm::RefToBaseProd
Definition:
RefToBase.h:62
edm::Event::put
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition:
Event.h:94
JetTracksAssociationExplicit::produce
void produce(reco::JetTracksAssociation::Container *fAssociation, const std::vector< edm::RefToBase< reco::Jet > > &fJets, const std::vector< reco::TrackRef > &fTracks) const
Definition:
JetTracksAssociationExplicit.cc:13
View.h
edm::EventSetup
Definition:
EventSetup.h:44
Jet.h
JetTracksAssociatorExplicit::JetTracksAssociatorExplicit
JetTracksAssociatorExplicit(const edm::ParameterSet &)
Definition:
JetTracksAssociatorExplicit.cc:19
edm::Event::getByLabel
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition:
Event.h:361
JetTracksAssociatorExplicit::mAssociatorExplicit
JetTracksAssociationExplicit mAssociatorExplicit
Definition:
JetTracksAssociatorExplicit.h:30
edm::AssociationVector
Definition:
AssociationVector.h:58
JetTracksAssociatorExplicit.h
muonTagProbeFilters_cff.allTracks
tuple allTracks
Definition:
muonTagProbeFilters_cff.py:22
JetTracksAssociation.h
edm::ParameterSet
Definition:
ParameterSet.h:35
edm::Event
Definition:
Event.h:56
Track.h
JetTracksAssociatorExplicit::mJets
edm::InputTag mJets
Definition:
JetTracksAssociatorExplicit.h:28
JetTracksAssociatorExplicit::produce
virtual void produce(edm::Event &, const edm::EventSetup &)
Definition:
JetTracksAssociatorExplicit.cc:30
edm::Ref< TrackCollection >
Generated for CMSSW Reference Manual by
1.8.5