CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
ElectronIsolatorFromEffectiveArea Class Reference
Inheritance diagram for ElectronIsolatorFromEffectiveArea:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef edm::ValueMap< double > CandDoubleMap
 
typedef ElectronEffectiveArea EEA
 
- Public Types inherited from edm::EDFilter
typedef EDFilter 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
 

Public Member Functions

 ElectronIsolatorFromEffectiveArea (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilter () 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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

bool filter (edm::Event &, const edm::EventSetup &) override
 

Static Private Member Functions

static std::map< std::string, EEA::ElectronEffectiveAreaTargetEEA_target ()
 
static std::map< std::string, EEA::ElectronEffectiveAreaTypeEEA_type ()
 

Private Attributes

edm::InputTag gsfElectronTag
 
edm::EDGetTokenT< reco::GsfElectronCollectiongsfElectronToken
 
const EEA::ElectronEffectiveAreaType modeEEA
 
edm::InputTag patElectronTag
 
edm::EDGetTokenT< pat::ElectronCollectionpatElectronToken
 
edm::InputTag pfElectronTag
 
edm::EDGetTokenT< reco::PFCandidateCollectionpfElectronToken
 
edm::EDGetTokenT< double > rhoIsoToken
 
const EEA::ElectronEffectiveAreaTarget targetEEA
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 14 of file ElectronIsolatorFromEffectiveArea.cc.

Member Typedef Documentation

◆ CandDoubleMap

Definition at line 16 of file ElectronIsolatorFromEffectiveArea.cc.

◆ EEA

Definition at line 17 of file ElectronIsolatorFromEffectiveArea.cc.

Constructor & Destructor Documentation

◆ ElectronIsolatorFromEffectiveArea()

ElectronIsolatorFromEffectiveArea::ElectronIsolatorFromEffectiveArea ( const edm::ParameterSet config)
explicit

Definition at line 35 of file ElectronIsolatorFromEffectiveArea.cc.

39  rhoIsoToken(consumes<double>(config.getParameter<edm::InputTag>("rhoIso"))),
40  modeEEA(EEA_type()[config.getParameter<std::string>("EffectiveAreaType")]),
41  targetEEA(EEA_target()[config.getParameter<std::string>("EffectiveAreaTarget")]) {
42  if (config.existsAs<edm::InputTag>("gsfElectrons"))
43  gsfElectronTag = config.getParameter<edm::InputTag>("gsfElectrons");
44  if (config.existsAs<edm::InputTag>("pfElectrons"))
45  pfElectronTag = config.getParameter<edm::InputTag>("pfElectrons");
46  if (config.existsAs<edm::InputTag>("patElectrons"))
47  patElectronTag = config.getParameter<edm::InputTag>("patElectrons");
48  if (!gsfElectronTag.label().empty())
49  gsfElectronToken = consumes<reco::GsfElectronCollection>(gsfElectronTag);
50  if (!pfElectronTag.label().empty())
51  pfElectronToken = consumes<reco::PFCandidateCollection>(pfElectronTag);
52  if (!patElectronTag.label().empty())
53  patElectronToken = consumes<pat::ElectronCollection>(patElectronTag);
54  produces<CandDoubleMap>();
55 }

References gsfElectronTag, gsfElectronToken, edm::InputTag::label(), patElectronTag, patElectronToken, pfElectronTag, and pfElectronToken.

Member Function Documentation

◆ EEA_target()

std::map< std::string, ElectronEffectiveArea::ElectronEffectiveAreaTarget > ElectronIsolatorFromEffectiveArea::EEA_target ( )
staticprivate

Definition at line 115 of file ElectronIsolatorFromEffectiveArea.cc.

115  {
116  std::map<std::string, EEA::ElectronEffectiveAreaTarget> m;
117  m["kEleEANoCorr"] = EEA::kEleEANoCorr;
118  m["kEleEAData2011"] = EEA::kEleEAData2011;
119  m["kEleEASummer11MC"] = EEA::kEleEASummer11MC;
120  m["kEleEAFall11MC"] = EEA::kEleEAFall11MC;
121  m["kEleEAData2012"] = EEA::kEleEAData2012;
122  return m;
123 }

References ElectronEffectiveArea::kEleEAData2011, ElectronEffectiveArea::kEleEAData2012, ElectronEffectiveArea::kEleEAFall11MC, ElectronEffectiveArea::kEleEANoCorr, ElectronEffectiveArea::kEleEASummer11MC, and visualization-live-secondInstance_cfg::m.

◆ EEA_type()

std::map< std::string, ElectronEffectiveArea::ElectronEffectiveAreaType > ElectronIsolatorFromEffectiveArea::EEA_type ( )
staticprivate

Definition at line 107 of file ElectronIsolatorFromEffectiveArea.cc.

107  {
108  std::map<std::string, EEA::ElectronEffectiveAreaType> m;
109  m["kEleGammaAndNeutralHadronIso03"] = EEA::kEleGammaAndNeutralHadronIso03;
110  m["kEleGammaAndNeutralHadronIso04"] = EEA::kEleGammaAndNeutralHadronIso04;
111  return m;
112 }

References ElectronEffectiveArea::kEleGammaAndNeutralHadronIso03, ElectronEffectiveArea::kEleGammaAndNeutralHadronIso04, and visualization-live-secondInstance_cfg::m.

◆ filter()

bool ElectronIsolatorFromEffectiveArea::filter ( edm::Event event,
const edm::EventSetup  
)
overrideprivatevirtual

Implements edm::EDFilter.

Definition at line 57 of file ElectronIsolatorFromEffectiveArea.cc.

57  {
58  std::unique_ptr<CandDoubleMap> product(new CandDoubleMap());
59  CandDoubleMap::Filler filler(*product);
60 
62  event.getByToken(rhoIsoToken, rho);
63 
64  if (!gsfElectronTag.label().empty()) {
66  event.getByToken(gsfElectronToken, gsfElectrons);
67  std::vector<double> gsfCorrectionsEA;
68  if (gsfElectrons.isValid()) {
69  for (reco::GsfElectronCollection::const_iterator it = gsfElectrons->begin(); it != gsfElectrons->end(); ++it)
70  gsfCorrectionsEA.push_back((*rho) *
71  EEA::GetElectronEffectiveArea(modeEEA, it->superCluster()->eta(), targetEEA));
72  filler.insert(gsfElectrons, gsfCorrectionsEA.begin(), gsfCorrectionsEA.end());
73  }
74  }
75 
76  if (!pfElectronTag.label().empty()) {
78  event.getByToken(pfElectronToken, pfElectrons);
79  std::vector<double> pfCorrectionsEA;
80  if (pfElectrons.isValid()) {
81  for (reco::PFCandidateCollection::const_iterator it = pfElectrons->begin(); it != pfElectrons->end(); ++it)
82  pfCorrectionsEA.push_back(
83  (*rho) * EEA::GetElectronEffectiveArea(modeEEA, it->gsfElectronRef()->superCluster()->eta(), targetEEA));
84  filler.insert(pfElectrons, pfCorrectionsEA.begin(), pfCorrectionsEA.end());
85  }
86  }
87 
88  if (!patElectronTag.label().empty()) {
90  event.getByToken(patElectronToken, patElectrons);
91  std::vector<double> patCorrectionsEA;
92  if (patElectrons.isValid()) {
93  for (pat::ElectronCollection::const_iterator it = patElectrons->begin(); it != patElectrons->end(); ++it)
94  patCorrectionsEA.push_back((*rho) *
95  EEA::GetElectronEffectiveArea(modeEEA, it->superCluster()->eta(), targetEEA));
96  filler.insert(patElectrons, patCorrectionsEA.begin(), patCorrectionsEA.end());
97  }
98  }
99 
100  filler.fill();
101  event.put(std::move(product));
102  return true;
103 }

References trigObjTnPSource_cfi::filler, ElectronEffectiveArea::GetElectronEffectiveArea(), electronIsolatorFromEffectiveArea_cfi::gsfElectrons, gsfElectronTag, gsfElectronToken, edm::InputTag::label(), modeEEA, eostools::move(), patElectronEAIsoCorrectionProducer_cfi::patElectrons, patElectronTag, patElectronToken, electronIsolatorFromEffectiveArea_cfi::pfElectrons, pfElectronTag, pfElectronToken, rho, rhoIsoToken, and targetEEA.

Member Data Documentation

◆ gsfElectronTag

edm::InputTag ElectronIsolatorFromEffectiveArea::gsfElectronTag
private

◆ gsfElectronToken

edm::EDGetTokenT<reco::GsfElectronCollection> ElectronIsolatorFromEffectiveArea::gsfElectronToken
private

◆ modeEEA

const EEA::ElectronEffectiveAreaType ElectronIsolatorFromEffectiveArea::modeEEA
private

Definition at line 29 of file ElectronIsolatorFromEffectiveArea.cc.

Referenced by filter().

◆ patElectronTag

edm::InputTag ElectronIsolatorFromEffectiveArea::patElectronTag
private

◆ patElectronToken

edm::EDGetTokenT<pat::ElectronCollection> ElectronIsolatorFromEffectiveArea::patElectronToken
private

◆ pfElectronTag

edm::InputTag ElectronIsolatorFromEffectiveArea::pfElectronTag
private

◆ pfElectronToken

edm::EDGetTokenT<reco::PFCandidateCollection> ElectronIsolatorFromEffectiveArea::pfElectronToken
private

◆ rhoIsoToken

edm::EDGetTokenT<double> ElectronIsolatorFromEffectiveArea::rhoIsoToken
private

Definition at line 28 of file ElectronIsolatorFromEffectiveArea.cc.

Referenced by filter().

◆ targetEEA

const EEA::ElectronEffectiveAreaTarget ElectronIsolatorFromEffectiveArea::targetEEA
private

Definition at line 30 of file ElectronIsolatorFromEffectiveArea.cc.

Referenced by filter().

ElectronEffectiveArea::GetElectronEffectiveArea
static Double_t GetElectronEffectiveArea(ElectronEffectiveAreaType type, Double_t SCEta, ElectronEffectiveAreaTarget EffectiveAreaTarget=kEleEAData2011)
Definition: ElectronEffectiveArea.h:59
ElectronIsolatorFromEffectiveArea::EEA_target
static std::map< std::string, EEA::ElectronEffectiveAreaTarget > EEA_target()
Definition: ElectronIsolatorFromEffectiveArea.cc:115
ElectronIsolatorFromEffectiveArea::pfElectronToken
edm::EDGetTokenT< reco::PFCandidateCollection > pfElectronToken
Definition: ElectronIsolatorFromEffectiveArea.cc:26
ElectronEffectiveArea::kEleGammaAndNeutralHadronIso03
Definition: ElectronEffectiveArea.h:40
ElectronIsolatorFromEffectiveArea::gsfElectronTag
edm::InputTag gsfElectronTag
Definition: ElectronIsolatorFromEffectiveArea.cc:22
electronIsolatorFromEffectiveArea_cfi.gsfElectrons
gsfElectrons
Definition: electronIsolatorFromEffectiveArea_cfi.py:4
edm::Handle< double >
ElectronIsolatorFromEffectiveArea::rhoIsoToken
edm::EDGetTokenT< double > rhoIsoToken
Definition: ElectronIsolatorFromEffectiveArea.cc:28
config
Definition: config.py:1
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
ElectronIsolatorFromEffectiveArea::EEA_type
static std::map< std::string, EEA::ElectronEffectiveAreaType > EEA_type()
Definition: ElectronIsolatorFromEffectiveArea.cc:107
ElectronIsolatorFromEffectiveArea::CandDoubleMap
edm::ValueMap< double > CandDoubleMap
Definition: ElectronIsolatorFromEffectiveArea.cc:16
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:78
ElectronEffectiveArea::kEleEANoCorr
Definition: ElectronEffectiveArea.h:57
ElectronIsolatorFromEffectiveArea::targetEEA
const EEA::ElectronEffectiveAreaTarget targetEEA
Definition: ElectronIsolatorFromEffectiveArea.cc:30
DDAxes::rho
ElectronEffectiveArea::kEleGammaAndNeutralHadronIso04
Definition: ElectronEffectiveArea.h:44
electronIsolatorFromEffectiveArea_cfi.pfElectrons
pfElectrons
Definition: electronIsolatorFromEffectiveArea_cfi.py:5
ElectronEffectiveArea::kEleEAFall11MC
Definition: ElectronEffectiveArea.h:57
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
ElectronIsolatorFromEffectiveArea::modeEEA
const EEA::ElectronEffectiveAreaType modeEEA
Definition: ElectronIsolatorFromEffectiveArea.cc:29
ElectronIsolatorFromEffectiveArea::pfElectronTag
edm::InputTag pfElectronTag
Definition: ElectronIsolatorFromEffectiveArea.cc:23
edm::ValueMap::Filler
helper::Filler< ValueMap< T > > Filler
Definition: ValueMap.h:168
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ElectronEffectiveArea::kEleEASummer11MC
Definition: ElectronEffectiveArea.h:57
ElectronIsolatorFromEffectiveArea::patElectronToken
edm::EDGetTokenT< pat::ElectronCollection > patElectronToken
Definition: ElectronIsolatorFromEffectiveArea.cc:27
eostools.move
def move(src, dest)
Definition: eostools.py:511
patElectronEAIsoCorrectionProducer_cfi.patElectrons
patElectrons
Definition: patElectronEAIsoCorrectionProducer_cfi.py:4
ElectronIsolatorFromEffectiveArea::gsfElectronToken
edm::EDGetTokenT< reco::GsfElectronCollection > gsfElectronToken
Definition: ElectronIsolatorFromEffectiveArea.cc:25
ElectronEffectiveArea::kEleEAData2011
Definition: ElectronEffectiveArea.h:57
edm::InputTag
Definition: InputTag.h:15
ElectronIsolatorFromEffectiveArea::patElectronTag
edm::InputTag patElectronTag
Definition: ElectronIsolatorFromEffectiveArea.cc:24
ElectronEffectiveArea::kEleEAData2012
Definition: ElectronEffectiveArea.h:57