CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
IsoValueMapProducer< T > Class Template Reference

#include <PhysicsTools/NanoAOD/plugins/IsoValueMapProducer.cc>

Inheritance diagram for IsoValueMapProducer< T >:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 IsoValueMapProducer (const edm::ParameterSet &iConfig)
 
 ~IsoValueMapProducer () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void doMiniIso (edm::Event &) const
 
template<>
void doMiniIso (edm::Event &iEvent) const
 
void doPFIsoEle (edm::Event &) const
 
template<>
void doPFIsoEle (edm::Event &iEvent) const
 
void doPFIsoPho (edm::Event &) const
 
template<>
void doPFIsoPho (edm::Event &iEvent) const
 
float getEtaForEA (const T *) const
 
template<>
float getEtaForEA (const pat::Electron *el) const
 
template<>
float getEtaForEA (const pat::Photon *ph) const
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 

Private Attributes

std::unique_ptr< EffectiveAreasea_miniiso_
 
std::unique_ptr< EffectiveAreasea_pfiso_
 
std::unique_ptr< EffectiveAreasea_pfiso_chg_
 
std::unique_ptr< EffectiveAreasea_pfiso_neu_
 
std::unique_ptr< EffectiveAreasea_pfiso_pho_
 
edm::EDGetTokenT< edm::ValueMap< float > > mapIsoChg_
 
edm::EDGetTokenT< edm::ValueMap< float > > mapIsoNeu_
 
edm::EDGetTokenT< edm::ValueMap< float > > mapIsoPho_
 
bool relative_
 
edm::EDGetTokenT< double > rho_miniiso_
 
edm::EDGetTokenT< double > rho_pfiso_
 
edm::EDGetTokenT< edm::View< T > > src_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

template<typename T>
class IsoValueMapProducer< T >

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 45 of file IsoValueMapProducer.cc.

Constructor & Destructor Documentation

template<typename T >
IsoValueMapProducer< T >::IsoValueMapProducer ( const edm::ParameterSet iConfig)
inlineexplicit

Definition at line 47 of file IsoValueMapProducer.cc.

References IsoValueMapProducer< T >::ea_miniiso_, IsoValueMapProducer< T >::ea_pfiso_, IsoValueMapProducer< T >::ea_pfiso_chg_, IsoValueMapProducer< T >::ea_pfiso_neu_, IsoValueMapProducer< T >::ea_pfiso_pho_, edm::ParameterSet::getParameter(), IsoValueMapProducer< T >::mapIsoChg_, IsoValueMapProducer< T >::mapIsoNeu_, IsoValueMapProducer< T >::mapIsoPho_, IsoValueMapProducer< T >::rho_miniiso_, and IsoValueMapProducer< T >::rho_pfiso_.

