43 : muons_(iConfig.getParameter<
edm::
InputTag>(
"muons")),
44 muonsCut_(iConfig.getParameter<
std::
string>(
"muonCut")),
46 pfCandidateCut_(iConfig.getParameter<
std::
string>(
"pfCandidatesCut")),
47 lostTrack_(iConfig.getParameter<
edm::
InputTag>(
"otherTracks")),
48 lostTrackCut_(iConfig.getParameter<
std::
string>(
"lostTrackCut")) {
52 produces<std::vector<pat::Muon>>();
64 descriptions.
add(
"mergedMuonsNoCuts",
desc);
76 auto out = std::make_unique<std::vector<pat::Muon>>();
87 for (
unsigned int pf = 0;
pf < pfCands->size(); ++
pf) {
88 auto pfCand = pfCands->at(
pf);
92 bool isPFMuon =
false;
94 for (
unsigned int i = 0,
n =
muon.numberOfSourceCandidatePtrs();
i <
n; ++
i) {
96 if (ptr.
isNonnull() && ptr == pfCandPtr) {
109 double energy =
sqrt(pfCand.p() * pfCand.p() + 0.011163691);
120 if (
std::abs(lostTrack.pdgId()) == 13)
124 double energy =
sqrt(lostTrack.p() * lostTrack.p() + 0.011163691);
126 reco::Muon mu(lostTrack.charge(), p4, lostTrack.vertex());
StringCutObjectSelector< pat::PackedCandidate, false > pfCandidateCut_
reco::CandidatePtr pfCandidate_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::Ptr< pat::PackedCandidate > PackedCandidatePtr
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
edm::EDGetTokenT< std::vector< pat::PackedCandidate > > pfCandToken_
~PATMuonMerger() override
edm::EDGetTokenT< std::vector< pat::Muon > > muonToken_
bool isNonnull() const
Checks for non-null.
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
edm::InputTag pfCandidate_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
StringCutObjectSelector< pat::Muon, false > muonsCut_
StringCutObjectSelector< pat::PackedCandidate, false > lostTrackCut_
PATMuonMerger(const edm::ParameterSet &iConfig)
Analysis-level muon class.
edm::EDGetTokenT< std::vector< pat::PackedCandidate > > lostTrackToken_