CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
ElectronIDValueMapProducer Class Reference
Inheritance diagram for ElectronIDValueMapProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ElectronIDValueMapProducer (const edm::ParameterSet &)
 
 ~ElectronIDValueMapProducer () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- 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)
 
 ~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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (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::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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
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 produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 

Private Attributes

const MultiTokenT< EcalRecHitCollectionebRecHits_
 
const MultiTokenT< EcalRecHitCollectioneeRecHits_
 
const MultiTokenT< EcalRecHitCollectionesRecHits_
 
const MultiTokenT< edm::View< reco::GsfElectron > > 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 18 of file ElectronIDValueMapProducer.cc.

Constructor & Destructor Documentation

ElectronIDValueMapProducer::ElectronIDValueMapProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 39 of file ElectronIDValueMapProducer.cc.

41  : src_ ( consumesCollector(), iConfig, "src", "srcMiniAOD")
42  , ebRecHits_(src_, consumesCollector(), iConfig, "ebReducedRecHitCollection", "ebReducedRecHitCollectionMiniAOD")
43  , eeRecHits_(src_, consumesCollector(), iConfig, "eeReducedRecHitCollection", "eeReducedRecHitCollectionMiniAOD")
44  , esRecHits_(src_, consumesCollector(), iConfig, "esReducedRecHitCollection", "esReducedRecHitCollectionMiniAOD")
45 {
46 
47  produces<edm::ValueMap<float> >("eleFull5x5SigmaIEtaIEta");
48  produces<edm::ValueMap<float> >("eleFull5x5SigmaIEtaIPhi");
49  produces<edm::ValueMap<float> >("eleFull5x5E1x5" );
50  produces<edm::ValueMap<float> >("eleFull5x5E2x5" );
51  produces<edm::ValueMap<float> >("eleFull5x5E5x5" );
52  produces<edm::ValueMap<float> >("eleFull5x5R9" );
53  produces<edm::ValueMap<float> >("eleFull5x5Circularity" );
54 
55 }
const MultiTokenT< edm::View< reco::GsfElectron > > src_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
const MultiTokenT< EcalRecHitCollection > eeRecHits_
const MultiTokenT< EcalRecHitCollection > esRecHits_
const MultiTokenT< EcalRecHitCollection > ebRecHits_
ElectronIDValueMapProducer::~ElectronIDValueMapProducer ( )
inlineoverride

Definition at line 23 of file ElectronIDValueMapProducer.cc.

References fillDescriptions(), and produce().

23 {}

Member Function Documentation

void ElectronIDValueMapProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 103 of file ElectronIDValueMapProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and DEFINE_FWK_MODULE.

Referenced by ~ElectronIDValueMapProducer().

103  {
104  // electronIDValueMapProducer
106  desc.add<edm::InputTag>("src", edm::InputTag("gedGsfElectrons"));
107  desc.add<edm::InputTag>("srcMiniAOD", edm::InputTag("slimmedElectrons","","@skipCurrentProcess"));
108  desc.add<edm::InputTag>("ebReducedRecHitCollection", edm::InputTag("reducedEcalRecHitsEB"));
109  desc.add<edm::InputTag>("eeReducedRecHitCollection", edm::InputTag("reducedEcalRecHitsEE"));
110  desc.add<edm::InputTag>("esReducedRecHitCollection", edm::InputTag("reducedEcalRecHitsES"));
111  desc.add<edm::InputTag>("ebReducedRecHitCollectionMiniAOD", edm::InputTag("reducedEgamma","reducedEBRecHits"));
112  desc.add<edm::InputTag>("eeReducedRecHitCollectionMiniAOD", edm::InputTag("reducedEgamma","reducedEERecHits"));
113  desc.add<edm::InputTag>("esReducedRecHitCollectionMiniAOD", edm::InputTag("reducedEgamma","reducedESRecHits"));
114  descriptions.add("electronIDValueMapProducer", desc);
115 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void ElectronIDValueMapProducer::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivate

Definition at line 57 of file ElectronIDValueMapProducer.cc.

References ebRecHits_, eeRecHits_, esRecHits_, MultiTokenT< T >::getValidHandle(), edm::isNotFinite(), EcalClusterLazyToolsT< ClusterTools >::localCovariances(), mathSSE::sqrt(), TrackRefitter_38T_cff::src, src_, and writeValueMap().

Referenced by ~ElectronIDValueMapProducer().

58 {
59  // Get handle on electrons
60  auto src = src_.getValidHandle(iEvent);
61 
62  noZS::EcalClusterLazyTools lazyToolnoZS(iEvent, iSetup,
63  ebRecHits_.get(iEvent),
64  eeRecHits_.get(iEvent),
65  esRecHits_.get(iEvent));
66 
67  // size_t n = src->size();
68  std::vector<float> eleFull5x5SigmaIEtaIEta, eleFull5x5SigmaIEtaIPhi;
69  std::vector<float> eleFull5x5R9, eleFull5x5Circularity;
70  std::vector<float> eleFull5x5E1x5,eleFull5x5E2x5,eleFull5x5E5x5;
71 
72  // reco::GsfElectron::superCluster() is virtual so we can exploit polymorphism
73  for (const auto &ele : *src) {
74  const auto& theseed = *(ele.superCluster()->seed());
75 
76  std::vector<float> vCov = lazyToolnoZS.localCovariances( theseed );
77  const float see = (edm::isNotFinite(vCov[0]) ? 0. : sqrt(vCov[0]));
78  const float sep = vCov[1];
79  eleFull5x5SigmaIEtaIEta.push_back(see);
80  eleFull5x5SigmaIEtaIPhi.push_back(sep);
81  eleFull5x5R9.push_back(lazyToolnoZS.e3x3( theseed ) / ele.superCluster()->rawEnergy() );
82 
83  const float e1x5 = lazyToolnoZS.e1x5( theseed );
84  const float e2x5 = lazyToolnoZS.e2x5Max( theseed );
85  const float e5x5 = lazyToolnoZS.e5x5( theseed );
86  const float circularity = (e5x5 != 0.) ? 1.-e1x5/e5x5 : -1;
87 
88  eleFull5x5E1x5.push_back(e1x5);
89  eleFull5x5E2x5.push_back(e2x5);
90  eleFull5x5E5x5.push_back(e5x5);
91  eleFull5x5Circularity.push_back(circularity);
92  }
93 
94  writeValueMap(iEvent, src, eleFull5x5SigmaIEtaIEta, "eleFull5x5SigmaIEtaIEta");
95  writeValueMap(iEvent, src, eleFull5x5SigmaIEtaIPhi, "eleFull5x5SigmaIEtaIPhi");
96  writeValueMap(iEvent, src, eleFull5x5R9, "eleFull5x5R9");
97  writeValueMap(iEvent, src, eleFull5x5E1x5, "eleFull5x5E1x5");
98  writeValueMap(iEvent, src, eleFull5x5E2x5, "eleFull5x5E2x5");
99  writeValueMap(iEvent, src, eleFull5x5E5x5, "eleFull5x5E5x5");
100  writeValueMap(iEvent, src, eleFull5x5Circularity, "eleFull5x5Circularity");
101 }
const MultiTokenT< edm::View< reco::GsfElectron > > src_
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
void writeValueMap(edm::Event &iEvent, const edm::Handle< HandleType > &handle, const std::vector< ValueType > &values, const std::string &label)
Definition: Utils.h:13
T sqrt(T t)
Definition: SSEVec.h:18
const MultiTokenT< EcalRecHitCollection > eeRecHits_
edm::Handle< T > getValidHandle(const edm::Event &iEvent) const
Definition: MultiToken.h:95
std::vector< float > localCovariances(const reco::BasicCluster &cluster, float w0=4.7)
const MultiTokenT< EcalRecHitCollection > esRecHits_
const MultiTokenT< EcalRecHitCollection > ebRecHits_

Member Data Documentation

const MultiTokenT<EcalRecHitCollection> ElectronIDValueMapProducer::ebRecHits_
private

Definition at line 33 of file ElectronIDValueMapProducer.cc.

Referenced by produce().

const MultiTokenT<EcalRecHitCollection> ElectronIDValueMapProducer::eeRecHits_
private

Definition at line 34 of file ElectronIDValueMapProducer.cc.

Referenced by produce().

const MultiTokenT<EcalRecHitCollection> ElectronIDValueMapProducer::esRecHits_
private

Definition at line 35 of file ElectronIDValueMapProducer.cc.

Referenced by produce().

const MultiTokenT<edm::View<reco::GsfElectron> > ElectronIDValueMapProducer::src_
private

Definition at line 32 of file ElectronIDValueMapProducer.cc.

Referenced by produce().