CommonTools
CandAlgos
plugins
CandViewRefMerger.cc
Go to the documentation of this file.
1
/* \class CandViewRefMerger
2
*
3
* Producer of merged references to Candidates
4
*
5
* \author: Luca Lista, INFN
6
*
7
*/
8
9
#include "
FWCore/Framework/interface/MakerMacros.h
"
10
#include "
DataFormats/Candidate/interface/Candidate.h
"
11
#include "
FWCore/Framework/interface/EDProducer.h
"
12
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
13
#include "
FWCore/Framework/interface/Event.h
"
14
#include "
FWCore/Utilities/interface/transform.h
"
15
#include "
DataFormats/Common/interface/Handle.h
"
16
17
class
CandViewRefMerger
:
public
edm::EDProducer
{
18
public
:
19
explicit
CandViewRefMerger
(
const
edm::ParameterSet
&
cfg
)
20
:
srcTokens_
(
21
edm
::
vector_transform
(
cfg
.getParameter<
std
::
vector
<
edm
::
InputTag
> >(
"src"
),
22
[this](
edm
::
InputTag
const
&
tag
) {
return
consumes<reco::CandidateView>(
tag
); })) {
23
produces<std::vector<reco::CandidateBaseRef> >();
24
}
25
26
private
:
27
void
produce
(
edm::Event
& evt,
const
edm::EventSetup
&)
override
{
28
std::unique_ptr<std::vector<reco::CandidateBaseRef> >
out
(
new
std::vector<reco::CandidateBaseRef>);
29
for
(
std::vector
<
edm::EDGetTokenT<reco::CandidateView>
>::const_iterator
i
=
srcTokens_
.begin();
30
i
!=
srcTokens_
.end();
31
++
i
) {
32
edm::Handle<reco::CandidateView>
src
;
33
evt.
getByToken
(*
i
,
src
);
34
for
(
size_t
j
= 0;
j
<
src
->size(); ++
j
)
35
out
->push_back(
src
->refAt(
j
));
36
}
37
evt.
put
(
std::move
(
out
));
38
}
39
std::vector<edm::EDGetTokenT<reco::CandidateView> >
srcTokens_
;
40
};
41
42
DEFINE_FWK_MODULE
(
CandViewRefMerger
);
Handle.h
mps_fire.i
i
Definition:
mps_fire.py:428
EDProducer.h
edm::EDGetTokenT
Definition:
EDGetToken.h:33
edm
HLT enums.
Definition:
AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition:
HLT_FULL_cff.py:89285
CandViewRefMerger::CandViewRefMerger
CandViewRefMerger(const edm::ParameterSet &cfg)
Definition:
CandViewRefMerger.cc:19
watchdog.const
const
Definition:
watchdog.py:83
edm::Handle
Definition:
AssociativeIterator.h:50
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition:
GlobalPosition_Frontier_DevDB_cff.py:11
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition:
Event.h:535
edm::vector_transform
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition:
transform.h:11
CandViewRefMerger::srcTokens_
std::vector< edm::EDGetTokenT< reco::CandidateView > > srcTokens_
Definition:
CandViewRefMerger.cc:39
edm::ParameterSet
Definition:
ParameterSet.h:47
TrackRefitter_38T_cff.src
src
Definition:
TrackRefitter_38T_cff.py:24
Event.h
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition:
Event.h:133
trackerHitRTTI::vector
Definition:
trackerHitRTTI.h:21
edm::EventSetup
Definition:
EventSetup.h:58
looper.cfg
cfg
Definition:
looper.py:297
CandViewRefMerger
Definition:
CandViewRefMerger.cc:17
eostools.move
def move(src, dest)
Definition:
eostools.py:511
std
Definition:
JetResolutionObject.h:76
transform.h
edm::EDProducer
Definition:
EDProducer.h:35
MillePedeFileConverter_cfg.out
out
Definition:
MillePedeFileConverter_cfg.py:31
Candidate.h
ParameterSet.h
CandViewRefMerger::produce
void produce(edm::Event &evt, const edm::EventSetup &) override
Definition:
CandViewRefMerger.cc:27
dqmiolumiharvest.j
j
Definition:
dqmiolumiharvest.py:66
edm::Event
Definition:
Event.h:73
Generated for CMSSW Reference Manual by
1.8.16