CMS 3D CMS Logo

ME0TriggerPseudoProducer.cc
Go to the documentation of this file.
1 
26 
28 
30 public:
32  ~ME0TriggerPseudoProducer() override;
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<ME0SegmentCollection>(me0segmentProducer_);
46  me0_geom_token_ = esConsumes<ME0Geometry, MuonGeometryRecord>();
47  config_ = conf;
48 
49  // register what this produces
50  produces<ME0TriggerDigiCollection>();
51 }
52 
54 
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 
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< ME0SegmentCollection > me0segment_token_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ME0TriggerPseudoProducer(const edm::ParameterSet &)
T const * product() const
Definition: Handle.h:70
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
edm::ESGetToken< ME0Geometry, MuonGeometryRecord > me0_geom_token_
bool isValid() const
Definition: HandleBase.h:70
def move(src, dest)
Definition: eostools.py:511