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>>();
77 out->reserve(muons->size() + pfCands->size() + lostTracks->size());
80 for (
auto&
muon : *muons) {
87 for (
unsigned int pf = 0;
pf < pfCands->size(); ++
pf) {
88 auto pfCand = pfCands->at(
pf);
92 bool isPFMuon =
false;
93 for (
auto&
muon : *muons) {
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);
117 for (
auto& lostTrack : *lostTracks) {
120 if (
std::abs(lostTrack.pdgId()) == 13)
124 double energy =
sqrt(lostTrack.p() * lostTrack.p() + 0.011163691);
StringCutObjectSelector< pat::PackedCandidate, false > pfCandidateCut_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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_
#define DEFINE_FWK_MODULE(type)
~PATMuonMerger() override
edm::EDGetTokenT< std::vector< pat::Muon > > muonToken_
Abs< T >::type abs(const T &t)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool isNonnull() const
Checks for non-null.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
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_