CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
ElectronIDValueMapProducer Class Reference
Inheritance diagram for ElectronIDValueMapProducer:
edm::stream::EDProducer<>

Public Member Functions

 ElectronIDValueMapProducer (const edm::ParameterSet &)
 
 ~ElectronIDValueMapProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

MultiTokenT< EcalRecHitCollectionebRecHits_
 
MultiTokenT< EcalRecHitCollectioneeRecHits_
 
MultiTokenT< EcalRecHitCollectionesRecHits_
 
std::unique_ptr< noZS::EcalClusterLazyToolslazyToolnoZS
 
MultiTokenT< edm::View< reco::GsfElectron > > src_
 

Static Private Attributes

static char eleFull5x5Circularity_ [] = "eleFull5x5Circularity"
 
static char eleFull5x5E1x5_ [] = "eleFull5x5E1x5"
 
static char eleFull5x5E2x5_ [] = "eleFull5x5E2x5"
 
static char eleFull5x5E5x5_ [] = "eleFull5x5E5x5"
 
static char eleFull5x5R9_ [] = "eleFull5x5R9"
 
static char eleFull5x5SigmaIEtaIEta_ [] = "eleFull5x5SigmaIEtaIEta"
 
static char eleFull5x5SigmaIEtaIPhi_ [] = "eleFull5x5SigmaIEtaIPhi"
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 24 of file ElectronIDValueMapProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 54 of file ElectronIDValueMapProducer.cc.

References eleFull5x5Circularity_, eleFull5x5E1x5_, eleFull5x5E2x5_, eleFull5x5E5x5_, eleFull5x5R9_, eleFull5x5SigmaIEtaIEta_, and eleFull5x5SigmaIEtaIPhi_.

56  : src_ ( consumesCollector(), iConfig, "src", "srcMiniAOD")
57  , ebRecHits_(src_, consumesCollector(), iConfig, "ebReducedRecHitCollection", "ebReducedRecHitCollectionMiniAOD")
58  , eeRecHits_(src_, consumesCollector(), iConfig, "eeReducedRecHitCollection", "eeReducedRecHitCollectionMiniAOD")
59  , esRecHits_(src_, consumesCollector(), iConfig, "esReducedRecHitCollection", "esReducedRecHitCollectionMiniAOD")
60 {
61 
62  produces<edm::ValueMap<float> >(eleFull5x5SigmaIEtaIEta_);
63  produces<edm::ValueMap<float> >(eleFull5x5SigmaIEtaIPhi_);
64  produces<edm::ValueMap<float> >(eleFull5x5E1x5_);
65  produces<edm::ValueMap<float> >(eleFull5x5E2x5_);
66  produces<edm::ValueMap<float> >(eleFull5x5E5x5_);
67  produces<edm::ValueMap<float> >(eleFull5x5R9_);
68  produces<edm::ValueMap<float> >(eleFull5x5Circularity_);
69 
70 }
MultiTokenT< EcalRecHitCollection > ebRecHits_
MultiTokenT< EcalRecHitCollection > esRecHits_
MultiTokenT< edm::View< reco::GsfElectron > > src_
MultiTokenT< EcalRecHitCollection > eeRecHits_
ElectronIDValueMapProducer::~ElectronIDValueMapProducer ( )
override

Definition at line 72 of file ElectronIDValueMapProducer.cc.

72  {
73 }

Member Function Documentation

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

Definition at line 121 of file ElectronIDValueMapProducer.cc.

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

