Main Page
Namespaces
Classes
Package Documentation
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
auto
jetTracks
= std::make_unique<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
(
std::move
(
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
MessageLogger.h
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition:
Event.h:122
mps_fire.i
i
Definition:
mps_fire.py:156
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition:
Event.h:457
JetTracksAssociatorExplicit::~JetTracksAssociatorExplicit
virtual ~JetTracksAssociatorExplicit()
Definition:
JetTracksAssociatorExplicit.cc:27
edm::Ref< TrackCollection >
Event.h
edm::Handle
Definition:
AssociativeIterator.h:47
reco::JetRefBaseProd
edm::RefToBaseProd< reco::Jet > JetRefBaseProd
Definition:
JetCollection.h:14
allTracks_cfi.allTracks
allTracks
Definition:
allTracks_cfi.py:4
hcaldqm::fEvent
Definition:
DQTask.h:19
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:45
Jet.h
JetTracksAssociatorExplicit::JetTracksAssociatorExplicit
JetTracksAssociatorExplicit(const edm::ParameterSet &)
Definition:
JetTracksAssociatorExplicit.cc:18
impactParameterTagInfos_cfi.jetTracks
jetTracks
Definition:
impactParameterTagInfos_cfi.py:4
JetTracksAssociatorExplicit::mTracks
edm::EDGetTokenT< reco::TrackCollection > mTracks
Definition:
JetTracksAssociatorExplicit.h:28
JetTracksAssociatorExplicit::mAssociatorExplicit
JetTracksAssociationExplicit mAssociatorExplicit
Definition:
JetTracksAssociatorExplicit.h:29
JetTracksAssociatorExplicit.h
edm::InputTag
Definition:
InputTag.h:15
JetTracksAssociation.h
edm::ParameterSet
Definition:
ParameterSet.h:36
JetTracksAssociatorExplicit::mJets
edm::EDGetTokenT< edm::View< reco::Jet > > mJets
Definition:
JetTracksAssociatorExplicit.h:27
edm::Event
Definition:
Event.h:66
Track.h
JetTracksAssociatorExplicit::produce
virtual void produce(edm::Event &, const edm::EventSetup &)
Definition:
JetTracksAssociatorExplicit.cc:29
eostools.move
def move(src, dest)
Definition:
eostools.py:510
Generated for CMSSW Reference Manual by
1.8.11