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,
90 : jets_(consumes<edm::
View<pat::
Jet>>(params.getParameter<edm::
InputTag>(
"jets"))),
91 muons_(consumes<edm::
View<pat::
Muon>>(params.getParameter<edm::
InputTag>(
"muons"))),
93 taus_(consumes<edm::
View<pat::
Tau>>(params.getParameter<edm::
InputTag>(
"taus"))),
94 photons_(consumes<edm::
View<pat::
Photon>>(params.getParameter<edm::
InputTag>(
"photons")))
97 produces<std::vector<pat::Jet>>(
"jets");
98 produces<std::vector<pat::Muon>>(
"muons");
99 produces<std::vector<pat::Electron>>(
"electrons");
100 produces<std::vector<pat::Tau>>(
"taus");
101 produces<std::vector<pat::Photon>>(
"photons");
116 template <
class C1,
class C2,
class C3,
class C4>
120 const C3& refProdMany,
124 for (
auto&
j : itemsOne) {
127 for (
auto&
m : itemsMany) {
129 m.addUserCand(nameOne,
reco::CandidatePtr(refProdOne.id(), ji, refProdOne.productGetter()));
139 template <
class C1,
class C2,
class C3,
class C4>
143 const C3& refProdMany,
147 for (
auto&
j : itemsOne) {
150 for (
auto&
m : itemsMany) {
152 m.addUserCand(nameOne,
reco::CandidatePtr(refProdOne.id(), ji, refProdOne.productGetter()));
166 auto jets = std::make_unique<std::vector<pat::Jet>>();
167 for (
const auto&
j : *jetsIn)
169 auto jetRefProd = iEvent.
getRefBeforePut<std::vector<pat::Jet>>(
"jets");
173 auto muons = std::make_unique<std::vector<pat::Muon>>();
174 for (
const auto&
m : *muonsIn)
176 auto muRefProd = iEvent.
getRefBeforePut<std::vector<pat::Muon>>(
"muons");
180 auto electrons = std::make_unique<std::vector<pat::Electron>>();
181 for (
const auto&
e : *electronsIn)
183 auto eleRefProd = iEvent.
getRefBeforePut<std::vector<pat::Electron>>(
"electrons");
187 auto taus = std::make_unique<std::vector<pat::Tau>>();
188 for (
const auto&
t : *tausIn)
190 auto tauRefProd = iEvent.
getRefBeforePut<std::vector<pat::Tau>>(
"taus");
194 auto photons = std::make_unique<std::vector<pat::Photon>>();
195 for (
const auto&
p : *photonsIn)
197 auto phRefProd = iEvent.
getRefBeforePut<std::vector<pat::Photon>>(
"photons");
~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)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#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)
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_
RefProd< PROD > getRefBeforePut()
void matchElectronToPhoton(const C1 &refProdOne, C2 &itemsOne, const std::string &nameOne, const C3 &refProdMany, C4 &itemsMany, const std::string &nameMany)
const edm::EDGetTokenT< edm::View< pat::Tau > > taus_
const edm::EDGetTokenT< edm::View< pat::Photon > > photons_
void endStream() override
constexpr char Electron[]
EDProductGetter const * productGetter() const
Accessor for product getter.