52 produces<edm::ValueMap<float>>(
"miniIsoChg");
53 produces<edm::ValueMap<float>>(
"miniIsoAll");
58 produces<edm::ValueMap<float>>(
"PFIsoChg");
59 produces<edm::ValueMap<float>>(
"PFIsoAll");
60 produces<edm::ValueMap<float>>(
"PFIsoAll04");
65 produces<edm::ValueMap<float>>(
"PFIsoChg");
66 produces<edm::ValueMap<float>>(
"PFIsoAll");
118 template <
typename T>
138 unsigned int nInput = src->size();
141 miniIsoChg.reserve(nInput);
142 miniIsoAll.reserve(nInput);
144 for (
const auto &
obj : *src) {
145 auto iso =
obj.miniPFIsolation();
146 auto chg = iso.chargedHadronIso();
147 auto neu = iso.neutralHadronIso();
148 auto pho = iso.photonIso();
153 miniIsoChg.push_back(scale*
chg);
154 miniIsoAll.push_back(scale*(chg+
std::max(0.0,neu+pho-(*rho)*ea)));
159 fillerChg.
insert(src,miniIsoChg.begin(),miniIsoChg.end());
163 fillerAll.
insert(src,miniIsoAll.begin(),miniIsoAll.end());
188 unsigned int nInput = src->size();
191 PFIsoChg.reserve(nInput);
192 PFIsoAll.reserve(nInput);
193 PFIsoAll04.reserve(nInput);
195 for (
const auto &
obj : *src) {
196 auto iso =
obj.pfIsolationVariables();
197 auto chg = iso.sumChargedHadronPt;
198 auto neu = iso.sumNeutralHadronEt;
199 auto pho = iso.sumPhotonEt;
202 PFIsoChg.push_back(scale*
chg);
203 PFIsoAll.push_back(scale*(chg+
std::max(0.0,neu+pho-(*rho)*ea)));
204 PFIsoAll04.push_back(scale*(
obj.chargedHadronIso()+
std::max(0.0,
obj.neutralHadronIso()+
obj.photonIso()-(*rho)*ea*16./9.)));
209 fillerChg.
insert(src,PFIsoChg.begin(),PFIsoChg.end());
213 fillerAll.
insert(src,PFIsoAll.begin(),PFIsoAll.end());
217 fillerAll04.
insert(src,PFIsoAll04.begin(),PFIsoAll04.end());
239 unsigned int nInput = src->size();
242 PFIsoChg.reserve(nInput);
243 PFIsoAll.reserve(nInput);
245 for (
const auto &
obj : *src) {
246 auto chg =
obj.chargedHadronIso();
247 auto neu =
obj.neutralHadronIso();
248 auto pho =
obj.photonIso();
253 PFIsoChg.push_back(scale*
std::max(0.0,
chg-(*rho)*ea_chg));
254 PFIsoAll.push_back(PFIsoChg.back()+scale*(
std::max(0.0,neu-(*rho)*ea_neu)+
std::max(0.0,pho-(*rho)*ea_pho)));
259 fillerChg.
insert(src,PFIsoChg.begin(),PFIsoChg.end());
263 fillerAll.
insert(src,PFIsoAll.begin(),PFIsoAll.end());
274 template <
typename T>
278 desc.
add<
edm::InputTag>(
"src")->setComment(
"input physics object collection");
279 desc.
add<
bool>(
"relative")->setComment(
"compute relative isolation instead of absolute one");
281 desc.
add<
edm::FileInPath>(
"EAFile_MiniIso")->setComment(
"txt file containing effective areas to be used for mini-isolation pileup subtraction");
282 desc.
add<
edm::InputTag>(
"rho_MiniIso")->setComment(
"rho to be used for effective-area based mini-isolation pileup subtraction");
285 desc.
add<
edm::FileInPath>(
"EAFile_PFIso")->setComment(
"txt file containing effective areas to be used for PF-isolation pileup subtraction for electrons");
286 desc.
add<
edm::InputTag>(
"rho_PFIso")->setComment(
"rho to be used for effective-area based PF-isolation pileup subtraction for electrons");
289 desc.
add<
edm::InputTag>(
"mapIsoChg")->setComment(
"input charged PF isolation calculated in VID for photons");
290 desc.
add<
edm::InputTag>(
"mapIsoNeu")->setComment(
"input neutral PF isolation calculated in VID for photons");
291 desc.
add<
edm::InputTag>(
"mapIsoPho")->setComment(
"input photon PF isolation calculated in VID for photons");
292 desc.
add<
edm::FileInPath>(
"EAFile_PFIso_Chg")->setComment(
"txt file containing effective areas to be used for charged PF-isolation pileup subtraction for photons");
293 desc.
add<
edm::FileInPath>(
"EAFile_PFIso_Neu")->setComment(
"txt file containing effective areas to be used for neutral PF-isolation pileup subtraction for photons");
294 desc.
add<
edm::FileInPath>(
"EAFile_PFIso_Pho")->setComment(
"txt file containing effective areas to be used for photon PF-isolation pileup subtraction for photons");
295 desc.
add<
edm::InputTag>(
"rho_PFIso")->setComment(
"rho to be used for effective-area based PF-isolation pileup subtraction for photons");
298 if (
typeid(
T) ==
typeid(
pat::Muon)) modname+=
"Muon";
300 else if (
typeid(
T) ==
typeid(
pat::Photon)) modname+=
"Pho";
302 modname+=
"IsoValueMapProducer";
303 descriptions.
add(modname,desc);
T getParameter(std::string const &) const
Analysis-level Photon class.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
IsoValueMapProducer(const edm::ParameterSet &iConfig)
IsoValueMapProducer< pat::Muon > MuonIsoValueMapProducer
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< double > rho_pfiso_
void insert(const H &h, I begin, I end)
void doPFIsoEle(edm::Event &) const
reco::SuperClusterRef superCluster() const override
override the superCluster method from CaloJet, to access the internal storage of the supercluster ...
IsoValueMapProducer< pat::Photon > PhoIsoValueMapProducer
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
~IsoValueMapProducer() override
#define DEFINE_FWK_MODULE(type)
void doMiniIso(edm::Event &) const
IsoValueMapProducer< pat::IsolatedTrack > IsoTrackIsoValueMapProducer
ParameterDescriptionBase * add(U const &iLabel, T const &value)
IsoValueMapProducer< pat::Electron > EleIsoValueMapProducer
std::unique_ptr< EffectiveAreas > ea_pfiso_chg_
std::unique_ptr< EffectiveAreas > ea_pfiso_pho_
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)
float getEtaForEA(const T *) const
void doPFIsoPho(edm::Event &) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< double > rho_miniiso_
std::unique_ptr< EffectiveAreas > ea_pfiso_
std::unique_ptr< EffectiveAreas > ea_miniiso_
Analysis-level muon class.
reco::SuperClusterRef superCluster() const override
override the reco::GsfElectron::superCluster method, to access the internal storage of the superclust...
Power< A, B >::type pow(const A &a, const B &b)