CMS 3D CMS Logo

MuonLinksProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: MuonIdentification
4 // Class: MuonLinksProducer
5 //
6 //
7 // Original Author: Dmytro Kovalskyi
8 //
9 //
10 
11 // system include files
12 #include <memory>
13 
14 // user include files
16 //#include "FWCore/Framework/interface/EDProducer.h"
17 
20 
22 
27 
28 #include <algorithm>
29 
31  produces<reco::MuonTrackLinksCollection>();
32  m_inputCollection = iConfig.getParameter<edm::InputTag>("inputCollection");
33  muonToken_ = consumes<reco::MuonCollection>(m_inputCollection);
34 }
35 
37 
39  auto output = std::make_unique<reco::MuonTrackLinksCollection>();
41  iEvent.getByToken(muonToken_, muons);
42 
43  for (reco::MuonCollection::const_iterator muon = muons->begin(); muon != muons->end(); ++muon) {
44  if (!muon->isGlobalMuon())
45  continue;
46  output->push_back(reco::MuonTrackLinks(muon->track(), muon->standAloneMuon(), muon->combinedMuon()));
47  }
48  iEvent.put(std::move(output));
49 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
edm::EDGetTokenT< reco::MuonCollection > muonToken_
int iEvent
Definition: GenABIO.cc:224
~MuonLinksProducer() override
edm::InputTag m_inputCollection
MuonLinksProducer(const edm::ParameterSet &)
def move(src, dest)
Definition: eostools.py:511