PhysicsTools
RecoAlgos
src
MassKinFitterCandProducer.cc
Go to the documentation of this file.
1
#include "
PhysicsTools/RecoAlgos/interface/MassKinFitterCandProducer.h
"
2
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
3
#include "
DataFormats/Common/interface/Handle.h
"
4
#include "
FWCore/Framework/interface/ESHandle.h
"
5
#include "
FWCore/Framework/interface/Event.h
"
6
7
MassKinFitterCandProducer::MassKinFitterCandProducer
(
const
edm::ParameterSet
&
cfg
,
CandMassKinFitter
*
f
)
8
: srcToken_(consumes<
reco
::
CandidateCollection
>(
cfg
.getParameter<
edm
::
InputTag
>(
"src"
))), fitter_(
f
) {
9
if
(
f
==
nullptr
)
10
fitter_
.reset(
new
CandMassKinFitter
(
cfg
.getParameter<
double
>(
"mass"
)));
11
produces<reco::CandidateCollection>();
12
}
13
14
void
MassKinFitterCandProducer::produce
(
edm::Event
& evt,
const
edm::EventSetup
& es) {
15
using namespace
edm
;
16
using namespace
reco
;
17
Handle<CandidateCollection>
cands
;
18
evt.
getByToken
(
srcToken_
,
cands
);
19
auto
refitted = std::make_unique<CandidateCollection>();
20
for
(
CandidateCollection::const_iterator
c
=
cands
->begin();
c
!=
cands
->end(); ++
c
) {
21
Candidate
*
clone
=
c
->clone();
22
fitter_
->set(*
clone
);
23
refitted->push_back(
clone
);
24
}
25
evt.
put
(
std::move
(refitted));
26
}
Handle.h
ESHandle.h
f
double f[11][100]
Definition:
MuScleFitUtils.cc:78
edm
HLT enums.
Definition:
AlignableModifier.h:19
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:528
MassKinFitterCandProducer.h
edm::OwnVector::const_iterator
Definition:
OwnVector.h:41
MassKinFitterCandProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition:
MassKinFitterCandProducer.cc:14
HLT_2018_cff.InputTag
InputTag
Definition:
HLT_2018_cff.py:79016
edm::ParameterSet
Definition:
ParameterSet.h:36
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:132
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
HLT_2018_cff.cands
cands
Definition:
HLT_2018_cff.py:13762
ParameterSet.h
MassKinFitterCandProducer::srcToken_
edm::EDGetTokenT< reco::CandidateCollection > srcToken_
Definition:
MassKinFitterCandProducer.h:19
MassKinFitterCandProducer::MassKinFitterCandProducer
MassKinFitterCandProducer(const edm::ParameterSet &, CandMassKinFitter *=nullptr)
Definition:
MassKinFitterCandProducer.cc:7
edm::Event
Definition:
Event.h:73
Generated for CMSSW Reference Manual by
1.8.16