FastSimulation
Validation
plugins
EmptySimHits.cc
Go to the documentation of this file.
1
#include <memory>
2
3
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
4
#include "
FWCore/Framework/interface/EDProducer.h
"
5
6
#include "
FWCore/Framework/interface/Event.h
"
7
#include "
FWCore/Framework/interface/MakerMacros.h
"
8
9
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
10
11
#include "
SimDataFormats/CaloHit/interface/PCaloHitContainer.h
"
12
#include "
SimDataFormats/TrackingHit/interface/PSimHitContainer.h
"
13
14
class
EmptySimHits
:
public
edm::EDProducer
{
15
public
:
16
explicit
EmptySimHits
(
const
edm::ParameterSet
&);
17
~EmptySimHits
()
override
{};
18
19
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions);
20
21
private
:
22
void
beginJob
()
override
{};
23
void
produce
(
edm::Event
&,
const
edm::EventSetup
&)
override
;
24
void
endJob
()
override
{};
25
26
std::vector<std::string>
pCaloHitInstanceLabels
;
27
std::vector<std::string>
pSimHitInstanceLabels
;
28
};
29
30
EmptySimHits::EmptySimHits
(
const
edm::ParameterSet
& iConfig) {
31
pSimHitInstanceLabels
= iConfig.
getParameter
<std::vector<std::string> >(
"pSimHitInstanceLabels"
);
32
pCaloHitInstanceLabels
= iConfig.
getParameter
<std::vector<std::string> >(
"pCaloHitInstanceLabels"
);
33
34
for
(
size_t
i
= 0;
i
<
pSimHitInstanceLabels
.size();
i
++) {
35
produces<edm::PSimHitContainer>(
pSimHitInstanceLabels
[
i
]);
36
}
37
38
for
(
size_t
i
= 0;
i
<
pCaloHitInstanceLabels
.size();
i
++) {
39
produces<edm::PCaloHitContainer>(
pCaloHitInstanceLabels
[
i
]);
40
}
41
}
42
43
void
EmptySimHits::produce
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
44
for
(
size_t
i
= 0;
i
<
pSimHitInstanceLabels
.size();
i
++) {
45
std::unique_ptr<edm::PSimHitContainer> pSimHitContainer(
new
edm::PSimHitContainer
());
46
iEvent
.put(
std::move
(pSimHitContainer),
pSimHitInstanceLabels
[
i
]);
47
}
48
49
for
(
size_t
i
= 0;
i
<
pCaloHitInstanceLabels
.size();
i
++) {
50
std::unique_ptr<edm::PCaloHitContainer> pCaloHitContainer(
new
edm::PCaloHitContainer
());
51
iEvent
.put(
std::move
(pCaloHitContainer),
pCaloHitInstanceLabels
[
i
]);
52
}
53
}
54
55
void
EmptySimHits::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
56
//The following says we do not know what parameters are allowed so do no validation
57
// Please change this to state exactly what you do use, even if it is no parameters
58
edm::ParameterSetDescription
desc
;
59
desc
.setUnknown();
60
descriptions.
addDefault
(
desc
);
61
}
62
63
//define this as a plug-in
64
DEFINE_FWK_MODULE
(
EmptySimHits
);
mps_fire.i
i
Definition:
mps_fire.py:428
EDProducer.h
EmptySimHits::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition:
EmptySimHits.cc:43
EmptySimHits::EmptySimHits
EmptySimHits(const edm::ParameterSet &)
Definition:
EmptySimHits.cc:30
PSimHitContainer.h
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
EmptySimHits::pSimHitInstanceLabels
std::vector< std::string > pSimHitInstanceLabels
Definition:
EmptySimHits.cc:27
MakerMacros.h
EmptySimHits::endJob
void endJob() override
Definition:
EmptySimHits.cc:24
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
EmptySimHits::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
EmptySimHits.cc:55
EmptySimHits::~EmptySimHits
~EmptySimHits() override
Definition:
EmptySimHits.cc:17
EmptySimHits
Definition:
EmptySimHits.cc:14
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::EventSetup
Definition:
EventSetup.h:57
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition:
eostools.py:511
Frameworkfwd.h
EmptySimHits::pCaloHitInstanceLabels
std::vector< std::string > pCaloHitInstanceLabels
Definition:
EmptySimHits.cc:24
edm::PCaloHitContainer
std::vector< PCaloHit > PCaloHitContainer
Definition:
PCaloHitContainer.h:8
edm::EDProducer
Definition:
EDProducer.h:35
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
PCaloHitContainer.h
EmptySimHits::beginJob
void beginJob() override
Definition:
EmptySimHits.cc:22
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition:
PSimHitContainer.h:11
ParameterSet.h
edm::Event
Definition:
Event.h:73
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:99
Generated for CMSSW Reference Manual by
1.8.16