CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
EgammaHLTHcalIsolation Class Reference

#include <RecoEgamma/EgammaHLTAlgos/interface/EgammaHLTHcalIsolation.h>

Public Member Functions

 EgammaHLTHcalIsolation (float eMinHB, float eMinHE, float etMinHB, float etMinHE, float innerCone, float outerCone, int depth)
 
float getESum (float candEta, float candPhi, const HBHERecHitCollection *hbhe, const CaloGeometry *geometry) const
 
float getESum (float candEta, float candPhi, const HBHERecHitCollection *hbhe, const CaloGeometry *geometry, const HcalSeverityLevelComputer *hcalSevLvlAlgo, const HcalChannelQuality *dbHcalChStatus) const
 
float getEtSum (float candEta, float candPhi, const HBHERecHitCollection *hbhe, const CaloGeometry *geometry) const
 
float getEtSum (float candEta, float candPhi, const HBHERecHitCollection *hbhe, const CaloGeometry *geometry, const HcalSeverityLevelComputer *hcalSevLvlAlgo, const HcalChannelQuality *dbHcalChStatus) const
 
std::pair< float, float > getSum (float candEta, float candPhi, const HBHERecHitCollection *hbhe, const CaloGeometry *geometry, const HcalSeverityLevelComputer *hcalSevLvlAlgo=NULL, const HcalChannelQuality *dbHcalChStatus=NULL) const
 

Static Public Member Functions

static int getEffectiveDepth (const HcalDetId id)
 

Private Member Functions

bool acceptHit_ (const HcalDetId id, const GlobalPoint &pos, const float hitEnergy, const float candEta, const float candPhi) const
 
bool passCleaning_ (const CaloRecHit *hit, const HcalSeverityLevelComputer *hcalSevLvlComp, const HcalChannelQuality *hcalChanStatus) const
 
bool passDepth_ (const HcalDetId id) const
 
bool passMinE_ (float energy, const HcalDetId id) const
 
bool passMinEt_ (float et, const HcalDetId id) const
 

Private Attributes

int depth_
 
float eMinHB_
 
float eMinHE_
 
float etMinHB_
 
float etMinHE_
 
int hcalAcceptSeverityLevel_
 
float innerCone_
 
float outerCone_
 
bool useRecoveredHcalHits_
 

Detailed Description

Description: sum pt hcal hits in cone around egamma candidate

Usage: <usage>

Definition at line 43 of file EgammaHLTHcalIsolation.h.

Constructor & Destructor Documentation

EgammaHLTHcalIsolation::EgammaHLTHcalIsolation ( float  eMinHB,
float  eMinHE,
float  etMinHB,
float  etMinHE,
float  innerCone,
float  outerCone,
int  depth 
)
inline

Member Function Documentation

bool EgammaHLTHcalIsolation::acceptHit_ ( const HcalDetId  id,
const GlobalPoint pos,
const float  hitEnergy,
const float  candEta,
const float  candPhi 
) const
private

Definition at line 65 of file EgammaHLTHcalIsolation.cc.

References reco::deltaR2(), PV3DBase< T, PVType, FrameType >::eta(), create_public_lumi_plots::exp, innerCone_, outerCone_, passDepth_(), passMinE_(), passMinEt_(), PV3DBase< T, PVType, FrameType >::phi(), and funct::sin().

66 {
67  if(passMinE_(hitEnergy,id) && passDepth_(id)){ //doing the energy and depth cuts first will avoid potentially slow eta calc
68  float innerConeSq = innerCone_*innerCone_;
69  float outerConeSq = outerCone_*outerCone_;
70 
71  float hitEta = pos.eta();
72  float hitPhi = pos.phi();
73 
74  float dR2 = reco::deltaR2(candEta,candPhi,hitEta,hitPhi);
75 
76  if(dR2>=innerConeSq && dR2<outerConeSq) { //pass inner and outer cone cuts
77  float hitEt = hitEnergy*sin(2*atan(exp(-hitEta)));
78  if(passMinEt_(hitEt,id)) return true; //and we've passed the last requirement
79  }//end dR check
80  }//end min energy + depth check
81 
82  return false;
83 }
bool passDepth_(const HcalDetId id) const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
bool passMinEt_(float et, const HcalDetId id) const
double deltaR2(const T1 &t1, const T2 &t2)
Definition: deltaR.h:36
T eta() const
Definition: PV3DBase.h:76
bool passMinE_(float energy, const HcalDetId id) const
int EgammaHLTHcalIsolation::getEffectiveDepth ( const HcalDetId  id)
static

