CMS 3D CMS Logo

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

#include <EgammaHcalIsolation.h>

Public Types

enum  HcalDepth { AllDepths =0, Depth1 =1, Depth2 =2 }
 

Public Member Functions

 EgammaHcalIsolation (double extRadius, double intRadius, double eLowB, double eLowE, double etLowB, double etLowE, edm::ESHandle< CaloGeometry > theCaloGeom, const HBHERecHitCollection &mhbhe)
 
double getHcalESum (const reco::Candidate *c) const
 
double getHcalESum (const reco::SuperCluster *sc) const
 
double getHcalESum (const math::XYZPoint &p) const
 
double getHcalESum (const GlobalPoint &pclu) const
 
double getHcalESumDepth1 (const reco::Candidate *c) const
 
double getHcalESumDepth1 (const reco::SuperCluster *sc) const
 
double getHcalESumDepth1 (const math::XYZPoint &p) const
 
double getHcalESumDepth1 (const GlobalPoint &pclu) const
 
double getHcalESumDepth2 (const reco::Candidate *c) const
 
double getHcalESumDepth2 (const reco::SuperCluster *sc) const
 
double getHcalESumDepth2 (const math::XYZPoint &p) const
 
double getHcalESumDepth2 (const GlobalPoint &pclu) const
 
double getHcalEtSum (const reco::Candidate *c) const
 
double getHcalEtSum (const reco::SuperCluster *sc) const
 
double getHcalEtSum (const math::XYZPoint &p) const
 
double getHcalEtSum (const GlobalPoint &pclu) const
 
double getHcalEtSumDepth1 (const reco::Candidate *c) const
 
double getHcalEtSumDepth1 (const reco::SuperCluster *sc) const
 
double getHcalEtSumDepth1 (const math::XYZPoint &p) const
 
double getHcalEtSumDepth1 (const GlobalPoint &pclu) const
 
double getHcalEtSumDepth2 (const reco::Candidate *c) const
 
double getHcalEtSumDepth2 (const reco::SuperCluster *sc) const
 
double getHcalEtSumDepth2 (const math::XYZPoint &p) const
 
double getHcalEtSumDepth2 (const GlobalPoint &pclu) const
 
 ~EgammaHcalIsolation ()
 

Private Member Functions

double getHcalSum (const GlobalPoint &, const HcalDepth &, double(*)(const double &)) const
 
bool isDepth2 (const DetId &) const
 

Private Attributes

CaloDualConeSelector< HBHERecHit > * doubleConeSel_
 
double eLowB_
 
double eLowE_
 
double etLowB_
 
double etLowE_
 
double extRadius_
 
double intRadius_
 
const HBHERecHitCollectionmhbhe_
 
edm::ESHandle< CaloGeometrytheCaloGeom_
 

Detailed Description

Definition at line 31 of file EgammaHcalIsolation.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

EgammaHcalIsolation::EgammaHcalIsolation ( double  extRadius,
double  intRadius,
double  eLowB,
double  eLowE,
double  etLowB,
double  etLowE,
edm::ESHandle< CaloGeometry theCaloGeom,
const HBHERecHitCollection mhbhe 
)

Definition at line 28 of file EgammaHcalIsolation.cc.

References doubleConeSel_, extRadius_, DetId::Hcal, intRadius_, edm::ESHandle< T >::product(), and theCaloGeom_.

37  :
40  eLowB_(eLowB),
41  eLowE_(eLowE),
42  etLowB_(etLowB),
43  etLowE_(etLowE),
44  theCaloGeom_(theCaloGeom) ,
45  mhbhe_(mhbhe)
46 {
47  //set up the geometry and selector
48  const CaloGeometry* caloGeom = theCaloGeom_.product();
50 }
edm::ESHandle< CaloGeometry > theCaloGeom_
CaloDualConeSelector< HBHERecHit > * doubleConeSel_
const HBHERecHitCollection & mhbhe_
T const * product() const
Definition: ESHandle.h:86
EgammaHcalIsolation::~EgammaHcalIsolation ( )

Definition at line 52 of file EgammaHcalIsolation.cc.

