33 #include "TLorentzVector.h"
48 produces<edm::ValueMap<float>>(
"eCorr");
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();
101 fillerCorr.
insert(srcRaw, eCorr.begin(), eCorr.end());
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");
114 modname +=
"Electron";
117 modname +=
"EnergyVarProducer";
118 descriptions.
add(modname, desc);
Analysis-level Photon class.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< edm::View< T > > srcRaw_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
EGMEnergyVarProducer< pat::Photon > PhotonEnergyVarProducer
#define DEFINE_FWK_MODULE(type)
void insert(const H &h, I begin, I end)
~EGMEnergyVarProducer() override
bool matchByCommonParentSuperClusterRef(const C1 &c1, const C2 &c2)
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
EGMEnergyVarProducer< pat::Electron > ElectronEnergyVarProducer
EGMEnergyVarProducer(const edm::ParameterSet &iConfig)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Analysis-level electron class.
edm::EDGetTokenT< edm::View< T > > srcCorr_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)