RecoMuon
MuonIdentification
plugins
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
15
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
16
//#include "FWCore/Framework/interface/EDProducer.h"
17
18
#include "
FWCore/Framework/interface/Event.h
"
19
#include "
FWCore/Framework/interface/EventSetup.h
"
20
21
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
22
23
#include "
DataFormats/Common/interface/Handle.h
"
24
#include "
DataFormats/TrackReco/interface/Track.h
"
25
#include "
DataFormats/MuonReco/interface/MuonTrackLinks.h
"
26
#include "
RecoMuon/MuonIdentification/plugins/MuonLinksProducer.h
"
27
28
#include <algorithm>
29
30
MuonLinksProducer::MuonLinksProducer
(
const
edm::ParameterSet
& iConfig) {
31
produces<reco::MuonTrackLinksCollection>();
32
m_inputCollection
= iConfig.
getParameter
<
edm::InputTag
>(
"inputCollection"
);
33
muonToken_
= consumes<reco::MuonCollection>(
m_inputCollection
);
34
}
35
36
MuonLinksProducer::~MuonLinksProducer
() {}
37
38
void
MuonLinksProducer::produce
(
edm::StreamID
,
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup)
const
{
39
auto
output
= std::make_unique<reco::MuonTrackLinksCollection>();
40
edm::Handle<reco::MuonCollection>
muons
;
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:72
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
HLT_FULL_cff.muon
muon
Definition:
HLT_FULL_cff.py:11710
edm::ParameterSet
Definition:
ParameterSet.h:47
reco::MuonTrackLinks
Definition:
MuonTrackLinks.h:16
MuonTrackLinks.h
Event.h
MuonLinksProducer::~MuonLinksProducer
~MuonLinksProducer() override
Definition:
MuonLinksProducer.cc:36
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::EventSetup
Definition:
EventSetup.h:58
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
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
ParameterSet.h
edm::Event
Definition:
Event.h:73
MuonLinksProducer::MuonLinksProducer
MuonLinksProducer(const edm::ParameterSet &)
Definition:
MuonLinksProducer.cc:30
edm::InputTag
Definition:
InputTag.h:15
Generated for CMSSW Reference Manual by
1.8.16