34 #include "TLorentzVector.h" 50 produces<edm::ValueMap<float>>(
"eCorr");
88 unsigned nSrcRaw = srcRaw->size();
89 unsigned nSrcCorr = srcCorr->size();
91 std::vector<float>
eCorr(nSrcCorr,-1);
93 for (
unsigned int ir = 0; ir<nSrcRaw; ir++){
94 auto egm_raw = srcRaw->ptrAt(ir);
95 for (
unsigned int ic = 0; ic<nSrcCorr; ic++){
96 auto egm_corr = srcCorr->ptrAt(ic);
98 eCorr[ir] = egm_corr->energy()/egm_raw->energy();
106 fillerCorr.
insert(srcRaw,eCorr.begin(),eCorr.end());
113 template <
typename T>
117 desc.
add<
edm::InputTag>(
"srcRaw")->setComment(
"input raw physics object collection");
118 desc.
add<
edm::InputTag>(
"srcCorr")->setComment(
"input corrected physics object collection");
121 else if (
typeid(
T) ==
typeid(
pat::Photon)) modname+=
"Photon";
122 modname+=
"EnergyVarProducer";
123 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
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)
#define DEFINE_FWK_MODULE(type)
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)