CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Public Member Functions

 ElectronIsolatorFromEffectiveArea (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

Static Private Member Functions

static std::map< std::string,
EEA::ElectronEffectiveAreaTarget
EEA_target ()
 
static std::map< std::string,
EEA::ElectronEffectiveAreaType
EEA_type ()
 

Private Attributes

edm::EDGetTokenT
< reco::GsfElectronCollection
gsfElectronToken
 
const
EEA::ElectronEffectiveAreaType 
modeEEA
 
edm::EDGetTokenT
< reco::PFCandidateCollection
pfElectronToken
 
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 &)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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

Definition at line 13 of file ElectronIsolatorFromEffectiveArea.cc.

Member Typedef Documentation

Definition at line 16 of file ElectronIsolatorFromEffectiveArea.cc.

Definition at line 17 of file ElectronIsolatorFromEffectiveArea.cc.

Constructor & Destructor Documentation

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

Definition at line 34 of file ElectronIsolatorFromEffectiveArea.cc.

35  : gsfElectronToken( consumes<reco::GsfElectronCollection>( config.getParameter<edm::InputTag>("gsfElectrons") ) )
36  , pfElectronToken( consumes<reco::PFCandidateCollection>( config.getParameter<edm::InputTag>("pfElectrons") ) )
37  , rhoIsoToken( consumes<double>( config.getParameter<edm::InputTag>("rhoIso") ) )
38  , modeEEA( EEA_type()[ config.getParameter<std::string>("EffectiveAreaType") ] )
39  , targetEEA( EEA_target()[ config.getParameter<std::string>("EffectiveAreaTarget") ] )
40 { produces<CandDoubleMap>(); }
T getParameter(std::string const &) const
static std::map< std::string, EEA::ElectronEffectiveAreaTarget > EEA_target()
static std::map< std::string, EEA::ElectronEffectiveAreaType > EEA_type()
const EEA::ElectronEffectiveAreaType modeEEA
edm::EDGetTokenT< reco::PFCandidateCollection > pfElectronToken
const EEA::ElectronEffectiveAreaTarget targetEEA
edm::EDGetTokenT< reco::GsfElectronCollection > gsfElectronToken

Member Function Documentation

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

Definition at line 78 of file ElectronIsolatorFromEffectiveArea.cc.

References ElectronEffectiveArea::kEleGammaAndNeutralHadronIso03, ElectronEffectiveArea::kEleGammaAndNeutralHadronIso04, and m.

79 {
80  std::map<std::string,EEA::ElectronEffectiveAreaType> m;
81  m["kEleGammaAndNeutralHadronIso03"] = EEA::kEleGammaAndNeutralHadronIso03;
82  m["kEleGammaAndNeutralHadronIso04"] = EEA::kEleGammaAndNeutralHadronIso04;
83  return m;
84 }
bool ElectronIsolatorFromEffectiveArea::filter ( edm::Event event,
const edm::EventSetup  
)
privatevirtual

Implements edm::EDFilter.

Definition at line 45 of file ElectronIsolatorFromEffectiveArea.cc.

References edm::helper::Filler< Map >::fill(), ElectronEffectiveArea::GetElectronEffectiveArea(), gsfElectrons_cfi::gsfElectrons, gsfElectronToken, edm::helper::Filler< Map >::insert(), edm::HandleBase::isValid(), modeEEA, pfElectrons_cff::pfElectrons, pfElectronToken, rho, rhoIsoToken, and targetEEA.

Referenced by Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filter(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setDataAccessor(), and Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView().

46 {
47  std::auto_ptr<CandDoubleMap> product(new CandDoubleMap());
48  CandDoubleMap::Filler filler(*product);
49 
50  edm::Handle<double> rho; event.getByToken(rhoIsoToken, rho);
53  std::vector<double> gsfCorrectionsEA,pfCorrectionsEA;
54 
55  if(gsfElectrons.isValid()) {
56  for ( reco::GsfElectronCollection::const_iterator it = gsfElectrons->begin(); it != gsfElectrons->end(); ++it)
57  gsfCorrectionsEA.push_back( (*rho) * EEA::GetElectronEffectiveArea( modeEEA, it->superCluster()->eta(), targetEEA ) );
58  filler.insert(gsfElectrons, gsfCorrectionsEA.begin(), gsfCorrectionsEA.end() );
59  }
60 
61  if(pfElectrons.isValid()) {
62  for ( reco::PFCandidateCollection::const_iterator it = pfElectrons->begin(); it != pfElectrons->end(); ++it)
63  pfCorrectionsEA.push_back( (*rho) * EEA::GetElectronEffectiveArea( modeEEA, it->gsfElectronRef()->superCluster()->eta(), targetEEA ) );
64  filler.insert( pfElectrons, pfCorrectionsEA.begin(), pfCorrectionsEA.end() );
65  }
66 
67  filler.fill();
68  event.put(product);
69  return true;
70 }
Definition: DDAxes.h:10
static Double_t GetElectronEffectiveArea(ElectronEffectiveAreaType type, Double_t SCEta, ElectronEffectiveAreaTarget EffectiveAreaTarget=kEleEAData2011)
const EEA::ElectronEffectiveAreaType modeEEA
bool isValid() const
Definition: HandleBase.h:76
helper::Filler< ValueMap< T > > Filler
Definition: ValueMap.h:156
edm::EDGetTokenT< reco::PFCandidateCollection > pfElectronToken
const EEA::ElectronEffectiveAreaTarget targetEEA
edm::EDGetTokenT< reco::GsfElectronCollection > gsfElectronToken

Member Data Documentation

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

Definition at line 22 of file ElectronIsolatorFromEffectiveArea.cc.

Referenced by filter().

const EEA::ElectronEffectiveAreaType ElectronIsolatorFromEffectiveArea::modeEEA
private

Definition at line 25 of file ElectronIsolatorFromEffectiveArea.cc.

Referenced by filter().

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

Definition at line 23 of file ElectronIsolatorFromEffectiveArea.cc.

Referenced by filter().

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

Definition at line 24 of file ElectronIsolatorFromEffectiveArea.cc.

Referenced by filter().

const EEA::ElectronEffectiveAreaTarget ElectronIsolatorFromEffectiveArea::targetEEA
private

Definition at line 26 of file ElectronIsolatorFromEffectiveArea.cc.

Referenced by filter().