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 
19 
21 
26 
27 #include <algorithm>
28 
30  produces<reco::MuonTrackLinksCollection>();
31  m_inputCollection = iConfig.getParameter<edm::InputTag>("inputCollection");
32  muonToken_ = consumes<reco::MuonCollection>(m_inputCollection);
33 }
34 
36 
38  auto output = std::make_unique<reco::MuonTrackLinksCollection>();
40  iEvent.getByToken(muonToken_, muons);
41 
42  for (reco::MuonCollection::const_iterator muon = muons->begin(); muon != muons->end(); ++muon) {
43  if (!muon->isGlobalMuon())
44  continue;
45  output->push_back(reco::MuonTrackLinks(muon->track(), muon->standAloneMuon(), muon->combinedMuon()));
46  }
47  iEvent.put(std::move(output));
48 }
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