#include <ElectronHcalHelper.h>
Definition at line 20 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),hadTower_(0) {}
ElectronHcalHelper::~ElectronHcalHelper | ( | ) |
Definition at line 109 of file ElectronHcalHelper.cc.
References cfg_, hadTower_, 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_ ; delete hadTower_; } 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(), hadTower_, ElectronHcalHelper::Configuration::hOverEConeSize, and ElectronHcalHelper::Configuration::useTowers.
Referenced by GsfElectronAlgo::checkSetup(), and ElectronSeedProducer::produce().
{ if (cfg_.hOverEConeSize==0) { return ; } if (cfg_.useTowers) { delete hadTower_ ; hadTower_ = new EgammaHadTower(es) ; } else { 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, |
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.
{ if (cfg_.hOverEConeSize==0) { return 0 ; } if (cfg_.useTowers) { return(hcalESumDepth1(sc,excludeTowers)+hcalESumDepth2(sc,excludeTowers)) ; } else { return hcalIso_->getHcalESum(&sc) ; } }
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().
{ if (cfg_.hOverEConeSize==0) { return 0 ; } if (cfg_.useTowers) { return towerIso1_->getTowerESum(&sc, excludeTowers) ; } else { return hcalIso_->getHcalESumDepth1(&sc) ; } }
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().
{ return hadTower_->getDepth1HcalESum(towers) ; }
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().
{ if (cfg_.hOverEConeSize==0) { return 0 ; } if (cfg_.useTowers) { return towerIso2_->getTowerESum(&sc, excludeTowers) ; } else { return hcalIso_->getHcalESumDepth2(&sc) ; } }
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().
{ return hadTower_->getDepth2HcalESum(towers) ; }
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().
double ElectronHcalHelper::hOverEConeSize | ( | ) | const [inline] |
Definition at line 50 of file ElectronHcalHelper.h.
References cfg_, and ElectronHcalHelper::Configuration::hOverEConeSize.
{ return cfg_.hOverEConeSize ; }
void ElectronHcalHelper::readEvent | ( | 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_, edm::Handle< T >::product(), EgammaHadTower::setTowerCollection(), 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 ; } hadTower_->setTowerCollection(towersH_->product()); 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 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] |
Definition at line 59 of file ElectronHcalHelper.h.
Referenced by checkSetup(), hcalESum(), hcalESumDepth1(), hcalESumDepth2(), hOverEConeSize(), readEvent(), and ~ElectronHcalHelper().
EgammaHadTower* ElectronHcalHelper::hadTower_ [private] |
Definition at line 74 of file ElectronHcalHelper.h.
Referenced by checkSetup(), hcalESumDepth1BehindClusters(), hcalESumDepth2BehindClusters(), hcalTowersBehindClusters(), readEvent(), and ~ElectronHcalHelper().
edm::Handle<HBHERecHitCollection>* ElectronHcalHelper::hbhe_ [private] |
Definition at line 66 of file ElectronHcalHelper.h.
Referenced by readEvent(), and ~ElectronHcalHelper().
EgammaHcalIsolation* ElectronHcalHelper::hcalIso_ [private] |
Definition at line 68 of file ElectronHcalHelper.h.
Referenced by hcalESum(), hcalESumDepth1(), hcalESumDepth2(), readEvent(), and ~ElectronHcalHelper().
Definition at line 67 of file ElectronHcalHelper.h.
Referenced by readEvent(), and ~ElectronHcalHelper().
Definition at line 72 of file ElectronHcalHelper.h.
Referenced by hcalESumDepth1(), readEvent(), and ~ElectronHcalHelper().
Definition at line 73 of file ElectronHcalHelper.h.
Referenced by hcalESumDepth2(), readEvent(), and ~ElectronHcalHelper().
Definition at line 71 of file ElectronHcalHelper.h.
Referenced by readEvent(), and ~ElectronHcalHelper().