Definition at line 131 of file EgammaHLTHcalIsolation.cc.

References HLT_25ns14e33_v1_cff::depth.

Referenced by passDepth_().

132 {
133  int iEtaAbs = id.ietaAbs();
134  int depth = id.depth();
135  if(iEtaAbs<=17 ||
136  (iEtaAbs<=29 && depth==1) ||
137  (iEtaAbs>=27 && iEtaAbs<=29 && depth==2)){
138  return 1;
139  }else return 2;
140 
141 }
float EgammaHLTHcalIsolation::getESum ( float  candEta,
float  candPhi,
const HBHERecHitCollection hbhe,
const CaloGeometry geometry 
) const
inline

Definition at line 59 of file EgammaHLTHcalIsolation.h.

References getSum().

Referenced by EgammaHLTHcalIsolationProducersRegional::produce().

61  {return getSum(candEta,candPhi,hbhe,geometry).first;}
std::pair< float, float > getSum(float candEta, float candPhi, const HBHERecHitCollection *hbhe, const CaloGeometry *geometry, const HcalSeverityLevelComputer *hcalSevLvlAlgo=NULL, const HcalChannelQuality *dbHcalChStatus=NULL) const
float EgammaHLTHcalIsolation::getESum ( float  candEta,
float  candPhi,
const HBHERecHitCollection hbhe,
const CaloGeometry geometry,
const HcalSeverityLevelComputer hcalSevLvlAlgo,
const HcalChannelQuality dbHcalChStatus 
) const
inline

Definition at line 65 of file EgammaHLTHcalIsolation.h.

References getSum().

69  {return getSum(candEta,candPhi,hbhe,geometry,
70  hcalSevLvlAlgo,dbHcalChStatus).first;}
std::pair< float, float > getSum(float candEta, float candPhi, const HBHERecHitCollection *hbhe, const CaloGeometry *geometry, const HcalSeverityLevelComputer *hcalSevLvlAlgo=NULL, const HcalChannelQuality *dbHcalChStatus=NULL) const
float EgammaHLTHcalIsolation::getEtSum ( float  candEta,
float  candPhi,
const HBHERecHitCollection hbhe,
const CaloGeometry geometry 
) const
inline

Definition at line 62 of file EgammaHLTHcalIsolation.h.

References getSum().

Referenced by EgammaHLTHcalIsolationProducersRegional::produce().

64  {return getSum(candEta,candPhi,hbhe,geometry).second;}
std::pair< float, float > getSum(float candEta, float candPhi, const HBHERecHitCollection *hbhe, const CaloGeometry *geometry, const HcalSeverityLevelComputer *hcalSevLvlAlgo=NULL, const HcalChannelQuality *dbHcalChStatus=NULL) const
float EgammaHLTHcalIsolation::getEtSum ( float  candEta,
float  candPhi,
const HBHERecHitCollection hbhe,
const CaloGeometry geometry,
const HcalSeverityLevelComputer hcalSevLvlAlgo,
const HcalChannelQuality dbHcalChStatus 
) const
inline

Definition at line 71 of file EgammaHLTHcalIsolation.h.

References getSum().

