L1Trigger
L1THGCal
plugins
HGCalTowerProducer.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
HGCalTowerProducer
:
public
edm::stream::EDProducer
<> {
19
public
:
20
HGCalTowerProducer
(
const
edm::ParameterSet
&);
21
~HGCalTowerProducer
()
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_towers_map_
;
29
edm::ESHandle<HGCalTriggerGeometryBase>
triggerGeometry_
;
30
31
std::unique_ptr<HGCalTowerProcessorBase>
towersProcess_
;
32
};
33
34
DEFINE_FWK_MODULE
(
HGCalTowerProducer
);
35
36
HGCalTowerProducer::HGCalTowerProducer
(
const
edm::ParameterSet
& conf)
37
: input_towers_map_(consumes<
l1t
::
HGCalTowerMapBxCollection
>(conf.getParameter<
edm
::
InputTag
>(
"InputTowerMaps"
))) {
38
//setup TowerMap parameters
39
const
edm::ParameterSet
& towerParamConfig = conf.
getParameterSet
(
"ProcessorParameters"
);
40
const
std::string
& towerProcessorName = towerParamConfig.
getParameter
<
std::string
>(
"ProcessorName"
);
41
towersProcess_
=
HGCalTowerFactory::get
()->create(towerProcessorName, towerParamConfig);
42
43
produces<l1t::HGCalTowerBxCollection>(
towersProcess_
->name());
44
}
45
46
void
HGCalTowerProducer::beginRun
(
const
edm::Run
&
/*run*/
,
const
edm::EventSetup
& es) {
47
es.
get
<
CaloGeometryRecord
>().
get
(
""
,
triggerGeometry_
);
48
towersProcess_
->setGeometry(
triggerGeometry_
.
product
());
49
}
50
51
void
HGCalTowerProducer::produce
(
edm::Event
&
e
,
const
edm::EventSetup
& es) {
52
// Output collections
53
auto
towers_output = std::make_unique<l1t::HGCalTowerBxCollection>();
54
55
// Input collections
56
edm::Handle<l1t::HGCalTowerMapBxCollection>
towersMapBxColl;
57
58
e
.getByToken(
input_towers_map_
, towersMapBxColl);
59
60
towersProcess_
->run(towersMapBxColl, *towers_output, es);
61
62
e
.put(
std::move
(towers_output),
towersProcess_
->name());
63
}
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
HGCalTowerProducer::~HGCalTowerProducer
~HGCalTowerProducer() override
Definition:
HGCalTowerProducer.cc:21
edm::Run
Definition:
Run.h:45
CaloGeometryRecord
Definition:
CaloGeometryRecord.h:30
edm
HLT enums.
Definition:
AlignableModifier.h:19
HGCalTowerProducer::towersProcess_
std::unique_ptr< HGCalTowerProcessorBase > towersProcess_
Definition:
HGCalTowerProducer.cc:31
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
HGCalTowerProducer::beginRun
void beginRun(const edm::Run &, const edm::EventSetup &) override
Definition:
HGCalTowerProducer.cc:46
HGCalTriggerGeometryBase.h
edm::ESHandle< HGCalTriggerGeometryBase >
HGCalTowerProducer::triggerGeometry_
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
Definition:
HGCalTowerProducer.cc:29
CaloGeometryRecord.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
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
edm::EDGetToken
Definition:
EDGetToken.h:35
get
#define get
HGCalTowerProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition:
HGCalTowerProducer.cc:51
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition:
eostools.py:511
HGCalTowerProducer::HGCalTowerProducer
HGCalTowerProducer(const edm::ParameterSet &)
Definition:
HGCalTowerProducer.cc:36
l1t::HGCalTowerMapBxCollection
BXVector< HGCalTowerMap > HGCalTowerMapBxCollection
Definition:
HGCalTowerMap.h:12
Frameworkfwd.h
HGCalProcessorBase.h
HGCalTowerProducer
Definition:
HGCalTowerProducer.cc:18
HGCalTowerProducer::input_towers_map_
edm::EDGetToken input_towers_map_
Definition:
HGCalTowerProducer.cc:28
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