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 &, const std::vector< CaloTowerDetId > *excludeTowers=0)
 
double hcalESumDepth1 (const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=0)
 
double hcalESumDepth1BehindClusters (const std::vector< CaloTowerDetId > &towers)
 
double hcalESumDepth2 (const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=0)
 
double hcalESumDepth2BehindClusters (const std::vector< CaloTowerDetId > &towers)
 
std::vector< CaloTowerDetIdhcalTowersBehindClusters (const reco::SuperCluster &sc)
 
double hOverEConeSize () const
 
void readEvent (const edm::Event &)
 
 ~ElectronHcalHelper ()
 

Private Attributes

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

Detailed Description

Definition at line 20 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),hadTower_(0)
13  {}
EgammaTowerIsolation * towerIso1_
edm::Handle< HBHERecHitCollection > * hbhe_
edm::Handle< CaloTowerCollection > * towersH_
const Configuration cfg_
unsigned long long caloGeomCacheId_
EgammaHcalIsolation * hcalIso_
HBHERecHitMetaCollection * mhbhe_
EgammaHadTower * hadTower_
EgammaTowerIsolation * towerIso2_
ElectronHcalHelper::~ElectronHcalHelper ( )

Definition at line 109 of file ElectronHcalHelper.cc.

References cfg_, hadTower_, hbhe_, hcalIso_, ElectronHcalHelper::Configuration::hOverEConeSize, mhbhe_, hitfit::return, towerIso1_, towerIso2_, towersH_, and ElectronHcalHelper::Configuration::useTowers.

110  {
111  if (cfg_.hOverEConeSize==0)
112  { return ; }
113  if (cfg_.useTowers)
114  {
115  delete towerIso1_ ;
116  delete towerIso2_ ;
117  delete towersH_ ;
118  delete hadTower_;
119  }
120  else
121  {
122  delete hcalIso_ ;
123  delete mhbhe_ ;
124  delete hbhe_ ;
125  }
126  }
EgammaTowerIsolation * towerIso1_
edm::Handle< HBHERecHitCollection > * hbhe_
edm::Handle< CaloTowerCollection > * towersH_
const Configuration cfg_
EgammaHcalIsolation * hcalIso_
HBHERecHitMetaCollection * mhbhe_
EgammaHadTower * hadTower_
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(), hadTower_, ElectronHcalHelper::Configuration::hOverEConeSize, hitfit::return, and ElectronHcalHelper::Configuration::useTowers.

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

16  {
17 
18  if (cfg_.hOverEConeSize==0)
19  { return ; }
20 
21  if (cfg_.useTowers)
22  {
23  delete hadTower_ ;
24  hadTower_ = new EgammaHadTower(es) ;
25  }
26  else
27  {
28  unsigned long long newCaloGeomCacheId_
29  = es.get<CaloGeometryRecord>().cacheIdentifier() ;
30  if (caloGeomCacheId_!=newCaloGeomCacheId_)
31  {
32  caloGeomCacheId_ = newCaloGeomCacheId_ ;
33  es.get<CaloGeometryRecord>().get(caloGeom_) ;
34  }
35  }
36  }
const Configuration cfg_
edm::ESHandle< CaloGeometry > caloGeom_
unsigned long long caloGeomCacheId_
const T & get() const
Definition: EventSetup.h:55
EgammaHadTower * hadTower_
double ElectronHcalHelper::hcalESum ( const reco::SuperCluster sc,
const std::vector< CaloTowerDetId > *  excludeTowers = 0 
)

Definition at line 79 of file ElectronHcalHelper.cc.

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

80  {
81  if (cfg_.hOverEConeSize==0)
82  { return 0 ; }
83  if (cfg_.useTowers)
84  { return(hcalESumDepth1(sc,excludeTowers)+hcalESumDepth2(sc,excludeTowers)) ; }
85  else
86  { return hcalIso_->getHcalESum(&sc) ; }
87  }
const Configuration cfg_
double hcalESumDepth2(const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=0)
EgammaHcalIsolation * hcalIso_
double getHcalESum(const reco::Candidate *c) const
double hcalESumDepth1(const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=0)
double ElectronHcalHelper::hcalESumDepth1 ( const reco::SuperCluster sc,
const std::vector< CaloTowerDetId > *  excludeTowers = 0 
)

Definition at line 89 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().

90  {
91  if (cfg_.hOverEConeSize==0)
92  { return 0 ; }
93  if (cfg_.useTowers)
94  { return towerIso1_->getTowerESum(&sc, excludeTowers) ; }
95  else
96  { return hcalIso_->getHcalESumDepth1(&sc) ; }
97  }
EgammaTowerIsolation * towerIso1_
const Configuration cfg_
double getTowerESum(const reco::Candidate *, const std::vector< CaloTowerDetId > *detIdToExclude=0) const
EgammaHcalIsolation * hcalIso_
double getHcalESumDepth1(const reco::Candidate *c) const
double ElectronHcalHelper::hcalESumDepth1BehindClusters ( const std::vector< CaloTowerDetId > &  towers)