47  :
49  relative_(iConfig.getParameter<bool>("relative"))
50  {
51  if ((typeid(T) == typeid(pat::Muon)) || (typeid(T) == typeid(pat::Electron)) || typeid(T) == typeid(pat::IsolatedTrack)) {
52  produces<edm::ValueMap<float>>("miniIsoChg");
53  produces<edm::ValueMap<float>>("miniIsoAll");
54  ea_miniiso_.reset(new EffectiveAreas((iConfig.getParameter<edm::FileInPath>("EAFile_MiniIso")).fullPath()));
55  rho_miniiso_ = consumes<double>(iConfig.getParameter<edm::InputTag>("rho_MiniIso"));
56  }
57  if ((typeid(T) == typeid(pat::Electron))) {
58  produces<edm::ValueMap<float>>("PFIsoChg");
59  produces<edm::ValueMap<float>>("PFIsoAll");
60  produces<edm::ValueMap<float>>("PFIsoAll04");
61  ea_pfiso_.reset(new EffectiveAreas((iConfig.getParameter<edm::FileInPath>("EAFile_PFIso")).fullPath()));
62  rho_pfiso_ = consumes<double>(iConfig.getParameter<edm::InputTag>("rho_PFIso"));
63  }
64  else if ((typeid(T) == typeid(pat::Photon))) {
65  produces<edm::ValueMap<float>>("PFIsoChg");
66  produces<edm::ValueMap<float>>("PFIsoAll");
67  mapIsoChg_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("mapIsoChg"));
68  mapIsoNeu_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("mapIsoNeu"));
69  mapIsoPho_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("mapIsoPho"));
70  ea_pfiso_chg_.reset(new EffectiveAreas((iConfig.getParameter<edm::FileInPath>("EAFile_PFIso_Chg")).fullPath()));
71  ea_pfiso_neu_.reset(new EffectiveAreas((iConfig.getParameter<edm::FileInPath>("EAFile_PFIso_Neu")).fullPath()));
72  ea_pfiso_pho_.reset(new EffectiveAreas((iConfig.getParameter<edm::FileInPath>("EAFile_PFIso_Pho")).fullPath()));
73  rho_pfiso_ = consumes<double>(iConfig.getParameter<edm::InputTag>("rho_PFIso"));
74  }
75  }
T getParameter(std::string const &) const
Analysis-level Photon class.
Definition: Photon.h:47
edm::EDGetTokenT< double > rho_pfiso_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::unique_ptr< EffectiveAreas > ea_pfiso_chg_
std::unique_ptr< EffectiveAreas > ea_pfiso_pho_
edm::EDGetTokenT< edm::ValueMap< float > > mapIsoChg_
edm::EDGetTokenT< edm::View< T > > src_
edm::EDGetTokenT< edm::ValueMap< float > > mapIsoNeu_
edm::EDGetTokenT< edm::ValueMap< float > > mapIsoPho_
std::unique_ptr< EffectiveAreas > ea_pfiso_neu_
Analysis-level electron class.
Definition: Electron.h:52
edm::EDGetTokenT< double > rho_miniiso_
std::unique_ptr< EffectiveAreas > ea_pfiso_
long double T
std::unique_ptr< EffectiveAreas > ea_miniiso_
Analysis-level muon class.
Definition: Muon.h:50
template<typename T >
IsoValueMapProducer< T >::~IsoValueMapProducer ( )
inlineoverride

Member Function Documentation

template<typename T >
void IsoValueMapProducer< T >::doMiniIso ( edm::Event iEvent) const
private

Definition at line 137 of file IsoValueMapProducer.cc.

References chg, IsoValueMapProducer< T >::ea_miniiso_, edm::helper::Filler< Map >::fill(), edm::Event::getByToken(), IsoValueMapProducer< T >::getEtaForEA(), edm::helper::Filler< Map >::insert(), SiStripPI::max, min(), electrons_cff::miniIsoAll, electrons_cff::miniIsoChg, eostools::move(), NewMuonAssociatorByHits_cfi::obj, funct::pow(), edm::Event::put(), dttmaxenums::R, IsoValueMapProducer< T >::relative_, rho, IsoValueMapProducer< T >::rho_miniiso_, Scenarios_cff::scale, TrackRefitter_38T_cff::src, and IsoValueMapProducer< T >::src_.

Referenced by IsoValueMapProducer< T >::produce().

