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
);
ConfigurationDescriptions.h
edm::StreamID
Definition:
StreamID.h:30
mps_fire.i
i
Definition:
mps_fire.py:355
pat::UnclusteredBlobProducer::candsrc_
edm::EDGetTokenT< edm::View< reco::Candidate > > candsrc_
Definition:
UnclusteredBlobProducer.cc:24
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition:
ParameterSetDescription.h:95
configurableAnalysis::Candidate
char Candidate[]
Definition:
modules.cc:20
sistrip::View
View
Definition:
ConstantsForView.h:26
edm::EDGetTokenT
Definition:
EDGetToken.h:33
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:45
edm::Handle
Definition:
AssociativeIterator.h:50
CandidateFwd.h
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:57
VertexCompositePtrCandidate.h
edm::global::EDProducer
Definition:
EDProducer.h:32
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
pat::UnclusteredBlobProducer::UnclusteredBlobProducer
UnclusteredBlobProducer(const edm::ParameterSet &)
Definition:
UnclusteredBlobProducer.cc:28
HLT_2018_cff.InputTag
InputTag
Definition:
HLT_2018_cff.py:79016
edm::ParameterSet
Definition:
ParameterSet.h:36
pat::UnclusteredBlobProducer::produce
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Definition:
UnclusteredBlobProducer.cc:35
Event.h
iEvent
int iEvent
Definition:
GenABIO.cc:224
RefToPtr.h
edm::EventSetup
Definition:
EventSetup.h:57
pat
Definition:
HeavyIon.h:7
pat::UnclusteredBlobProducer::~UnclusteredBlobProducer
~UnclusteredBlobProducer() override
Definition:
UnclusteredBlobProducer.cc:33
eostools.move
def move(src, dest)
Definition:
eostools.py:511
Frameworkfwd.h
pat::UnclusteredBlobProducer
Definition:
UnclusteredBlobProducer.cc:16
HLT_2018_cff.candidates
candidates
Definition:
HLT_2018_cff.py:53513
Candidate.h
ParameterSet.h
EDProducer.h
pat::UnclusteredBlobProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
UnclusteredBlobProducer.cc:53
edm::Event
Definition:
Event.h:73
edm::InputTag
Definition:
InputTag.h:15
Generated for CMSSW Reference Manual by
1.8.16