#include <RecoEgamma/EgammaTools/interface/HoECalculator.h>
Public Member Functions | |
HoECalculator (const edm::ESHandle< CaloGeometry > &) | |
HoECalculator () | |
double | operator() (const reco::BasicCluster *, HBHERecHitMetaCollection *mhbhe) |
double | operator() (const reco::SuperCluster *, HBHERecHitMetaCollection *mhbhe) |
double | operator() (const reco::SuperCluster *, const edm::Event &e, const edm::EventSetup &c) |
double | operator() (const reco::BasicCluster *, const edm::Event &e, const edm::EventSetup &c) |
Private Member Functions | |
double | getHoE (GlobalPoint pos, float energy, HBHERecHitMetaCollection *mhbhe) |
double | getHoE (GlobalPoint pos, float energy, const edm::Event &e, const edm::EventSetup &c) |
Private Attributes | |
const HBHERecHitCollection * | hithbhe_ |
edm::ESHandle< CaloGeometry > | theCaloGeom_ |
Definition at line 16 of file HoECalculator.h.
HoECalculator::HoECalculator | ( | ) |
Definition at line 8 of file HoECalculator.cc.
00008 : 00009 theCaloGeom_(0) 00010 { 00011 } HoECalculator::HoECalculator (const edm::ESHandle<CaloGeometry> &caloGeom) :
HoECalculator::HoECalculator | ( | const edm::ESHandle< CaloGeometry > & | caloGeom | ) |
Definition at line 12 of file HoECalculator.cc.
00012 : 00013 theCaloGeom_(caloGeom) 00014 { 00015 }
double HoECalculator::getHoE | ( | GlobalPoint | pos, | |
float | energy, | |||
HBHERecHitMetaCollection * | mhbhe | |||
) | [private] |
Definition at line 76 of file HoECalculator.cc.
References CaloRecHitMetaCollectionV::end(), SimpleCaloRecHitMetaCollection< C >::find(), CaloSubdetectorGeometry::getClosestCell(), DetId::Hcal, i, and theCaloGeom_.
00077 { 00078 00079 double HoE=0.; 00080 00081 if (mhbhe) { 00082 const CaloSubdetectorGeometry *geometry_p ; 00083 geometry_p = theCaloGeom_->getSubdetectorGeometry (DetId::Hcal,4) ; 00084 HcalDetId dB= geometry_p->getClosestCell(pos); 00085 CaloRecHitMetaCollectionV::const_iterator i=mhbhe->find(dB); 00086 if (i!=mhbhe->end()) { 00087 HoE = i->energy()/energy; 00088 } 00089 } 00090 return HoE ; 00091 00092 }
double HoECalculator::getHoE | ( | GlobalPoint | pos, | |
float | energy, | |||
const edm::Event & | e, | |||
const edm::EventSetup & | c | |||
) | [private] |
Definition at line 44 of file HoECalculator.cc.
References CaloRecHitMetaCollection::add(), CaloRecHitMetaCollectionV::end(), f, CaloRecHitMetaCollection::find(), edm::EventSetup::get(), edm::Event::getByLabel(), CaloSubdetectorGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, hithbhe_, edm::ESHandle< T >::isValid(), edm::ESHandle< T >::product(), edm::Handle< T >::product(), and theCaloGeom_.
Referenced by operator()().
00045 { 00046 if ( !theCaloGeom_.isValid() ) 00047 c.get<CaloGeometryRecord>().get(theCaloGeom_) ; 00048 00049 //product the geometry 00050 theCaloGeom_.product() ; 00051 00052 //Create a CaloRecHitMetaCollection 00053 edm::Handle< HBHERecHitCollection > hbhe ; 00054 e.getByLabel("hbhereco","",hbhe); 00055 const HBHERecHitCollection* hithbhe_ = hbhe.product(); 00056 00057 double HoE=0.; 00058 const CaloGeometry& geometry = *theCaloGeom_ ; 00059 const CaloSubdetectorGeometry *geometry_p ; 00060 geometry_p = geometry.getSubdetectorGeometry (DetId::Hcal,4) ; 00061 DetId hcalDetId ; 00062 hcalDetId = geometry_p->getClosestCell(pclu) ; 00063 double hcalEnergy = 0 ; 00064 CaloRecHitMetaCollection f; 00065 f.add(hithbhe_); 00066 CaloRecHitMetaCollection::const_iterator iterRecHit ; 00067 iterRecHit = f.find(hcalDetId) ; 00068 if (iterRecHit!=f.end()) { 00069 hcalEnergy = iterRecHit->energy() ; 00070 HoE = hcalEnergy/ecalEnergy ; 00071 } 00072 00073 return HoE ; 00074 }
double HoECalculator::operator() | ( | const reco::BasicCluster * | clus, | |
HBHERecHitMetaCollection * | mhbhe | |||
) |
Definition at line 39 of file HoECalculator.cc.
References reco::CaloCluster::energy(), getHoE(), reco::CaloCluster::x(), reco::CaloCluster::y(), and reco::CaloCluster::z().
00040 { 00041 return getHoE(GlobalPoint(clus->x(),clus->y(),clus->z()), clus->energy(), mhbhe); 00042 }
double HoECalculator::operator() | ( | const reco::SuperCluster * | clus, | |
HBHERecHitMetaCollection * | mhbhe | |||
) |
Definition at line 27 of file HoECalculator.cc.
References reco::SuperCluster::clustersBegin(), reco::SuperCluster::clustersEnd(), reco::CaloCluster::energy(), and getHoE().
00028 { 00029 // return getHoE(GlobalPoint(clus->x(),clus->y(),clus->z()), clus->energy(), mhbhe); 00030 float HoEmax = 0.; 00031 for (reco::BasicClusterRefVector::iterator bc=clus->clustersBegin(); bc!=clus->clustersEnd(); bc++) { 00032 float HoE = getHoE(GlobalPoint((*bc)->x(),(*bc)->y(),(*bc)->z()),clus->energy(), mhbhe); 00033 if (HoE > HoEmax) HoEmax = HoE; 00034 } 00035 return HoEmax; 00036 }
double HoECalculator::operator() | ( | const reco::SuperCluster * | clus, | |
const edm::Event & | e, | |||
const edm::EventSetup & | c | |||
) |
Definition at line 22 of file HoECalculator.cc.
References reco::CaloCluster::energy(), getHoE(), reco::CaloCluster::x(), reco::CaloCluster::y(), and reco::CaloCluster::z().
00023 { 00024 return getHoE(GlobalPoint(clus->x(),clus->y(),clus->z()), clus->energy(), e,c); 00025 }
double HoECalculator::operator() | ( | const reco::BasicCluster * | clus, | |
const edm::Event & | e, | |||
const edm::EventSetup & | c | |||
) |
Definition at line 17 of file HoECalculator.cc.
References reco::CaloCluster::energy(), getHoE(), reco::CaloCluster::x(), reco::CaloCluster::y(), and reco::CaloCluster::z().
00018 { 00019 return getHoE(GlobalPoint(clus->x(),clus->y(),clus->z()), clus->energy(), e,c); 00020 }
const HBHERecHitCollection* HoECalculator::hithbhe_ [private] |
edm::ESHandle<CaloGeometry> HoECalculator::theCaloGeom_ [private] |