Go to the documentation of this file.
33 #include "TLorentzVector.h"
48 produces<edm::ValueMap<float>>(
"eCorr");
79 iEvent.getByToken(srcRaw_, srcRaw);
81 iEvent.getByToken(srcCorr_, srcCorr);
83 unsigned nSrcRaw = srcRaw->size();
84 unsigned nSrcCorr = srcCorr->size();
86 std::vector<float>
eCorr(nSrcCorr, -1);
88 for (
unsigned int ir = 0; ir < nSrcRaw; ir++) {
89 auto egm_raw = srcRaw->ptrAt(ir);
90 for (
unsigned int ic = 0; ic < nSrcCorr; ic++) {
91 auto egm_corr = srcCorr->ptrAt(ic);
93 eCorr[ir] = egm_corr->energy() / egm_raw->energy();
107 template <
typename T>
110 desc.
add<
edm::InputTag>(
"srcRaw")->setComment(
"input raw physics object collection");
111 desc.
add<
edm::InputTag>(
"srcCorr")->setComment(
"input corrected physics object collection");
117 modname +=
"EnergyVarProducer";
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool matchByCommonParentSuperClusterRef(const C1 &c1, const C2 &c2)
void insert(const H &h, I begin, I end)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Analysis-level Photon class.
~EGMEnergyVarProducer() override
edm::EDGetTokenT< edm::View< T > > srcRaw_
EGMEnergyVarProducer< pat::Electron > ElectronEnergyVarProducer
#define DEFINE_FWK_MODULE(type)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< edm::View< T > > srcCorr_
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
EGMEnergyVarProducer< pat::Photon > PhotonEnergyVarProducer
EGMEnergyVarProducer(const edm::ParameterSet &iConfig)
Analysis-level electron class.
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)