137  {
138 
140  iEvent.getByToken(src_, src);
142  iEvent.getByToken(rho_miniiso_,rho);
143 
144  unsigned int nInput = src->size();
145 
146  std::vector<float> miniIsoChg, miniIsoAll;
147  miniIsoChg.reserve(nInput);
148  miniIsoAll.reserve(nInput);
149 
150  for (const auto & obj : *src) {
151  auto iso = obj.miniPFIsolation();
152  auto chg = iso.chargedHadronIso();
153  auto neu = iso.neutralHadronIso();
154  auto pho = iso.photonIso();
155  auto ea = ea_miniiso_->getEffectiveArea(fabs(getEtaForEA(&obj)));
156  float R = 10.0/std::min(std::max(obj.pt(), 50.0),200.0);
157  ea *= std::pow(R/0.3,2);
158  float scale = relative_ ? 1.0/obj.pt() : 1;
159  miniIsoChg.push_back(scale*chg);
160  miniIsoAll.push_back(scale*(chg+std::max(0.0,neu+pho-(*rho)*ea)));
161  }
162 
163  std::unique_ptr<edm::ValueMap<float>> miniIsoChgV(new edm::ValueMap<float>());
164  edm::ValueMap<float>::Filler fillerChg(*miniIsoChgV);
165  fillerChg.insert(src,miniIsoChg.begin(),miniIsoChg.end());
166  fillerChg.fill();
167  std::unique_ptr<edm::ValueMap<float>> miniIsoAllV(new edm::ValueMap<float>());
168  edm::ValueMap<float>::Filler fillerAll(*miniIsoAllV);
169  fillerAll.insert(src,miniIsoAll.begin(),miniIsoAll.end());
170  fillerAll.fill();
171 
172  iEvent.put(std::move(miniIsoChgV),"miniIsoChg");
173  iEvent.put(std::move(miniIsoAllV),"miniIsoAll");
174 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
const float chg[109]
Definition: CoreSimTrack.cc:5
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
T min(T a, T b)
Definition: MathUtil.h:58
edm::EDGetTokenT< edm::View< T > > src_
float getEtaForEA(const T *) const
edm::EDGetTokenT< double > rho_miniiso_
std::unique_ptr< EffectiveAreas > ea_miniiso_
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
def move(src, dest)
Definition: eostools.py:510
template<>
void IsoValueMapProducer< pat::Photon >::doMiniIso ( edm::Event iEvent) const
private

Definition at line 178 of file IsoValueMapProducer.cc.

178 {}
template<typename T >
void IsoValueMapProducer< T >::doPFIsoEle ( edm::Event iEvent) const
private

Definition at line 183 of file IsoValueMapProducer.cc.

Referenced by IsoValueMapProducer< T >::produce().

183 {}
template<>
void IsoValueMapProducer< pat::Electron >::doPFIsoEle ( edm::Event iEvent) const
private

Definition at line 187 of file IsoValueMapProducer.cc.

References chg, IsoValueMapProducer< T >::ea_pfiso_, edm::helper::Filler< Map >::fill(), edm::Event::getByToken(), IsoValueMapProducer< T >::getEtaForEA(), edm::helper::Filler< Map >::insert(), SiStripPI::max, eostools::move(), NewMuonAssociatorByHits_cfi::obj, electrons_cff::PFIsoAll, electrons_cff::PFIsoAll04, electrons_cff::PFIsoChg, edm::Event::put(), IsoValueMapProducer< T >::relative_, rho, IsoValueMapProducer< T >::rho_pfiso_, Scenarios_cff::scale, TrackRefitter_38T_cff::src, and IsoValueMapProducer< T >::src_.

187  {
188 
190  iEvent.getByToken(src_, src);
192  iEvent.getByToken(rho_pfiso_,rho);
193 
194  unsigned int nInput = src->size();
195 
196  std::vector<float> PFIsoChg, PFIsoAll, PFIsoAll04;
197  PFIsoChg.reserve(nInput);
198  PFIsoAll.reserve(nInput);
199  PFIsoAll04.reserve(nInput);
200 
201  for (const auto & obj : *src) {
202  auto iso = obj.pfIsolationVariables();
203  auto chg = iso.sumChargedHadronPt;
204  auto neu = iso.sumNeutralHadronEt;
205  auto pho = iso.sumPhotonEt;
206  auto ea = ea_pfiso_->getEffectiveArea(fabs(getEtaForEA(&obj)));
207  float scale = relative_ ? 1.0/obj.pt() : 1;
208  PFIsoChg.push_back(scale*chg);
209  PFIsoAll.push_back(scale*(chg+std::max(0.0,neu+pho-(*rho)*ea)));
210  PFIsoAll04.push_back(scale*(obj.chargedHadronIso()+std::max(0.0,obj.neutralHadronIso()+obj.photonIso()-(*rho)*ea*16./9.)));
211  }
212 
213  std::unique_ptr<edm::ValueMap<float>> PFIsoChgV(new edm::ValueMap<float>());
214  edm::ValueMap<float>::Filler fillerChg(*PFIsoChgV);
215  fillerChg.insert(src,PFIsoChg.begin(),PFIsoChg.end());
216  fillerChg.fill();
217  std::unique_ptr<edm::ValueMap<float>> PFIsoAllV(new edm::ValueMap<float>());
218  edm::ValueMap<float>::Filler fillerAll(*PFIsoAllV);
219  fillerAll.insert(src,PFIsoAll.begin(),PFIsoAll.end());
220  fillerAll.fill();
221  std::unique_ptr<edm::ValueMap<float>> PFIsoAll04V(new edm::ValueMap<float>());
222  edm::ValueMap<float>::Filler fillerAll04(*PFIsoAll04V);
223  fillerAll04.insert(src,PFIsoAll04.begin(),PFIsoAll04.end());
224  fillerAll04.fill();
225 
226  iEvent.put(std::move(PFIsoChgV),"PFIsoChg");
227  iEvent.put(std::move(PFIsoAllV),"PFIsoAll");
228  iEvent.put(std::move(PFIsoAll04V),"PFIsoAll04");
229 
230 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
const float chg[109]
Definition: CoreSimTrack.cc:5
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
edm::EDGetTokenT< double > rho_pfiso_
edm::EDGetTokenT< edm::View< T > > src_
float getEtaForEA(const T *) const
std::unique_ptr< EffectiveAreas > ea_pfiso_
def move(src, dest)
Definition: eostools.py:510
template<typename T >
void IsoValueMapProducer< T >::doPFIsoPho ( edm::Event iEvent) const
private

Definition at line 234 of file IsoValueMapProducer.cc.

Referenced by IsoValueMapProducer< T >::produce().

234 {}
template<>
void IsoValueMapProducer< pat::Photon >::doPFIsoPho ( edm::Event iEvent) const
private

Definition at line 238 of file IsoValueMapProducer.cc.

References chg, IsoValueMapProducer< T >::ea_pfiso_chg_, IsoValueMapProducer< T >::ea_pfiso_neu_, IsoValueMapProducer< T >::ea_pfiso_pho_, edm::helper::Filler< Map >::fill(), edm::Event::getByToken(), IsoValueMapProducer< T >::getEtaForEA(), mps_fire::i, edm::helper::Filler< Map >::insert(), photons_cff::mapIsoChg, IsoValueMapProducer< T >::mapIsoChg_, photons_cff::mapIsoNeu, IsoValueMapProducer< T >::mapIsoNeu_, photons_cff::mapIsoPho, IsoValueMapProducer< T >::mapIsoPho_, SiStripPI::max, eostools::move(), NewMuonAssociatorByHits_cfi::obj, electrons_cff::PFIsoAll, electrons_cff::PFIsoChg, edm::Event::put(), IsoValueMapProducer< T >::relative_, rho, IsoValueMapProducer< T >::rho_pfiso_, Scenarios_cff::scale, TrackRefitter_38T_cff::src, and IsoValueMapProducer< T >::src_.

238  {
239 
241  iEvent.getByToken(src_, src);
243  iEvent.getByToken(rho_pfiso_,rho);
245  iEvent.getByToken(mapIsoChg_, mapIsoChg);
247  iEvent.getByToken(mapIsoNeu_, mapIsoNeu);
249  iEvent.getByToken(mapIsoPho_, mapIsoPho);
250 
251  unsigned int nInput = src->size();
252 
253  std::vector<float> PFIsoChg, PFIsoAll;
254  PFIsoChg.reserve(nInput);
255  PFIsoAll.reserve(nInput);
256 
257  for (unsigned int i=0; i<nInput; i++){
258  auto obj = src->ptrAt(i);
259  auto chg = (*mapIsoChg)[obj];
260  auto neu = (*mapIsoNeu)[obj];
261  auto pho = (*mapIsoPho)[obj];
262  auto ea_chg = ea_pfiso_chg_->getEffectiveArea(fabs(getEtaForEA(obj.get())));
263  auto ea_neu = ea_pfiso_neu_->getEffectiveArea(fabs(getEtaForEA(obj.get())));
264  auto ea_pho = ea_pfiso_pho_->getEffectiveArea(fabs(getEtaForEA(obj.get())));
265  float scale = relative_ ? 1.0/obj->pt() : 1;
266  PFIsoChg.push_back(scale*std::max(0.0,chg-(*rho)*ea_chg));
267  PFIsoAll.push_back(PFIsoChg.back()+scale*(std::max(0.0,neu-(*rho)*ea_neu)+std::max(0.0,pho-(*rho)*ea_pho)));
268  }
269 
270  std::unique_ptr<edm::ValueMap<float>> PFIsoChgV(new edm::ValueMap<float>());
271  edm::ValueMap<float>::Filler fillerChg(*PFIsoChgV);
272  fillerChg.insert(src,PFIsoChg.begin(),PFIsoChg.end());
273  fillerChg.fill();
274  std::unique_ptr<edm::ValueMap<float>> PFIsoAllV(new edm::ValueMap<float>());
275  edm::ValueMap<float>::Filler fillerAll(*PFIsoAllV);
276  fillerAll.insert(src,PFIsoAll.begin(),PFIsoAll.end());
277  fillerAll.fill();
278 
279  iEvent.put(std::move(PFIsoChgV),"PFIsoChg");
280  iEvent.put(std::move(PFIsoAllV),"PFIsoAll");
281 
282 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
const float chg[109]
Definition: CoreSimTrack.cc:5
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
edm::EDGetTokenT< double > rho_pfiso_
std::unique_ptr< EffectiveAreas > ea_pfiso_chg_
std::unique_ptr< EffectiveAreas > ea_pfiso_pho_
edm::EDGetTokenT< edm::ValueMap< float > > mapIsoChg_
edm::EDGetTokenT< edm::View< T > > src_
edm::EDGetTokenT< edm::ValueMap< float > > mapIsoNeu_
edm::EDGetTokenT< edm::ValueMap< float > > mapIsoPho_
std::unique_ptr< EffectiveAreas > ea_pfiso_neu_
float getEtaForEA(const T *) const
def move(src, dest)
Definition: eostools.py:510
template<typename T >
void IsoValueMapProducer< T >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 289 of file IsoValueMapProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by IsoValueMapProducer< T >::~IsoValueMapProducer().

289  {
291  desc.add<edm::InputTag>("src")->setComment("input physics object collection");
292  desc.add<bool>("relative")->setComment("compute relative isolation instead of absolute one");
293  if ((typeid(T) == typeid(pat::Muon)) || (typeid(T) == typeid(pat::Electron)) || typeid(T) == typeid(pat::IsolatedTrack)) {
294  desc.add<edm::FileInPath>("EAFile_MiniIso")->setComment("txt file containing effective areas to be used for mini-isolation pileup subtraction");
295  desc.add<edm::InputTag>("rho_MiniIso")->setComment("rho to be used for effective-area based mini-isolation pileup subtraction");
296  }
297  if ((typeid(T) == typeid(pat::Electron))) {
298  desc.add<edm::FileInPath>("EAFile_PFIso")->setComment("txt file containing effective areas to be used for PF-isolation pileup subtraction for electrons");
299  desc.add<edm::InputTag>("rho_PFIso")->setComment("rho to be used for effective-area based PF-isolation pileup subtraction for electrons");
300  }
301  if ((typeid(T) == typeid(pat::Photon))) {
302  desc.add<edm::InputTag>("mapIsoChg")->setComment("input charged PF isolation calculated in VID for photons");
303  desc.add<edm::InputTag>("mapIsoNeu")->setComment("input neutral PF isolation calculated in VID for photons");
304  desc.add<edm::InputTag>("mapIsoPho")->setComment("input photon PF isolation calculated in VID for photons");
305  desc.add<edm::FileInPath>("EAFile_PFIso_Chg")->setComment("txt file containing effective areas to be used for charged PF-isolation pileup subtraction for photons");
306  desc.add<edm::FileInPath>("EAFile_PFIso_Neu")->setComment("txt file containing effective areas to be used for neutral PF-isolation pileup subtraction for photons");
307  desc.add<edm::FileInPath>("EAFile_PFIso_Pho")->setComment("txt file containing effective areas to be used for photon PF-isolation pileup subtraction for photons");
308  desc.add<edm::InputTag>("rho_PFIso")->setComment("rho to be used for effective-area based PF-isolation pileup subtraction for photons");
309  }
310  std::string modname;
311  if (typeid(T) == typeid(pat::Muon)) modname+="Muon";
312  else if (typeid(T) == typeid(pat::Electron)) modname+="Ele";
313  else if (typeid(T) == typeid(pat::Photon)) modname+="Pho";
314  else if (typeid(T) == typeid(pat::IsolatedTrack)) modname+="IsoTrack";
315  modname+="IsoValueMapProducer";
316  descriptions.add(modname,desc);
317 }
Analysis-level Photon class.
Definition: Photon.h:47
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Analysis-level electron class.
Definition: Electron.h:52
void add(std::string const &label, ParameterSetDescription const &psetDescription)
long double T
Analysis-level muon class.
Definition: Muon.h:50
template<typename T >
float IsoValueMapProducer< T >::getEtaForEA ( const T obj) const
private
template<>
float IsoValueMapProducer< pat::Electron >::getEtaForEA ( const pat::Electron el) const
private

Definition at line 117 of file IsoValueMapProducer.cc.

References pat::Electron::superCluster().

117  {
118  return el->superCluster()->eta();
119 }
reco::SuperClusterRef superCluster() const override
override the reco::GsfElectron::superCluster method, to access the internal storage of the superclust...
template<>
float IsoValueMapProducer< pat::Photon >::getEtaForEA ( const pat::Photon ph) const
private

Definition at line 120 of file IsoValueMapProducer.cc.

References pat::Photon::superCluster().

120  {
121  return ph->superCluster()->eta();
122 }
reco::SuperClusterRef superCluster() const override
override the superCluster method from CaloJet, to access the internal storage of the supercluster ...
template<typename T >
void IsoValueMapProducer< T >::produce ( edm::StreamID  streamID,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivate

Definition at line 126 of file IsoValueMapProducer.cc.

References IsoValueMapProducer< T >::doMiniIso(), IsoValueMapProducer< T >::doPFIsoEle(), and IsoValueMapProducer< T >::doPFIsoPho().

Referenced by IsoValueMapProducer< T >::~IsoValueMapProducer().

127 {
128 
129  if ((typeid(T) == typeid(pat::Muon)) || (typeid(T) == typeid(pat::Electron)) || typeid(T) == typeid(pat::IsolatedTrack)) { doMiniIso(iEvent); };
130  if ((typeid(T) == typeid(pat::Electron))) { doPFIsoEle(iEvent); }
131  if ((typeid(T) == typeid(pat::Photon))) { doPFIsoPho(iEvent); }
132 
133 }
Analysis-level Photon class.
Definition: Photon.h:47
void doPFIsoEle(edm::Event &) const
void doMiniIso(edm::Event &) const
Analysis-level electron class.
Definition: Electron.h:52
void doPFIsoPho(edm::Event &) const
long double T
Analysis-level muon class.
Definition: Muon.h:50

Member Data Documentation

template<typename T >
std::unique_ptr<EffectiveAreas> IsoValueMapProducer< T >::ea_miniiso_
private
template<typename T >
std::unique_ptr<EffectiveAreas> IsoValueMapProducer< T >::ea_pfiso_
private
template<typename T >
std::unique_ptr<EffectiveAreas> IsoValueMapProducer< T >::ea_pfiso_chg_
private
template<typename T >
std::unique_ptr<EffectiveAreas> IsoValueMapProducer< T >::ea_pfiso_neu_
private
template<typename T >
std::unique_ptr<EffectiveAreas> IsoValueMapProducer< T >::ea_pfiso_pho_
private
template<typename T >
edm::EDGetTokenT<edm::ValueMap<float> > IsoValueMapProducer< T >::mapIsoChg_
private
template<typename T >
edm::EDGetTokenT<edm::ValueMap<float> > IsoValueMapProducer< T >::mapIsoNeu_
private
template<typename T >
edm::EDGetTokenT<edm::ValueMap<float> > IsoValueMapProducer< T >::mapIsoPho_
private
template<typename T >
bool IsoValueMapProducer< T >::relative_
private
template<typename T >
edm::EDGetTokenT<double> IsoValueMapProducer< T >::rho_miniiso_
private
template<typename T >
edm::EDGetTokenT<double> IsoValueMapProducer< T >::rho_pfiso_
private
template<typename T >
edm::EDGetTokenT<edm::View<T> > IsoValueMapProducer< T >::src_
private