#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< CaloGeometry > | caloGeom_ |
unsigned long long | caloGeomCacheId_ |
const Configuration | cfg_ |
edm::Handle < HBHERecHitCollection > * | hbhe_ |
EgammaHcalIsolation * | hcalIso_ |
HBHERecHitMetaCollection * | mhbhe_ |
EgammaTowerIsolation * | towerIso1_ |
EgammaTowerIsolation * | towerIso2_ |
edm::Handle < CaloTowerCollection > * | towersH_ |
Definition at line 18 of file ElectronHcalHelper.h.
ElectronHcalHelper::ElectronHcalHelper | ( | const Configuration & | cfg | ) |
Definition at line 11 of file ElectronHcalHelper.cc.
: cfg_(cfg), caloGeomCacheId_(0), hbhe_(0), mhbhe_(0), hcalIso_(0), towersH_(0), towerIso1_(0), towerIso2_(0) {}
ElectronHcalHelper::~ElectronHcalHelper | ( | ) |
Definition at line 93 of file ElectronHcalHelper.cc.
References cfg_, hbhe_, hcalIso_, ElectronHcalHelper::Configuration::hOverEConeSize, mhbhe_, towerIso1_, towerIso2_, towersH_, and ElectronHcalHelper::Configuration::useTowers.
{ if (cfg_.hOverEConeSize==0) { return ; } if (cfg_.useTowers) { delete towerIso1_ ; delete towerIso2_ ; delete towersH_ ; } else { delete hcalIso_ ; delete mhbhe_ ; delete hbhe_ ; } }
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, and ElectronHcalHelper::Configuration::useTowers.
Referenced by GsfElectronAlgo::checkSetup(), and ElectronSeedProducer::produce().
{ if (cfg_.hOverEConeSize==0) { return ; } if (!cfg_.useTowers) { unsigned long long newCaloGeomCacheId_ = es.get<CaloGeometryRecord>().cacheIdentifier() ; if (caloGeomCacheId_!=newCaloGeomCacheId_) { caloGeomCacheId_ = newCaloGeomCacheId_ ; es.get<CaloGeometryRecord>().get(caloGeom_) ; } } }
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.
{ if (cfg_.hOverEConeSize==0) { return 0 ; } if (cfg_.useTowers) { return(hcalESumDepth1(sc)+hcalESumDepth2(sc)) ; } else { return hcalIso_->getHcalESum(&sc) ; } }
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().
{ if (cfg_.hOverEConeSize==0) { return 0 ; } if (cfg_.useTowers) { return towerIso1_->getTowerESum(&sc) ; } else { return hcalIso_->getHcalESumDepth1(&sc) ; } }
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().
{ if (cfg_.hOverEConeSize==0) { return 0 ; } if (cfg_.useTowers) { return towerIso2_->getTowerESum(&sc) ; } else { return hcalIso_->getHcalESumDepth2(&sc) ; } }
double ElectronHcalHelper::hOverEConeSize | ( | ) | const [inline] |
Definition at line 48 of file ElectronHcalHelper.h.
References cfg_, and ElectronHcalHelper::Configuration::hOverEConeSize.
{ return cfg_.hOverEConeSize ; }
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_, edm::Handle< T >::product(), towerIso1_, towerIso2_, towersH_, and ElectronHcalHelper::Configuration::useTowers.
Referenced by GsfElectronAlgo::beginEvent(), and ElectronSeedProducer::produce().
{ if (cfg_.hOverEConeSize==0) { return ; } if (cfg_.useTowers) { delete towerIso1_ ; towerIso1_ = 0 ; delete towerIso2_ ; towerIso2_ = 0 ; delete towersH_ ; towersH_ = 0 ; towersH_ = new edm::Handle<CaloTowerCollection>() ; if (!evt.getByLabel(cfg_.hcalTowers,*towersH_)) { edm::LogError("ElectronHcalHelper::readEvent")<<"failed to get the hcal towers of label "<<cfg_.hcalTowers ; } towerIso1_ = new EgammaTowerIsolation(cfg_.hOverEConeSize,0.,cfg_.hOverEPtMin,1,towersH_->product()) ; towerIso2_ = new EgammaTowerIsolation(cfg_.hOverEConeSize,0.,cfg_.hOverEPtMin,2,towersH_->product()) ; } else { delete hcalIso_ ; hcalIso_ = 0 ; delete mhbhe_ ; mhbhe_ = 0 ; delete hbhe_ ; hbhe_ = 0 ; hbhe_= new edm::Handle<HBHERecHitCollection>() ; if (!evt.getByLabel(cfg_.hcalRecHits,*hbhe_)) { edm::LogError("ElectronHcalHelper::readEvent")<<"failed to get the rechits of label "<<cfg_.hcalRecHits ; } mhbhe_= new HBHERecHitMetaCollection(**hbhe_) ; hcalIso_ = new EgammaHcalIsolation(cfg_.hOverEConeSize,0.,cfg_.hOverEHBMinE,cfg_.hOverEHFMinE,0.,0.,caloGeom_,mhbhe_) ; } }
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] |
Definition at line 53 of file ElectronHcalHelper.h.
Referenced by checkSetup(), hcalESum(), hcalESumDepth1(), hcalESumDepth2(), hOverEConeSize(), readEvent(), and ~ElectronHcalHelper().
edm::Handle<HBHERecHitCollection>* ElectronHcalHelper::hbhe_ [private] |
Definition at line 60 of file ElectronHcalHelper.h.
Referenced by readEvent(), and ~ElectronHcalHelper().
EgammaHcalIsolation* ElectronHcalHelper::hcalIso_ [private] |
Definition at line 62 of file ElectronHcalHelper.h.
Referenced by hcalESum(), hcalESumDepth1(), hcalESumDepth2(), readEvent(), and ~ElectronHcalHelper().
Definition at line 61 of file ElectronHcalHelper.h.
Referenced by readEvent(), and ~ElectronHcalHelper().
Definition at line 66 of file ElectronHcalHelper.h.
Referenced by hcalESumDepth1(), readEvent(), and ~ElectronHcalHelper().
Definition at line 67 of file ElectronHcalHelper.h.
Referenced by hcalESumDepth2(), readEvent(), and ~ElectronHcalHelper().
Definition at line 65 of file ElectronHcalHelper.h.
Referenced by readEvent(), and ~ElectronHcalHelper().