CMS 3D CMS Logo

Classes | Public Member Functions | Private Attributes

ElectronHcalHelper Class Reference

#include <ElectronHcalHelper.h>

List of all members.

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.

  : 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_ ;
   }
 }

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, and ElectronHcalHelper::Configuration::useTowers.

Referenced by GsfElectronAlgo::checkSetup(), ElectronSeedProducer::produce(), and EgammaHLTBcHcalIsolationProducersRegional::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 
)
double ElectronHcalHelper::hcalESumDepth1 ( const reco::SuperCluster sc,
const std::vector< CaloTowerDetId > *  excludeTowers = 0 
)
double ElectronHcalHelper::hcalESumDepth1BehindClusters ( const std::vector< CaloTowerDetId > &  towers)
double ElectronHcalHelper::hcalESumDepth2 ( const reco::SuperCluster sc,
const std::vector< CaloTowerDetId > *  excludeTowers = 0 
)
double ElectronHcalHelper::hcalESumDepth2BehindClusters ( const std::vector< CaloTowerDetId > &  towers)
std::vector< CaloTowerDetId > ElectronHcalHelper::hcalTowersBehindClusters ( const reco::SuperCluster sc)
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 ( 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_, edm::Handle< T >::product(), EgammaHadTower::setTowerCollection(), towerIso1_, towerIso2_, towersH_, and ElectronHcalHelper::Configuration::useTowers.

Referenced by GsfElectronAlgo::beginEvent(), ElectronSeedProducer::produce(), and EgammaHLTBcHcalIsolationProducersRegional::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_) ;
   }
 }

Member Data Documentation

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().

Definition at line 66 of file ElectronHcalHelper.h.

Referenced by 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().