References doubleConeSel_.

53 {
54  delete doubleConeSel_;
55 }
CaloDualConeSelector< HBHERecHit > * doubleConeSel_

Member Function Documentation

double EgammaHcalIsolation::getHcalESum ( const reco::Candidate c) const
inline

Definition at line 52 of file EgammaHcalIsolation.h.

References reco::Candidate::get(), edm::Ref< C, T, F >::get(), and getHcalESum().

Referenced by getHcalESum(), and ElectronHcalHelper::hcalESum().

52 { return getHcalESum(c->get<reco::SuperClusterRef>().get()); }
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:244
double getHcalESum(const reco::Candidate *c) const
T get() const
get a component
Definition: Candidate.h:217
double EgammaHcalIsolation::getHcalESum ( const reco::SuperCluster sc) const
inline

Definition at line 54 of file EgammaHcalIsolation.h.

References getHcalESum(), and reco::CaloCluster::position().

Referenced by getHcalESum().

54 { return getHcalESum(sc->position()); }
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:126
double getHcalESum(const reco::Candidate *c) const
double EgammaHcalIsolation::getHcalESum ( const math::XYZPoint p) const
inline

Definition at line 56 of file EgammaHcalIsolation.h.

References getHcalESum().

Referenced by getHcalESum().

56 { return getHcalESum(GlobalPoint(p.x(),p.y(),p.z())); }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
double getHcalESum(const reco::Candidate *c) const
double EgammaHcalIsolation::getHcalESum ( const GlobalPoint pclu) const
inline

Definition at line 58 of file EgammaHcalIsolation.h.

References AllDepths, getHcalSum(), and scaleToE().

58 { return getHcalSum(pclu,AllDepths,&scaleToE); }
double getHcalSum(const GlobalPoint &, const HcalDepth &, double(*)(const double &)) const
double scaleToE(const double &eta)
double EgammaHcalIsolation::getHcalESumDepth1 ( const reco::Candidate c) const
inline

Definition at line 62 of file EgammaHcalIsolation.h.

References reco::Candidate::get(), edm::Ref< C, T, F >::get(), and getHcalESumDepth1().

Referenced by getHcalESumDepth1(), and ElectronHcalHelper::hcalESumDepth1().

62 { return getHcalESumDepth1(c->get<reco::SuperClusterRef>().get()); }
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:244
T get() const
get a component
Definition: Candidate.h:217
double getHcalESumDepth1(const reco::Candidate *c) const
double EgammaHcalIsolation::getHcalESumDepth1 ( const reco::SuperCluster sc) const
inline

Definition at line 64 of file EgammaHcalIsolation.h.

References getHcalESumDepth1(), and reco::CaloCluster::position().

Referenced by getHcalESumDepth1().

64 { return getHcalESumDepth1(sc->position()); }
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:126
double getHcalESumDepth1(const reco::Candidate *c) const
double EgammaHcalIsolation::getHcalESumDepth1 ( const math::XYZPoint p) const
inline

Definition at line 66 of file EgammaHcalIsolation.h.

References getHcalESumDepth1().

Referenced by getHcalESumDepth1().

66 { return getHcalESumDepth1(GlobalPoint(p.x(),p.y(),p.z())); }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
double getHcalESumDepth1(const reco::Candidate *c) const
double EgammaHcalIsolation::getHcalESumDepth1 ( const GlobalPoint pclu) const
inline

Definition at line 68 of file EgammaHcalIsolation.h.

References Depth1, getHcalSum(), and scaleToE().

68 { return getHcalSum(pclu,Depth1,&scaleToE); }
double getHcalSum(const GlobalPoint &, const HcalDepth &, double(*)(const double &)) const
double scaleToE(const double &eta)
double EgammaHcalIsolation::getHcalESumDepth2 ( const reco::Candidate c) const
inline

Definition at line 72 of file EgammaHcalIsolation.h.

References reco::Candidate::get(), edm::Ref< C, T, F >::get(), and getHcalESumDepth2().

Referenced by getHcalESumDepth2(), and ElectronHcalHelper::hcalESumDepth2().

