Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
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
//
7
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
8
9
// user include files
10
#include "
FWCore/Framework/interface/Event.h
"
11
#include "
DataFormats/Common/interface/View.h
"
12
#include "
DataFormats/JetReco/interface/Jet.h
"
13
#include "
DataFormats/TrackReco/interface/Track.h
"
14
#include "
DataFormats/JetReco/interface/JetTracksAssociation.h
"
15
16
#include "
JetTracksAssociatorExplicit.h
"
17
18
JetTracksAssociatorExplicit::JetTracksAssociatorExplicit
(
const
edm::ParameterSet
& fConfig)
19
: mAssociatorExplicit ()
20
{
21
mJets
= consumes<edm::View <reco::Jet> >(fConfig.
getParameter
<
edm::InputTag
> (
"jets"
));
22
mTracks
= consumes<reco::TrackCollection>(fConfig.
getParameter
<
edm::InputTag
>(
"tracks"
));
23
24
produces<reco::JetTracksAssociation::Container> ();
25
}
26
27
JetTracksAssociatorExplicit::~JetTracksAssociatorExplicit
() {}
28
29
void
JetTracksAssociatorExplicit::produce
(
edm::Event
& fEvent,
const
edm::EventSetup
& fSetup) {
30
edm::Handle <edm::View <reco::Jet>
> jets_h;
31
fEvent.
getByToken
(
mJets
, jets_h);
32
edm::Handle <reco::TrackCollection>
tracks_h;
33
fEvent.
getByToken
(
mTracks
, tracks_h);
34
35
std::auto_ptr<reco::JetTracksAssociation::Container> jetTracks (
new
reco::JetTracksAssociation::Container
(
reco::JetRefBaseProd
(jets_h)));
36
37
// format inputs
38
std::vector <edm::RefToBase<reco::Jet> >
allJets
;
39
allJets.reserve (jets_h->size());
40
for
(
unsigned
i
= 0;
i
< jets_h->size(); ++
i
) allJets.push_back (jets_h->refAt(
i
));
41
std::vector <reco::TrackRef>
allTracks
;
42
allTracks.reserve (tracks_h->size());
43
// run algo
44
for
(
unsigned
i
= 0;
i
< tracks_h->size(); ++
i
) {
45
allTracks.push_back (
reco::TrackRef
(tracks_h,
i
));
46
}
47
48
49
mAssociatorExplicit
.
produce
(&*jetTracks, allJets, allTracks);
50
51
52
// store output
53
fEvent.
put
(jetTracks);
54
}
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
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
i
int i
Definition:
DBlmapReader.cc:9
MessageLogger.h
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition:
Event.h:446
JetTracksAssociatorExplicit::~JetTracksAssociatorExplicit
virtual ~JetTracksAssociatorExplicit()
Definition:
JetTracksAssociatorExplicit.cc:27
edm::Ref< TrackCollection >
Event.h
edm::Handle
Definition:
AssociativeIterator.h:47
edm::RefToBaseProd< reco::Jet >
edm::Event::put
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition:
Event.h:113
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:12
View.h
edm::EventSetup
Definition:
EventSetup.h:44
Jet.h
JetTracksAssociatorExplicit::JetTracksAssociatorExplicit
JetTracksAssociatorExplicit(const edm::ParameterSet &)
Definition:
JetTracksAssociatorExplicit.cc:18
JetTracksAssociatorExplicit::mTracks
edm::EDGetTokenT< reco::TrackCollection > mTracks
Definition:
JetTracksAssociatorExplicit.h:28
JetTracksAssociatorExplicit::mAssociatorExplicit
JetTracksAssociationExplicit mAssociatorExplicit
Definition:
JetTracksAssociatorExplicit.h:29
edm::AssociationVector< reco::JetRefBaseProd, Values >
JetTracksAssociatorExplicit.h
muonTagProbeFilters_cff.allTracks
tuple allTracks
Definition:
muonTagProbeFilters_cff.py:22
edm::InputTag
Definition:
InputTag.h:17
JetTracksAssociation.h
edm::ParameterSet
Definition:
ParameterSet.h:35
JetTracksAssociatorExplicit::mJets
edm::EDGetTokenT< edm::View< reco::Jet > > mJets
Definition:
JetTracksAssociatorExplicit.h:27
edm::Event
Definition:
Event.h:59
Track.h
JetTracksAssociatorExplicit::produce
virtual void produce(edm::Event &, const edm::EventSetup &)
Definition:
JetTracksAssociatorExplicit.cc:29
Generated for CMSSW Reference Manual by
1.8.5