CMS 3D CMS Logo

GE0TriggerPseudoProducer.cc
Go to the documentation of this file.
1 
26 
28 
30 public:
32  ~GE0TriggerPseudoProducer() override = default;
33 
34  void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
35 
36 private:
41 };
42 
44  : me0segmentProducer_(conf.getParameter<edm::InputTag>("ME0SegmentProducer")),
45  me0segment_token_(consumes<GEMSegmentCollection>(me0segmentProducer_)),
46  me0_geom_token_(esConsumes<GEMGeometry, MuonGeometryRecord>()),
47  config_(conf) {
48  // register what this produces
49  produces<GE0TriggerDigiCollection>();
50 }
51 
54 
55  edm::Handle<GEMSegmentCollection> me0Segmentcoll;
56  ev.getByToken(me0segment_token_, me0Segmentcoll);
57  const GEMSegmentCollection* me0segments = me0Segmentcoll.product();
58 
59  // Create empty collection
60  auto oc_trig = std::make_unique<GE0TriggerDigiCollection>();
61 
62  auto trigBuilder = std::make_unique<GE0TriggerPseudoBuilder>(config_);
63  trigBuilder->setME0Geometry(&*h_me0);
64 
65  // Fill output collections if valid input collection is available.
66  if (me0Segmentcoll.isValid()) {
67  trigBuilder->build(*me0segments, *oc_trig);
68  }
69 
70  // Put collections in event.
71  ev.put(std::move(oc_trig));
72 }
73 
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
~GE0TriggerPseudoProducer() override=default
edm::EDGetTokenT< GEMSegmentCollection > me0segment_token_
T const * product() const
Definition: Handle.h:70
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
bool isValid() const
Definition: HandleBase.h:70
HLT enums.
GE0TriggerPseudoProducer(const edm::ParameterSet &)
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > me0_geom_token_
def move(src, dest)
Definition: eostools.py:511