72 { return getHcalESumDepth2(c->get<reco::SuperClusterRef>().get()); }
double getHcalESumDepth2(const reco::Candidate *c) const
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:244
T get() const
get a component
Definition: Candidate.h:217
double EgammaHcalIsolation::getHcalESumDepth2 ( const reco::SuperCluster sc) const
inline

Definition at line 74 of file EgammaHcalIsolation.h.

References getHcalESumDepth2(), and reco::CaloCluster::position().

Referenced by getHcalESumDepth2().

74 { return getHcalESumDepth2(sc->position()); }
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:126
double getHcalESumDepth2(const reco::Candidate *c) const
double EgammaHcalIsolation::getHcalESumDepth2 ( const math::XYZPoint p) const
inline

Definition at line 76 of file EgammaHcalIsolation.h.

References getHcalESumDepth2().

Referenced by getHcalESumDepth2().

76 { return getHcalESumDepth2(GlobalPoint(p.x(),p.y(),p.z())); }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
double getHcalESumDepth2(const reco::Candidate *c) const
double EgammaHcalIsolation::getHcalESumDepth2 ( const GlobalPoint pclu) const
inline

Definition at line 78 of file EgammaHcalIsolation.h.

References Depth2, getHcalSum(), and scaleToE().

78 { return getHcalSum(pclu,Depth2,&scaleToE); }
double getHcalSum(const GlobalPoint &, const HcalDepth &, double(*)(const double &)) const
double scaleToE(const double &eta)
double EgammaHcalIsolation::getHcalEtSum ( const reco::Candidate c) const
inline

Definition at line 53 of file EgammaHcalIsolation.h.

References reco::Candidate::get(), edm::Ref< C, T, F >::get(), and getHcalEtSum().

Referenced by getHcalEtSum().

53 { return getHcalEtSum(c->get<reco::SuperClusterRef>().get()); }
double getHcalEtSum(const reco::Candidate *c) const
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:244
T get() const
get a component
Definition: Candidate.h:217
double EgammaHcalIsolation::getHcalEtSum ( const reco::SuperCluster sc) const
inline

Definition at line 55 of file EgammaHcalIsolation.h.

References getHcalEtSum(), and reco::CaloCluster::position().

Referenced by getHcalEtSum().

55 { return getHcalEtSum(sc->position()); }
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:126
double getHcalEtSum(const reco::Candidate *c) const
double EgammaHcalIsolation::getHcalEtSum ( const math::XYZPoint p) const
inline

Definition at line 57 of file EgammaHcalIsolation.h.

References getHcalEtSum().

Referenced by getHcalEtSum().

57 { return getHcalEtSum(GlobalPoint(p.x(),p.y(),p.z())); }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
double getHcalEtSum(const reco::Candidate *c) const
double EgammaHcalIsolation::getHcalEtSum ( const GlobalPoint pclu) const
inline

Definition at line 59 of file EgammaHcalIsolation.h.

References AllDepths, getHcalSum(), and scaleToEt().

59 { return getHcalSum(pclu,AllDepths,&scaleToEt); }
double getHcalSum(const GlobalPoint &, const HcalDepth &, double(*)(const double &)) const
double scaleToEt(const double &eta)
double EgammaHcalIsolation::getHcalEtSumDepth1 ( const reco::Candidate c) const
inline

Definition at line 63 of file EgammaHcalIsolation.h.

References reco::Candidate::get(), edm::Ref< C, T, F >::get(), and getHcalEtSumDepth1().

Referenced by getHcalEtSumDepth1().

63 { return getHcalEtSumDepth1(c->get<reco::SuperClusterRef>().get()); }
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:244
double getHcalEtSumDepth1(const reco::Candidate *c) const
T get() const
get a component
Definition: Candidate.h:217
double EgammaHcalIsolation::getHcalEtSumDepth1 ( const reco::SuperCluster sc) const
inline

Definition at line 65 of file EgammaHcalIsolation.h.

References getHcalEtSumDepth1(), and reco::CaloCluster::position().

Referenced by getHcalEtSumDepth1().

