L1Trigger
L1THGCal
plugins
HGCalConcentratorProducer.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/HGCDigi/interface/HGCDigiCollections.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
#include <utility>
18
19
class
HGCalConcentratorProducer
:
public
edm::stream::EDProducer
<> {
20
public
:
21
HGCalConcentratorProducer
(
const
edm::ParameterSet
&);
22
~HGCalConcentratorProducer
()
override
{}
23
24
void
beginRun
(
const
edm::Run
&,
const
edm::EventSetup
&)
override
;
25
void
produce
(
edm::Event
&,
const
edm::EventSetup
&)
override
;
26
27
private
:
28
// inputs
29
edm::EDGetToken
input_cell_
,
input_sums_
;
30
edm::ESHandle<HGCalTriggerGeometryBase>
triggerGeometry_
;
31
32
std::unique_ptr<HGCalConcentratorProcessorBase>
concentratorProcess_
;
33
};
34
35
DEFINE_FWK_MODULE
(
HGCalConcentratorProducer
);
36
37
HGCalConcentratorProducer::HGCalConcentratorProducer
(
const
edm::ParameterSet
& conf)
38
: input_cell_(consumes<
l1t
::
HGCalTriggerCellBxCollection
>(conf.getParameter<
edm
::
InputTag
>(
"InputTriggerCells"
))),
39
input_sums_(consumes<
l1t
::
HGCalTriggerSumsBxCollection
>(conf.getParameter<
edm
::
InputTag
>(
"InputTriggerSums"
))) {
40
//setup Concentrator parameters
41
const
edm::ParameterSet
& concParamConfig = conf.
getParameterSet
(
"ProcessorParameters"
);
42
const
std::string
& concProcessorName = concParamConfig.
getParameter
<
std::string
>(
"ProcessorName"
);
43
concentratorProcess_
= std::unique_ptr<HGCalConcentratorProcessorBase>{
44
HGCalConcentratorFactory::get
()->create(concProcessorName, concParamConfig)};
45
46
produces<l1t::HGCalTriggerCellBxCollection>(
concentratorProcess_
->name());
47
produces<l1t::HGCalTriggerSumsBxCollection>(
concentratorProcess_
->name());
48
}
49
50
void
HGCalConcentratorProducer::beginRun
(
const
edm::Run
&
/*run*/
,
const
edm::EventSetup
& es) {
51
es.
get
<
CaloGeometryRecord
>().
get
(
triggerGeometry_
);
52
53
concentratorProcess_
->setGeometry(
triggerGeometry_
.
product
());
54
}
55
56
void
HGCalConcentratorProducer::produce
(
edm::Event
&
e
,
const
edm::EventSetup
& es) {
57
// Output collections
58
std::pair<l1t::HGCalTriggerCellBxCollection, l1t::HGCalTriggerSumsBxCollection> cc_output;
59
60
// Input collections
61
edm::Handle<l1t::HGCalTriggerCellBxCollection>
trigCellBxColl;
62
63
e
.getByToken(
input_cell_
, trigCellBxColl);
64
concentratorProcess_
->run(trigCellBxColl, cc_output, es);
65
// Put in the event
66
e
.put(std::make_unique<l1t::HGCalTriggerCellBxCollection>(
std::move
(cc_output.first)),
concentratorProcess_
->name());
67
e
.put(std::make_unique<l1t::HGCalTriggerSumsBxCollection>(
std::move
(cc_output.second)),
concentratorProcess_
->name());
68
}
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
edm::Run
Definition:
Run.h:45
CaloGeometryRecord
Definition:
CaloGeometryRecord.h:30
edm
HLT enums.
Definition:
AlignableModifier.h:19
HGCalConcentratorProducer::input_cell_
edm::EDGetToken input_cell_
Definition:
HGCalConcentratorProducer.cc:29
EDProducer.h
HGCalTriggerSums.h
edm::Handle
Definition:
AssociativeIterator.h:50
HGCalConcentratorProducer::HGCalConcentratorProducer
HGCalConcentratorProducer(const edm::ParameterSet &)
Definition:
HGCalConcentratorProducer.cc:37
MakerMacros.h
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:73
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
HGCalConcentratorProducer
Definition:
HGCalConcentratorProducer.cc:19
HGCalTriggerGeometryBase.h
l1t::HGCalTriggerCellBxCollection
BXVector< HGCalTriggerCell > HGCalTriggerCellBxCollection
Definition:
HGCalTriggerCell.h:11
edm::ESHandle< HGCalTriggerGeometryBase >
HGCalConcentratorProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition:
HGCalConcentratorProducer.cc:56
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
HGCalConcentratorProducer::triggerGeometry_
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
Definition:
HGCalConcentratorProducer.cc:30
l1t
delete x;
Definition:
CaloConfig.h:22
HGCDigiCollections.h
edm::stream::EDProducer
Definition:
EDProducer.h:38
edm::EventSetup
Definition:
EventSetup.h:57
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
Frameworkfwd.h
HGCalConcentratorProducer::concentratorProcess_
std::unique_ptr< HGCalConcentratorProcessorBase > concentratorProcess_
Definition:
HGCalConcentratorProducer.cc:32
HGCalProcessorBase.h
HGCalConcentratorProducer::beginRun
void beginRun(const edm::Run &, const edm::EventSetup &) override
Definition:
HGCalConcentratorProducer.cc:50
HGCalTriggerCell.h
edm::Event
Definition:
Event.h:73
HGCalConcentratorProducer::~HGCalConcentratorProducer
~HGCalConcentratorProducer() override
Definition:
HGCalConcentratorProducer.cc:22
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition:
ParameterSet.cc:2121
l1t::HGCalTriggerSumsBxCollection
BXVector< HGCalTriggerSums > HGCalTriggerSumsBxCollection
Definition:
HGCalTriggerSums.h:11
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
HGCalConcentratorProducer::input_sums_
edm::EDGetToken input_sums_
Definition:
HGCalConcentratorProducer.cc:29
Generated for CMSSW Reference Manual by
1.8.16