test
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_
 
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.

13 { }
EgammaTowerIsolation * towerIso1_
tuple cfg
Definition: looper.py:293
const Configuration cfg_
unsigned long long caloGeomCacheId_
EgammaHcalIsolation * hcalIso_
EgammaHadTower * hadTower_
EgammaTowerIsolation * towerIso2_
ElectronHcalHelper::~ElectronHcalHelper ( )

Definition at line 110 of file ElectronHcalHelper.cc.

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

111  {
112  if (cfg_.hOverEConeSize==0)
113  { return ; }
114  if (cfg_.useTowers)
115  {
116  delete towerIso1_ ;
117  delete towerIso2_ ;
118  delete hadTower_;
119  }
120  else
121  {
122  delete hcalIso_ ;
123  }
124  }
EgammaTowerIsolation * towerIso1_
const Configuration cfg_
EgammaHcalIsolation * hcalIso_
return(e1-e2)*(e1-e2)+dp *dp
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:56
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 80 of file ElectronHcalHelper.cc.

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

Referenced by EgammaHLTBcHcalIsolationProducersRegional::produce().

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

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

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

91  {
92  if (cfg_.hOverEConeSize==0)
93  { return 0 ; }
94  if (cfg_.useTowers)
95  { return towerIso1_->getTowerESum(&sc, excludeTowers) ; }
96  else
97  { return hcalIso_->getHcalESumDepth1(&sc) ; }
98  }
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)
double ElectronHcalHelper::hcalESumDepth2 ( const reco::SuperCluster sc,
const std::vector< CaloTowerDetId > *  excludeTowers = 0 
)

Definition at line 100 of file ElectronHcalHelper.cc.

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

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

101  {
102  if (cfg_.hOverEConeSize==0)
103  { return 0 ; }
104  if (cfg_.useTowers)
105  { return towerIso2_->getTowerESum(&sc, excludeTowers) ; }
106  else
107  { return hcalIso_->getHcalESumDepth2(&sc) ; }
108  }
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)
std::vector< CaloTowerDetId > ElectronHcalHelper::hcalTowersBehindClusters ( const reco::SuperCluster sc)

Definition at line 71 of file ElectronHcalHelper.cc.

References hadTower_, and EgammaHadTower::towersOf().

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

72  { 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, 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 
62  if (!evt.getByToken(cfg_.hcalRecHits,hbhe_)) {
63  edm::LogError("ElectronHcalHelper::readEvent")
64  <<"failed to get the rechits";
65  }
66 
68  }
69  }
EgammaTowerIsolation * towerIso1_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
const Configuration cfg_
void setTowerCollection(const CaloTowerCollection *towercollection)
edm::ESHandle< CaloGeometry > caloGeom_
edm::EDGetTokenT< HBHERecHitCollection > hcalRecHits
T const * product() const
Definition: Handle.h:81
EgammaHcalIsolation * hcalIso_
return(e1-e2)*(e1-e2)+dp *dp
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
EgammaTowerIsolation* ElectronHcalHelper::towerIso1_
private

Definition at line 68 of file ElectronHcalHelper.h.

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

EgammaTowerIsolation* ElectronHcalHelper::towerIso2_
private

Definition at line 69 of file ElectronHcalHelper.h.

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