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 }
edm::StreamID
Definition: StreamID.h:30
PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
Handle.h
muon
Definition: MuonCocktails.h:17
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
HLT_2018_cff.muon
muon
Definition: HLT_2018_cff.py:10349
edm::Handle< reco::MuonCollection >
MuonLinksProducer::produce
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Definition: MuonLinksProducer.cc:38
MuonLinksProducer.h
MuonLinksProducer::muonToken_
edm::EDGetTokenT< reco::MuonCollection > muonToken_
Definition: MuonLinksProducer.h:37
Track.h
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
MuonLinksProducer::~MuonLinksProducer
~MuonLinksProducer() override
Definition: MuonLinksProducer.cc:36
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
MuonLinksProducer::m_inputCollection
edm::InputTag m_inputCollection
Definition: MuonLinksProducer.h:36
Frameworkfwd.h
EventSetup.h
ParameterSet.h
edm::Event
Definition: Event.h:73
MuonLinksProducer::MuonLinksProducer
MuonLinksProducer(const edm::ParameterSet &)
Definition: MuonLinksProducer.cc:30
edm::InputTag
Definition: InputTag.h:15