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_
 
EgammaHcalIsolationhcalIso_
 
HBHERecHitMetaCollectionmhbhe_
 
EgammaTowerIsolationtowerIso1_
 
EgammaTowerIsolationtowerIso2_
 

Detailed Description

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

Definition at line 111 of file ElectronHcalHelper.cc.

References cfg_, hadTower_, hcalIso_, ElectronHcalHelper::Configuration::hOverEConeSize, mhbhe_, reco::return(), towerIso1_, towerIso2_, and ElectronHcalHelper::Configuration::useTowers.

112  {
113  if (cfg_.hOverEConeSize==0)
114  { return ; }
115  if (cfg_.useTowers)
116  {
117  delete towerIso1_ ;
118  delete towerIso2_ ;
119  delete hadTower_;
120  }
121  else
122  {
123  delete hcalIso_ ;
124  delete mhbhe_ ;
125  }
126  }
EgammaTowerIsolation * towerIso1_
const Configuration cfg_
EgammaHcalIsolation * hcalIso_
return(e1-e2)*(e1-e2)+dp *dp
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, reco::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
return(e1-e2)*(e1-e2)+dp *dp
EgammaHadTower * hadTower_
double ElectronHcalHelper::hcalESum ( const reco::SuperCluster sc,
const std::vector< CaloTowerDetId > *  excludeTowers = 0 
)

Definition at line 81 of file ElectronHcalHelper.cc.

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

Referenced by EgammaHLTBcHcalIsolationProducersRegional::produce().

82  {
83  if (cfg_.hOverEConeSize==0)
84  { return 0 ; }
85  if (cfg_.useTowers)
86  { return(hcalESumDepth1(sc,excludeTowers)+hcalESumDepth2(sc,excludeTowers)) ; }
87  else
88  { return hcalIso_->getHcalESum(&sc) ; }
89  }
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 91 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().

92  {
93  if (cfg_.hOverEConeSize==0)
94  { return 0 ; }
95  if (cfg_.useTowers)
96  { return towerIso1_->getTowerESum(&sc, excludeTowers) ; }
97  else
98  { return hcalIso_->getHcalESumDepth1(&sc) ; }
99  }
EgammaTowerIsolation * towerIso1_
const Configuration cfg_
double getTowerESum(const reco::Candidate *cand, 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 75 of file ElectronHcalHelper.cc.

References EgammaHadTower::getDepth1HcalESum(), and hadTower_.

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

76  { 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 101 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().

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

Definition at line 78 of file ElectronHcalHelper.cc.

References EgammaHadTower::getDepth2HcalESum(), and hadTower_.

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

79  { 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 72 of file ElectronHcalHelper.cc.

References hadTower_, and EgammaHadTower::towersOf().

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

73  { 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::getByToken(), hadTower_, hcalIso_, ElectronHcalHelper::Configuration::hcalRecHits, ElectronHcalHelper::Configuration::hcalTowers, ElectronHcalHelper::Configuration::hOverEConeSize, ElectronHcalHelper::Configuration::hOverEHBMinE, ElectronHcalHelper::Configuration::hOverEHFMinE, ElectronHcalHelper::Configuration::hOverEPtMin, mhbhe_, edm::Handle< T >::product(), reco::return(), EgammaHadTower::setTowerCollection(), towerIso1_, towerIso2_, 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 
49  if (!evt.getByToken(cfg_.hcalTowers,towersH_)){
50  edm::LogError("ElectronHcalHelper::readEvent")
51  <<"failed to get the hcal towers";
52  }
56  }
57  else
58  {
59  delete hcalIso_ ; hcalIso_ = 0 ;
60  delete mhbhe_ ; mhbhe_ = 0 ;
61 
63  if (!evt.getByToken(cfg_.hcalRecHits,hbhe_)) {
64  edm::LogError("ElectronHcalHelper::readEvent")
65  <<"failed to get the rechits";
66  }
67  mhbhe_= new HBHERecHitMetaCollection(*hbhe_) ;
69  }
70  }
EgammaTowerIsolation * towerIso1_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
const Configuration cfg_
void setTowerCollection(const CaloTowerCollection *towercollection)
edm::ESHandle< CaloGeometry > caloGeom_
edm::EDGetTokenT< HBHERecHitCollection > hcalRecHits
SimpleCaloRecHitMetaCollection< HBHERecHitCollection > HBHERecHitMetaCollection
EgammaHcalIsolation * hcalIso_
T const * product() const
Definition: Handle.h:81
return(e1-e2)*(e1-e2)+dp *dp
HBHERecHitMetaCollection * mhbhe_
EgammaHadTower * hadTower_
edm::EDGetTokenT< CaloTowerCollection > hcalTowers
EgammaTowerIsolation * towerIso2_

Member Data Documentation

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

Definition at line 62 of file ElectronHcalHelper.h.

Referenced by checkSetup(), and readEvent().

unsigned long long ElectronHcalHelper::caloGeomCacheId_
private

Definition at line 61 of file ElectronHcalHelper.h.

Referenced by checkSetup().

const Configuration ElectronHcalHelper::cfg_
private
EgammaHadTower* ElectronHcalHelper::hadTower_
private
EgammaHcalIsolation* ElectronHcalHelper::hcalIso_
private
HBHERecHitMetaCollection* ElectronHcalHelper::mhbhe_
private

Definition at line 65 of file ElectronHcalHelper.h.

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

EgammaTowerIsolation* ElectronHcalHelper::towerIso1_
private

Definition at line 69 of file ElectronHcalHelper.h.

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

EgammaTowerIsolation* ElectronHcalHelper::towerIso2_
private

Definition at line 70 of file ElectronHcalHelper.h.

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