57 template <
class C1,
class C2,
class C3,
class C4>
61 const C3& refProdMany,
65 template <
class C1,
class C2,
class C3,
class C4>
69 const C3& refProdMany,
73 template <
class C1,
class C2,
class C3,
class C4>
77 const C3& refProdMany,
109 produces<std::vector<pat::Jet>>(
"jets");
110 produces<std::vector<pat::Muon>>(
"muons");
111 produces<std::vector<pat::Electron>>(
"electrons");
113 produces<std::vector<pat::Electron>>(
"lowPtElectrons");
114 produces<std::vector<pat::Tau>>(
"taus");
115 produces<std::vector<pat::Photon>>(
"photons");
130 template <
class C1,
class C2,
class C3,
class C4>
134 const C3& refProdMany,
138 for (
auto&
j : itemsOne) {
141 for (
auto&
m : itemsMany) {
143 m.addUserCand(nameOne,
reco::CandidatePtr(refProdOne.id(), ji, refProdOne.productGetter()));
153 template <
class C1,
class C2,
class C3,
class C4>
157 const C3& refProdMany,
161 for (
auto&
j : itemsOne) {
164 for (
auto&
m : itemsMany) {
166 m.addUserCand(nameOne,
reco::CandidatePtr(refProdOne.id(), ji, refProdOne.productGetter()));
176 template <
class C1,
class C2,
class C3,
class C4>
180 const C3& refProdMany,
184 for (
auto&
j : itemsOne) {
185 std::vector<std::pair<size_t, float>> idxs;
187 for (
auto&
m : itemsMany) {
190 m.addUserCand(nameOne,
reco::CandidatePtr(refProdOne.id(), ji, refProdOne.productGetter()));
191 idxs.push_back(std::make_pair(mi, dr2));
195 std::sort(idxs.begin(), idxs.end(), [](
auto& left,
auto& right) {
return left.second < right.second; });
198 for (
auto idx : idxs) {
210 auto jets = std::make_unique<std::vector<pat::Jet>>();
211 for (
const auto&
j : *jetsIn)
213 auto jetRefProd =
iEvent.getRefBeforePut<std::vector<pat::Jet>>(
"jets");
217 auto muons = std::make_unique<std::vector<pat::Muon>>();
218 for (
const auto&
m : *muonsIn)
220 auto muRefProd =
iEvent.getRefBeforePut<std::vector<pat::Muon>>(
"muons");
224 auto electrons = std::make_unique<std::vector<pat::Electron>>();
225 for (
const auto&
e : *electronsIn)
227 auto eleRefProd =
iEvent.getRefBeforePut<std::vector<pat::Electron>>(
"electrons");
230 auto lowPtElectrons = std::make_unique<std::vector<pat::Electron>>();
233 for (
const auto&
e : *lowPtElectronsIn) {
240 auto taus = std::make_unique<std::vector<pat::Tau>>();
241 for (
const auto&
t : *tausIn)
243 auto tauRefProd =
iEvent.getRefBeforePut<std::vector<pat::Tau>>(
"taus");
247 auto photons = std::make_unique<std::vector<pat::Photon>>();
248 for (
const auto&
p : *photonsIn)
250 auto phRefProd =
iEvent.getRefBeforePut<std::vector<pat::Photon>>(
"photons");
259 auto lowPtEleRefProd =
iEvent.getRefBeforePut<std::vector<pat::Electron>>(
"lowPtElectrons");
~PATObjectCrossLinker() override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void matchOneToMany(const C1 &refProdOne, C2 &itemsOne, const std::string &nameOne, const C3 &refProdMany, C4 &itemsMany, const std::string &nameMany)
EDProductGetter const * productGetter() const
Accessor for product getter.
#define DEFINE_FWK_MODULE(type)
void produce(edm::Event &, const edm::EventSetup &) override
void beginStream(edm::StreamID) override
const edm::EDGetTokenT< edm::View< pat::Muon > > muons_
bool matchByCommonParentSuperClusterRef(const C1 &c1, const C2 &c2)
edm::EDGetTokenT< edm::View< pat::Electron > > lowPtElectrons_
PATObjectCrossLinker(const edm::ParameterSet &)
void addDefault(ParameterSetDescription const &psetDescription)
bool matchByCommonSourceCandidatePtr(const C1 &c1, const C2 &c2)
const edm::EDGetTokenT< edm::View< pat::Jet > > jets_
const edm::EDGetTokenT< edm::View< pat::Electron > > electrons_
void matchElectronToPhoton(const C1 &refProdOne, C2 &itemsOne, const std::string &nameOne, const C3 &refProdMany, C4 &itemsMany, const std::string &nameMany)
void matchLowPtToElectron(const C1 &refProdOne, C2 &itemsOne, const std::string &nameOne, const C3 &refProdMany, C4 &itemsMany, const std::string &nameMany)
edm::InputTag lowPtElectronsTag_
const edm::EDGetTokenT< edm::View< pat::Tau > > taus_
const edm::EDGetTokenT< edm::View< pat::Photon > > photons_
void endStream() override