Definition at line 73 of file ElectronHcalHelper.cc.

References EgammaHadTower::getDepth1HcalESum(), and hadTower_.

Referenced by GsfElectronAlgo::calculateShowerShape(), and EgammaHLTBcHcalIsolationProducersRegional::produce().

74  { return hadTower_->getDepth1HcalESum(towers) ; }
double getDepth1HcalESum(const reco::SuperCluster &sc) const
EgammaHadTower * hadTower_
double ElectronHcalHelper::hcalESumDepth2 ( const reco::SuperCluster sc,
const std::vector< CaloTowerDetId > *  excludeTowers = 0 
)

Definition at line 99 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().

100  {
101  if (cfg_.hOverEConeSize==0)
102  { return 0 ; }
103  if (cfg_.useTowers)
104  { return towerIso2_->getTowerESum(&sc, excludeTowers) ; }
105  else
106  { return hcalIso_->getHcalESumDepth2(&sc) ; }
107  }
const Configuration cfg_
double getHcalESumDepth2(const reco::Candidate *c) const
double getTowerESum(const reco::Candidate *, const std::vector< CaloTowerDetId > *detIdToExclude=0) const
EgammaHcalIsolation * hcalIso_
EgammaTowerIsolation * towerIso2_
double ElectronHcalHelper::hcalESumDepth2BehindClusters ( const std::vector< CaloTowerDetId > &  towers)

Definition at line 76 of file ElectronHcalHelper.cc.

References EgammaHadTower::getDepth2HcalESum(), and hadTower_.

Referenced by GsfElectronAlgo::calculateShowerShape(), and EgammaHLTBcHcalIsolationProducersRegional::produce().

77  { return hadTower_->getDepth2HcalESum(towers) ; }
double getDepth2HcalESum(const reco::SuperCluster &sc) const
EgammaHadTower * hadTower_
std::vector< CaloTowerDetId > ElectronHcalHelper::hcalTowersBehindClusters ( const reco::SuperCluster sc)

Definition at line 70 of file ElectronHcalHelper.cc.

References hadTower_, and EgammaHadTower::towersOf().

Referenced by GsfElectronAlgo::calculateShowerShape(), and EgammaHLTBcHcalIsolationProducersRegional::produce().

71  { return hadTower_->towersOf(sc) ; }
std::vector< CaloTowerDetId > towersOf(const reco::SuperCluster &sc) const
EgammaHadTower * hadTower_
double ElectronHcalHelper::hOverEConeSize ( ) const
inline
void ElectronHcalHelper::readEvent ( const edm::Event evt)

Definition at line 38 of file ElectronHcalHelper.cc.

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

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

39  {
40  if (cfg_.hOverEConeSize==0)
41  { return ; }
42 
43  if (cfg_.useTowers)
44  {
45  delete towerIso1_ ; towerIso1_ = 0 ;
46  delete towerIso2_ ; towerIso2_ = 0 ;
47  delete towersH_ ; towersH_ = 0 ;
48 
51  { edm::LogError("ElectronHcalHelper::readEvent")<<"failed to get the hcal towers of label "<<cfg_.hcalTowers ; }
55  }
56  else
57  {
58  delete hcalIso_ ; hcalIso_ = 0 ;
59  delete mhbhe_ ; mhbhe_ = 0 ;
60  delete hbhe_ ; hbhe_ = 0 ;
61 
63  if (!evt.getByLabel(cfg_.hcalRecHits,*hbhe_))
64  { edm::LogError("ElectronHcalHelper::readEvent")<<"failed to get the rechits of label "<<cfg_.hcalRecHits ; }
67  }
68  }
EgammaTowerIsolation * towerIso1_
edm::Handle< HBHERecHitCollection > * hbhe_
edm::Handle< CaloTowerCollection > * towersH_
const Configuration cfg_
void setTowerCollection(const CaloTowerCollection *towercollection)
edm::ESHandle< CaloGeometry > caloGeom_
SimpleCaloRecHitMetaCollection< HBHERecHitCollection > HBHERecHitMetaCollection
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
EgammaHcalIsolation * hcalIso_
HBHERecHitMetaCollection * mhbhe_
EgammaHadTower * hadTower_
EgammaTowerIsolation * towerIso2_

Member Data Documentation

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

Definition at line 63 of file ElectronHcalHelper.h.

Referenced by checkSetup(), and readEvent().

unsigned long long ElectronHcalHelper::caloGeomCacheId_
private

Definition at line 62 of file ElectronHcalHelper.h.

Referenced by checkSetup().

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

Definition at line 66 of file ElectronHcalHelper.h.

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

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

Definition at line 67 of file ElectronHcalHelper.h.

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

EgammaTowerIsolation* ElectronHcalHelper::towerIso1_
private

Definition at line 72 of file ElectronHcalHelper.h.

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

EgammaTowerIsolation* ElectronHcalHelper::towerIso2_
private

Definition at line 73 of file ElectronHcalHelper.h.

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

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

Definition at line 71 of file ElectronHcalHelper.h.

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