52 produces<edm::ValueMap<float>>(
"miniIsoChg");
53 produces<edm::ValueMap<float>>(
"miniIsoAll");
59 produces<edm::ValueMap<float>>(
"PFIsoChg");
60 produces<edm::ValueMap<float>>(
"PFIsoAll");
61 produces<edm::ValueMap<float>>(
"PFIsoAll04");
68 produces<edm::ValueMap<float>>(
"PFIsoChg");
69 produces<edm::ValueMap<float>>(
"PFIsoAll");
81 produces<edm::ValueMap<float>>(
"PFIsoChgQuadratic");
82 produces<edm::ValueMap<float>>(
"PFIsoAllQuadratic");
132 template <
typename T>
142 return ph->superCluster()->eta();
145 template <
typename T>
158 doPFIsoPhoQuadratic(
iEvent);
162 template <
typename T>
165 const auto&
rho =
iEvent.get(rho_miniiso_);
167 unsigned int nInput =
src->size();
173 for (
const auto&
obj : *
src) {
174 auto iso =
obj.miniPFIsolation();
175 auto chg = iso.chargedHadronIso();
176 auto neu = iso.neutralHadronIso();
177 auto pho = iso.photonIso();
178 auto ea = ea_miniiso_->getEffectiveArea(fabs(getEtaForEA(&
obj)));
181 float scale = relative_ ? 1.0 /
obj.pt() : 1;
186 auto miniIsoChgV = std::make_unique<edm::ValueMap<float>>();
190 auto miniIsoAllV = std::make_unique<edm::ValueMap<float>>();
202 template <
typename T>
209 const auto&
rho =
iEvent.get(rho_pfiso_);
211 unsigned int nInput =
src->size();
218 for (
const auto&
obj : *
src) {
219 auto iso =
obj.pfIsolationVariables();
220 auto chg = iso.sumChargedHadronPt;
221 auto neu = iso.sumNeutralHadronEt;
222 auto pho = iso.sumPhotonEt;
223 auto ea = ea_pfiso_->getEffectiveArea(fabs(getEtaForEA(&
obj)));
224 float scale = relative_ ? 1.0 /
obj.pt() : 1;
231 auto PFIsoChgV = std::make_unique<edm::ValueMap<float>>();
235 auto PFIsoAllV = std::make_unique<edm::ValueMap<float>>();
239 auto PFIsoAll04V = std::make_unique<edm::ValueMap<float>>();
249 template <
typename T>
256 const auto&
rho =
iEvent.get(rho_pfiso_);
258 unsigned int nInput =
src->size();
265 for (
const auto&
obj : *
src) {
266 auto chg =
obj.chargedHadronIso();
267 auto neu =
obj.neutralHadronIso();
268 auto pho =
obj.photonIso();
270 auto ea_chg = ea_pfiso_chg_->getEffectiveArea(fabs(getEtaForEA(&
obj)));
271 auto ea_neu = ea_pfiso_neu_->getEffectiveArea(fabs(getEtaForEA(&
obj)));
272 auto ea_pho = ea_pfiso_pho_->getEffectiveArea(fabs(getEtaForEA(&
obj)));
274 float scale = relative_ ? 1.0 /
obj.pt() : 1;
280 auto PFIsoChgV = std::make_unique<edm::ValueMap<float>>();
284 auto PFIsoAllV = std::make_unique<edm::ValueMap<float>>();
293 template <
typename T>
300 const auto&
rho =
iEvent.get(rho_pfiso_);
302 unsigned int nInput =
src->size();
309 for (
const auto&
obj : *
src) {
310 auto chg =
obj.chargedHadronIso();
311 auto ecal =
obj.ecalPFClusterIso();
312 auto hcal =
obj.hcalPFClusterIso();
314 auto quadratic_ea_chg = quadratic_ea_pfiso_chg_->getQuadraticEA(fabs(getEtaForEA(&
obj)));
315 auto linear_ea_chg = quadratic_ea_pfiso_chg_->getLinearEA(fabs(getEtaForEA(&
obj)));
316 auto quadratic_ea_ecal = quadratic_ea_pfiso_ecal_->getQuadraticEA(fabs(getEtaForEA(&
obj)));
317 auto linear_ea_ecal = quadratic_ea_pfiso_ecal_->getLinearEA(fabs(getEtaForEA(&
obj)));
318 auto quadratic_ea_hcal = quadratic_ea_pfiso_hcal_->getQuadraticEA(fabs(getEtaForEA(&
obj)));
319 auto linear_ea_hcal = quadratic_ea_pfiso_hcal_->getLinearEA(fabs(getEtaForEA(&
obj)));
321 float scale = relative_ ? 1.0 /
obj.pt() : 1;
329 auto PFIsoChgQuadraticV = std::make_unique<edm::ValueMap<float>>();
332 fillerChgQuadratic.fill();
334 auto PFIsoAllQuadraticV = std::make_unique<edm::ValueMap<float>>();
337 fillerAllQuadratic.fill();
344 template <
typename T>
348 desc.add<
bool>(
"relative")->setComment(
"compute relative isolation instead of absolute one");
349 desc.add<
bool>(
"doQuadratic",
false)->setComment(
"flag to do quadratic EA corections for photons");
353 ->setComment(
"txt file containing effective areas to be used for mini-isolation pileup subtraction");
355 ->setComment(
"rho to be used for effective-area based mini-isolation pileup subtraction");
360 "txt file containing effective areas to be used for PF-isolation pileup subtraction for electrons");
362 ->setComment(
"rho to be used for effective-area based PF-isolation pileup subtraction for electrons");
366 ->setComment(
"input charged PF isolation calculated in VID for photons");
368 ->setComment(
"input neutral PF isolation calculated in VID for photons");
369 desc.addOptional<
edm::InputTag>(
"mapIsoPho")->setComment(
"input photon PF isolation calculated in VID for photons");
373 "txt file containing effective areas to be used for charged PF-isolation pileup subtraction for photons");
376 "txt file containing effective areas to be used for neutral PF-isolation pileup subtraction for photons");
379 "txt file containing effective areas to be used for photon PF-isolation pileup subtraction for photons");
382 ->setComment(
"rho to be used for effective-area based PF-isolation pileup subtraction for photons");
386 "txt file containing quadratic effective areas to be used for charged PF-isolation pileup subtraction for " 390 "txt file containing quadratic effective areas to be used for ecal PF-isolation pileup subtraction for " 394 "txt file containing quadratic effective areas to be used for hcal PF-isolation pileup subtraction for " 407 modname +=
"IsoValueMapProducer";
Analysis-level Photon class.
T getParameter(std::string const &) const
float getEtaForEA(const T *) const
std::unique_ptr< EffectiveAreas > quadratic_ea_pfiso_chg_
IsoValueMapProducer(const edm::ParameterSet &iConfig)
IsoValueMapProducer< pat::Muon > MuonIsoValueMapProducer
std::unique_ptr< EffectiveAreas > quadratic_ea_pfiso_hcal_
edm::EDGetTokenT< double > rho_pfiso_
reco::SuperClusterRef superCluster() const override
override the reco::GsfElectron::superCluster method, to access the internal storage of the superclust...
IsoValueMapProducer< pat::Photon > PhoIsoValueMapProducer
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
~IsoValueMapProducer() override
void doMiniIso(edm::Event &) const
IsoValueMapProducer< pat::IsolatedTrack > IsoTrackIsoValueMapProducer
#define DEFINE_FWK_MODULE(type)
void doPFIsoEle(edm::Event &) const
IsoValueMapProducer< pat::Electron > EleIsoValueMapProducer
std::unique_ptr< EffectiveAreas > ea_pfiso_chg_
std::unique_ptr< EffectiveAreas > ea_pfiso_pho_
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
edm::EDGetTokenT< edm::View< T > > src_
std::unique_ptr< EffectiveAreas > ea_pfiso_neu_
Analysis-level electron class.
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void doPFIsoPho(edm::Event &) const
std::unique_ptr< EffectiveAreas > quadratic_ea_pfiso_ecal_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< double > rho_miniiso_
std::unique_ptr< EffectiveAreas > ea_pfiso_
void doPFIsoPhoQuadratic(edm::Event &) const
std::unique_ptr< EffectiveAreas > ea_miniiso_
Analysis-level muon class.