CMS 3D CMS Logo

ME0TriggerProducer.cc
Go to the documentation of this file.
1 
25 
26 class ME0TriggerBuilder;
27 
29 public:
30  explicit ME0TriggerProducer(const edm::ParameterSet&);
31  ~ME0TriggerProducer() override;
32 
33  void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
34 
35 private:
39 };
40 
42  me0PadDigis_ = conf.getParameter<edm::InputTag>("ME0PadDigis");
43  me0_pad_token_ = consumes<ME0PadDigiCollection>(me0PadDigis_);
44  config_ = conf;
45 
46  // register what this produces
47  produces<ME0TriggerDigiCollection>();
48 }
49 
51 
54  setup.get<MuonGeometryRecord>().get(h_me0);
55 
57  ev.getByToken(me0_pad_token_, me0PadDigis);
58  const ME0PadDigiCollection* me0Pads = me0PadDigis.product();
59 
60  // Create empty collection
61  std::unique_ptr<ME0TriggerDigiCollection> oc_trig(new ME0TriggerDigiCollection);
62 
63  std::unique_ptr<ME0TriggerBuilder> trigBuilder(new ME0TriggerBuilder(config_));
64  trigBuilder->setME0Geometry(&*h_me0);
65 
66  // Fill output collections if valid input collection is available.
67  trigBuilder->build(me0Pads, *oc_trig);
68 
69  // Put collections in event.
70  ev.put(std::move(oc_trig));
71 }
72 
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
edm::InputTag me0PadDigis_
edm::ParameterSet config_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
bool ev
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
~ME0TriggerProducer() override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
T const * product() const
Definition: Handle.h:69
ME0TriggerProducer(const edm::ParameterSet &)
T get() const
Definition: EventSetup.h:73
def move(src, dest)
Definition: eostools.py:511
edm::EDGetTokenT< ME0PadDigiCollection > me0_pad_token_