CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  :
8  theCaloGeom_(0)
9 {
10 }
edm::ESHandle< CaloGeometry > theCaloGeom_
Definition: HoECalculator.h:48
HoECalculator::HoECalculator ( const edm::ESHandle< CaloGeometry > &  caloGeom)

Definition at line 11 of file HoECalculator.cc.

11  :
12  theCaloGeom_(caloGeom)
13 {
14 }
edm::ESHandle< CaloGeometry > theCaloGeom_
Definition: HoECalculator.h:48

Member Function Documentation

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

Definition at line 53 of file HoECalculator.cc.

References edm::SortedCollection< T, SORT >::end(), edm::SortedCollection< T, SORT >::find(), geometry, edm::EventSetup::get(), edm::eventsetup::EventSetupRecord::get(), edm::Event::getByLabel(), CaloSubdetectorGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, hithbhe_, edm::ESHandleBase::isValid(), edm::Handle< T >::product(), edm::ESHandle< class >::product(), and theCaloGeom_.

Referenced by operator()().

54 {
55  if ( !theCaloGeom_.isValid() )
57 
58  //product the geometry
60 
61  //Create a HBHERecHitCollection
63  e.getByLabel("hbhereco","",hbhe);
64  const HBHERecHitCollection* hithbhe_ = hbhe.product();
65 
66  double HoE=0.;
68  const CaloSubdetectorGeometry *geometry_p ;
69  geometry_p = geometry.getSubdetectorGeometry (DetId::Hcal,4) ;
70  DetId hcalDetId ;
71  hcalDetId = geometry_p->getClosestCell(pclu) ;
72  double hcalEnergy = 0 ;
73 
75  iterRecHit = hithbhe_->find(hcalDetId) ;
76  if (iterRecHit!=hithbhe_->end()) {
77  hcalEnergy = iterRecHit->energy() ;
78  HoE = hcalEnergy/ecalEnergy ;
79  }
80 
81  return HoE ;
82 }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
const HBHERecHitCollection * hithbhe_
Definition: HoECalculator.h:49
std::vector< HBHERecHit >::const_iterator const_iterator
edm::ESHandle< CaloGeometry > theCaloGeom_
Definition: HoECalculator.h:48
void get(HolderT &iHolder) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:402
const_iterator end() const
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
ESHandle< TrackerGeometry > geometry
iterator find(key_type k)
bool isValid() const
Definition: ESHandle.h:47
double HoECalculator::operator() ( const reco::BasicCluster clus,
const edm::Event e,
const edm::EventSetup c 
)

Definition at line 16 of file HoECalculator.cc.

References trackerHits::c, alignCSCRings::e, and getHoE().

17 {
18  return getHoE(GlobalPoint(clus->x(),clus->y(),clus->z()), clus->energy(), e,c);
19 }
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 21 of file HoECalculator.cc.

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

22 {
23  return getHoE(GlobalPoint(clus->x(),clus->y(),clus->z()), clus->energy(), e,c);
24 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
double z() const
z coordinate of cluster centroid
Definition: CaloCluster.h:158
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:152
double energy() const
cluster energy
Definition: CaloCluster.h:120
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:155

Member Data Documentation

const HBHERecHitCollection* HoECalculator::hithbhe_
private

Definition at line 49 of file HoECalculator.h.

Referenced by getHoE().

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

Definition at line 48 of file HoECalculator.h.

Referenced by getHoE().