◆ PackedPFCandidateRefMixer()
pat::PackedPFCandidateRefMixer::PackedPFCandidateRefMixer |
( |
const edm::ParameterSet & |
iConfig | ) |
|
|
explicit |
◆ ~PackedPFCandidateRefMixer()
pat::PackedPFCandidateRefMixer::~PackedPFCandidateRefMixer |
( |
| ) |
|
|
inlineoverride |
◆ produce()
Definition at line 46 of file PackedPFCandidateRefMixer.cc.
References Exception, trigObjTnPSource_cfi::filler, newFWLiteAna::found, mps_fire::i, edm::Ref< C, T, F >::id(), iEvent, edm::Ref< C, T, F >::key(), eostools::move(), dqmiodumpmetadata::n, MillePedeFileConverter_cfg::out, packedPFCandidateRefMixer_cfi::pf, packedPFCandidateRefMixer_cfi::pf2pf, and edm::refToPtr().
49 std::vector<edm::Handle<edm::Association<pat::PackedCandidateCollection>>> pf2pcs(
pf2pcs_.size());
52 for (
unsigned int i = 0,
n = pf2pcs.size();
i <
n; ++
i) {
55 std::vector<reco::CandidatePtr> outptrs;
56 outptrs.reserve(
pf->size());
57 for (
unsigned int i = 0,
n =
pf->size();
i <
n; ++
i) {
59 const auto& newpfRef = (*pf2pf)[oldpfRef];
61 for (
const auto& pf2pc : pf2pcs) {
62 if (pf2pc->contains(newpfRef.id())) {
63 outptrs.push_back(
refToPtr((*pf2pc)[newpfRef]));
69 edm::LogPrint(
"PackedPFCandidateRefMixer") <<
"oldpfRef: " << oldpfRef.id() <<
" / " << oldpfRef.key() <<
"\n";
70 edm::LogPrint(
"PackedPFCandidateRefMixer") <<
"newpfRef: " << newpfRef.id() <<
" / " << newpfRef.key() <<
"\n";
71 edm::LogPrint(
"PackedPFCandidateRefMixer") <<
"and I have " << pf2pcs.size() <<
" rekey maps." 73 for (
const auto& pf2pc : pf2pcs) {
74 edm::LogPrint(
"PackedPFCandidateRefMixer") <<
"this map has keys in: " 76 for (
const auto& pair : pf2pc->ids()) {
77 edm::LogPrint(
"PackedPFCandidateRefMixer") <<
"\t" << pair.first <<
"\n";
80 throw cms::Exception(
"LogicError") <<
"A packed candidate has refs that we don't understand\n";
85 filler.insert(
pf, outptrs.begin(), outptrs.end());
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
edm::EDGetTokenT< std::vector< reco::PFCandidate > > pf_
Log< level::Warning, true > LogPrint
edm::EDGetTokenT< edm::ValueMap< reco::PFCandidateRef > > pf2pf_
std::vector< edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > > pf2pcs_
◆ pf2pcs_
◆ pf2pf_
◆ pf_