CMS 3D CMS Logo

ME0TriggerProducer.cc
Go to the documentation of this file.
9 
11 {
12  me0PadDigiClusterProducer_ = conf.getParameter<edm::InputTag>("ME0PadDigiClusterProducer");
13  me0_pad_token_ = consumes<ME0PadDigiClusterCollection>(me0PadDigiClusterProducer_);
14  config_ = conf;
15 
16  // register what this produces
17  produces<ME0TriggerDigiCollection>();
18 }
19 
21 {
22 }
23 
25 {
27  setup.get<MuonGeometryRecord>().get(h_me0);
28 
29  edm::Handle<ME0PadDigiClusterCollection> me0PadDigiClusters;
30  ev.getByToken(me0_pad_token_, me0PadDigiClusters);
31  const ME0PadDigiClusterCollection *me0Pads = me0PadDigiClusters.product();
32 
33  // Create empty collection
34  std::unique_ptr<ME0TriggerDigiCollection> oc_trig(new ME0TriggerDigiCollection);
35 
36  std::unique_ptr<ME0TriggerBuilder> trigBuilder( new ME0TriggerBuilder(config_) );
37  trigBuilder->setME0Geometry(&*h_me0);
38 
39  // Fill output collections if valid input collection is available.
40  if (me0PadDigiClusters.isValid()) {
41  trigBuilder->build(me0Pads, *oc_trig);
42  }
43 
44  // Put collections in event.
45  ev.put(std::move(oc_trig));
46 }
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
edm::ParameterSet config_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
bool ev
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
edm::InputTag me0PadDigiClusterProducer_
~ME0TriggerProducer() override
bool isValid() const
Definition: HandleBase.h:74
T const * product() const
Definition: Handle.h:74
ME0TriggerProducer(const edm::ParameterSet &)
T get() const
Definition: EventSetup.h:71
edm::EDGetTokenT< ME0PadDigiClusterCollection > me0_pad_token_
def move(src, dest)
Definition: eostools.py:511