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
#include "
FWCore/Utilities/interface/ESGetToken.h
"
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
edm::ESGetToken<HGCalTriggerGeometryBase, CaloGeometryRecord>
triggerGeomToken_
;
32
33
std::unique_ptr<HGCalConcentratorProcessorBase>
concentratorProcess_
;
34
};
35
36
DEFINE_FWK_MODULE
(
HGCalConcentratorProducer
);
37
38
HGCalConcentratorProducer::HGCalConcentratorProducer
(
const
edm::ParameterSet
& conf)
39
: input_cell_(consumes<
l1t
::
HGCalTriggerCellBxCollection
>(conf.getParameter<
edm
::
InputTag
>(
"InputTriggerCells"
))),
40
input_sums_(consumes<
l1t
::
HGCalTriggerSumsBxCollection
>(conf.getParameter<
edm
::
InputTag
>(
"InputTriggerSums"
))),
41
triggerGeomToken_(esConsumes<
HGCalTriggerGeometryBase
,
CaloGeometryRecord
,
edm
::
Transition
::BeginRun>()) {
42
//setup Concentrator parameters
43
const
edm::ParameterSet
& concParamConfig = conf.
getParameterSet
(
"ProcessorParameters"
);
44
const
std::string
& concProcessorName = concParamConfig.
getParameter
<
std::string
>(
"ProcessorName"
);
45
concentratorProcess_
= std::unique_ptr<HGCalConcentratorProcessorBase>{
46
HGCalConcentratorFactory::get
()->create(concProcessorName, concParamConfig)};
47
48
produces<l1t::HGCalTriggerCellBxCollection>(
concentratorProcess_
->name());
49
produces<l1t::HGCalTriggerSumsBxCollection>(
concentratorProcess_
->name());
50
}
51
52
void
HGCalConcentratorProducer::beginRun
(
const
edm::Run
&
/*run*/
,
const
edm::EventSetup
& es) {
53
triggerGeometry_
= es.
getHandle
(
triggerGeomToken_
);
54
55
concentratorProcess_
->setGeometry(
triggerGeometry_
.
product
());
56
}
57
58
void
HGCalConcentratorProducer::produce
(
edm::Event
&
e
,
const
edm::EventSetup
& es) {
59
// Output collections
60
std::pair<l1t::HGCalTriggerCellBxCollection, l1t::HGCalTriggerSumsBxCollection> cc_output;
61
62
// Input collections
63
edm::Handle<l1t::HGCalTriggerCellBxCollection>
trigCellBxColl;
64
65
e
.getByToken(
input_cell_
, trigCellBxColl);
66
concentratorProcess_
->run(trigCellBxColl, cc_output, es);
67
// Put in the event
68
e
.put(std::make_unique<l1t::HGCalTriggerCellBxCollection>(
std::move
(cc_output.first)),
concentratorProcess_
->name());
69
e
.put(std::make_unique<l1t::HGCalTriggerSumsBxCollection>(
std::move
(cc_output.second)),
concentratorProcess_
->name());
70
}
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
HGCalTriggerGeometryBase
Definition:
HGCalTriggerGeometryBase.h:19
edm::Run
Definition:
Run.h:45
CaloGeometryRecord
Definition:
CaloGeometryRecord.h:30
edm
HLT enums.
Definition:
AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition:
HLT_FULL_cff.py:89287
HGCalConcentratorProducer::input_cell_
edm::EDGetToken input_cell_
Definition:
HGCalConcentratorProducer.cc:29
EDProducer.h
HGCalTriggerSums.h
edm::Handle
Definition:
AssociativeIterator.h:50
ESGetToken.h
HGCalConcentratorProducer::HGCalConcentratorProducer
HGCalConcentratorProducer(const edm::ParameterSet &)
Definition:
HGCalConcentratorProducer.cc:38
MakerMacros.h
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:58
CaloGeometryRecord.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition:
ParameterSet.h:47
edm::Transition
Transition
Definition:
Transition.h:12
Event.h
HGCalConcentratorProducer::triggerGeometry_
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
Definition:
HGCalConcentratorProducer.cc:30
l1t
delete x;
Definition:
CaloConfig.h:22
HGCDigiCollections.h
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition:
EventSetup.h:148
edm::stream::EDProducer
Definition:
EDProducer.h:38
edm::EventSetup
Definition:
EventSetup.h:57
edm::EDGetToken
Definition:
EDGetToken.h:35
get
#define get
edm::ESGetToken< HGCalTriggerGeometryBase, CaloGeometryRecord >
HGCalConcentratorProducer::triggerGeomToken_
edm::ESGetToken< HGCalTriggerGeometryBase, CaloGeometryRecord > triggerGeomToken_
Definition:
HGCalConcentratorProducer.cc:31
eostools.move
def move(src, dest)
Definition:
eostools.py:511
Frameworkfwd.h
HGCalConcentratorProducer::concentratorProcess_
std::unique_ptr< HGCalConcentratorProcessorBase > concentratorProcess_
Definition:
HGCalConcentratorProducer.cc:33
HGCalProcessorBase.h
HGCalConcentratorProducer::beginRun
void beginRun(const edm::Run &, const edm::EventSetup &) override
Definition:
HGCalConcentratorProducer.cc:52
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
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:2128
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