L1Trigger
L1THGCal
plugins
HGCalTowerMapProducer.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
2
#include "
FWCore/Framework/interface/stream/EDProducer.h
"
3
4
#include "
FWCore/Framework/interface/Event.h
"
5
#include "
FWCore/Framework/interface/MakerMacros.h
"
6
7
#include "
DataFormats/L1THGCal/interface/HGCalTriggerCell.h
"
8
#include "
DataFormats/L1THGCal/interface/HGCalTriggerSums.h
"
9
#include "
DataFormats/L1THGCal/interface/HGCalTower.h
"
10
11
#include "
Geometry/Records/interface/CaloGeometryRecord.h
"
12
#include "
L1Trigger/L1THGCal/interface/HGCalTriggerGeometryBase.h
"
13
14
#include "
L1Trigger/L1THGCal/interface/HGCalProcessorBase.h
"
15
16
#include <memory>
17
18
class
HGCalTowerMapProducer
:
public
edm::stream::EDProducer
<> {
19
public
:
20
HGCalTowerMapProducer
(
const
edm::ParameterSet
&);
21
~HGCalTowerMapProducer
()
override
{}
22
23
void
beginRun
(
const
edm::Run
&,
const
edm::EventSetup
&)
override
;
24
void
produce
(
edm::Event
&,
const
edm::EventSetup
&)
override
;
25
26
private
:
27
// inputs
28
edm::EDGetToken
input_cell_
;
29
edm::ESHandle<HGCalTriggerGeometryBase>
triggerGeometry_
;
30
31
std::unique_ptr<HGCalTowerMapProcessorBase>
towersMapProcess_
;
32
};
33
34
DEFINE_FWK_MODULE
(
HGCalTowerMapProducer
);
35
36
HGCalTowerMapProducer::HGCalTowerMapProducer
(
const
edm::ParameterSet
& conf)
37
: input_cell_(consumes<
l1t
::
HGCalTriggerCellBxCollection
>(conf.getParameter<
edm
::
InputTag
>(
"InputTriggerCells"
))) {
38
//setup TowerMap parameters
39
const
edm::ParameterSet
& towerMapParamConfig = conf.
getParameterSet
(
"ProcessorParameters"
);
40
const
std::string
& towerMapProcessorName = towerMapParamConfig.
getParameter
<
std::string
>(
"ProcessorName"
);
41
towersMapProcess_
= std::unique_ptr<HGCalTowerMapProcessorBase>{
42
HGCalTowerMapFactory::get
()->create(towerMapProcessorName, towerMapParamConfig)};
43
44
produces<l1t::HGCalTowerMapBxCollection>(
towersMapProcess_
->name());
45
}
46
47
void
HGCalTowerMapProducer::beginRun
(
const
edm::Run
&
/*run*/
,
const
edm::EventSetup
& es) {
48
es.
get
<
CaloGeometryRecord
>().
get
(
""
,
triggerGeometry_
);
49
towersMapProcess_
->setGeometry(
triggerGeometry_
.
product
());
50
}
51
52
void
HGCalTowerMapProducer::produce
(
edm::Event
&
e
,
const
edm::EventSetup
& es) {
53
// Output collections
54
auto
towersMap_output = std::make_unique<l1t::HGCalTowerMapBxCollection>();
55
56
// Input collections
57
edm::Handle<l1t::HGCalTriggerCellBxCollection>
trigCellBxColl;
58
59
e
.getByToken(
input_cell_
, trigCellBxColl);
60
61
towersMapProcess_
->run(trigCellBxColl, *towersMap_output, es);
62
63
e
.put(
std::move
(towersMap_output),
towersMapProcess_
->name());
64
}
HGCalTowerMapProducer::~HGCalTowerMapProducer
~HGCalTowerMapProducer() override
Definition:
HGCalTowerMapProducer.cc:21
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
HGCalTowerMapProducer::beginRun
void beginRun(const edm::Run &, const edm::EventSetup &) override
Definition:
HGCalTowerMapProducer.cc:47
edm::Run
Definition:
Run.h:45
CaloGeometryRecord
Definition:
CaloGeometryRecord.h:30
edm
HLT enums.
Definition:
AlignableModifier.h:19
EDProducer.h
HGCalTriggerSums.h
edm::Handle
Definition:
AssociativeIterator.h:50
MakerMacros.h
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:73
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
HGCalTowerMapProducer::HGCalTowerMapProducer
HGCalTowerMapProducer(const edm::ParameterSet &)
Definition:
HGCalTowerMapProducer.cc:36
HGCalTriggerGeometryBase.h
l1t::HGCalTriggerCellBxCollection
BXVector< HGCalTriggerCell > HGCalTriggerCellBxCollection
Definition:
HGCalTriggerCell.h:11
edm::ESHandle< HGCalTriggerGeometryBase >
HGCalTowerMapProducer::towersMapProcess_
std::unique_ptr< HGCalTowerMapProcessorBase > towersMapProcess_
Definition:
HGCalTowerMapProducer.cc:31
CaloGeometryRecord.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
HGCalTowerMapProducer
Definition:
HGCalTowerMapProducer.cc:18
HLT_2018_cff.InputTag
InputTag
Definition:
HLT_2018_cff.py:79016
edm::ParameterSet
Definition:
ParameterSet.h:36
Event.h
l1t
delete x;
Definition:
CaloConfig.h:22
HGCalTower.h
edm::stream::EDProducer
Definition:
EDProducer.h:38
edm::EventSetup
Definition:
EventSetup.h:57
HGCalTowerMapProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition:
HGCalTowerMapProducer.cc:52
edm::EDGetToken
Definition:
EDGetToken.h:35
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition:
eostools.py:511
HGCalTowerMapProducer::input_cell_
edm::EDGetToken input_cell_
Definition:
HGCalTowerMapProducer.cc:28
Frameworkfwd.h
HGCalTowerMapProducer::triggerGeometry_
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
Definition:
HGCalTowerMapProducer.cc:29
HGCalProcessorBase.h
HGCalTriggerCell.h
edm::Event
Definition:
Event.h:73
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition:
ParameterSet.cc:2121
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
Generated for CMSSW Reference Manual by
1.8.16