65 { return getHcalEtSumDepth1(sc->position()); }
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:126
double getHcalEtSumDepth1(const reco::Candidate *c) const
double EgammaHcalIsolation::getHcalEtSumDepth1 ( const math::XYZPoint p) const
inline

Definition at line 67 of file EgammaHcalIsolation.h.

References getHcalEtSumDepth1().

Referenced by getHcalEtSumDepth1().

67 { return getHcalEtSumDepth1(GlobalPoint(p.x(),p.y(),p.z())); }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
double getHcalEtSumDepth1(const reco::Candidate *c) const
double EgammaHcalIsolation::getHcalEtSumDepth1 ( const GlobalPoint pclu) const
inline

Definition at line 69 of file EgammaHcalIsolation.h.

References Depth1, getHcalSum(), and scaleToEt().

69 { return getHcalSum(pclu,Depth1,&scaleToEt); }
double getHcalSum(const GlobalPoint &, const HcalDepth &, double(*)(const double &)) const
double scaleToEt(const double &eta)
double EgammaHcalIsolation::getHcalEtSumDepth2 ( const reco::Candidate c) const
inline

Definition at line 73 of file EgammaHcalIsolation.h.

References reco::Candidate::get(), edm::Ref< C, T, F >::get(), and getHcalEtSumDepth2().

Referenced by getHcalEtSumDepth2().

73 { return getHcalEtSumDepth2(c->get<reco::SuperClusterRef>().get()); }
double getHcalEtSumDepth2(const reco::Candidate *c) const
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:244
T get() const
get a component
Definition: Candidate.h:217
double EgammaHcalIsolation::getHcalEtSumDepth2 ( const reco::SuperCluster sc) const
inline

Definition at line 75 of file EgammaHcalIsolation.h.

References getHcalEtSumDepth2(), and reco::CaloCluster::position().

Referenced by getHcalEtSumDepth2().

75 { return getHcalEtSumDepth2(sc->position()); }
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:126
double getHcalEtSumDepth2(const reco::Candidate *c) const
double EgammaHcalIsolation::getHcalEtSumDepth2 ( const math::XYZPoint p) const
inline

Definition at line 77 of file EgammaHcalIsolation.h.

References getHcalEtSumDepth2().

Referenced by getHcalEtSumDepth2().

77 { return getHcalEtSumDepth2(GlobalPoint(p.x(),p.y(),p.z())); }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
double getHcalEtSumDepth2(const reco::Candidate *c) const
double EgammaHcalIsolation::getHcalEtSumDepth2 ( const GlobalPoint pclu) const
inline

Definition at line 79 of file EgammaHcalIsolation.h.

References Depth2, getHcalSum(), isDepth2(), and scaleToEt().

79 { return getHcalSum(pclu,Depth2,&scaleToEt); }
double getHcalSum(const GlobalPoint &, const HcalDepth &, double(*)(const double &)) const
double scaleToEt(const double &eta)
double EgammaHcalIsolation::getHcalSum ( const GlobalPoint pclu,
const HcalDepth depth,
double(*)(const double &)  scale 
) const
private

Definition at line 57 of file EgammaHcalIsolation.cc.

References AllDepths, Depth1, Depth2, CaloRecHit::detid(), doubleConeSel_, eLowB_, eLowE_, edm::SortedCollection< T, SORT >::empty(), CaloRecHit::energy(), stringResolutionProvider_cfi::eta, etLowB_, etLowE_, CaloGeometry::getPosition(), HcalBarrel, HcalEndcap, i, isDepth2(), mhbhe_, edm::ESHandle< T >::product(), Scenarios_cff::scale, scaleToEt(), CaloDualConeSelector< T >::selectCallback(), and theCaloGeom_.

Referenced by getHcalESum(), getHcalESumDepth1(), getHcalESumDepth2(), getHcalEtSum(), getHcalEtSumDepth1(), and getHcalEtSumDepth2().