121  {
122  // electronIDValueMapProducer
124  desc.add<edm::InputTag>("src", edm::InputTag("gedGsfElectrons"));
125  desc.add<edm::InputTag>("srcMiniAOD", edm::InputTag("slimmedElectrons","","@skipCurrentProcess"));
126  desc.add<edm::InputTag>("ebReducedRecHitCollection", edm::InputTag("reducedEcalRecHitsEB"));
127  desc.add<edm::InputTag>("eeReducedRecHitCollection", edm::InputTag("reducedEcalRecHitsEE"));
128  desc.add<edm::InputTag>("esReducedRecHitCollection", edm::InputTag("reducedEcalRecHitsES"));
129  desc.add<edm::InputTag>("ebReducedRecHitCollectionMiniAOD", edm::InputTag("reducedEgamma","reducedEBRecHits"));
130  desc.add<edm::InputTag>("eeReducedRecHitCollectionMiniAOD", edm::InputTag("reducedEgamma","reducedEERecHits"));
131  desc.add<edm::InputTag>("esReducedRecHitCollectionMiniAOD", edm::InputTag("reducedEgamma","reducedESRecHits"));
132  descriptions.add("electronIDValueMapProducer", desc);
133 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void ElectronIDValueMapProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 75 of file ElectronIDValueMapProducer.cc.

References heepElectronID_HEEPV50_CSA14_25ns_cff::e1x5, heepElectronID_HEEPV50_CSA14_25ns_cff::e2x5, heepElectronID_HEEPV50_CSA14_25ns_cff::e5x5, ebRecHits_, eeRecHits_, eleFull5x5Circularity_, eleFull5x5E1x5_, eleFull5x5E2x5_, eleFull5x5E5x5_, eleFull5x5R9_, eleFull5x5SigmaIEtaIEta_, eleFull5x5SigmaIEtaIPhi_, esRecHits_, MultiTokenT< T >::getValidHandle(), iEvent, edm::detail::isnan(), lazyToolnoZS, mathSSE::sqrt(), TrackRefitter_38T_cff::src, src_, and writeValueMap().

75  {
76 
77  // Get handle on electrons
78  auto src = src_.getValidHandle(iEvent);
79 
80  lazyToolnoZS = std::make_unique<noZS::EcalClusterLazyTools>(iEvent, iSetup,
81  ebRecHits_.get(iEvent),
82  eeRecHits_.get(iEvent),
83  esRecHits_.get(iEvent));
84 
85  // size_t n = src->size();
86  std::vector<float> eleFull5x5SigmaIEtaIEta, eleFull5x5SigmaIEtaIPhi;
87  std::vector<float> eleFull5x5R9, eleFull5x5Circularity;
88  std::vector<float> eleFull5x5E1x5,eleFull5x5E2x5,eleFull5x5E5x5;
89 
90  // reco::GsfElectron::superCluster() is virtual so we can exploit polymorphism
91  for (const auto &ele : *src) {
92  const auto& theseed = *(ele.superCluster()->seed());
93 
94  std::vector<float> vCov = lazyToolnoZS->localCovariances( theseed );
95  const float see = (isnan(vCov[0]) ? 0. : sqrt(vCov[0]));
96  const float sep = vCov[1];
97  eleFull5x5SigmaIEtaIEta.push_back(see);
98  eleFull5x5SigmaIEtaIPhi.push_back(sep);
99  eleFull5x5R9.push_back(lazyToolnoZS->e3x3( theseed ) / ele.superCluster()->rawEnergy() );
100 
101  const float e1x5 = lazyToolnoZS->e1x5( theseed );
102  const float e2x5 = lazyToolnoZS->e2x5Max( theseed );
103  const float e5x5 = lazyToolnoZS->e5x5( theseed );
104  const float circularity = (e5x5 != 0.) ? 1.-e1x5/e5x5 : -1;
105 
106  eleFull5x5E1x5.push_back(e1x5);
107  eleFull5x5E2x5.push_back(e2x5);
108  eleFull5x5E5x5.push_back(e5x5);
109  eleFull5x5Circularity.push_back(circularity);
110  }
111 
112  writeValueMap(iEvent, src, eleFull5x5SigmaIEtaIEta, eleFull5x5SigmaIEtaIEta_);
113  writeValueMap(iEvent, src, eleFull5x5SigmaIEtaIPhi, eleFull5x5SigmaIEtaIPhi_);
114  writeValueMap(iEvent, src, eleFull5x5R9, eleFull5x5R9_);
115  writeValueMap(iEvent, src, eleFull5x5E1x5, eleFull5x5E1x5_);
116  writeValueMap(iEvent, src, eleFull5x5E2x5, eleFull5x5E2x5_);
117  writeValueMap(iEvent, src, eleFull5x5E5x5, eleFull5x5E5x5_);
118  writeValueMap(iEvent, src, eleFull5x5Circularity, eleFull5x5Circularity_);
119 }
std::unique_ptr< noZS::EcalClusterLazyTools > lazyToolnoZS
MultiTokenT< EcalRecHitCollection > ebRecHits_
void writeValueMap(edm::Event &iEvent, const edm::Handle< HandleType > &handle, const std::vector< ValueType > &values, const std::string &label)
Definition: Utils.h:13
int iEvent
Definition: GenABIO.cc:230
bool isnan(float x)
Definition: math.h:13
T sqrt(T t)
Definition: SSEVec.h:18
edm::Handle< T > getValidHandle(const edm::Event &iEvent)
Definition: MultiToken.h:83
MultiTokenT< EcalRecHitCollection > esRecHits_
MultiTokenT< edm::View< reco::GsfElectron > > src_
MultiTokenT< EcalRecHitCollection > eeRecHits_

Member Data Documentation

MultiTokenT<EcalRecHitCollection> ElectronIDValueMapProducer::ebRecHits_
private

Definition at line 41 of file ElectronIDValueMapProducer.cc.

Referenced by produce().

MultiTokenT<EcalRecHitCollection> ElectronIDValueMapProducer::eeRecHits_
private

Definition at line 42 of file ElectronIDValueMapProducer.cc.

Referenced by produce().

char ElectronIDValueMapProducer::eleFull5x5Circularity_[] = "eleFull5x5Circularity"
staticprivate

Definition at line 51 of file ElectronIDValueMapProducer.cc.

Referenced by ElectronIDValueMapProducer(), and produce().

char ElectronIDValueMapProducer::eleFull5x5E1x5_[] = "eleFull5x5E1x5"
staticprivate

Definition at line 47 of file ElectronIDValueMapProducer.cc.

Referenced by ElectronIDValueMapProducer(), and produce().

char ElectronIDValueMapProducer::eleFull5x5E2x5_[] = "eleFull5x5E2x5"
staticprivate

Definition at line 48 of file ElectronIDValueMapProducer.cc.

Referenced by ElectronIDValueMapProducer(), and produce().

char ElectronIDValueMapProducer::eleFull5x5E5x5_[] = "eleFull5x5E5x5"
staticprivate

Definition at line 49 of file ElectronIDValueMapProducer.cc.

Referenced by ElectronIDValueMapProducer(), and produce().

char ElectronIDValueMapProducer::eleFull5x5R9_[] = "eleFull5x5R9"
staticprivate

Definition at line 50 of file ElectronIDValueMapProducer.cc.

Referenced by ElectronIDValueMapProducer(), and produce().

char ElectronIDValueMapProducer::eleFull5x5SigmaIEtaIEta_[] = "eleFull5x5SigmaIEtaIEta"
staticprivate

Definition at line 45 of file ElectronIDValueMapProducer.cc.

Referenced by ElectronIDValueMapProducer(), and produce().

char ElectronIDValueMapProducer::eleFull5x5SigmaIEtaIPhi_[] = "eleFull5x5SigmaIEtaIPhi"
staticprivate

Definition at line 46 of file ElectronIDValueMapProducer.cc.

Referenced by ElectronIDValueMapProducer(), and produce().

MultiTokenT<EcalRecHitCollection> ElectronIDValueMapProducer::esRecHits_
private

Definition at line 43 of file ElectronIDValueMapProducer.cc.

Referenced by produce().

std::unique_ptr<noZS::EcalClusterLazyTools> ElectronIDValueMapProducer::lazyToolnoZS
private

Definition at line 37 of file ElectronIDValueMapProducer.cc.

Referenced by produce().

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

Definition at line 40 of file ElectronIDValueMapProducer.cc.

Referenced by produce().