PhysicsTools
RecoAlgos
src
MassKinFitterCandProducer.cc
Go to the documentation of this file.
1
#include <memory>
2
3
#include "
DataFormats/Common/interface/Handle.h
"
4
#include "
FWCore/Framework/interface/ESHandle.h
"
5
#include "
FWCore/Framework/interface/Event.h
"
6
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
7
#include "
PhysicsTools/RecoAlgos/interface/MassKinFitterCandProducer.h
"
8
9
MassKinFitterCandProducer::MassKinFitterCandProducer
(
const
edm::ParameterSet
&
cfg
,
CandMassKinFitter
*
f
)
10
: srcToken_(consumes<
reco
::
CandidateCollection
>(
cfg
.getParameter<
edm
::
InputTag
>(
"src"
))), fitter_(
f
) {
11
if
(
f
==
nullptr
)
12
fitter_
= std::make_unique<CandMassKinFitter>(
cfg
.getParameter<
double
>(
"mass"
));
13
produces<reco::CandidateCollection>();
14
}
15
16
void
MassKinFitterCandProducer::produce
(
edm::Event
& evt,
const
edm::EventSetup
& es) {
17
using namespace
edm
;
18
using namespace
reco
;
19
Handle<CandidateCollection>
cands
;
20
evt.
getByToken
(
srcToken_
,
cands
);
21
auto
refitted = std::make_unique<CandidateCollection>();
22
for
(
CandidateCollection::const_iterator
c
=
cands
->begin();
c
!=
cands
->end(); ++
c
) {
23
Candidate
*
clone
=
c
->clone();
24
fitter_
->set(*
clone
);
25
refitted->push_back(
clone
);
26
}
27
evt.
put
(
std::move
(refitted));
28
}
Handle.h
ESHandle.h
f
double f[11][100]
Definition:
MuScleFitUtils.cc:78
edm
HLT enums.
Definition:
AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition:
HLT_FULL_cff.py:85964
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:45
edm::Handle
Definition:
AssociativeIterator.h:50
CandMassKinFitter
Definition:
CandMassKinFitter.h:6
clone
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition:
eve_macros.cc:135
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition:
Event.h:531
MassKinFitterCandProducer.h
edm::OwnVector::const_iterator
Definition:
OwnVector.h:41
HLT_FULL_cff.cands
cands
Definition:
HLT_FULL_cff.py:15205
MassKinFitterCandProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition:
MassKinFitterCandProducer.cc:16
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
MassKinFitterCandProducer::fitter_
std::unique_ptr< CandMassKinFitter > fitter_
Definition:
MassKinFitterCandProducer.h:20
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition:
Event.h:133
edm::EventSetup
Definition:
EventSetup.h:57
HltBtagPostValidation_cff.c
c
Definition:
HltBtagPostValidation_cff.py:31
looper.cfg
cfg
Definition:
looper.py:297
reco::Candidate
Definition:
Candidate.h:27
eostools.move
def move(src, dest)
Definition:
eostools.py:511
reco::CandidateCollection
edm::OwnVector< Candidate > CandidateCollection
collection of Candidate objects
Definition:
CandidateFwd.h:21
ParameterSet.h
MassKinFitterCandProducer::srcToken_
edm::EDGetTokenT< reco::CandidateCollection > srcToken_
Definition:
MassKinFitterCandProducer.h:19
MassKinFitterCandProducer::MassKinFitterCandProducer
MassKinFitterCandProducer(const edm::ParameterSet &, CandMassKinFitter *=nullptr)
Definition:
MassKinFitterCandProducer.cc:9
edm::Event
Definition:
Event.h:73
Generated for CMSSW Reference Manual by
1.8.16