35 std::vector<edm::EDGetTokenT<reco::PFCandidateCollection>>
pf_;
36 std::vector<edm::EDGetTokenT<edm::Association<pat::PackedCandidateCollection>>>
pf2pc_;
47 linkToPackedPF_(iConfig.getParameter<bool>(
"linkToPackedPFCandidates")),
49 modifyMuon_(iConfig.getParameter<bool>(
"modifyMuons"))
52 const std::vector<edm::InputTag> &
pf = iConfig.
getParameter<std::vector<edm::InputTag>>(
"pfCandidates");
53 const std::vector<edm::InputTag> & pf2pc = iConfig.
getParameter<std::vector<edm::InputTag>>(
"packedPFCandidates");
54 if (pf.size() != pf2pc.size())
throw cms::Exception(
"Configuration") <<
"Mismatching pfCandidates and packedPFCandidates\n";
67 produces<std::vector<pat::Muon> >();
83 auto out = std::make_unique<std::vector<pat::Muon>>();
84 out->reserve(src->size());
88 std::map<reco::CandidatePtr,pat::PackedCandidateRef> mu2pc;
92 for (
unsigned int ipfh = 0, npfh =
pf_.size(); ipfh < npfh; ++ipfh) {
95 const auto & pfcoll = (*pf);
96 const auto & pfmap = (*pf2pc);
97 for (
unsigned int i = 0,
n = pf->size();
i <
n; ++
i) {
104 for (vector<pat::Muon>::const_iterator it = src->begin(), ed = src->end(); it != ed; ++it) {
const edm::EDGetTokenT< pat::MuonCollection > src_
T getParameter(std::string const &) const
void embedDytMuon()
embed reference to the above dyt Track
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool isNonnull() const
Checks for non-null.
void embedTpfmsMuon()
embed reference to the above tpfms Track
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
PATMuonSlimmer(const edm::ParameterSet &iConfig)
virtual ~PATMuonSlimmer()
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
const bool linkToPackedPF_
std::vector< edm::EDGetTokenT< reco::PFCandidateCollection > > pf_
std::unique_ptr< pat::ObjectModifier< pat::Muon > > muonModifier_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
reco::MuonRef muonRef() const
std::vector< Muon > MuonCollection
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
Particle reconstructed by the particle flow algorithm.
std::vector< edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > > pf2pc_
virtual void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override final
const StringCutObjectSelector< pat::Muon > saveTeVMuons_
void embedPickyMuon()
embed reference to the above picky Track
Analysis-level muon class.
edm::Ptr< reco::Candidate > refToOrig_