75  {return getSum(candEta,candPhi,hbhe,geometry,
76  hcalSevLvlAlgo,dbHcalChStatus).second;}
std::pair< float, float > getSum(float candEta, float candPhi, const HBHERecHitCollection *hbhe, const CaloGeometry *geometry, const HcalSeverityLevelComputer *hcalSevLvlAlgo=NULL, const HcalChannelQuality *dbHcalChStatus=NULL) const
std::pair< float, float > EgammaHLTHcalIsolation::getSum ( float  candEta,
float  candPhi,
const HBHERecHitCollection hbhe,
const CaloGeometry geometry,
const HcalSeverityLevelComputer hcalSevLvlAlgo = NULL,
const HcalChannelQuality dbHcalChStatus = NULL 
) const

Definition at line 24 of file EgammaHLTHcalIsolation.cc.

References HLT_25ns14e33_v1_cff::depth, relval_parameters_module::energy, geometry, funct::sin(), PV3DBase< T, PVType, FrameType >::theta(), and ecaldqm::zside().

Referenced by getESum(), and getEtSum().

25 {
26  float sumE=0.;
27  float sumEt=0.;
28 
29  for(HBHERecHitCollection::const_iterator hbheItr = hbhe->begin(); hbheItr != hbhe->end(); ++hbheItr){
30  if(passCleaning_(&(*hbheItr),hcalSevLvlAlgo,dbHcalChStatus)){
31  // if(hbheItr->id().ietaAbs()==29) continue;
32 
33  HcalDetId id = hbheItr->id();
34  if(!(id.ietaAbs()==28 && id.depth()==3)){ //default normal case
35  float energy = hbheItr->energy();
36  const GlobalPoint& pos = geometry->getPosition(id);
37  if(acceptHit_(id,pos,energy,candEta,candPhi)){
38  sumE+=energy;
39  sumEt+=energy*sin(pos.theta());
40  }
41  }else{
42  //the special case, tower 28 depth 3 is split between tower 28 and 29 when using calo towers so we have to emulate it. To do this we need to divide energy by 2 and then check seperately if 28 and 29 are accepted
43  float energy = hbheItr->energy()/2.;
44  HcalDetId tower28Id(id.subdet(),28*id.zside(),id.iphi(),2);
45  const GlobalPoint& tower28Pos = geometry->getPosition(tower28Id);
46  if(acceptHit_(id,tower28Pos,energy,candEta,candPhi)){
47  sumE+=energy;
48  sumEt+=energy*sin(tower28Pos.theta());
49  }
50  HcalDetId tower29Id(id.subdet(),29*id.zside(),id.iphi(),2);
51  const GlobalPoint& tower29Pos = geometry->getPosition(tower29Id);
52  if(acceptHit_(id,tower29Pos,energy,candEta,candPhi)){
53  sumE+=energy;
54  sumEt+=energy*sin(tower29Pos.theta());
55  }
56  }//end of the special case for tower 28 depth 3
57  }//end cleaning check
58  }//end of loop over all rec hits
59  return std::make_pair(sumE,sumEt);
60 
61 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
bool passCleaning_(const CaloRecHit *hit, const HcalSeverityLevelComputer *hcalSevLvlComp, const HcalChannelQuality *hcalChanStatus) const
std::vector< HBHERecHit >::const_iterator const_iterator
int zside(DetId const &)
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:68
const_iterator end() const
bool acceptHit_(const HcalDetId id, const GlobalPoint &pos, const float hitEnergy, const float candEta, const float candPhi) const
const_iterator begin() const
bool EgammaHLTHcalIsolation::passCleaning_ ( const CaloRecHit hit,
const HcalSeverityLevelComputer hcalSevLvlComp,
const HcalChannelQuality hcalChanStatus 
) const
private

Definition at line 109 of file EgammaHLTHcalIsolation.cc.

References CaloRecHit::detid(), CaloRecHit::flags(), HcalSeverityLevelComputer::getSeverityLevel(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), hcalAcceptSeverityLevel_, NULL, HcalSeverityLevelComputer::recoveredRecHit(), and useRecoveredHcalHits_.

111 {
112  if(hcalSevLvlComp==NULL || hcalChanStatus==NULL) return true; //return true if we dont have valid pointers
113 
114  const DetId id = hit->detid();
115 
116  const uint32_t recHitFlag = hit->flags();
117  const uint32_t dbStatusFlag = hcalChanStatus->getValues(id)->getValue();
118 
119  int severityLevel = hcalSevLvlComp->getSeverityLevel(id,recHitFlag,dbStatusFlag);
120  bool isRecovered = hcalSevLvlComp->recoveredRecHit(id,recHitFlag);
121 
122  if(severityLevel == 0) return true;
123  else if(isRecovered) return useRecoveredHcalHits_;
124  else if(severityLevel <= hcalAcceptSeverityLevel_) return true;
125  else return false;
126 }
const DetId & detid() const
Definition: CaloRecHit.h:20
#define NULL
Definition: scimark2.h:8
const Item * getValues(DetId fId, bool throwOnFail=true) const
bool recoveredRecHit(const DetId &myid, const uint32_t &myflag) const
uint32_t flags() const
Definition: CaloRecHit.h:21
Definition: DetId.h:18
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
uint32_t getValue() const
bool EgammaHLTHcalIsolation::passDepth_ ( const HcalDetId  id) const
private

Definition at line 100 of file EgammaHLTHcalIsolation.cc.

References depth_, and getEffectiveDepth().

Referenced by acceptHit_().

101 {
102  if(depth_==-1) return true; //I wish we had chosen 0 as all depths but EgammaTowerIsolation chose -1 and 0 as invalid
103  else if(getEffectiveDepth(id)==depth_) return true;
104  else return false;
105 
106 }
static int getEffectiveDepth(const HcalDetId id)
bool EgammaHLTHcalIsolation::passMinE_ ( float  energy,
const HcalDetId  id 
) const
private

Definition at line 85 of file EgammaHLTHcalIsolation.cc.

References eMinHB_, eMinHE_, HcalBarrel, and HcalEndcap.

Referenced by acceptHit_().

86 {
87  if(id.subdet()==HcalBarrel && energy>=eMinHB_) return true;
88  else if(id.subdet()==HcalEndcap && energy>=eMinHE_) return true;
89  else return false;
90 }
bool EgammaHLTHcalIsolation::passMinEt_ ( float  et,
const HcalDetId  id 
) const
private

Definition at line 92 of file EgammaHLTHcalIsolation.cc.

References etMinHB_, etMinHE_, HcalBarrel, and HcalEndcap.

Referenced by acceptHit_().

93 {
94  if(id.subdet()==HcalBarrel && et>=etMinHB_) return true;
95  else if(id.subdet()==HcalEndcap && et>=etMinHE_) return true;
96  else return false;
97 
98 }

Member Data Documentation

int EgammaHLTHcalIsolation::depth_
private

Definition at line 102 of file EgammaHLTHcalIsolation.h.

Referenced by passDepth_().

float EgammaHLTHcalIsolation::eMinHB_
private

Definition at line 96 of file EgammaHLTHcalIsolation.h.

Referenced by passMinE_().

float EgammaHLTHcalIsolation::eMinHE_
private

Definition at line 97 of file EgammaHLTHcalIsolation.h.

Referenced by passMinE_().

float EgammaHLTHcalIsolation::etMinHB_
private

Definition at line 98 of file EgammaHLTHcalIsolation.h.

Referenced by passMinEt_().

float EgammaHLTHcalIsolation::etMinHE_
private

Definition at line 99 of file EgammaHLTHcalIsolation.h.

Referenced by passMinEt_().

int EgammaHLTHcalIsolation::hcalAcceptSeverityLevel_
private

Definition at line 106 of file EgammaHLTHcalIsolation.h.

Referenced by passCleaning_().

float EgammaHLTHcalIsolation::innerCone_
private

Definition at line 100 of file EgammaHLTHcalIsolation.h.

Referenced by acceptHit_().

float EgammaHLTHcalIsolation::outerCone_
private

Definition at line 101 of file EgammaHLTHcalIsolation.h.

Referenced by acceptHit_().

bool EgammaHLTHcalIsolation::useRecoveredHcalHits_
private

Definition at line 105 of file EgammaHLTHcalIsolation.h.

Referenced by passCleaning_().