CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Attributes
ElectronHcalHelper Class Reference

#include <ElectronHcalHelper.h>

Classes

struct  Configuration
 

Public Member Functions

void checkSetup (const edm::EventSetup &)
 
 ElectronHcalHelper (const Configuration &)
 
double hcalESum (const reco::SuperCluster &)
 
double hcalESumDepth1 (const reco::SuperCluster &)
 
double hcalESumDepth2 (const reco::SuperCluster &)
 
double hOverEConeSize () const
 
void readEvent (edm::Event &)
 
 ~ElectronHcalHelper ()
 

Private Attributes

edm::ESHandle< CaloGeometrycaloGeom_
 
unsigned long long caloGeomCacheId_
 
const Configuration cfg_
 
edm::Handle
< HBHERecHitCollection > * 
hbhe_
 
EgammaHcalIsolationhcalIso_
 
HBHERecHitMetaCollectionmhbhe_
 
EgammaTowerIsolationtowerIso1_
 
EgammaTowerIsolationtowerIso2_
 
edm::Handle
< CaloTowerCollection > * 
towersH_
 

Detailed Description

Definition at line 18 of file ElectronHcalHelper.h.

Constructor & Destructor Documentation

ElectronHcalHelper::ElectronHcalHelper ( const Configuration cfg)

Definition at line 11 of file ElectronHcalHelper.cc.

12  : cfg_(cfg), caloGeomCacheId_(0), hbhe_(0), mhbhe_(0), hcalIso_(0), towersH_(0), towerIso1_(0), towerIso2_(0)
13  {}
EgammaTowerIsolation * towerIso1_
edm::Handle< HBHERecHitCollection > * hbhe_
edm::Handle< CaloTowerCollection > * towersH_
const Configuration cfg_
unsigned long long caloGeomCacheId_
EgammaHcalIsolation * hcalIso_
HBHERecHitMetaCollection * mhbhe_
EgammaTowerIsolation * towerIso2_
ElectronHcalHelper::~ElectronHcalHelper ( )

Definition at line 93 of file ElectronHcalHelper.cc.

References cfg_, hbhe_, hcalIso_, ElectronHcalHelper::Configuration::hOverEConeSize, mhbhe_, mathSSE::return(), towerIso1_, towerIso2_, towersH_, and ElectronHcalHelper::Configuration::useTowers.

94  {
95  if (cfg_.hOverEConeSize==0)
96  { return ; }
97  if (cfg_.useTowers)
98  {
99  delete towerIso1_ ;
100  delete towerIso2_ ;
101  delete towersH_ ;
102  }
103  else
104  {
105  delete hcalIso_ ;
106  delete mhbhe_ ;
107  delete hbhe_ ;
108  }
109  }
EgammaTowerIsolation * towerIso1_
edm::Handle< HBHERecHitCollection > * hbhe_
edm::Handle< CaloTowerCollection > * towersH_
const Configuration cfg_
return((rh^lh)&mask)
EgammaHcalIsolation * hcalIso_
HBHERecHitMetaCollection * mhbhe_
EgammaTowerIsolation * towerIso2_

Member Function Documentation

void ElectronHcalHelper::checkSetup ( const edm::EventSetup es)

Definition at line 15 of file ElectronHcalHelper.cc.

References caloGeom_, caloGeomCacheId_, cfg_, edm::EventSetup::get(), ElectronHcalHelper::Configuration::hOverEConeSize, mathSSE::return(), and ElectronHcalHelper::Configuration::useTowers.

Referenced by GsfElectronAlgo::checkSetup(), and ElectronSeedProducer::produce().

16  {
17  if (cfg_.hOverEConeSize==0)
18  { return ; }
19 
20  if (!cfg_.useTowers)
21  {
22  unsigned long long newCaloGeomCacheId_
23  = es.get<CaloGeometryRecord>().cacheIdentifier() ;
24  if (caloGeomCacheId_!=newCaloGeomCacheId_)
25  {
26  caloGeomCacheId_ = newCaloGeomCacheId_ ;
27  es.get<CaloGeometryRecord>().get(caloGeom_) ;
28  }
29  }
30  }
const Configuration cfg_
return((rh^lh)&mask)
edm::ESHandle< CaloGeometry > caloGeom_
unsigned long long caloGeomCacheId_
const T & get() const
Definition: EventSetup.h:55
double ElectronHcalHelper::hcalESum ( const reco::SuperCluster sc)

Definition at line 63 of file ElectronHcalHelper.cc.

References cfg_, EgammaHcalIsolation::getHcalESum(), hcalESumDepth1(), hcalESumDepth2(), hcalIso_, ElectronHcalHelper::Configuration::hOverEConeSize, and ElectronHcalHelper::Configuration::useTowers.

64  {
65  if (cfg_.hOverEConeSize==0)
66  { return 0 ; }
67  if (cfg_.useTowers)
68  { return(hcalESumDepth1(sc)+hcalESumDepth2(sc)) ; }
69  else
70  { return hcalIso_->getHcalESum(&sc) ; }
71  }
double hcalESumDepth2(const reco::SuperCluster &)
const Configuration cfg_
EgammaHcalIsolation * hcalIso_
double getHcalESum(const reco::Candidate *c) const
double hcalESumDepth1(const reco::SuperCluster &)
double ElectronHcalHelper::hcalESumDepth1 ( const reco::SuperCluster sc)

Definition at line 73 of file ElectronHcalHelper.cc.

References cfg_, EgammaHcalIsolation::getHcalESumDepth1(), EgammaTowerIsolation::getTowerESum(), hcalIso_, ElectronHcalHelper::Configuration::hOverEConeSize, towerIso1_, and ElectronHcalHelper::Configuration::useTowers.

