L1Trigger
L1TGEM
plugins
ME0TriggerPseudoProducer.cc
Go to the documentation of this file.
1
10
#include "
FWCore/Framework/interface/MakerMacros.h
"
11
#include "
FWCore/Framework/interface/ConsumesCollector.h
"
12
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
13
#include "
FWCore/Framework/interface/global/EDProducer.h
"
14
#include "
FWCore/Framework/interface/Event.h
"
15
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
16
#include "
FWCore/Utilities/interface/InputTag.h
"
17
#include "
FWCore/Utilities/interface/ESGetToken.h
"
18
#include "
FWCore/Framework/interface/ESHandle.h
"
19
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
20
#include "
L1Trigger/L1TGEM/interface/ME0TriggerPseudoBuilder.h
"
21
#include "
DataFormats/Common/interface/Handle.h
"
22
#include "
DataFormats/GEMDigi/interface/ME0TriggerDigiCollection.h
"
23
#include "
DataFormats/GEMRecHit/interface/ME0SegmentCollection.h
"
24
#include "
Geometry/Records/interface/MuonGeometryRecord.h
"
25
#include "
Geometry/GEMGeometry/interface/ME0Geometry.h
"
26
27
class
ME0TriggerPseudoBuilder
;
28
29
class
ME0TriggerPseudoProducer
:
public
edm::global::EDProducer
<> {
30
public
:
31
explicit
ME0TriggerPseudoProducer
(
const
edm::ParameterSet
&);
32
~ME0TriggerPseudoProducer
()
override
;
33
34
void
produce
(
edm::StreamID
,
edm::Event
&,
const
edm::EventSetup
&)
const override
;
35
36
private
:
37
edm::InputTag
me0segmentProducer_
;
38
edm::EDGetTokenT<ME0SegmentCollection>
me0segment_token_
;
39
edm::ESGetToken<ME0Geometry, MuonGeometryRecord>
me0_geom_token_
;
40
edm::ParameterSet
config_
;
41
};
42
43
ME0TriggerPseudoProducer::ME0TriggerPseudoProducer
(
const
edm::ParameterSet
& conf) {
44
me0segmentProducer_
= conf.
getParameter
<
edm::InputTag
>(
"ME0SegmentProducer"
);
45
me0segment_token_
= consumes<ME0SegmentCollection>(
me0segmentProducer_
);
46
me0_geom_token_
= esConsumes<ME0Geometry, MuonGeometryRecord>();
47
config_
= conf;
48
49
// register what this produces
50
produces<ME0TriggerDigiCollection>();
51
}
52
53
ME0TriggerPseudoProducer::~ME0TriggerPseudoProducer
() {}
54
55
void
ME0TriggerPseudoProducer::produce
(
edm::StreamID
,
edm::Event
&
ev
,
const
edm::EventSetup
&
setup
)
const
{
56
edm::ESHandle<ME0Geometry>
h_me0 =
setup
.getHandle(
me0_geom_token_
);
57
58
edm::Handle<ME0SegmentCollection>
me0Segmentcoll;
59
ev
.getByToken(
me0segment_token_
, me0Segmentcoll);
60
const
ME0SegmentCollection
* me0segments = me0Segmentcoll.
product
();
61
62
// Create empty collection
63
auto
oc_trig = std::make_unique<ME0TriggerDigiCollection>();
64
65
auto
trigBuilder = std::make_unique<ME0TriggerPseudoBuilder>(
config_
);
66
trigBuilder->setME0Geometry(&*h_me0);
67
68
// Fill output collections if valid input collection is available.
69
if
(me0Segmentcoll.
isValid
()) {
70
trigBuilder->build(me0segments, *oc_trig);
71
}
72
73
// Put collections in event.
74
ev
.put(
std::move
(oc_trig));
75
}
76
77
DEFINE_FWK_MODULE
(
ME0TriggerPseudoProducer
);
edm::StreamID
Definition:
StreamID.h:30
Handle.h
MessageLogger.h
edm::Handle::product
T const * product() const
Definition:
Handle.h:70
ESHandle.h
ME0TriggerPseudoProducer::me0segmentProducer_
edm::InputTag me0segmentProducer_
Definition:
ME0TriggerPseudoProducer.cc:37
edm::EDGetTokenT< ME0SegmentCollection >
ME0TriggerPseudoProducer::produce
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Definition:
ME0TriggerPseudoProducer.cc:55
ME0TriggerDigiCollection.h
ME0SegmentCollection.h
ME0TriggerPseudoProducer::~ME0TriggerPseudoProducer
~ME0TriggerPseudoProducer() override
Definition:
ME0TriggerPseudoProducer.cc:53
ME0TriggerPseudoProducer
Definition:
ME0TriggerPseudoProducer.cc:29
ME0TriggerPseudoProducer::config_
edm::ParameterSet config_
Definition:
ME0TriggerPseudoProducer.cc:40
edm::Handle< ME0SegmentCollection >
ESGetToken.h
singleTopDQM_cfi.setup
setup
Definition:
singleTopDQM_cfi.py:37
ME0TriggerPseudoBuilder.h
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
edm::ESHandle< ME0Geometry >
edm::global::EDProducer
Definition:
EDProducer.h:32
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
ME0TriggerPseudoProducer::me0segment_token_
edm::EDGetTokenT< ME0SegmentCollection > me0segment_token_
Definition:
ME0TriggerPseudoProducer.cc:38
ME0TriggerPseudoProducer::ME0TriggerPseudoProducer
ME0TriggerPseudoProducer(const edm::ParameterSet &)
Definition:
ME0TriggerPseudoProducer.cc:43
edm::EventSetup
Definition:
EventSetup.h:58
edm::ESGetToken< ME0Geometry, MuonGeometryRecord >
InputTag.h
ME0Geometry.h
ME0TriggerPseudoBuilder
Definition:
ME0TriggerPseudoBuilder.h:20
eostools.move
def move(src, dest)
Definition:
eostools.py:511
Frameworkfwd.h
ev
bool ev
Definition:
Hydjet2Hadronizer.cc:95
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
ME0TriggerPseudoProducer::me0_geom_token_
edm::ESGetToken< ME0Geometry, MuonGeometryRecord > me0_geom_token_
Definition:
ME0TriggerPseudoProducer.cc:39
ConsumesCollector.h
ParameterSet.h
EDProducer.h
MuonGeometryRecord.h
edm::HandleBase::isValid
bool isValid() const
Definition:
HandleBase.h:70
edm::Event
Definition:
Event.h:73
ME0SegmentCollection
edm::InputTag
Definition:
InputTag.h:15
Generated for CMSSW Reference Manual by
1.8.16