59 {
60  double sum = 0.;
61  if (! mhbhe_.empty())
62  {
63  //Compute the HCAL energy behind ECAL
64  doubleConeSel_->selectCallback(pclu, mhbhe_, [this, &sum, &depth, &scale](const HBHERecHit& i) {
65  double eta = theCaloGeom_.product()->getPosition(i.detid()).eta();
66  HcalDetId hcalDetId(i.detid());
67  if(hcalDetId.subdet() == HcalBarrel && //Is it in the barrel?
68  i.energy() > eLowB_ && //Does it pass the min energy?
69  i.energy()*scaleToEt(eta) > etLowB_ && //Does it pass the min et?
70  (depth == AllDepths || depth == Depth1)) { //Are we asking for the first depth?
71  sum += i.energy() * scale(eta);
72  }
73  if(hcalDetId.subdet() == HcalEndcap && //Is it in the endcap?
74  i.energy() > eLowE_ && //Does it pass the min energy?
75  i.energy()*scaleToEt(eta) > etLowE_ ) { //Does it pass the min et?
76  switch(depth) { //Which depth?
77  case AllDepths: sum += i.energy() * scale(eta); break;
78  case Depth1: sum += (isDepth2(i.detid())) ? 0 : i.energy() * scale(eta); break;
79  case Depth2: sum += (isDepth2(i.detid())) ? i.energy() * scale(eta) : 0; break;
80  }
81  }
82  });
83  }
84 
85  return sum ;
86 }
bool isDepth2(const DetId &) const
double scaleToEt(const double &eta)
int i
Definition: DBlmapReader.cc:9
const DetId & detid() const
Definition: CaloRecHit.h:21
edm::ESHandle< CaloGeometry > theCaloGeom_
CaloDualConeSelector< HBHERecHit > * doubleConeSel_
const HBHERecHitCollection & mhbhe_
float energy() const
Definition: CaloRecHit.h:17
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:70
void selectCallback(double eta, double phi, const edm::SortedCollection< T > &inputCollection, std::function< void(const T &)> callback)
T const * product() const
Definition: ESHandle.h:86
bool EgammaHcalIsolation::isDepth2 ( const DetId detId) const
private

Definition at line 88 of file EgammaHcalIsolation.cc.

References particleFlowClusterECALTimeSelected_cfi::depth.

Referenced by getHcalEtSumDepth2(), and getHcalSum().

88  {
89 
90  if( (HcalDetId(detId).depth()==2 && HcalDetId(detId).ietaAbs()>=18 && HcalDetId(detId).ietaAbs()<27) ||
91  (HcalDetId(detId).depth()==3 && HcalDetId(detId).ietaAbs()==27) ) {
92 
93  return true;
94 
95  } else {
96  return false;
97  }
98 }

Member Data Documentation

CaloDualConeSelector<HBHERecHit>* EgammaHcalIsolation::doubleConeSel_
private

Definition at line 99 of file EgammaHcalIsolation.h.

Referenced by EgammaHcalIsolation(), getHcalSum(), and ~EgammaHcalIsolation().

double EgammaHcalIsolation::eLowB_
private

Definition at line 90 of file EgammaHcalIsolation.h.

Referenced by getHcalSum().

double EgammaHcalIsolation::eLowE_
private

Definition at line 91 of file EgammaHcalIsolation.h.

Referenced by getHcalSum().

double EgammaHcalIsolation::etLowB_
private

Definition at line 92 of file EgammaHcalIsolation.h.

Referenced by getHcalSum().

double EgammaHcalIsolation::etLowE_
private

Definition at line 93 of file EgammaHcalIsolation.h.

Referenced by getHcalSum().

double EgammaHcalIsolation::extRadius_
private

Definition at line 88 of file EgammaHcalIsolation.h.

Referenced by EgammaHcalIsolation().

double EgammaHcalIsolation::intRadius_
private

Definition at line 89 of file EgammaHcalIsolation.h.

Referenced by EgammaHcalIsolation().

const HBHERecHitCollection& EgammaHcalIsolation::mhbhe_
private

Definition at line 97 of file EgammaHcalIsolation.h.

Referenced by getHcalSum().

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

Definition at line 96 of file EgammaHcalIsolation.h.

Referenced by EgammaHcalIsolation(), and getHcalSum().