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::HoECalculator ( )

Definition at line 7 of file HoECalculator.cc.

7 : theCaloGeom_(nullptr) {}
edm::ESHandle< CaloGeometry > theCaloGeom_
Definition: HoECalculator.h:39
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

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 edm::SortedCollection< T, SORT >::end(), edm::SortedCollection< T, SORT >::find(), edm::EventSetup::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), edm::Event::getByLabel(), CaloSubdetectorGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), photonIsolationHIProducer_cfi::hbhe, DetId::Hcal, hithbhe_, edm::ESHandleBase::isValid(), edm::Handle< T >::product(), 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 CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
const HBHERecHitCollection * hithbhe_
Definition: HoECalculator.h:40
std::vector< T >::const_iterator const_iterator
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESHandle< CaloGeometry > theCaloGeom_
Definition: HoECalculator.h:39
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:488
const_iterator end() const
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:17
T const * product() const
Definition: Handle.h:69
iterator find(key_type k)
T get() const
Definition: EventSetup.h:73
bool isValid() const
Definition: ESHandle.h:44
T const * product() const
Definition: ESHandle.h:86
double HoECalculator::operator() ( const reco::BasicCluster clus,
const edm::Event e,
const edm::EventSetup c 
)

Definition at line 10 of file HoECalculator.cc.

References HltBtagPostValidation_cff::c, MillePedeFileConverter_cfg::e, and getHoE().

10  {
11  return getHoE(GlobalPoint(clus->x(), clus->y(), clus->z()), clus->energy(), e, c);
12 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
double getHoE(GlobalPoint pos, float energy, const edm::Event &e, const edm::EventSetup &c)
double HoECalculator::operator() ( const reco::SuperCluster clus,
const edm::Event e,
const edm::EventSetup c 
)

Definition at line 14 of file HoECalculator.cc.

References HltBtagPostValidation_cff::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 z() const
z coordinate of cluster centroid
Definition: CaloCluster.h:177
double getHoE(GlobalPoint pos, float energy, const edm::Event &e, const edm::EventSetup &c)
double x() const
x coordinate of cluster centroid
Definition: CaloCluster.h:171
double energy() const
cluster energy
Definition: CaloCluster.h:148
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:174

Member Data Documentation

const HBHERecHitCollection* HoECalculator::hithbhe_
private

Definition at line 40 of file HoECalculator.h.

Referenced by getHoE().

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

Definition at line 39 of file HoECalculator.h.

Referenced by getHoE().