Referenced by GsfElectronAlgo::calculateShowerShape(), and hcalESum().

74  {
75  if (cfg_.hOverEConeSize==0)
76  { return 0 ; }
77  if (cfg_.useTowers)
78  { return towerIso1_->getTowerESum(&sc) ; }
79  else
80  { return hcalIso_->getHcalESumDepth1(&sc) ; }
81  }
EgammaTowerIsolation * towerIso1_
double getTowerESum(const reco::Candidate *) const
const Configuration cfg_
EgammaHcalIsolation * hcalIso_
double getHcalESumDepth1(const reco::Candidate *c) const
double ElectronHcalHelper::hcalESumDepth2 ( const reco::SuperCluster sc)

Definition at line 83 of file ElectronHcalHelper.cc.

References cfg_, EgammaHcalIsolation::getHcalESumDepth2(), EgammaTowerIsolation::getTowerESum(), hcalIso_, ElectronHcalHelper::Configuration::hOverEConeSize, towerIso2_, and ElectronHcalHelper::Configuration::useTowers.

Referenced by GsfElectronAlgo::calculateShowerShape(), and hcalESum().

84  {
85  if (cfg_.hOverEConeSize==0)
86  { return 0 ; }
87  if (cfg_.useTowers)
88  { return towerIso2_->getTowerESum(&sc) ; }
89  else
90  { return hcalIso_->getHcalESumDepth2(&sc) ; }
91  }
double getTowerESum(const reco::Candidate *) const
const Configuration cfg_
double getHcalESumDepth2(const reco::Candidate *c) const
EgammaHcalIsolation * hcalIso_
EgammaTowerIsolation * towerIso2_
double ElectronHcalHelper::hOverEConeSize ( ) const
inline
void ElectronHcalHelper::readEvent ( edm::Event evt)

Definition at line 32 of file ElectronHcalHelper.cc.

References caloGeom_, cfg_, edm::Event::getByLabel(), hbhe_, hcalIso_, ElectronHcalHelper::Configuration::hcalRecHits, ElectronHcalHelper::Configuration::hcalTowers, ElectronHcalHelper::Configuration::hOverEConeSize, ElectronHcalHelper::Configuration::hOverEHBMinE, ElectronHcalHelper::Configuration::hOverEHFMinE, ElectronHcalHelper::Configuration::hOverEPtMin, mhbhe_, mathSSE::return(), towerIso1_, towerIso2_, towersH_, and ElectronHcalHelper::Configuration::useTowers.

Referenced by GsfElectronAlgo::beginEvent(), and ElectronSeedProducer::produce().

33  {
34  if (cfg_.hOverEConeSize==0)
35  { return ; }
36 
37  if (cfg_.useTowers)
38  {
39  delete towerIso1_ ; towerIso1_ = 0 ;
40  delete towerIso2_ ; towerIso2_ = 0 ;
41  delete towersH_ ; towersH_ = 0 ;
42 
45  { edm::LogError("ElectronHcalHelper::readEvent")<<"failed to get the hcal towers of label "<<cfg_.hcalTowers ; }
48  }
49  else
50  {
51  delete hcalIso_ ; hcalIso_ = 0 ;
52  delete mhbhe_ ; mhbhe_ = 0 ;
53  delete hbhe_ ; hbhe_ = 0 ;
54 
56  if (!evt.getByLabel(cfg_.hcalRecHits,*hbhe_))
57  { edm::LogError("ElectronHcalHelper::readEvent")<<"failed to get the rechits of label "<<cfg_.hcalRecHits ; }
60  }
61  }
EgammaTowerIsolation * towerIso1_
edm::Handle< HBHERecHitCollection > * hbhe_
edm::Handle< CaloTowerCollection > * towersH_
const Configuration cfg_
return((rh^lh)&mask)
edm::ESHandle< CaloGeometry > caloGeom_
SimpleCaloRecHitMetaCollection< HBHERecHitCollection > HBHERecHitMetaCollection
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
EgammaHcalIsolation * hcalIso_
HBHERecHitMetaCollection * mhbhe_
EgammaTowerIsolation * towerIso2_

Member Data Documentation

edm::ESHandle<CaloGeometry> ElectronHcalHelper::caloGeom_
private

Definition at line 57 of file ElectronHcalHelper.h.

Referenced by checkSetup(), and readEvent().

unsigned long long ElectronHcalHelper::caloGeomCacheId_
private

Definition at line 56 of file ElectronHcalHelper.h.

Referenced by checkSetup().

const Configuration ElectronHcalHelper::cfg_
private
edm::Handle<HBHERecHitCollection>* ElectronHcalHelper::hbhe_
private

Definition at line 60 of file ElectronHcalHelper.h.

Referenced by readEvent(), and ~ElectronHcalHelper().

EgammaHcalIsolation* ElectronHcalHelper::hcalIso_
private
HBHERecHitMetaCollection* ElectronHcalHelper::mhbhe_
private

Definition at line 61 of file ElectronHcalHelper.h.

Referenced by readEvent(), and ~ElectronHcalHelper().

EgammaTowerIsolation* ElectronHcalHelper::towerIso1_
private

Definition at line 66 of file ElectronHcalHelper.h.

Referenced by hcalESumDepth1(), readEvent(), and ~ElectronHcalHelper().

EgammaTowerIsolation* ElectronHcalHelper::towerIso2_
private

Definition at line 67 of file ElectronHcalHelper.h.

Referenced by hcalESumDepth2(), readEvent(), and ~ElectronHcalHelper().

edm::Handle<CaloTowerCollection>* ElectronHcalHelper::towersH_
private

Definition at line 65 of file ElectronHcalHelper.h.

Referenced by readEvent(), and ~ElectronHcalHelper().