CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HoECalculator Class Reference

#include <HoECalculator.h>

Public Member Functions

 HoECalculator ()
 
 HoECalculator (const edm::ESHandle< CaloGeometry > &)
 
double operator() (const reco::BasicCluster *, const edm::Event &e, const edm::EventSetup &c)
 
double operator() (const reco::SuperCluster *, const edm::Event &e, const edm::EventSetup &c)
 

Private Member Functions

double getHoE (GlobalPoint pos, float energy, const edm::Event &e, const edm::EventSetup &c)
 

Private Attributes

const HBHERecHitCollectionhithbhe_
 
edm::ESHandle< CaloGeometrytheCaloGeom_
 

Detailed Description

Definition at line 14 of file HoECalculator.h.

Constructor & Destructor Documentation

◆ HoECalculator() [1/2]

HoECalculator::HoECalculator ( )

Definition at line 7 of file HoECalculator.cc.

7 : theCaloGeom_(nullptr) {}
edm::ESHandle< CaloGeometry > theCaloGeom_
Definition: HoECalculator.h:39

◆ HoECalculator() [2/2]

HoECalculator::HoECalculator ( const edm::ESHandle< CaloGeometry > &  caloGeom)

Definition at line 8 of file HoECalculator.cc.

8 : theCaloGeom_(caloGeom) {}
edm::ESHandle< CaloGeometry > theCaloGeom_
Definition: HoECalculator.h:39

Member Function Documentation

◆ getHoE()

double HoECalculator::getHoE ( GlobalPoint  pos,
float  energy,
const edm::Event e,
const edm::EventSetup c 
)
private

Definition at line 45 of file HoECalculator.cc.

References c, MillePedeFileConverter_cfg::e, edm::SortedCollection< T, SORT >::end(), edm::SortedCollection< T, SORT >::find(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), CaloSubdetectorGeometry::getClosestCell(), photonIsolationHIProducer_cfi::hbhe, DetId::Hcal, hithbhe_, edm::ESHandleBase::isValid(), edm::ESHandle< T >::product(), and theCaloGeom_.

Referenced by operator()().

45  {
46  if (!theCaloGeom_.isValid())
48 
49  //product the geometry
51 
52  //Create a HBHERecHitCollection
54  e.getByLabel("hbhereco", "", hbhe);
55  const HBHERecHitCollection* hithbhe_ = hbhe.product();
56 
57  double HoE = 0.;
59  const CaloSubdetectorGeometry* geometry_p;
60  geometry_p = geometry.getSubdetectorGeometry(DetId::Hcal, 4);
61  DetId hcalDetId;
62  hcalDetId = geometry_p->getClosestCell(pclu);
63  double hcalEnergy = 0;
64 
66  iterRecHit = hithbhe_->find(hcalDetId);
67  if (iterRecHit != hithbhe_->end()) {
68  hcalEnergy = iterRecHit->energy();
69  HoE = hcalEnergy / ecalEnergy;
70  }
71 
72  return HoE;
73 }
const HBHERecHitCollection * hithbhe_
Definition: HoECalculator.h:40
std::vector< T >::const_iterator const_iterator
T const * product() const
Definition: ESHandle.h:86
edm::ESHandle< CaloGeometry > theCaloGeom_
Definition: HoECalculator.h:39
virtual DetId getClosestCell(const GlobalPoint &r) const
bool isValid() const
Definition: ESHandle.h:44
const_iterator end() const
Definition: DetId.h:17
iterator find(key_type k)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const

◆ operator()() [1/2]

double HoECalculator::operator() ( const reco::BasicCluster clus,
const edm::Event e,
const edm::EventSetup c 
)

Definition at line 10 of file HoECalculator.cc.

References c, MillePedeFileConverter_cfg::e, reco::CaloCluster::energy(), getHoE(), reco::CaloCluster::x(), reco::CaloCluster::y(), and reco::CaloCluster::z().

10  {
11  return getHoE(GlobalPoint(clus->x(), clus->y(), clus->z()), clus->energy(), e, c);
12 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
double x() const
x coordinate of cluster centroid
Definition: CaloCluster.h:172
double getHoE(GlobalPoint pos, float energy, const edm::Event &e, const edm::EventSetup &c)
double z() const
z coordinate of cluster centroid
Definition: CaloCluster.h:178
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:175
double energy() const
cluster energy
Definition: CaloCluster.h:149

◆ operator()() [2/2]

double HoECalculator::operator() ( const reco::SuperCluster clus,
const edm::Event e,
const edm::EventSetup c 
)

Definition at line 14 of file HoECalculator.cc.

References c, MillePedeFileConverter_cfg::e, reco::CaloCluster::energy(), getHoE(), reco::CaloCluster::x(), reco::CaloCluster::y(), and reco::CaloCluster::z().

14  {
15  return getHoE(GlobalPoint(clus->x(), clus->y(), clus->z()), clus->energy(), e, c);
16 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
double x() const
x coordinate of cluster centroid
Definition: CaloCluster.h:172
double getHoE(GlobalPoint pos, float energy, const edm::Event &e, const edm::EventSetup &c)
double z() const
z coordinate of cluster centroid
Definition: CaloCluster.h:178
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:175
double energy() const
cluster energy
Definition: CaloCluster.h:149

Member Data Documentation

◆ hithbhe_

const HBHERecHitCollection* HoECalculator::hithbhe_
private

Definition at line 40 of file HoECalculator.h.

Referenced by getHoE().

◆ theCaloGeom_

edm::ESHandle<CaloGeometry> HoECalculator::theCaloGeom_
private

Definition at line 39 of file HoECalculator.h.

Referenced by getHoE().