RecoHGCal
TICL
plugins
TICLSeedingRegionProducer.cc
Go to the documentation of this file.
1
// Authors: Felice Pantaleo, Marco Rovere
2
// Emails: felice.pantaleo@cern.ch, marco.rovere@cern.ch
3
// Date: 06/2019
4
5
#include <vector>
6
7
#include "
FWCore/Framework/interface/ESHandle.h
"
8
#include "
FWCore/Framework/interface/Event.h
"
9
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
10
#include "
FWCore/Framework/interface/MakerMacros.h
"
11
#include "
FWCore/Framework/interface/stream/EDProducer.h
"
12
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
13
#include "
FWCore/ParameterSet/interface/ConfigurationDescriptions.h
"
14
#include "
FWCore/ParameterSet/interface/ParameterSetDescription.h
"
15
#include "
FWCore/ParameterSet/interface/PluginDescription.h
"
16
#include "
FWCore/Framework/interface/ConsumesCollector.h
"
17
#include "
RecoHGCal/TICL/plugins/SeedingRegionAlgoBase.h
"
18
#include "
SeedingRegionAlgoFactory.h
"
19
#include "
SeedingRegionByL1.h
"
20
#include "
SeedingRegionByTracks.h
"
21
#include "
SeedingRegionGlobal.h
"
22
#include "
SeedingRegionByHF.h
"
23
24
using namespace
ticl
;
25
26
class
TICLSeedingRegionProducer
:
public
edm::stream::EDProducer
<> {
27
public
:
28
TICLSeedingRegionProducer
(
const
edm::ParameterSet
&);
29
~TICLSeedingRegionProducer
()
override
{}
30
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions);
31
32
void
beginRun(
edm::Run
const
&
iEvent
,
edm::EventSetup
const
& es)
override
;
33
34
void
produce(
edm::Event
&,
const
edm::EventSetup
&)
override
;
35
36
private
:
37
std::unique_ptr<SeedingRegionAlgoBase>
myAlgo_
;
38
};
39
40
DEFINE_FWK_MODULE
(
TICLSeedingRegionProducer
);
41
42
TICLSeedingRegionProducer::TICLSeedingRegionProducer
(
const
edm::ParameterSet
& ps) {
43
auto
sumes = consumesCollector();
44
auto
seedingPSet
= ps.
getParameter
<
edm::ParameterSet
>(
"seedingPSet"
);
45
auto
algoType =
seedingPSet
.getParameter<
std::string
>(
"type"
);
46
myAlgo_ =
SeedingRegionAlgoFactory::get
()->create(algoType,
seedingPSet
, sumes);
47
produces<std::vector<TICLSeedingRegion>>();
48
}
49
50
void
TICLSeedingRegionProducer::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
51
edm::ParameterSetDescription
desc
;
52
53
edm::ParameterSetDescription
seedingDesc;
54
seedingDesc.
addNode
(
edm::PluginDescription<SeedingRegionAlgoFactory>
(
"type"
,
"SeedingRegionGlobal"
,
true
));
55
desc
.add<
edm::ParameterSetDescription
>(
"seedingPSet"
, seedingDesc);
56
descriptions.
add
(
"ticlSeedingRegionProducer"
,
desc
);
57
}
58
59
void
TICLSeedingRegionProducer::beginRun
(
edm::Run
const
&
iEvent
,
edm::EventSetup
const
& es) { myAlgo_->initialize(es); }
60
61
void
TICLSeedingRegionProducer::produce
(
edm::Event
& evt,
const
edm::EventSetup
& es) {
62
auto
result
= std::make_unique<std::vector<TICLSeedingRegion>>();
63
myAlgo_->makeRegions(evt, es, *
result
);
64
65
evt.
put
(
std::move
(
result
));
66
}
ConfigurationDescriptions.h
MessageLogger.h
SeedingRegionByTracks.h
ESHandle.h
edm::Run
Definition:
Run.h:45
SeedingRegionAlgoFactory.h
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
edm::PluginDescription
Definition:
PluginDescription.h:98
TICLSeedingRegionProducer::beginRun
void beginRun(edm::Run const &iEvent, edm::EventSetup const &es) override
Definition:
TICLSeedingRegionProducer.cc:59
TICLSeedingRegions_cff.seedingPSet
seedingPSet
Definition:
TICLSeedingRegions_cff.py:8
EDProducer.h
ticl
Definition:
Common.h:8
TICLSeedingRegionProducer::TICLSeedingRegionProducer
TICLSeedingRegionProducer(const edm::ParameterSet &)
Definition:
TICLSeedingRegionProducer.cc:42
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
SeedingRegionByHF.h
fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
TICLSeedingRegionProducer::myAlgo_
std::unique_ptr< SeedingRegionAlgoBase > myAlgo_
Definition:
TICLSeedingRegionProducer.cc:37
TICLSeedingRegionProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
TICLSeedingRegionProducer.cc:50
ParameterSetDescription.h
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
PluginDescription.h
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
TICLSeedingRegionProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition:
TICLSeedingRegionProducer.cc:61
TICLSeedingRegionProducer::~TICLSeedingRegionProducer
~TICLSeedingRegionProducer() override
Definition:
TICLSeedingRegionProducer.cc:29
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition:
Event.h:133
edm::stream::EDProducer
Definition:
EDProducer.h:38
edm::EventSetup
Definition:
EventSetup.h:58
edm::ParameterSetDescription::addNode
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
Definition:
ParameterSetDescription.cc:41
get
#define get
SeedingRegionGlobal.h
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition:
eostools.py:511
Frameworkfwd.h
SeedingRegionByL1.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
SeedingRegionAlgoBase.h
mps_fire.result
result
Definition:
mps_fire.py:311
ConsumesCollector.h
TICLSeedingRegionProducer
Definition:
TICLSeedingRegionProducer.cc:26
edm::Event
Definition:
Event.h:73
Generated for CMSSW Reference Manual by
1.8.16