CMS 3D CMS Logo

ME0TriggerPseudoProducer.cc
Go to the documentation of this file.
9 
11 {
12  me0segmentProducer_ = conf.getParameter<edm::InputTag>("ME0SegmentProducer");
13  me0segment_token_ = consumes<ME0SegmentCollection>(me0segmentProducer_);
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<ME0SegmentCollection> me0Segmentcoll;
30  ev.getByToken(me0segment_token_, me0Segmentcoll);
31  const ME0SegmentCollection *me0segments = me0Segmentcoll.product();
32 
33  // Create empty collection
34  auto oc_trig = std::make_unique<ME0TriggerDigiCollection>();
35 
36  auto trigBuilder = std::make_unique<ME0TriggerPseudoBuilder>(config_);
37  trigBuilder->setME0Geometry(&*h_me0);
38 
39  // Fill output collections if valid input collection is available.
40  if (me0Segmentcoll.isValid()) {
41  trigBuilder->build(me0segments, *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::EDGetTokenT< ME0SegmentCollection > me0segment_token_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
ME0TriggerPseudoProducer(const edm::ParameterSet &)
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
bool ev
bool isValid() const
Definition: HandleBase.h:74
T const * product() const
Definition: Handle.h:74
T get() const
Definition: EventSetup.h:71
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
def move(src, dest)
Definition: eostools.py:511