src
JetMETCorrections
Type1MET
plugins
UnclusteredBlobProducer.cc
Go to the documentation of this file.
1
#include <string>
2
#include <memory>
3
4
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
5
#include "
FWCore/Framework/interface/global/EDProducer.h
"
6
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
7
#include "
FWCore/ParameterSet/interface/ConfigurationDescriptions.h
"
8
#include "
FWCore/Framework/interface/Event.h
"
9
10
#include "
DataFormats/Common/interface/RefToPtr.h
"
11
#include "
DataFormats/Candidate/interface/Candidate.h
"
12
#include "
DataFormats/Candidate/interface/VertexCompositePtrCandidate.h
"
13
#include "
DataFormats/Candidate/interface/CandidateFwd.h
"
14
15
namespace
pat
{
16
class
UnclusteredBlobProducer
:
public
edm::global::EDProducer
<> {
17
public
:
18
explicit
UnclusteredBlobProducer
(
const
edm::ParameterSet
&);
19
~UnclusteredBlobProducer
()
override
;
20
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions);
21
void
produce
(
edm::StreamID
,
edm::Event
&,
const
edm::EventSetup
&)
const override
;
22
23
private
:
24
edm::EDGetTokenT<edm::View<reco::Candidate>
>
candsrc_
;
25
};
26
}
// namespace pat
27
28
pat::UnclusteredBlobProducer::UnclusteredBlobProducer
(
const
edm::ParameterSet
& iConfig)
29
: candsrc_(consumes<
edm
::
View
<
reco
::
Candidate
>>(iConfig.getParameter<
edm
::
InputTag
>(
"candsrc"
))) {
30
produces<std::vector<reco::VertexCompositePtrCandidate>>();
31
}
32
33
pat::UnclusteredBlobProducer::~UnclusteredBlobProducer
() {}
34
35
void
pat::UnclusteredBlobProducer::produce
(
edm::StreamID
,
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup)
const
{
36
auto
blob = std::make_unique<std::vector<reco::VertexCompositePtrCandidate>>();
37
38
edm::Handle<edm::View<reco::Candidate>
>
candidates
;
39
iEvent
.getByToken(candsrc_,
candidates
);
40
41
blob->emplace_back();
42
43
auto
& c_blob = blob->back();
44
45
// combine all candidates into composite so they can be accessed properly by CandPtrSelector
46
for
(
unsigned
i
= 0;
i
<
candidates
->size(); ++
i
) {
47
c_blob.addDaughter(
candidates
->ptrAt(
i
));
48
}
49
50
iEvent
.put(
std::move
(blob));
51
}
52
53
void
pat::UnclusteredBlobProducer::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
54
edm::ParameterSetDescription
desc
;
55
desc
.add<
edm::InputTag
>(
"candsrc"
,
edm::InputTag
(
"badUnclustered"
));
56
57
descriptions.
add
(
"UnclusteredBlobProducer"
,
desc
);
58
}
59
60
using
pat::UnclusteredBlobProducer
;
61
62
#include "
FWCore/Framework/interface/MakerMacros.h
"
63
DEFINE_FWK_MODULE
(
UnclusteredBlobProducer
);
ProducerED_cfi.InputTag
InputTag
Definition:
ProducerED_cfi.py:5
mps_fire.i
i
Definition:
mps_fire.py:429
edm::StreamID
Definition:
StreamID.h:30
Event.h
edm::Handle
Definition:
AssociativeIterator.h:50
VertexCompositePtrCandidate.h
edm::EDGetTokenT
Definition:
EDGetToken.h:37
Frameworkfwd.h
pat::UnclusteredBlobProducer::UnclusteredBlobProducer
UnclusteredBlobProducer(const edm::ParameterSet &)
Definition:
UnclusteredBlobProducer.cc:28
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
pat::UnclusteredBlobProducer::produce
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Definition:
UnclusteredBlobProducer.cc:35
pat
Definition:
HeavyIon.h:7
ParameterSet.h
Candidate.h
iEvent
int iEvent
Definition:
GenABIO.cc:224
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:254
pat::UnclusteredBlobProducer::~UnclusteredBlobProducer
~UnclusteredBlobProducer() override
Definition:
UnclusteredBlobProducer.cc:33
pat::UnclusteredBlobProducer::candsrc_
edm::EDGetTokenT< edm::View< reco::Candidate > > candsrc_
Definition:
UnclusteredBlobProducer.cc:24
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
edm::EventSetup
Definition:
EventSetup.h:56
edm::global::EDProducer
Definition:
EDProducer.h:32
RefToPtr.h
configurableAnalysis::Candidate
char Candidate[]
Definition:
modules.cc:20
pat::UnclusteredBlobProducer
Definition:
UnclusteredBlobProducer.cc:16
pat::UnclusteredBlobProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
UnclusteredBlobProducer.cc:53
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:57
EDProducer.h
HLT_2024v14_cff.candidates
candidates
Definition:
HLT_2024v14_cff.py:38869
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:46
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::InputTag
Definition:
InputTag.h:15
edm::ParameterSet
Definition:
ParameterSet.h:48
CandidateFwd.h
ConfigurationDescriptions.h
edm::Event
Definition:
Event.h:73
MakerMacros.h
sistrip::View
View
Definition:
ConstantsForView.h:26
eostools.move
def move(src, dest)
Definition:
eostools.py:511
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
Generated for CMSSW Reference Manual by
1.8.14